Page 1 of 1
DSB.EXE
Posted: Fri Nov 23, 2007 1:13 am
by bigsofty
Hi,
I'm an old DM fan and I really like your conversion. I'm trying to understand how most of it works. LUA is new to me but I've been reading up on LUA and I understand how its an interpreted embeddable scripting language. But in this case how is DSB.EXE produced? Is it written in another language no mentioned? How does this use the various scripts?
Thanks for the genuine insight into a great game that has always interested me,
Ian
Posted: Fri Nov 23, 2007 2:34 am
by Sophia
DSB.exe is a compiled C program. As you know, Lua is embeddable-- that means it has to be embedded in a "host" application. That's what DSB.exe is. The exe contains a basic dungeon engine, a Lua interpreter, and a whole lot of special functions that allow Lua to control that dungeon engine. (The functions beginning with dsb_*)
As for how to "use" the scripts, that depends on what you want to do: To just play the game, all you have to do is download a dungeon (or just use the test_dungeon included), run DSB.exe, choose the directory that dungeon is in, and go. The core engine calls the Lua functions in the scripts as needed, and Lua is responsible for controlling a large portion of the game effects.
Therein lies most of DSB's flexibility: All you have to do to make it do something different is change the Lua code, which is, hopefully, usually pretty simple and straightforward.
If you want to edit things and are new, at first, you might just want to try reading over and making simple changes to the test_dungeon. Remy has produced a nice dungeon builder program, but, unfortunately, it's currently unable to load Lua dungeons, so the learning curve is a little steep, as you'll have to start from scratch. We're happy to help out on this forum, though.

Posted: Fri Nov 23, 2007 4:24 am
by bigsofty
My main interest is just to see how the game runs, which I find fascinating in its self, is the C source for the engine available?
I am currently trying to decipher the map format and understand how it interacts with the game in real-time... as you say though, its all a 'bit' confusing to a nooby like me!
Thanks for your help Sophia and for DSB itself!

Posted: Fri Nov 23, 2007 8:28 am
by beowuuf
Have you ever looked at the original dungeons under an editor (like CSBwin or DMute)?
It might help to ge the underlying logic of the old dungeons - small thigns like monster generators, triggers, etc that we probably take for granted
Posted: Fri Nov 23, 2007 10:26 am
by bigsofty
beowuuf wrote:Have you ever looked at the original dungeons under an editor (like CSBwin or DMute)?
It might help to ge the underlying logic of the old dungeons - small thigns like monster generators, triggers, etc that we probably take for granted
Yep, maybe its just me but I find it quite unreadable unfortunately, the source seems to try to emulate too many 68000 hardware features like the MC data and address registers for example and although conversion notes are their, their main to do with 68000 to C, rather than program logic... more of an exercise in reverse engineering rather than a dissection and dissemination of the game design... not sure I'm making sense here?
Posted: Fri Nov 23, 2007 5:44 pm
by Paul Stevens
You make perfect sense. And you are
one-hundred percent correct. That program
is no place to learn how the DM dungeons
work.
Beowuuf was not suggesting that you examine
the code. He was suggesting that you first
become very familiar with the higher level
editor and the construction of the dungeons
themselves.....not the code that runs it. The
code cannot make sense at all unless you know,
second nature, what it is trying to accomplish.
Posted: Fri Nov 23, 2007 6:28 pm
by bigsofty
Paul Stevens wrote:You make perfect sense. And you are
one-hundred percent correct. That program
is no place to learn how the DM dungeons
work.
Beowuuf was not suggesting that you examine
the code. He was suggesting that you first
become very familiar with the higher level
editor and the construction of the dungeons
themselves.....not the code that runs it. The
code cannot make sense at all unless you know,
second nature, what it is trying to accomplish.
Ah yes, I see what you mean, you may very well be right, which editor would you recommend that is the most intuitive and who's file format allows me to examine the changes it makes to the dungeon data structure?
Posted: Fri Nov 23, 2007 7:14 pm
by beowuuf
CSBwin is playing with the original dungeon.dat format, so that would be the one you would want to examine for it's ease
DMute is also looking at the origianal PC format without any clone attachments, but it is not a complete tool and so might not be as intuitive
Posted: Fri Nov 23, 2007 7:17 pm
by Gambit37
That depends if you're talking about DSB specifically, or Dungeon master generally.
If you want to learn about the original dungeon construction and mechanics, DMute is a good place to start as it works with the original games.
A more complex editor comes with CSBWin which as you know is the reverse engineerd code that now runs on Windows.
RTC is another clone that uses a completely different engine and file format (simple, easily understandable text files) and finally DSB does it's own thing too, as explained above.
Posted: Fri Nov 23, 2007 7:32 pm
by Paul Stevens
The original DM data files are totally
unreadable. CSBwin uses this format.
So do not attempt to examine CSBwin's
files unless you really want to know how
the original worked. You will slowly
go crazy over a period of a few months.
Or decide that you are too stupid and quit.
The RTC files are both readable and 'data'
rather than 'code'. THe DSB files are intended
to be executed (well, interpreted as code
anyway).
Unless I misuderstand your intentions, I
would recommend the RTC editor and data
files.
Posted: Fri Nov 23, 2007 8:36 pm
by Joramun

Unbelievers !

(

)
DSB's dungeon format is the most understandable dungeon format, especially for a programmer !
It is the only one that doesn't require an editor to be read, a simple notepad is enough.
And DSB's engine is the only one to expose a major part of itself to the human eye, through the base lua code !
Bigsofty : I don't clearly understand what you want to understand
DSB map format is "simple"... the most basic form is :
First, include the map of the levels, as an array of bits (0 for wall, 1 for corridor), either by interpreting a text or an image :
or
then implement characters, items and monsters with :
and
then add (if wanted) champion to the player party :
and finally place the party in the dungeon :
Posted: Fri Nov 23, 2007 8:59 pm
by bigsofty
Interesting stuff, thank you!

I'll go an have a look at this in more detail now...
Posted: Fri Dec 21, 2007 9:08 pm
by bigsofty
A month later, a little less confused but its been great fun, thanks again to all involved in the development of this great project... and have a HAPPY CHRISTMAS!

Posted: Sat Dec 22, 2007 9:33 am
by linflas
Joramun wrote:DSB's dungeon format is the most understandable dungeon format, especially for a programmer !
It is the only one that doesn't require an editor to be read, a simple notepad is enough.
i am not a programmer... but i can understand RTC's data files

(well i write scripts for work but that is not the question

)
DSBDM is still at a very early stage : i hope for Sophia that it will be as good as RTCed is.. because what definitely misses to DSB is a fully functional wysiwyg editor !
Posted: Sat Dec 22, 2007 12:01 pm
by Gambit37
I think DSB is for programmer types and RTC is for us arty types. I prefer RTC with it's editor because it gives instant visual results.
Posted: Sat Dec 22, 2007 6:20 pm
by Sophia
Wouldn't a true WYSIWYG editor involve running around in the dungeon in a 3d view and creating it that way?
I do see what you mean, though. It seems to feed on itself a bit: DSB started off being more "programmer type" oriented, and so that's the type it attracts, and so on. The end result is why around 90% of the talk on the DSB forum is Lua technobabble.
In defense of DSB's "artyness," though, I will say it allows some neat little arty tricks: drawing side view wallitems at distance 0, overriding wallsets by wall facing, overlays, nostalgic glow-in-the-dark cyan, to name a few...
(Of course, it may be a moot point because it requires writing Lua code to do all of this, anyway.

)