Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: The effect of Crystals  (Read 7143 times)

0 Members and 1 Guest are viewing this topic.

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
The effect of Crystals
« on: December 19, 2015, 12:46:12 PM »

Hi guys

Just noticed this as I am starting to piece together and test my layout for the final Tower of Book of Skulls.

I have always known that the Chaos Crystal 'summons' the baddie you allocted as #1 in the monster list (The Lord of Entropy in the original) by clearing a bit from it's X position value. This stops it from appearing immediately. (there is then a slight delay after the crystal is used usually too!)

However, i had noticed on one of my new levels a couple of data blocks had become corrupt. A space appeared as a standing fireball (!!) and a switch appeared as a unmoveable space....

It occured to me that (since the floor has the crystal sockets on it) that this might be the cause of the problem.

One of the locations affected is X09 Y01 .... the original map has this as a pillar, which until removed, prevents you from using the teleport pads to the final battle.


I'm going to guess that all 4 crystals activate 'something' ... but does anyone know what, and where this might be in the disassmbled game code?

All input welcomed as ever!  I will probably make some investigations myself using my editor too :)

Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: The effect of Crystals
« Reply #1 on: December 20, 2015, 04:33:33 PM »

With a little help of the old Alan Chapman maps.....

I have tested these, and they seem to work ok:

Moon Crustal
- remove    X03 Y 09 
- remove   X0F Y09

Dragon Crystal: 
- remove   X10 Y08

Serpent Crystal
- remove : X09 Y01

Chaos Crystals
- remove:    X09 Y03

I need to do some more invetigation into the 'summoning' of the 1st monster though (via the Chaos Crystal) as this seems to have limits on it....  (i.e. it wont work if the monster is not $6B)

« Last Edit: December 20, 2015, 04:35:13 PM by Hungry Horace »
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: The effect of Crystals
« Reply #2 on: December 20, 2015, 09:31:26 PM »

Getting some very odd results (slight differences in location values) on my own levels from the original game....  Definitely this needs investigation in the original game code.


How is this covered in the HTML version?
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: The effect of Crystals
« Reply #3 on: December 21, 2015, 10:43:21 AM »

How is this covered in the HTML version?

Hi Horace, in the HTML version we don't really use any of the logic from the original this is all done by trying to emulate the feel, the original data is only used for the map data/monsters/triggers.
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: The effect of Crystals
« Reply #4 on: December 21, 2015, 11:02:43 AM »

How is this covered in the HTML version?

Hi Horace, in the HTML version we don't really use any of the logic from the original this is all done by trying to emulate the feel, the original data is only used for the map data/monsters/triggers.

so if you reach the final level, you would not be able to complete it? I assume you dont have the logic in your code for these actions, or did you add them in as your own code?

One for your bug-list then if not ;)



I discovered why my new maps had differing effects. I couldnt work out why the dragon crystal was affecting a totally different location, and at first i thought it might be affecting 2 positions.... however, it seems not.

Code: [Select]
Dragon Crystal:
- remove   X10 Y08

this is correct, however, if the level is less than $10 locations wide (as mine is) then the effect will be 'rolled' onto the next row. I guess this is because it doesnt 'clip' the value to the upper-bound X value (i.e. the width) and it keeps moving through the data set until it gets to where it *thinks* it should be affecting. (which means the Y axis value will be increased, every time it goes over the width value.

I'm still really wanting to change the values on my game edit (rather than work around), so i will continue to hunt for where this rule is in the code!
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: The effect of Crystals
« Reply #5 on: December 21, 2015, 11:35:00 AM »

We just did our own code to check the crystals where placed in the slots :)
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
The effect of Crystals
« Reply #6 on: December 21, 2015, 09:15:33 PM »

Ok, well the good news is i found the code that is 'clearing' the spaces:

Code: [Select]
59E0 <<< MOVE 90001,D7  (SERPENT CRYSTAL REMOVED SPACE VALUES X09 Y01 )
59D6 - CHECK TOWER
59DE BRANCH IF NOT '5' (ZENDIK)
59E6  SUB ROUTINE  849C
59EA   DO THE CLEAR  ... ANDI ..  (0,A6  D0.W )
59F0  RTS

these are memory addresses (left hand side) and i've only loosely sketched down the instructions.

THis shows the addresses cleared are 'hard coded' (at least the serpent one is) rather than being a a nice clean data block.

The good news is a quick search of the binary in a hex editor reveals the other X/Y coords are also in there are Longwords like this, so i susepct that will be the code for the other crystals, i just havent time to test it yet.

More soon.... :D
« Last Edit: December 22, 2015, 06:11:18 AM by Hungry Horace »
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: The effect of Crystals
« Reply #7 on: December 22, 2015, 07:53:37 PM »

right, got the code nailed down.... just a small resource issue to address!

Code: [Select]

lbC0055E2
LSR.W #3,D1
ADDI.W #$60,D1
CMP.W ($2E,A5),D1
BNE.B lbC0055E0
CLR.L ($2C,A5)
MOVEM.L D0/A6,-(SP)
BSR.W lbC00599C
MOVEM.L (SP)+,D0/A6
MOVE.B (A6,D0.W),D1
LSR.W #2,D1
ANDI.W #14,D1
LEA (CrystalActions).L,A0
ADDA.W (lbW00561A,PC,D1.W),A0
JSR (A0)
MOVEQ #5,D0
BRA.W PlaySound?

lbW00561A dw 0
dw $24
dw $6A
dw $8A
dw $22
dw $E0
dw $22
dw $D8

CrystalActions MOVEQ #5,D4
MOVEQ #$12,D6
BSR.W lbC0056D8
CMPI.W #5,(CurrentTower).L
BNE.B Exit_CrystalAction
MOVE.L #$90001,D7 ;Serpent Crystal Remove Location
Last_CrystalAction BSR.W RemoveLocationData?
ANDI.W #$F8,(A6,D0.W)
Exit_CrystalAction RTS

BCLR #2,(A6,D0.W)
BSR.W lbC0080F4
BSR.W lbC007556
CMPI.W #5,(CurrentTower).L
BNE.B Exit_CrystalAction
LEA (UnpackedMonsters).L,A0
CMPI.B #$6B,(11,A0) ;Only If Entropy
BNE.B lbC00568C
TST.B (A0)
BPL.B lbC00568C
ANDI.B #$7F,(A0)
MOVE.L #$90008,D7    ;Chaos Crystal Remove Location 1
BSR.W RemoveLocationData?
BSET #7,(1,A6,D0.W)
lbC00568C MOVE.L #$90003,D7 ;Chaos Crystal Remove Location 2
BRA.B Last_CrystalAction

MOVEQ #7,D4
MOVEQ #$11,D6
BSR.B lbC0056D8
CMPI.W #5,(CurrentTower).L
BNE.B Exit_CrystalAction
MOVE.L #$100008,D7 ;Dragon Crystal Remove Location
BSR.B Last_CrystalAction
MOVE.L #lbW03FC64,D7   ;Dragon Crystal Remove Location (needs fixing for wrong label)
BRA.B Last_CrystalAction

MOVEQ #9,D4
MOVEQ #$13,D6
BSR.B lbC0056D8
CMPI.W #5,(CurrentTower).L
BNE.B Exit_CrystalAction
lbC0056C4 MOVE.L #lbB02FC65,D7   ;Moon Crystal Remove Location (needs fixing also)
BSR.W Last_CrystalAction
MOVE.L #$F0009,D7 ;Moon Crystal Remove Location
BRA.W Last_CrystalAction
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: The effect of Crystals
« Reply #8 on: December 28, 2015, 10:55:07 PM »

the above code has some bad labelling, as i've worked things out a bit better.

However, i can confirm the following actions happen on the crystal clicks, and i will re-post the source segment soon.

Moon Crustal
- remove    X03 Y 09          | disasm: ---- .... hex 56e6 (+50)
- remove   X0F Y09

Dragon Crystal: 
- remove   X10 Y08
- remove   X04 Y08

Serpent Crystal  | disasm: 5686 .... hex 565e
- remove : X09 Y01

Chaos Crystal
- remove:    X09 Y03
- Prep location for 'arrival' of big bad at X09 Y 08 .... this is *essential* for the 'summoning' of the bad guy to work.

I've added all of these to my Editor's 'datamap' for v439 .... and also added the function to edit them all using the Editor itself... they only work on the final tower however, as is evident from the code. I needed to do this to be able to make nice clean edits to Book Of Skulls!  (i've also added code to limit the function to a specifica floor of the tower)

The 'summoning' of the monster is limited to only working for baddied $6B (Lord of Entropy) but this limitation is easily removed.

Hope this helps (especially the HTML version!)

:D
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022