DSB.EXE

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
bigsofty
Neophyte
Posts: 7
Joined: Fri Nov 23, 2007 12:52 am

DSB.EXE

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

Post 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. :)
bigsofty
Neophyte
Posts: 7
Joined: Fri Nov 23, 2007 12:52 am

Post 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! :roll:

Thanks for your help Sophia and for DSB itself! :)
Ian Thompson
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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
bigsofty
Neophyte
Posts: 7
Joined: Fri Nov 23, 2007 12:52 am

Post 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?
Ian Thompson
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post 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.
bigsofty
Neophyte
Posts: 7
Joined: Fri Nov 23, 2007 12:52 am

Post 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?
Ian Thompson
User avatar
beowuuf
Archmastiff
Posts: 20686
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post 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
User avatar
Gambit37
Should eat more pies
Posts: 13773
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post 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.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post 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.
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Post by Joramun »

:shock: Unbelievers ! :shock: ( :lol: :wink: )

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 :P

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()
or

Code: Select all

dsb_image2map()
then implement characters, items and monsters with :

Code: Select all

dsb_add_champion()
and

Code: Select all

dsb_spawn(item)
then add (if wanted) champion to the player party :

Code: Select all

dsb_champion_toparty
and finally place the party in the dungeon :

Code: Select all

dsb_party_place
What Is Your Quest ?
bigsofty
Neophyte
Posts: 7
Joined: Fri Nov 23, 2007 12:52 am

Post by bigsofty »

Interesting stuff, thank you! :) I'll go an have a look at this in more detail now...
Ian Thompson
bigsofty
Neophyte
Posts: 7
Joined: Fri Nov 23, 2007 12:52 am

Post 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! :D
Ian Thompson
User avatar
linflas
My other avatar is gay
Posts: 2445
Joined: Tue Nov 04, 2003 9:58 pm
Location: Lille, France
Contact:

Post 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 :roll:
(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 !
User avatar
Gambit37
Should eat more pies
Posts: 13773
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

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

Post 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. :oops: )
Post Reply