Wine Cellar Deconstructed (well, I tried anyway)

Any developer realated stuff
Post Reply
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Wine Cellar Deconstructed (well, I tried anyway)

Post by Darendor »

Right, I had a look at the Wine Cellar.

Here's my notes:
[9 BLOCKS] NMA0.PRG - starts @ T8 S9 - Contains "The Cellar"
T8 S19 {2nd half of square definitions}
T8 S16 {1st half of traps, specials, etc}
T8 S18 {2nd half of traps, specials, etc}
T7 S6 {position 34 to 43 inclusive contains the dungeon caption; i.e. "Cellars" in this case}
T7 S16 {Contains the three text specials; the end of the sector also contains text clue from another
dungeon level elsewhere "voice from no where proclaims:"}
T7 S4 {Text from other dungeon except for end of sector starting at position #215}
T7 S14 {"HERE FOR NO ZERO DIRECTORIES"; "ZEROING DIRECTORIES"; "SET CONSTANTS FOR LOOP"; etc...}
T7 S2 {Nearly identical to T7 S4...}


So what happens is the game first loads in the dungeon's walls, doors, secret doors and whatnot from the first two blocks of the program file - in this case, NMA0.PRG. The next two blocks contain the dungeon's layout of traps, specials, darkness, stairs, and so forth. The fifth block appears to hold little except for the name of the dungeon, from position #34 to 43 inclusive - this is what's displayed in the caption. Note that unused characters are filled in with character #160, meaning dungeon levels can have a maximum name length of 10 characters - at least it appears that way.
The sixth sector holds the non-loading specials (i.e. the text messages, such as "This is the Wine Cellar of the Scarlet Bard...", "Rare wines - 50 years and older..." and so forth). I also noticed text from a clue in Kylearan's Tower here for some strange reason.
Block #7 also had text from another dungeon, with unidentified code towards the end bytes.
Block 8 had some drive programming code on it with comments regarding zeroing directories and such. Not sure what any of that has to do with the Wine Cellar in particular...
Block 9 was nearly identical to block #7.

So, the first 5 blocks out of 9 for each dungeon file are identified. Two for physical layout, two for trap and special layout, one for dungeon name, and the other three I can only guess at.
I suspect the fifth block also contains the code for deciding whether to allow the player to teleport/Phase Door, and that at least one of the other three sectors contains a monster table for random encounters such as # of monsters, how many of each type can appear, and what picture to load for each, in addition to experience and gold award and chance of dropping what items.
Chaney
Posts: 100
Joined: Tue Jun 27, 2006 7:56 pm
Location: California

Post by Chaney »

They should have kept you on DW. You are more dedicated than they were.
When in doubt, kick your neighbors dog!
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

I don't suppose you know anything about how to analyse this code?
Chaney
Posts: 100
Joined: Tue Jun 27, 2006 7:56 pm
Location: California

Post by Chaney »

:( :( :( :( Alas, no
When in doubt, kick your neighbors dog!
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Chaney wrote::( :( :( :( Alas, no
Know anyone who might? :roll:
Chaney
Posts: 100
Joined: Tue Jun 27, 2006 7:56 pm
Location: California

Post by Chaney »

No. If I did, I would have volunteered them.
When in doubt, kick your neighbors dog!
User avatar
ZeroZero
Posts: 286
Joined: Tue Mar 10, 2009 9:10 pm
Location: Germany

Re: Wine Cellar Deconstructed (well, I tried anyway)

Post by ZeroZero »

Darendor wrote: T7 S2 {Nearly identical to T7 S4...}
Well that is ok, that sector only contains three bytes for the file. However what puzzles me too is that the text is in the other sector as well, which should be fully usable for that dungeon. Maybe it is a buffer that is overwritten after loading...
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Re: Wine Cellar Deconstructed (well, I tried anyway)

Post by Darendor »

ZeroZero wrote:
Darendor wrote: T7 S2 {Nearly identical to T7 S4...}
Well that is ok, that sector only contains three bytes for the file. However what puzzles me too is that the text is in the other sector as well, which should be fully usable for that dungeon. Maybe it is a buffer that is overwritten after loading...
You've been looking at your dungeon disk too?

See anything I've missed?
Post Reply