Bwa-hahahaha!

Any developer realated stuff
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Post by Horpner »

Awesome job on clearing The Cellars!

It's hard to be sure, but I'm guessing that the code for specials is stored in the files with the map data.

Take a look at memory location $fa00 next time you're in a dungeon, and you'll find another string of 484 bytes. Each byte represents 8 of the features that a dungeon tile can have. These bytes are arranged in the exact same order as the bytes containing the map.

Counting from the the right-most binary digit:

bit 0 is set if there are stairs up.
bit 1 is set if there are stairs down.
bit 2 is set if there is a special (this includes spinners, magic squares, messages, magic mouths, etc. Everything that's not covered by one of the other bits.)
bit 3 is set if there's darkness
bit 4 is set if there's a trap.
bit 5 is set if there's a portal down
bit 6 is set if there's a portal up
bit 7 is set if there's a random encounter scheduled for this tile.

It remains to be discovered how the special handling code is found and activated, since all specials have the same bit flag set.

How many files are there on the dungeon disk? How many dungeons?
Death and drek? WTF?
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Well, as far as dungeons, we have:

- Skara Brae
- Wine Cellar
- Sewers 1
- Sewers 2
- Sewers 3
- Catacombs 1
- Catacombs 2
- Catacombs 3
- Harkyn's Castle 1
- Harkyn's Castle 2
- Harkyn's Castle 3
- Kylearan's Tower
- Mangar's Tower 1
- Mangar's Tower 2
- Mangar's Tower 3
- Mangar's Tower 4
- Mangar's Tower 5

17 dungeon levels total (18 if you buy into my theory that Mangar's Tower has two level 4s). There are 97 files on the dungeon disk, all named "NM##" where ## is a hex number.
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Bit 7 indicates whether a random encounter appears? You mean we can make it so monsters only wander in certain areas?
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Horpner wrote:Take a look at memory location $fa00 next time you're in a dungeon, and you'll find another string of 484 bytes. Each byte represents 8 of the features that a dungeon tile can have. These bytes are arranged in the exact same order as the bytes containing the map.

Counting from the the right-most binary digit:

bit 0 is set if there are stairs up.
bit 1 is set if there are stairs down.
bit 2 is set if there is a special (this includes spinners, magic squares, messages, magic mouths, etc. Everything that's not covered by one of the other bits.)
bit 3 is set if there's darkness
bit 4 is set if there's a trap.
bit 5 is set if there's a portal down
bit 6 is set if there's a portal up
bit 7 is set if there's a random encounter scheduled for this tile.

It remains to be discovered how the special handling code is found and activated, since all specials have the same bit flag set.
Call me an idiot, but from $fa00 to where exactly?

I'm sitting at the stairs into Harkyn's castle, and I see:

Code: Select all

$fa00: 01 00 00 00   00 00 00 00
$fa08: 00 04 00 04   04 04 04 04
$fa10: 04 04 00 04   00 00 00 00
$fa18: 00 00 00 00   00 00 80 00
$fa20: 00 00 04 00   00 00 00 00
$fa28: 00 04 04 00   00 00 00 80
$fa30: 00 88 00 00   00 00 00 00
$fa38: 04 00 00 00   00 00 00 00
The 01 I presume is the stairs down at 0N, 0E. The "04"s are traps. But there's no traps along the path to the "greeting" special at 0N, 9E.

Any ideas?
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Post by Horpner »

Darendor wrote:I'm sitting at the stairs into Harkyn's castle, and I see:

Code: Select all

$fa00: 01 00 00 00   00 00 00 00
$fa08: 00 04 00 04   04 04 04 04
$fa10: 04 04 00 04   00 00 00 00
$fa18: 00 00 00 00   00 00 80 00
$fa20: 00 00 04 00   00 00 00 00
$fa28: 00 04 04 00   00 00 00 80
$fa30: 00 88 00 00   00 00 00 00
$fa38: 04 00 00 00   00 00 00 00
The 01 I presume is the stairs down at 0N, 0E. The "04"s are traps. But there's no traps along the path to the "greeting" special at 0N, 9E.

Any ideas?
You must convert to binary to read the flags.

01 is easy: 0000 0001 --> Stairs down
04 is: 0000 0100 --> Something special, i.e., bit 3 is set.

I don't have my map in front of me, but I think those are the damage zones and a nessage saying there's hot coals or something similar.

Other flags visible in that block of bytes:

Edit: Corrected my bad binary conversion on the next line:
80 is 1000 0000 --> Random encounter.

Here's a table to help convert to binary:

Code: Select all

Hex Binary
0   0000
1   0001
2   0010
3   0011
4   0100
5   0101
6   0110
7   0111
8   1000
9   1001
A   1010
B   1011
C   1100
D   1101
E   1110
F   1111
You just look up a digit, and half the byte is deciphered.

So 9C is 1001 1100. Bits 2, 3, 4, and 7 are set. Remember that I'm counting bits from the right, starting with bit 0, the least significant bit.
Last edited by Horpner on Wed Jan 28, 2009 1:49 pm, edited 1 time in total.
Death and drek? WTF?
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Post by Horpner »

I used Star Commander (a dos program that can work with d64 disk images directly) to search around on the dungeon disk for The Cellars. I found it in file nma1.prg.

There's bunches of files.
Death and drek? WTF?
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Does Star Commander find the specials and the text with them perchance?
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

$FA09 has the special at 0N, 9E in Harkyn's Castle level 1 which reads:
"A wide corridor leads into Baron Harkyn's castle. Fabulous tapestries adorn the walls. The flickering torchlight casts strange shadows."

I'm wondering where that text code would be hidden.
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

In case you were wondering, if you put a portal down anywhere and descend it, it behaves as though you've descended the stairs down back outside to Skara Brae.

I wonder what happens if I put skylights on level 3 of the castle and try to go up. :?
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

...It attempts to load level 4 of the Castle, then the screen border turns red, and it says: "Insert the DUNGEON disk, check the drive, and press a key."

Crash. Whooyeah. Wonder what filename it looks for. :?
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Star Commander locks up on my system.
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

Track 21, Sector 13 contains the names of traps on chests: POISON NEEDLE, BLADES, DARTS, GAS CLOUD, SHOCKER, CRAZYCLOUD, MINDTRAP...

Track 23, sector 3 says "RD ROOM" and "NO"...hmm...
Track 24, sector 4 says "ROOM", and "NO"...
Track 27, sector 4 and 5 has "THOR"...
Track 27, sector 12 has "LIEWITHPASSIONANDBEFOREVERDAMNED"...
Track 27, sector 17 has "SPECTRE SNAR"...
Track 28, sector 0 also has "SPECTRE SNAR"...
Track 7, sector 14 has: "HERE FOR NO ZERO DIRECTORIES", "ZEROING DIRECTORIES ---", "SET CONSTANTS FOR LOOP -- S9 IS SIZE OF EACH VOLUME; OH IS OVERHEAD AT START OF DRIVE" (this repeats a few times throughout the disk)
Track 9, sector 1 has "STONE GOLEM"...
Track 9, sector 2 has "SINISTERR"... (yes, with an extra "R")...
Track 9, sector 18 has "CIRCLE"...
Track 11, sector 1 repeats the "ZERO DIRECTORIES" bit...
Track 11, sector 4 also repeats the "SET CONSTANTS FOR LOOP" bit...
Track 11, sector 7 has "ET CARD", "NOW LOAD READ DRIVER"...
Track 11, sector 9 repeats "CARD", "NOW LOAD READ DRIVER"...
Track 11, sector 11 has "NOW LOAD READ DRIVER"...
Track 11, sector 15 has some numbers: 769,0; 770,73; 771,169; 772,2; 773,72; 774, 44; 775,255; 776,207; 777,44; 778, 0; 779,198; 780, 169; 781,255; 782,141; 783, 255; 784, 203; 785,76; 786, 248; 787,198. Also, "INIT OMNIN".
Track 11, sector 17 repeats "HERE FOR NO ZERO DIRECTORIES"...
Track 12, sector 3 repeats "NOW LOAD READ DRIVER"....
Track 12, sector 4 repeats "HERE FOR NO ZERO DIRECTORIES"...
Track 12, sector 5 repeats "NOW LOAD READ DRIVER"...
Track 12, sector 6 repeats last numbers from track 11, sector 15: 783, 255; 784, 203; 785,76; 786, 248; 787,198. Also, "INIT OMNIN" is repeated.
Track 12, sector 13 & 14 repeats "NOW LOAD READ DRIVER"...
Track 12, sector 15 repeats "HERE FOR NO ZERO DIRECTORIES"...
Track 12, sector 16 repeats "NOW LOAD READ DRIVER"....
Track 12, sector 17 repeats last several numbers from track 11, sector 15:778, 0; 779,198; 780, 169; 781,255; 782,141; 783, 255; 784, 203; 785,76; 786, 248; 787,198. Also, "INIT OMNIN" is again repeated.
Track 13, sector 1 and sector 4 repeats "HERE FOR NO ZERO DIRECTORIES"...
Track 13, sector 11 and sector 13 has "IRKM DESMET DAEM.". Could this be inputted somewhere for a response?
Track 14, sector 5 and sector 14 repeats "HERE FOR NO ZERO DIRECTORIES"...
Track 14, sector 15 repeats "IRKM DESMET DAEM."...
Track 21, sector 5 and 6 has "TRAP!"...

I think some of the missing code for specials must be either on hidden files on the DUNGEON disk or else on the CHARACTER and/or BOOT disks.
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

The BOOT disk...
Track 4, sector 4 has "LP", "AD3", "NOTEPTRTP", "IM", "CAD3", "D3 NM"...
Track 4, sector 6 has "NUM", "ADR", "NOTEPTRLAB", "SCNT", "LA", "INC2", "ADD", "MLSR", "DRAW", "PIC", "WAIT", "WRITE", "PRINT", "JPL", "JMI", "JNE", "JEQ", "JCS", "JCC"...
Track 6, sector 7 has "MAFLARFISOSHTRZP", "FRFOMACOBASKWOHL", "MASTLERELEV"...this is the beginning of the input codes for the magic system it seems...
Track 6, sector 8 has "IWAST", "INWOFLREPOST", "GRREWROVSHSP", "INOGMALE", "FLANAPAR", "MIJAPHBLLOTRHYIM", "DISBTADUMIFIFEAR", "WIWOVANISESICURS", "CAEYWIWAINVI", "WIOGDIILMIBL", "WIDRMIWP", "WIGISOSI", "VOPLAIARSTLISCSI", "HOWAWISTMAGAAREN", "MYSHOGSTMIMISTFL", "SPTODRBRSTSI", "ANMAANSWSTTO", "PHDOYMCA", "RESTDEST", "SUDEREDE", "LE"...
Track 6, sector 9 has "SUDEBA", "SUPHDISP", "PRSUANDE", "SPBIDMST", "SPSPBEDE", "GRSU"...
Track 7, sector 0 has "CHAR- ACTER", "CHAR- ACTER"...
Track 8, sector 20 has "DUNGEON"...
Track 17, sector 0 has "53280,1" and "53281,0" and "'EA.PRG',8,1" and "49152". This turns the screen and border black and loads "EA.PRG" to machine language 49153 ($c000) and calls it with a SYS from BASIC.
Track 17, sector 8 has "EA4.PRGEA3.PRGEA2.PRG", which are the other 3 files listed on the boot disk and are being called to.
Track 18, sector 1 has "BARD'S TALE I" and "EA1.PRG", "EA2.PRG", "EA3.PRG", EA4.PRG"...
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

The CHARACTER disk...

Track 9, sector 11 has "NOW GET THE RESULTS, LENGTH FIRST", "OMNINET NOT INSTALLED", "768,169:769,0:770,72:771,169:772,2:773,"...what the HELL is Omninet??
Track 12, sector 12 has "THE BARD'S TALE:"...
Track 26, sector 2 & 3 has the "UTILITIES" menu...
Track 26, sector 12 & 13 has the disk copy utility...
Track 27, sector 6 has "CHARACTER"...
Track 27, sector 8 has "TARGET", "TARGET"...
Track 27, sector 16 has "(1)", "(2)", "(3)", "(4)", "(5)", "(6)", "(7)", "(RETURN)"
Track 27, sector 17 has "(1-6)", "#(1-8)", "#(1-8),G", "#(1-6)"...probably the trade screen...
User avatar
Darendor
Posts: 1503
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Post by Darendor »

I made an attempt to see where specials and data might be hidden.

I teleported to just outside of the 396 berserkers in the Castle are at and made a note of the disk drive position, which is track #12.

I slowed the emulator down to 10%, then kicked down the door. As soon as I entered, the drive ran of course as I had triggered the special.

I watched the drive indicator carefully and it made these movements:

start at track 12
18
26
18
26
18
17
18
17


(display picture)
The legions of Baron Harkyn stand before you, recognizing you as intruders. "Death to them" they scream.


Now, we know the game first scans the party for "Robes" to see whether the berserkers actually appear or not (you DID know this, right?), and then decides whether a fight ensues.

Since track 18 is the disk directory, I suspect the game looks there to see where to find the special information. Then it gets sent to track 26 to retrieve it, then has to get the picture from track #17.

What do you figure?
Post Reply