Incorrect Values - Dungeon Layout

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

Incorrect Values - Dungeon Layout

Post by Darendor »

It seems there's something strange going on with the way walls are drawn in dungeon files on BTI.

ZeroZero, you said that dungeon layout is found on a dungeon disk from locations $002 to 201.

However, consider this chart:
Image

The byte for 21N 21E is $1e5, NOT $201. There's 28 bytes unaccounted for.

Quantum Reality says there's a lookup table somewhere.
User avatar
Quantum Reality
Posts: 91
Joined: Mon Mar 15, 2010 8:34 pm

Post by Quantum Reality »

The lookup table is in the Dungeon Mapper program I referred to, not in the Bard's Tale.

However, what it does is tells me that the value as calculated from the byte stored in the dungeon cell section can correspond to a given layout of walls in that cell in the maze.

Further, the mapper skips no bytes that I can see.

It moves from value 484 ($1E4) in the array R, and moves to zero in the array. It then plots the walls. The extraneous bytes mean nothing, because it then skips down two sectors and grabs the events.
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Well, I know that $202 begins the events sequence because on my "Loft" level I have placed a byte to indicate something at 0N 0E, and sure enough it's there.
User avatar
ZeroZero
Posts: 286
Joined: Tue Mar 10, 2009 9:10 pm
Location: Germany

Post by ZeroZero »

Lmao.... there are some unused bytes at the end of each map, thats why.

The maps are 22 x 22 cells, thats 484 bytes needed for a map. The area the map takes is 512 bytes big, that leaves 28 bytes unused in each map.

21N 21E is 002 (fileoffset, skipping the load address) + 21 * 22 + 21 = 485 = 1e5h. So all is good. I assume they didn't remove the unused bytes to be able to load the whole map file at once and w/o needing to move memory later. It is just more convenient to work with "standard" address ranges starting at some xx00 rather than starting at xx63 or so.
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Oh. :?
Post Reply