DSB.EXE
Moderator: Sophia
Forum rules
Please read the Forum rules and policies before posting. You may
to help finance the hosting costs of this forum.
Please read the Forum rules and policies before posting. You may

DSB.EXE
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
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
Ian Thompson
- Sophia
- Concise and Honest
- Posts: 4307
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
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.
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.

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!
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!

Ian Thompson
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?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
Ian Thompson
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
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.
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?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.
Ian Thompson
- Gambit37
- Should eat more pies
- Posts: 13773
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
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.
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.
- Paul Stevens
- CSBwin Guru
- Posts: 4322
- Joined: Sun Apr 08, 2001 6:00 pm
- Location: Madison, Wisconsin, USA
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.
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.




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 :
Code: Select all
dsb_text2map()
Code: Select all
dsb_image2map()
Code: Select all
dsb_add_champion()
Code: Select all
dsb_spawn(item)
Code: Select all
dsb_champion_toparty
Code: Select all
dsb_party_place
What Is Your Quest ?
- linflas
- My other avatar is gay
- Posts: 2445
- Joined: Tue Nov 04, 2003 9:58 pm
- Location: Lille, France
- Contact:
i am not a programmer... but i can understand RTC's data filesJoramun 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.

(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 !
- Sophia
- Concise and Honest
- Posts: 4307
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
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.
)

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.
