Item support + Editor / dungeon building question

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.
Post Reply
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Item support + Editor / dungeon building question

Post by zoom »

how many different items does DSB support?

There are increasing thoughts about finally using DSB.

but how would I start with building a dungeon?

downloading DSB test dungeon, because there are
a couple of files ?

learning lua and/or just copy, paste and read through docs?

I know you can build a map by having a paint program.
let;s say red pixel is for a closed door , black meaning wall.
But this should be explained again, please

So a step by step progression on what to do to build a dungeon
would be in order. what one needs, what one would like to read through (could be scaled in months roughly, no need to rush it)

Joramun did DM and CSB. How did he accomplish it?
would it be wise to open up each file of his work and read that?

sorry if this was asked before, but does not hurt, does it?

edit:
you alter monsters like items ? what is hardcoded?
Adamo showed me this editor, forgot it !
http://www.dungeon-master.com/forum/vie ... hp?t=27204
but editing defense of helmet not possible?
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

I`m also curious about that. How to edit things? How to change monster`s AI? Do I have to lua?

PS. Can I change the DSB graphics somehow to make graphics look EXACTLY like original? (Right now it uses higher resolution as I see).
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Item support + Editor / dungeon building question

Post by Sophia »

zoom wrote:how many different items does DSB support?
The short answer is "a lot." ;)
zoom wrote:but how would I start with building a dungeon?
downloading DSB test dungeon, because there are
a couple of files ?
The test dungeon comes with DSB. You could always poke around in it. I admit that DSB editing isn't as user-friendly as CSBwin or RTC... :)
zoom wrote:I know you can build a map by having a paint program.
let;s say red pixel is for a closed door , black meaning wall.
But this should be explained again, please
It's based on palette index, not color. You can set the colors to whatever values you find easy to remember.

Essentially, DSB uses the dungeon's colorconvert table to figure out what to put in a given square, based on its palette index. For example, this line from the test dungeon:

Code: Select all

[4] = {0, "fountain_lion", SOUTH},
This means that anywhere there is a pixel of palette index 4, make that square a wall (0), and put a "fountain_lion" facing south.
Another example along the same lines:

Code: Select all

[128] = {1, "rounddrain", CENTER},
This means anywhere there is a pixel of palette index 128, make that square a floor (1), and put a "rounddrain" in the center.

If the first character of the object is a _, it will execute a function and pass the location as well as anything else specified in the table as parameters. For example

Code: Select all

[64] = {1, "_spawn_door", "door_black", false},
Anywhere it sees a pixel of palette index 64, it will make that square a floor (1), and then call spawn_door as follows:

Code: Select all

spawn_door(level, x, y, "door_black", false)
zoom wrote:So a step by step progression on what to do to build a dungeon
would be in order. what one needs, what one would like to read through (could be scaled in months roughly, no need to rush it)
Hopefully something like this will be on the wiki eventually... :)
zoom wrote:Joramun did DM and CSB. How did he accomplish it?
would it be wise to open up each file of his work and read that?
Joramun cheated a little, because he wrote a program to convert RTC .txt files to DSB dungeon.lua. It worked well enough for DM and CSB, though if there are a lot of custom items and whatnot in them, it won't work of course.
zoom wrote:you alter monsters like items ? what is hardcoded?
Almost nothing is "hard"-coded, but just about everything is Lua-coded. This means that to alter the properties of monsters and items, you need to poke around in an objects.lua file. Take a look at base/objects.lua for the one that contains all DM and CSB items, or the test_dungeon's own smaller objects.lua to give some ideas how to modify objects in your own dungeon.

It might not be a bad idea to just copy the whole test_dungeon and start making changes to it, and see what you can come up with from there.
Adamo wrote:How to edit things? How to change monster`s AI? Do I have to lua?
Monster AI is rather complex, there's just no getting around that. It's all in base/monster_ai.lua, and it's not the sort of thing you'll be able to understand in a day. ;)

Some of the more common monster functionality is defined as properties in the monster's objects.lua entry, or hooked in the less complex base/monster.lua, if that helps...
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Item support + Editor / dungeon building question

Post by Gambit37 »

Sophia wrote:For example, this line from the test dungeon:

Code: Select all

[4] = {0, "fountain_lion", SOUTH},
This means that anywhere there is a pixel of palette index 4, make that square a wall (0), and put a "fountain_lion" facing south.
Actually, although not very user friendly, this is quite powerful. A very neat idea, assuming the dungeon designer remembers their colours... :-)
Sophia wrote:Joramun cheated a little, because he wrote a program to convert RTC .txt files to DSB dungeon.lua.
I think that's a perfectly acceptable cheat... :-)
User avatar
ian_scho
High Lord
Posts: 2806
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Post by ian_scho »

Coming from pouring 100s of hours over an editor in DMJava I find DSB both a great joy and a source of fear. THERE IS SO MUCH MORE I CAN DO with DSB, yet the smallest changes from the 'norm' will take me longer to complete. I'm not talking about custom items, more about changing the actions of items and objects in the dungeon into something really different.
That's why this time around I've set upon modding the engine first, creating a dungeon later.
How to change monster`s AI?
Instead of reading monster_ai.LUA and making your own 3000 line code hell, why not just inject ideas into your monster's head by calling a function (dsb_ai), passing in a verb?

I have yet to make a dungeon layout with DSB!
User avatar
Joramun
Mon Master
Posts: 925
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Post by Joramun »

I actually began mapping DM with the palette system, but at some point I took a step back to look at the task, and it was cleary much easier and more useful to write a basic RTC txt file converter, especially since RTC dungeon definitions are mostly linear.

The big drawback is that anything that has a "complicated backstage definition" like WALLITEM_ACTION in RTC, can't be translated in any easy and straight forward manner in DSB.
It's like translating from Chinese to English : as long as it's just basic conversation it's ok, but if you enter Philosophy it gets impossible.

I'll release a couple of hacks I made for DSB
as examples on the wiki, ASAP (probably in september).
What Is Your Quest ?
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Re: Item support + Editor / dungeon building question

Post by zoom »

Sophia wrote: The short answer is "a lot."
So you cannot tell exactly? Not that it matters, but how about 16.3 billion? ;)
Sophia wrote: I admit that DSB editing isn't as user-friendly as CSBwin or RTC... :)
"was noch nicht ist, kann ja noch werden! ;)"
rough translation: what is not yet the case can ever become..
Sophia wrote: It's based on palette index, not color. You can set the colors to whatever values you find easy to remember.
There will be alist where you can look up the pallete indices, so
you don't need to remember, no?
Sophia wrote: Essentially, DSB uses the dungeon's colorconvert table to figure out what to put in a given square, based on its palette index.
ah, ok that's a start. The examples are easy enough to understand..is the CENTER attribute absolutely necessary when there is no other way to put the graphic, like round drains (always "centered") Is it bad if you omitt the ,CENTER?
Sophia wrote:

Code: Select all

[64] = {1, "_spawn_door", "door_black", false},
Anywhere it sees a pixel of palette index 64, it will make that square a floor (1), and then call spawn_door as follows:

Code: Select all

spawn_door(level, x, y, "door_black", false)
The (level, x, y) coordinateswhere does the program get these from? I guess from the level map=color map??
(I have yet to look at the TEST dungeon, so probably no need to answer!!
Sophia wrote:It might not be a bad idea to just copy the whole test_dungeon and start making changes to it, and see what you can come up with from there.
(...)
Take a look at base/objects.lua for the one that contains all DM and CSB items, or the test_dungeon's own smaller objects.lua to give some ideas how to modify objects in your own dungeon.
good advice ^^
THanks for the reply!
Sophia wrote: Joramun cheated a little, because he wrote a program to convert RTC .txt files to DSB dungeon.lua. It worked well enough for DM and CSB, though if there are a lot of custom items and whatnot in them, it won't work of course.
Joramun wrote: (...) began mapping DM with the palette system, but at some point I took a step back to look at the task, and it was cleary much easier and more useful to write a basic RTC txt file converter
So there's a converter, good for RTC'lers...
You would not recommend doing it the palette way with a
dungeon made from scratch? I guess in case of DM and CSB it
would make sense to use the convert or if there is an existing
RTC dungeon or parts of it...

@ian_scho: interesting approach you do, I see that the more
possiblilities you have the bigger the project gets and the more
one needs to keep everything ordered..
Instead of reading monster_ai.LUA and making your own 3000 line code hell, why not just inject ideas into your monster's head by calling a function (dsb_ai), passing in a verb?
someday I will look into this and hopefully understand...who does not want to cram complex mechanisms into their dungeon?? :twisted:
User avatar
Joramun
Mon Master
Posts: 925
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Re: Item support + Editor / dungeon building question

Post by Joramun »

zoom wrote:
Sophia wrote:I admit that DSB editing isn't as user-friendly as CSBwin or RTC...
what is not yet the case can ever become..
I'd say it won't improve. It's just a matter of what you have to learn in order to make the mechanics :
- in CSBWin, you make DSAs (which is very powerful, but lacks readability)
- in RTC, you're using a set amount of objects, which is normally the most userfriendly, but the less powerful
(it's still ok now, though I never got around some functions, probably by lack of perseverence)
- in DSB, you program it (which is very powerful and still readable), so you're bound to learn LUA (which is an easy language). Remy's Editor is quite powerful, though.
There will be alist where you can look up the pallete indices, so
you don't need to remember, no?
Since you have to define the color palette in your own paint program, you have to decide what color is what, so the list is yours to make and remember.
ah, ok that's a start. The examples are easy enough to understand..is the CENTER attribute absolutely necessary when there is no other way to put the graphic, like round drains (always "centered") Is it bad if you omitt the ,CENTER?
As a general case, omitting is bad, because all parameters end up to be arguments (=input) of a function,
and if an argument is missing, bad things happen.
In a few particular cases (designed so), arguments can be omitted. (it just means there is a DEFAULT argument)
The (level, x, y) coordinateswhere does the program get these from? I guess from the level map=color map??
(I have yet to look at the TEST dungeon, so probably no need to answer!!
Each level is defined in dungeon.lua (level 1, 2 etc.) as a full map.
The map is either:
- in full text ( array of 0 and 1, like in RTC .TXT) see "my" CSB and DM dungeons
- or a colormap, that has to be imported (see the test dungeon !!)
So there's a converter, good for RTC'lers...
You would not recommend doing it the palette way with a
dungeon made from scratch? I guess in case of DM and CSB it
would make sense to use the convert or if there is an existing
RTC dungeon or parts of it...
I recommend using Remy's editor, or palette+text editor.

My converter is useful only if your RTC dungeon.txt is 99.9 % done,
because any big map layout / item layout will require tedious work in the text file,
and NO mechanics are translated except the very basic ones (relays and counters),
moreover some of them must be fixed by hand !!
What Is Your Quest ?
User avatar
Parallax
DMwiki contributor
Posts: 424
Joined: Mon Aug 28, 2006 7:56 pm
Location: Back in New Jersey

Re: Item support + Editor / dungeon building question

Post by Parallax »

Sophia wrote:Essentially, DSB uses the dungeon's colorconvert table to figure out what to put in a given square, based on its palette index. For example, this line from the test dungeon:

Code: Select all

[4] = {0, "fountain_lion", SOUTH},
Can you associate several archetypes with a given entry by say, having two or more lines for the same color index? I might reconsider using bitmaps if you can.

I have tried to make DSB dungeons several times. At first, I tried using bitmaps and the palette converter. I did not like it. Then I tried it with Joramund's RTSB, but I found the output very hard to read and build on. Remy's editor was the one that allowed me to go furthest, but I still didn't get farther than ten levels worth of layout and about 5% of the mechanics implemented before I started hitting points where his editor couldn't handle what I wanted to do, and leaving the editor with the lua file and modifying that meant I could not go back to the editor afterward.

I guess the first person to get a DSB dungeon out wins the privilege of writing a tutorial about it. :)
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post by Adamo »

is there a chance for a user-friendly editor for DSB? I mean, like CSBwin or RTC editors
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

I could live with 2 or more editors, e.g. like ADGE and csbuild ;) :P
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Item support + Editor / dungeon building question

Post by Gambit37 »

Sophia wrote:I admit that DSB editing isn't as user-friendly as CSBwin or RTC...
Joramun wrote:- in DSB, you program it (which is very powerful and still readable), so you're bound to learn LUA (which is an easy language).
This is the biggest barrier to entry for getting people interested in making dungeons for DSB. At the end of the day, unless you're of programmer mentality, DSB dungeon creation is too complicated. It doesn't matter that LUA is a 'simple' language -- most people just want to build stuff easily and quickly without having to learn another language to do it.

I can see the power of DSB and I've often thought about switching to it from RTC, as RTC has a lot of restrictions (ie, it's basically still Dungeon Master). I could get around those restrictions in DSB, but it would take too long to get up to speed and I don't want to waste the last few years of learning RTC.
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

I would not say it was a waste to learn RTC !! What you learned you learned, I am shocked you see it that way! :shock:
true, it will not be 100% useful, but nevertheless, you know a great
deal about how things can be done and got the gist of dungeon building/ engine restrictions and more..

edit: I witnessed over the past years! that you suggested
a lot to RTC, with preserverance and dedication. So a good 1% of
it is probably yours, so it is comprehensible that you don't want to waste this effort. I think on the long run it won't be so bad to switch to DSB;something call it experience in life tells me..
there has to be a proper editor, else not many dungeons can /will be created, and what will that be good for??
DSB's edit0r problem has to be tackled!!!!!
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

I don't mean that I think my time on RTC is wasted, far from it. That's why I still want to build my dungeon using it. But if I did ever switch to DSB (very unlikely), *then* the time I had spent on RTC would feel somehow... pointless.

I think rather more than 1% of RTC happened because of *everyones* input. Certainly GG did the actual work, but I think it's fair to say that RTC would never have got to where it has without the the years of play testing, bug reporting and suggestions that we have all given.

Anyway, this isn't about one engine being better than other or anything like that. Each engine suits different types of people, that was the point I was making.
User avatar
ian_scho
High Lord
Posts: 2806
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Post by ian_scho »

Gambit37 wrote:Each engine suits different types of people, that was the point I was making.
THAT was exactly what I was thinking.
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

@gambit and others
Yeah, I forgot the others..
My point was, it would not be irrelevant or a waste having used RTC -instead- imo it would very likely help building dungeons with DSB.
plus I understand people are not very likely to switch because of a bond to RTC and the obstacles to DSB. Switching could therefore feel pointless indeed, but it would not be...

Totally acceptable when one doesn't want to dive into the "lua ocean", for whatever reason. I am positive this will not be about capability... (May I add in my perspective, I guess lua will roughly be as difficult as html! I could be wrong here, though)

anyway, not much sense to post on here for I don't know whether there is actually an inclination to discuss ?this? further or not.
Just getting my point across. hope noone minds :? :o
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

zoom wrote:May I add in my perspective, I guess lua will roughly be as difficult as html! I could be wrong here, though
Quite wrong! ;-)

HTML is a page description language, it simply describes the structure of a document and is in no way 'programming'. You might be thinking of Javascript?

Lua on the other hand is pure programming and requires a logical mind -- while I'm OK with the basics in any programming language, once I get beyond the simplest stuff it generally becomes nonsense to me because I'm not that kind of thinker.
Tom Hatfield
Ee Master
Posts: 688
Joined: Mon May 07, 2001 7:00 pm
Location: Indiana, USA
Contact:

Post by Tom Hatfield »

Lua is a scripting language and as such requires a basic programming mindset, but it doesn't even begin to touch on the level of problem solving real programming entails. And yet, my interest in learning Lua is vague at best. About the time I convince myself it would be a good idea, I find something better (in this case, the VSA script engine, which parallels what I'm already using — no, it is what I'm already using). And if I, a programmer, have no interest in building with a scripting language I don't know, how could anyone expect a non-programmer to pick up the torch?

Fortunately, except for a few people who want a full-blown editor, the purpose of DSB isn't to provide a platform for developing DM clones. It's Sophia's pet project. If she wants to make an editor, she will, but I don't see it happening. She's comfortable with the tools and concepts. I think DSB is an awesome achievement, and I lurk this forum for inspiration, but I'm not going to use it because it isn't what I want.

However, one of my interests is to release friendly tools for prospective dungeon builders. Actually, I want those tools for myself, but I'm all about giving them away when I'm done with them. Killing two birds with one stone, as it were. The community is a powerful driving force behind development, but it's rarely the direction unless they're paying you for it. At most, their opinions have an influence.

Back in the days of Doom, all the editing tools were made by fans. When Quake was released, id released qradiant with it, but extraordinarily few people cared to use it for precisely the same reason as nobody wants to use DSB: it was too hard to learn. So fans made convenient editors and released them freely, and the Quake community flourished.
Post Reply