Questions about DSB/ESB

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

Questions about DSB/ESB

Post by Gambit37 »

I hope you'll allow me to start a athread for asking questions about DSB? Treat me as a complete noob, please :mrgreen:

A quick read through the text of the dungeon.lua file seems to make sense: objects are spawned in the first part of the file, mechanism are created afterwards using exvars that reference spawned items. That will take some getting used to, as RTC combines properties and mechanism of items on the same line so they are easier to find. Anyway....

1) Can I write stuff by hand in here, in any order, and it will work in ESB OK?

2) What rules does ESB use to determine the order to write the dsb_spawns in? (RTC bases it on coordinates, starting at the top left of the dungeon and working down to the lower right.)

3) Is the order and content of this file preserved when editing in ESB? Can I add comments to the LUA by hand and they will be preserved after a roundtrip through the editor and back to hand coding?

4) ESB appears to create items and exvars with incremental integer IDs. That's not very friendly for later finding stuff in the text file. Can we set our own prefixes and/or format for these IDs?

5) Will I learn enough LUA for building dungeons simply from working with the examples provided, or do I actually need to learn LUA first?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Since you're completely new (and asked to be treated as such) I'll start with a basic introduction to the structure of a DSB dungeon directory. There is a startup.lua which is run on load, an objects.lua that is run after all the initialization is done and the objects for the game are being set up, and finally a dungeon.lua, which contains the actual dungeon layout.

Any custom code you may write should be put in startup.lua, or in files that are loaded after startup.lua through the use of a lua_manifest. You shouldn't put code directly into dungeon.lua. In fact, if you're using ESB, there isn't a whole lot of need to even open dungeon.lua by hand, and the Lua that ESB produces isn't exactly friendly for doing so.

I'll answer your questions, though that explanation may have made some of them redundant. Just to be sure, I'll answer them all anyway. :)
Gambit37 wrote:Can I write stuff by hand in here, in any order, and it will work in ESB OK?
Yes, for the most part, though I'll admit that I've not made any extensive modifications to an ESB-generated dungeon.lua.
Gambit37 wrote:What rules does ESB use to determine the order to write the dsb_spawns in? (RTC bases it on coordinates, starting at the top left of the dungeon and working down to the lower right.)
ESB does the same thing.
Gambit37 wrote:Is the order and content of this file preserved when editing in ESB? Can I add comments to the LUA by hand and they will be preserved after a roundtrip through the editor and back to hand coding?
No, it completely obliterates the file.
Gambit37 wrote:ESB appears to create items and exvars with incremental integer IDs. That's not very friendly for later finding stuff in the text file. Can we set our own prefixes and/or format for these IDs?
No, they're just integers, because this is their internal identifier number.
Gambit37 wrote:Will I learn enough LUA for building dungeons simply from working with the examples provided, or do I actually need to learn LUA first?
I think you'll probably learn enough just playing around with the examples. Lua is a pretty "learn by doing" language and the learning curve isn't that steep once you get over the first few bumps. You don't need to use a lot of the advanced features to make use of DSB. (Indeed, because I "learned by doing" while writing DSB, DSB itself doesn't really make use of a lot of the advanced features!)
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

OK, cool, thanks, that helps. Looks like any comments can be made fine in other .lua files, but not dungeon.lua. A shame (what's the point of having a text file if you can't comment it? same problem with RTC), but understandable given the nature of the editing tool.
Sophia wrote:No, it completely obliterates the file.
I hope ESB ain't buggy and liable to trash a LUA file then. ;) RTC works the same way, it totally re-outputs the entire file on save, but if a bug causes a crash, it can trash your file. I've had that a few times and it is not fun at all. Can you give any guarantees on the fitness for purpose of ESB. Dungeon designers put hundreds if not thousands of hours into their creations and no-one wants to use a tool that might trash their work. I know that no software is bug free, but it would be good to know up front if there are possibilities of ESB crashing and trashing a file so that I'm at least aware of it. Does ESB create a backup of the last good file before working on it?

Re: #4. My converted dungeon has identifiers like "RTC_part01_0357_2" -- so I have to change all these to INTs? If so, I can see my conversion process is going to take a looooooong time...
User avatar
Joramun
Mon Master
Posts: 925
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Re: Questions about DSB/ESB

Post by Joramun »

ESB only trashes the file when you save-overwrite it.

For identifiers, see my explanation in the other topic !!
The RTC_blabla are variables that hold integers !! You certainly shouldn't touch them, otherwise you will suffer great pain in the *ss.
What Is Your Quest ?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Gambit37 wrote:I hope ESB ain't buggy and liable to trash a LUA file then.
Yeah, that's true. "Never has" doesn't necessarily mean "never will." I'm going to make a release very soon, and I'll make that version create backups. Better safe than sorry.
Gambit37 wrote:Can you give any guarantees on the fitness for purpose of ESB.
Yes, I guarantee there is some purpose for which ESB is fit. Whether or not this may be its intended purpose is not part of the guarantee. :mrgreen:
User avatar
Bit
Arch Master
Posts: 1064
Joined: Mon Mar 03, 2008 10:53 am
Location: Nuts trees

Re: Questions about DSB/ESB

Post by Bit »

Gambit, I wrote a little program that replaces lots of strings in a textfile, you just write another textfile how to replace like
RTC_part01_0357_2:=1
You can write thousands of those lines, and the file to be processed can have up to 32 MB I think. Would that help?
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

Maybe, thanks :) I don't think I need it now though, based on new info. These labels can remain as they are. :)
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

6) Where can I find info on how DSB defines GFX shapes, sizes, offsets and parameters? Doesn't appear to be anything on the wiki?

7) Can DSB do asymmetrical flooritems? IE, Items where you see a different view if you're facing north, vs. east for example.

8) Can I draw into the 640 x 480 space, or just 640 x 400?

9) Can it do different coloured distance shading -- make things whiter in fog for example?

10) Should I install LUA? Or do I just need any old text editor for DSB?
User avatar
Joramun
Mon Master
Posts: 925
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Re: Questions about DSB/ESB

Post by Joramun »

Sophia might differ, but here are some ideas on how to do those things:

6) Open graphics.lua in dsb**/base/, the graphics are displayed at a position depending of the object renderer, which is defined (but only implicitly) by the object definition in objects.lua in dsb**/base/
Experimenting might be the best way to position things.

7) I think that a hack comparable to the compass hack can do the trick: switching the graphics of the item based on the party orientation.

8 ) 9) no idea

10) LuaEdit would be a good idea, however, I use Scite which is a text editor with syntax highlighting, and it suits me well.
In any case, a Lua interpreter won't understand the dsb_* functions and therefore its only use would be syntax checking (which DSB/ESB happens to do correctly thanks to the embedded Lua engine)
What Is Your Quest ?
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

Thanks for the info.
Joramun wrote:Experimenting might be the best way to position things.
I'd love to get some specific background on this. I wasted literally *years* experimenting with RTC because it was poorly documented (well, not documented at all!) and I simply don't have the time or patience to go through all that again. I'm not as young as I once was ;-)

For example, I'd love to get specific info on

6a) How wallsets are positioned by default and how easy it is to change their positions (some of my wallsets don't fit any established DM/CSB/RTC coords).How do doors and doorpillars work / are positioned? Pits and Stairs etc.? I have lots of non-standard stuff for these items that I'm sure will need manual positioning and I really don't want to spends weeks doing "position-testindsb-tweakposition-testindbs-tweakposition" it's such an incredible waste of time and doing that in RTC honestly drove me quite bonkers!
6b) How monsters are positioned (for example, if I need to do clever things with vertical or horizontal offsets to cater for flying or very wide side views of wide monsters)
6c) Are there any offsets for inventory items placed on the ground, or is that automatic
6d) What's the setup for flooritems (RTC for example, treats the center of each tile as it's origin, making an assumption about the size of the tile as a 2D surface projected into pseudo 3D space)
6e) What are the sizes, positions and coordinates for all the interface elements? And indeed, can they all be changed?)
6f) What are the sizes/format of FONTS?

For #7, I'm not talking about items the party carries, I'm talking about things like statues etc. RTC allows multiple views for these items for every possible tile in the visible view and from every possible angle.
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: Questions about DSB/ESB

Post by Mon Ful Ir »

I can answer two of those:-
6b) The default positioning for monsters works well; and
6c) It's automatic.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Gambit37 wrote:Where can I find info on how DSB defines GFX shapes, sizes, offsets and parameters? Doesn't appear to be anything on the wiki?
Yes, it's not that well documented at this point. The good news is that DSB's automatic positioning usually makes quite a bit of sense, only requiring minor tweaking, and its coordinate system is a simple 1:1 mapping to screen pixels (for unscaled objects, anyway) with the coordinate origin in the upper left of the viewport. Hopefully, it should preserve your sanity... mostly. :)
Gambit37 wrote:Can DSB do asymmetrical flooritems? IE, Items where you see a different view if you're facing north, vs. east for example.
It can, through a small hack. The viewangle property of an arch specifies a single direction the object is visible from, so you can overlay multiple objects and create one that looks different from all four ways.
Gambit37 wrote:Can I draw into the 640 x 480 space, or just 640 x 400?
640 x 480.
Gambit37 wrote:Can it do different coloured distance shading -- make things whiter in fog for example?
Yes. dsb_level_tint(level, { R, G, B } ) controls the "fade to" color.
Gambit37 wrote:Should I install LUA? Or do I just need any old text editor for DSB?
LuaEdit is nice, but a little buggy. The Lua interpreter is embedded into DSB, though, so about the only thing you need an actual Lua development setup for is LuaC, to compile/obfuscate your scripts.
Mon Ful Ir
Adept
Posts: 221
Joined: Sat Jan 07, 2006 1:54 am
Location: Britain

Re: Questions about DSB/ESB

Post by Mon Ful Ir »

Sophia wrote:Yes, it's not that well documented at this point. The good news is that DSB's automatic positioning usually makes quite a bit of sense, only requiring minor tweaking, and its coordinate system is a simple 1:1 mapping to screen pixels (for unscaled objects, anyway) with the coordinate origin in the upper left of the viewport. Hopefully, it should preserve your sanity... mostly. :)
I've not seriously tried to make a wallset, but for everything else the only things that seem to need offsets are wallitems.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

Cool, thanks Sophia. Any clarification of the stuff in 6a to 6f?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Gambit37 wrote:How wallsets are positioned by default and how easy it is to change their positions (some of my wallsets don't fit any established DM/CSB/RTC coords).How do doors and doorpillars work / are positioned? Pits and Stairs etc.? I have lots of non-standard stuff for these items that I'm sure will need manual positioning and I really don't want to spends weeks doing "position-testindsb-tweakposition-testindbs-tweakposition" it's such an incredible waste of time and doing that in RTC honestly drove me quite bonkers!
I don't quite understand what you're asking. The positions are.. as close as I can get to DM? Most things will "just work" but for things that don't, it's pretty easy to change their positions. You can just change x_off and y_off when you load the graphics. This is true for every graphic in DSB (just about) so you shouldn't have a huge amount of trouble. There are also other properties like mid_x_tweak and far_x_tweak (and y) for tweaking the way the more distant auto-scaled views are displayed. There is also an x_compress property used to squash things like the perspective view of ornate alcoves that may otherwise not quite fit on their wall.
Gambit37 wrote:How monsters are positioned (for example, if I need to do clever things with vertical or horizontal offsets to cater for flying or very wide side views of wide monsters)
Most monsters, like other things, "just work," but they have the same position properties as other stuff.
Gambit37 wrote:Are there any offsets for inventory items placed on the ground, or is that automatic
Some larger items may need small offsets to avoid overdrawing the wall in a slightly peculiar way, but otherwise this is automatic too.
Gambit37 wrote:What's the setup for flooritems (RTC for example, treats the center of each tile as it's origin, making an assumption about the size of the tile as a 2D surface projected into pseudo 3D space)
DSB has two types of flooritems, flat and upright. They have different origins: upright near the center of the tile, flat closer to the bottom... but mostly still "just work" as long as you match the type. They still use a 1:1 coordinate-to-pixel ratio so positioning shouldn't be nearly as arcane as in RTC.
Gambit37 wrote:What are the sizes, positions and coordinates for all the interface elements? And indeed, can they all be changed?)
They're 2x versions of the interface elements in CSBwin, if that helps. I don't have the exact coordinates with me at the moment, sorry. You can see most of this stuff in render.lua though.
Gambit37 wrote:What are the sizes/format of FONTS?
It's kind of a strange Allegro format.
In the Allegro docs someone wrote: The size of each character is determined by the layout of the image, which should be a rectangular grid containing all the ASCII characters from space (32) up to the tilde (126). The way the characters are separated depends on the color depth of the image file:

* paletted (8 bit) image file Use color 0 for the transparent portions of the characters and fill the spaces between each letter with color 255.
* High (15/16 bit) and true (24/32 bit) color image file Use bright pink (maximum red and blue, zero green) for the transparent portions of the characters and fill the spaces between each letter with bright yellow (maximum red and green, zero blue).

Note that in each horizontal row the bounding boxes around the characters should align and have the same height.
I've added extracted copies of the fonts to the images directory, so just take a look at them here.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

Cool, many thanks for the info. Helps a lot. I think I need to spend some time looking over the base lua files -- I've only taken cursory scans so far and got a bit put off, but I guess I need to take the plunge at some point. Hopefully in a couple of months time I'll wonder what all the fuss was about abd be writing DSB LUA code with wild abandon :-)
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

10) What is the Mass of an object? Is it "Value x 100g" ? eg, Mass=1 = 100g?
11) What is duration measured in? EG "shield_duration = 280" is how many seconds?
12) Is there a full list somewhere of all the possible object properties? (Other than going through objects.lua and compiling my own)?
13) Can the mana consumption values of each rune at each power level be changed?
14) Does DSB have a hint oracle? Couldn't see anything in base.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Gambit37 wrote:What is the Mass of an object? Is it "Value x 100g" ? eg, Mass=1 = 100g?
Yes.
Gambit37 wrote:What is duration measured in? EG "shield_duration = 280" is how many seconds?
It's in DSB ticks, which are 5/sec when the party isn't moving around.
Gambit37 wrote:Is there a full list somewhere of all the possible object properties? (Other than going through objects.lua and compiling my own)?
No, not at present. Someone will have to make one. ;)
Gambit37 wrote:Can the mana consumption values of each rune at each power level be changed?
Of course. :D
Gambit37 wrote:Does DSB have a hint oracle? Couldn't see anything in base.
No. It wouldn't be horrible to make one using the fullscreen renderer stuff, though... provided someone wants to. ;)
User avatar
Joramun
Mon Master
Posts: 925
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Re: Questions about DSB/ESB

Post by Joramun »

The hint oracle would be an in-game feature though: you wouldn't have to load a savegame into it.

(But in any case I don't see the point of being forced to quit the game. I almost never used the hint oracle as a result of this.)

10) You already asked a question number 10 :wink:
What Is Your Quest ?
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

I actually still like the way the original Hint Oracle works: it forces you as a player to decide if you really need a hint, since getting one involves a complex process. I agree it could be made more user friendly, but the principle is sound.

Thanks for the answers Sophia, I'm getting pretty convinced to switch to DSB... :)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

I'm glad to help. ;)

Anyway, the "front door" screen is itself nothing more than a dsb_fullscreen call. So, actually, by making the hint oracle part of this, we can force the player to only do it when you could use the hint oracle in default DM. I personally don't like the process, but the option is open. :D
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

Code: Select all

magic_system_colors = {
	{0, 0, 0},
	{255, 255, 255},
	system_color,
	system_color,
	{0, 64, 64}     -- disabled rune
}
magic_runes = {
	"a", "b", "c", "d", "e", "f",
	"g", "h", "i", "j", "k", "l",
	"m", "n", "o", "p", "q", "r",
	"s", "t", "u", "v", "w", "x"
}
power_multipliers = { 1.0, 1.5, 2.0, 2.5, 3.0, 3.5 }
rune_costs = {
	10, 20, 30, 40, 50, 60,
	20, 30, 40, 50, 60, 70,
	40, 50, 60, 70, 70, 90,
	20, 20, 30, 40, 60, 70
}
runes_per_set = 6
rune_sets = 4

g_disabled_runes = {
	false, false, false, false, false, false,
	false, false, false, false, false, false,
	false, false, false, false, false, false,
	false, false, false, false, false, false
}
All the above in global.lua looks very, very interesting indeed! I don't want to code all the internal for a new magic system from scratch, but if I can override these defaults, I could certainly do something like the Sorcery spell system.

Can we make a totally new rune panel, with simply one set of 48 runes? Could we allow different characters to learn different runes? So some might learn ZAP for oinstance, but others might not? My brain is swimming with possibilities -- though I'm not keen on writing the code to make it work ;-)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Gambit37 wrote: All the above in global.lua looks very, very interesting indeed! I don't want to code all the internal for a new magic system from scratch, but if I can override these defaults, I could certainly do something like the Sorcery spell system.

Can we make a totally new rune panel, with simply one set of 48 runes? Could we allow different characters to learn different runes? So some might learn ZAP for oinstance, but others might not? My brain is swimming with possibilities -- though I'm not keen on writing the code to make it work ;-)
Yes, you can do all of that.. though the default DSB magic system is pretty well-suited to the standard DM system, and it'd probably require some pretty heavy rewriting to make something that different actually work. :(
User avatar
Joramun
Mon Master
Posts: 925
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Re: Questions about DSB/ESB

Post by Joramun »

Sophia wrote:Anyway, the "front door" screen is itself nothing more than a dsb_fullscreen call. So, actually, by making the hint oracle part of this, we can force the player to only do it when you could use the hint oracle in default DM. I personally don't like the process, but the option is open. :D
But wouldn't that require to externalize some of the code for loading/saving games, to be able to extract the party position from a savegame for example ?
I don't want to be scary, but it's a step toward the evil "load a party in another dungeon" feature :wink:
What Is Your Quest ?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Joramun wrote:But wouldn't that require to externalize some of the code for loading/saving games, to be able to extract the party position from a savegame for example ?
Not necessarily, if it only works once, on the current position, which I think is how real CSB worked. So, it can load the game just like it normally would, and then analyze the party's current position, and then you can either play the game or quit DSB-- unlike real CSB, where you had to reboot. ;)
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

More questions:

15) Can you make "always bright" items? IE, a torch that stays bright in the distance and isn't affected by shading or light level?

16) Can we use coloured images for magic runes? (I found this works in RTC as RTC only recolours fonts where they contain a pure white pixel)

17) I saw this function "dsb_set_xp_multiplier" -- says it works on a level basis. But presumably you could invoke it part way through a level to change the experience given on that same level? (Handy for large levels progressed linearly.)

18) "dsb_set_tint" will recolour monsters -- but this seems to just be an overlay that allows the underneath colours to show through. Is there a function for completely changing the colour of a monster but retaining the lumninance of each pixel? IE, could you say apply "brown" to the monster, and every pixel goes brown but retains it's brightness level so you can still each each pixel? This would be cool for doing things like making monsters turn to stone, ice, etc. without having to create hundreds of new images. Here's an example of what I mean:
Image

19) Can DSB do instant projectile damage to a monster without launching a projectile? EG, for creating guns and the like...
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Gambit37 wrote:Can you make "always bright" items? IE, a torch that stays bright in the distance and isn't affected by shading or light level?
If you mean the item itself, yes. DSB already does this for magic spells and explosions. For example, go down to a pitch black level and throw a fireball. The fireball and explosion will still be vibrant red and yellow. It won't cause any "glow," but the DM graphics are drawn that any light always appears to come from the party position, so it wouldn't look right anyway.
Gambit37 wrote:Can we use coloured images for magic runes? (I found this works in RTC as RTC only recolours fonts where they contain a pure white pixel)
Yes, DSB supports colored fonts as well as mono (recolored) ones. The wall writing is a standard Allegro font the same as the default font, but it isn't recolored.
Gambit37 wrote:I saw this function "dsb_set_xp_multiplier" -- says it works on a level basis. But presumably you could invoke it part way through a level to change the experience given on that same level? (Handy for large levels progressed linearly.)
Now you're thinking like a DSB user. ;)
Gambit37 wrote:"dsb_set_tint" will recolour monsters -- but this seems to just be an overlay that allows the underneath colours to show through. Is there a function for completely changing the colour of a monster but retaining the lumninance of each pixel? IE, could you say apply "brown" to the monster, and every pixel goes brown but retains it's brightness level so you can still each each pixel?
Yes, dsb_set_tint is just a little bit of eye candy for making monsters flash when special things happen to them. I'll have to look into a good way of doing what you want. In some ways, it seems like it's a better operation to carry out per bitmap rather than per object.
Gambit37 wrote:Can DSB do instant projectile damage to a monster without launching a projectile? EG, for creating guns and the like...
It can, but you'd likely find the code messy. DSB allows you to set the number of update repetitions that a flying object performs per tick, however, using dsb_set_flyreps. For example, a value of 8 will cause the object to move 8 sub-tiles per tick, or 4 full tiles.

Hmm, for a future update, I'll add better support in the base code so that you don't have to write a custom attack function if you want to do this.
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

Cool, that's great, thanks. I'm very interested ot see if you can get the monster palette thing working, that could do some cool stuff (a trigger turns off the lights, then have an infra red spell to reveal monsters).

I just realised from your answer about bright objects that you imply DSB doesn't have an ambient light object, like RTC. Is this the case? It's not essential, but it does add some atmosphere -- I have gentle light flickering working in RTC at present.

Good to know about the possibilities for guns. I still have ideas for a sci-fi game and a modern one too.....!

I've just been reading the Wiki about fullscreen stuff and subrenderers. OMG! So many possibilities spring to mind.... whay am I still fighting with RTC!?!? :P
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Re: Questions about DSB/ESB

Post by Sophia »

Gambit37 wrote:Cool, that's great, thanks. I'm very interested ot see if you can get the monster palette thing working, that could do some cool stuff (a trigger turns off the lights, then have an infra red spell to reveal monsters).
Ooh, that's a good idea. See, you're thinking more and more like a DSB user all the time. ;)
Gambit37 wrote:I just realised from your answer about bright objects that you imply DSB doesn't have an ambient light object, like RTC.
It doesn't, because I found the look unsatisfying. Due to the way the DM wallset is drawn, all light appears to come from the party's position. Having a flickering light in the distance looks odd, because it lights up where you're standing a bit more, but doesn't do anything where the light source actually is... :(
Gambit37 wrote:So many possibilities spring to mind.... whay am I still fighting with RTC!?!? :P
Good question. :D
User avatar
Gambit37
Should eat more pies
Posts: 13714
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Re: Questions about DSB/ESB

Post by Gambit37 »

Re: light sources. I agree, distant bright lights look odd due to no distant light effect, however they do add a little guidance to players lost in dark areas so I can kind of live with the unreal effect ;) Note that the ambient light object in RTC is not the same as distant "always bright" items though -- the ambient light does actually work pretty well at creating brighter areas around a specificed radius. I'll certainly miss this effect in my dungeon if I switch to DSB :( ;)

On another note:

Code: Select all

obj.door_metal_redlock = {
	type="DOOR",
	class="METAL",
	renderer_hack="LEFTRIGHT",
	front=gfx.door_metal,
	deco=gfx.door_deco_redlock,
	bash_mask=gfx.door_bashed,
	col=door_collide,
	msg_handler=door_msg_handler
}
Interesting that you went with a similar approach to the original game for creating differently decorated doors (by using small patches to overlay on the top) -- that offers much more flexibility, I like it :-) (RTC requires a full bitmap for every door type/decoration type). I'm curious about "renderer_hack" -- there appears to be only two settings for this, LEFTRIGHT and MAGICDOOR. I haven't investigated how these are setup yet, but I assume others could be created (such as DOWN)?

Can DSB automatically handle different sized doors (ie, like the narrow ones you'll have seen in Zagor)? In zagor, you ca only open them by clicking on their doorhandle -- possible in DSB easily enough?

Also, can I just say that I totally love you for ICONGRID.PCX :) This will be a massive time saver over how icons are handled in RTC. Having just one file + an offset = inspired :)
Post Reply