Does anyone knows (questions about modding) ?

Discuss anything about the original Dungeon Master on any of the original platforms (Amiga, Atari, etc.).
This forum may contain spoilers.

Moderator: Ameena

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
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

Hello here,

I'm modding dungeon.dat and graphics.dat to play with CSBwin.
I'm changing quite a lot of things using ADGE.net who's a very cool program (thanks to all contributors).

Actually I intended to place "poison cloud" a water magic spell and change the green cloud to blue.
All's nice, works quite well ; changed also the "bolt" aswell. :P
And... I noticed the graphics used when a creature dies is... The death cloud and its blue now ! :shock:
When you go in the dying ennemy "cloud", it shows the animation of death cloud (when you're in) but, its also blue (instead of grey). :evil:

So there is some function somewhere who says "use the death cloud animation and replace the green by grey".
Someone has an idea to replace this change of colour to make it replace the "blue by grey" instead ? :?:

I still don't know how to change "misc item" weight (IDK where its stored) to lower mainly chests (because its quite user friendly to get some space).
For logical reasons, I may change the chests graphics by bags then but I like to have more storage for not 5kg... :?:

Have a nice night,
User avatar
ChristopheF
Encyclopedist
Posts: 1696
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Does anyone knows (questions about modding) ?

Post by ChristopheF »

The "smoke" when a creature dies uses the same graphics as poison cloud but with a different color palette.
The palette changes are stored in item 558, see http://dmweb.free.fr/community/document ... known-data
In these 16 bytes of data, corresponding to 16 colors, byte #x contains a number. Divide this number by 10 and this gives you the index of the color to use to replace color #x in the bitmap.
I don't know if ADGE allows you to change that easily.

Misc items weight are stored in item 559: http://dmweb.free.fr/community/document ... escriptors

However, the weight of chests is hard coded in the program to 5Kg. The weight of items contained in the chest are added to get the total weight of a chest
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Re: Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

Hello Christophe,

Thanls alot for your answers. :!: Unfortunately ADGE can't edit those "items" and DM1GED aswell.
But I'll try with other stuff hoping it does not mess things up (because some edited dungeon may have a little different size than an original as I changed some graphics' size).
By any chance, you know a good tool to edit item 558/559, I'm a bit lost in the different things here. Problem being after modifications, it looks "the decompilers" like DMmute have difficulties to do their job. So the only solution I see could be to restart all gaphics.dat modifications from a standard dungeon ? But restarting all the changes is quite fastidious (I changed size of some items, palettes, combo, item power, item look... so it'll be very long to re-type it all). :roll:
Edit : DMmute looks to do the same stuff with PC version of game and extract well the 1994 Amiga version. But CSBwin does not work with this version... :evil:

I struggle with the same problem to change the rune's look. Samely its not easy to edit with ADGE and I hope to not have to re-change a basic version with all modifications I made.
Here are my new runes' look :
https://e.pcloud.link/publink/show?code ... fV1Re07NKy

By any chance, you have an idea of "hex adress" of the function who takes care of the weight of chests ? If I can hex edit by any value between 1-2 kg (who's normally a 10 or 20 value for weight) instead of 50, it would be very cool.

Have a good day :D
Last edited by FfuzzyLogik on Mon Aug 11, 2025 1:38 pm, edited 1 time in total.
User avatar
ChristopheF
Encyclopedist
Posts: 1696
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Does anyone knows (questions about modding) ?

Post by ChristopheF »

I think you can use the "Import/Export Manager" in ADGE.net to export the binary item 558 to 562 to separate files, then edit these files with a hexadecimal editor, and finally import them back into you modified graphics.dat. This way you can edit anything in these items, although not in a very user friendly way.
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Re: Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

Yes I can do that ! A bit tired, I searched in 558 zone the misc weights (its in 559 ^^).
The tip was obvious but obviously I need a nap to see the things better.
Thanks for the answer ! :P

The problem I get with the format for runes (font) ; I have no idea how are written in hex the "font" and I don't understand how to use Allegro to edit the font. :?:

Hard to be dumb and try to do things huh ^^
Have a good day :mrgreen:
User avatar
ChristopheF
Encyclopedist
Posts: 1696
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Does anyone knows (questions about modding) ?

Post by ChristopheF »

I got an email from "shu" (Japan) with some useful information for you:

Question about changing chest weight:
viewtopic.php?t=24489
With CSBuild, can change the chest weight and save it to "dungeon.dat".
Edit > Global Info > Edit Database > Database Type > Object Weight ...
Note that this is a dungeon.dat edit, not a graphics.dat edit.
And currently, it seems that only chest weight can be changed with CSBuild. X(

ADGE.net seems to be poor at pasting graphics.
In my graphics.dat, all pasting of graphics is done using DM1GDED.
http://dmweb.free.fr/community/tools/dm1gded/
Use ADGE.net to register the size values of edited graphics.
DM1GDED is only used to paste graphics.
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Re: Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

Hello Christophe,

Thanks again for answers and thanks to "Shu" too. :!:
Unfortunately I lack of time to test it all right now (will have to go for a week). But I'll definitively test things when I'll be back. I just wanna to say a word before my departure because you're very fast to help.

For pasting graphics, ADGE.net is nice, I integrate them with ease :?: Doble click, import. That's it. It also corrects small problems of palette !
Unfortunately, both ADGE and DMIGDED have difficulties because the font is considered as "font" and not "picture". So none of them can integrate the new runes graphics. And as I don't know how to "hex edit" that (IDK how its written), I'm still struck.

Thanks for detailed explanations to change chest's weight, quite hidden in the program.
Edit : You need to create a new game for the chest's weight to be changed. The values you need to change are the one on the right (but I don't know precisely whitch one ? Just spammed the 2 in one save or 19 and it worked).
I'm not sure about the "32 bit entry" file importance nor what's used in the tons of datas. Its one for each chest in the game or something ? :?: I'll test later, got to go.

For the colour palette changes in item558 ; here are the datas :
Hex values : 00 - 0a - 14 - 1e - 28 - 32 - 78 - 0a - 50 - 5a - 64 - 6e - 78 - 82 - 8c - 96 - 50
Dec values : 00 - 10 - 20 - 30 - 40 - 50 - 120 - 10 - 80 - 90 - 100 - 110 - 120 - 130 - 140 - 150 - 80
I'll try to figure out how tho edit that ; I don't know what these values means for now.

All misc items' weight are changed (with hex editing) ! Worked like a charm. That's wonderful. All "potions" have a 0,3 weight but not stored here. I suppose like chest, its hardcoded. But 0.3kg is a "decent weight".

See you ! :mrgreen:
User avatar
ChristopheF
Encyclopedist
Posts: 1696
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Does anyone knows (questions about modding) ?

Post by ChristopheF »

Dec values : 00 - 10 - 20 - 30 - 40 - 50 - 120 - 10 - 80 - 90 - 100 - 110 - 120 - 130 - 140 - 150 - 80
Caution: palette changes are 16 bytes long. You have 17 values here, the 80 at the end of the line is not part of it !

For example the first value 120 is at index 6. It means that color #6 in the original image should be replace with color #12 (120 / 10, you must divide palette change values by 10).
In this example, only colors #6 and #7 are replaced (with #12 and #1), other colors are left unchanged.
User avatar
ChristopheF
Encyclopedist
Posts: 1696
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Does anyone knows (questions about modding) ?

Post by ChristopheF »

The font format is here: http://dmweb.free.fr/community/document ... #fnt1-data

I don't know of any user friendly tool to edit that font.
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Re: Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

Hello Christophe,

I've done that in a rush before I ; had to go. But I understood your explanations. The precedent answers were fine to catch the thing. When I was writing them it made me think of a list.
The two who does not fit were the "changed ones". I just wrote it here in case someone else is interested.

Hex values at 05DE (item 558): 00 - 0a - 14 - 1e - 28 - 32 - 78 - 0a - 50 - 5a - 64 - 6e - 78 - 82 - 8c - 96
Corresponding colour (x10) : 00 - 10 - 20 - 30 - 40 - 50 - 120 - 10 - 80 - 90 - 100 - 110 - 120 - 130 - 140 - 150
Initial palette if I'm not making mistakes general palette is :
Black - Grey (darker) - Grey (mid) - Brown (dark) - Blue (sky) - Brown - Green (dark) - Green (light) - Red - Orange - Pink - Yellow - Grey (darkest) - Grey (lighter) - Blue (darker) - White
It does look to fit the colour changed... So the palette used here must be this one.

I tryed a change 78 => 3c ; 0a => 46 to let the "greens" not changed and replaced the 8C (the darker blue) with 78 (darkest grey). It works like a charm !

Thanks too for the format, once understood, fastidious to change but not very hard. I managed to do it !!! I'm very happy !
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Re: Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

I'm not far from finishing the 0.5 version with maaaany changes. But there are few things I'd still like to change.

The things in question are :
> Change lifebars (and text) colours. For text, ADGE can deal with it. For lifebars associated, IDK if someone knows ?
> Change some items special effects :
- Be able to pick the stat to be changed and value (like adding 5 strength, 6 mana max or a new kind like 10 HPmax)
- Be able to control where it must be equipped to get the effect
(because some items do some stuff but if I change where it can be equipped, the effect does not work anymore)

Good knight (because they protects during your sleep ?)
User avatar
ChristopheF
Encyclopedist
Posts: 1696
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Does anyone knows (questions about modding) ?

Post by ChristopheF »

On Atari ST version, graphic item #562 defines a color for each champion, but it is ignored to draw the graph bars. The bar colors are hard coded in an assembly routine specific for Atari ST.
All item effects are also hard coded in a dedicated function.

These things cannot be changed easily. You would need to hack into the binary executable or compile a custom version.
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Re: Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

Hello,

I was seraching how the experience for casting spells (potions or any other spell) are handed.
I noticed when I miss a "Lo" fire shield spell I gained around 20-21 XP but 82-85 when its a sucess. For a miss for "Lo" see through walls that was 30-32 and 62 for a sucess. For "light" spell (Lo too) its 57 XP for sucess and 30 for a miss. It looks multiplicated by 2 when its not a miss. Testing for "Zokathra" spell, its a level "6" difficulty spell (IDK if the game manages it well as it does not exist normally) 10 XP for a miss and 164XP for a sucess.
Here I modded the game so maybe the XP is not the same in "normal game", was testing if it brings well the good XP in good subclasses and would like to understand how it works. Light is now level 2 spell, see trhrough walls too and fire shield a level 3 spell.

But I don't see where those "actions" experience are stored and how the XP works (values don't look exactly the same, quite strange ?).
I know about "being hit" by a monster (x2) and the modification of level (XP multiplier depending on level). Was on level 1 for both spellcastings.

As I haven't found things (but data section is quite big, may have missed something), I ask for better understanding if someone have the knowledge.
Have a nice day.
slickrcbd
Expert
Posts: 333
Joined: Sun Dec 09, 2007 7:49 am

Re: Does anyone knows (questions about modding) ?

Post by slickrcbd »

That sounds odd that the more complex spells give less XP than the light spell, did you do your testing in the same place? IIRC the deeper in the dungeon you are, the more XP you get.
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Re: Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

Hi !
As I know there is a level dependency, yes for sure. I also was not hit by any creature in the last minute. As I try comparisons and with a "low" party to test, I cast just "Lo" spell also.
It looks the more complex is the spell the more it gives when you suceed but it brings less when you fail.
The level 7 spell I made brings 1XP when you miss but around 200XP if you were able to cast it.
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Re: Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

Hello,

I was searching the effect of sharp resistance seeing some ennemies have "sharp attack" and wanna to adjust some things in modding.

I've read on DM website
Bits 2-0: Sharp Resistance (type 4), in 1/8th of the protection value (minimum 0, maximum 7/8)
And Nerthing wrote here (https://gamefaqs.gamespot.com/snes/5882 ... faqs/33244) the sharp resistance works in 1/7th.
This was placed in his guide :
Sharp attacks use the following format to calculate armor: (Sharp Resistance / 7) * Armor Strength, so if the
Sharp Resistance value is 0, a creature having a Sharp attack will ignore your armor.
Two questions about that :
- It works in 1/8th or 1/7th ? (Probably the DM being more tested and recent is right but I prefer ask if someone is sure about that.)
- Why is the meaning of "maximum" placed to 7 on website ? Is it the maximum items have in the game (whitch are mithril armors) or the maximum possible the game can handle ?
I had as idea to place, for some very effective armours against "sharp attacks" some value like lets say 10 (so if its on 1/8th will add +25% resistance against those kind of attacks). And I'm not sure if it will work or cause some potential problems.

I already asked that but has someone found where, in the code, the "way" of some item bonuses are written ?
I'd really like the wands and some (mainly mana) boost items works as well in left hand, pouches and quiver eventually.
So the wands shall be very nice items to have on those close bags to improve the mana of your "low mages" at start to help them in their training.

I'd also give some more use for shields, so was thinking to add a bonus to lets say of "vitality" or "magic resistance" to one or two of them.
Is it possible to add a new kind of bonus to some existing item (even if it requires to replace one of the few +1 mana items effects in the game) ?
I have seen nothing about where and how those boosts are placed in the code (so even in hex editing, no idea of how to change them).
The things I know are : it depends on item and its wearing logation. If you change a force boosting armour by a weapon or a cloak, the bonus does not work on the hand or neck location. I haven't tested all locations but it looks to be specific to one (or two for cloak of night).

Have a good day,
User avatar
ChristopheF
Encyclopedist
Posts: 1696
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Does anyone knows (questions about modding) ?

Post by ChristopheF »

1) Each armor item has a Sharp Resistance value stored in 3 bits (so the only possible values you can define are 0 to 7, you cannot specify a higher value).

In the ReDMCSB source code http://dmweb.free.fr/community/redmcsb/, the Sharp Resistance value is used in the function named F0143_DUNGEON_GetArmourDefense that computes the Defense value.
If Sharp Resistance is not used, then Defense = Protection efficiency value\
else Defense = "Protection efficiency value" * (Sharp Resistance + 4) / 8

With a Sharp Resistance value of 0 you get Defense = 0.5 * "Protection efficiency value"
With a Sharp Resistance value of 4 you get Defense = "Protection efficiency value"
With a Sharp Resistance value of 7 you get Defense = 1.375 * "Protection efficiency value"

The description of Sharp Resistance on http://dmweb.free.fr/community/document ... escriptors
is wrong. I'll fix it in the next site update.

2) In DM/CSB, item bonuses are hard-coded. In DM2 they are defined in graphics.dat so you can add/remove/modify effects without modifying the program itself.
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Re: Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

Wow, what a fast and efficient answer !

Just not sure about what the words "Defense" and "Protection efficiency value" are... And how the "armour" value is modified and used. (I understand fast but ya need things to be explained for a looong time :wink: )
Oh and is the result rounded up or down ?

I suppose that "Protection efficiency value" is the base "Armor strength" value of the item are on tables, right ?
So every armour have more than 4 Sharp resistance will be "better" against "piercing" attack than regular one, right ?
And ennemies like living armour will have more difficulties to pierce a mithil mail than a plate mail.

Just to get a "complete table" if :
Sharp resistance = 0 => Defense = 0,500 * Armor strength
Sharp resistance = 1 => Defense = 0,625 * Armor strength
Sharp resistance = 2 => Defense = 0,750 * Armor strength
Sharp resistance = 3 => Defense = 0,875 * Armor strength
Sharp resistance = 4 => Defense = 1,000 * Armor strength
Sharp resistance = 5 => Defense = 1,125 * Armor strength
Sharp resistance = 6 => Defense = 1,250 * Armor strength
Sharp resistance = 7 => Defense = 1,375 * Armor strength

You know the link between "Defense" (calculated by your function) and "chances to hit" by ennemies ?
And as we do maths, is there a maximum Defense I must take care to not get considering the "*1,375" ? And a maximum Armor strength who must not be placed ?

Thanks a lot for your sharp answers ! :D And sorry to ask that much things.
I'll try to put this new knowledge to good use when I'll mod my items. :!:

Good knight (better to go to sleep protected), :mrgreen:
User avatar
ChristopheF
Encyclopedist
Posts: 1696
Joined: Sun Oct 24, 1999 2:36 pm
Location: France
Contact:

Re: Does anyone knows (questions about modding) ?

Post by ChristopheF »

"Protection efficiency value" and "Sharp Resistance" are the raw values associated with each item, stored as data directly in the program (or in graphics.dat item #559 on Atari ST). These terms are listed here: http://dmweb.free.fr/community/document ... escriptors
"Armor strength" in item tables is the same as "Protection efficiency value" on the link above. I will fix this to use the same term on both pages.
Also "Clothe" items = "Armour" items.

Indeed, armour with sharp resistance 5, 6 or 7 will provide a higher Defense against a piercing attack than a non piercing attack.
You can set an Armor strength values of 255 for an item if you want, there is no limitation in the code.
The computed Defense value is stored in a word (16 bit) so it can be greater than 255.

The game contains lots of formulas and special cases to compute "Attack", "Defense", "Damage" values. If you really want all the details, you must read the source code (in particular function F0321_CHAMPION_AddPendingDamageAndWounds_GetDamage in file CHAMPION.C).
User avatar
FfuzzyLogik
Novice
Posts: 21
Joined: Sat Jul 16, 2022 10:38 pm

Re: Does anyone knows (questions about modding) ?

Post by FfuzzyLogik »

Thanks alot ! Hopes its of use for some other persons than me and myself... (Yes, we're a bit numberous in my head :? )
Post Reply