Ultimate Amiga

Please login or register.

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

Author Topic: Champion Data (BW)  (Read 9350 times)

0 Members and 1 Guest are viewing this topic.

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Champion Data (BW)
« on: May 21, 2014, 10:03:11 PM »

I posted it in the hacking thread before I'll try dig it out as to what byte is what

There is basically

Attack timer
Spell cast cool down
Gain level
XP till next level
Owed spells
Current Worn spell

There is a lot of data for monsters not stored in the block of code we know about as I've tried taking a line of the data and freezing the values yet the monster will still die so their strength/hit point must be stored in another block of data
« Last Edit: May 21, 2014, 10:05:32 PM by Hungry Horace »
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: Re: Hacking: What next??!
« Reply #1 on: May 21, 2014, 10:03:24 PM »

Code: [Select]
01 23 11 0D 0D 23 23 1F 1F 06 09 05 80 00 00 00
C7 FF 00 00 00 00 07 09 02 00 03 00 00 00 00 00

This is Blodwyn's starting data, unedited from the champions.stats file.

immediately after starting the game (as blodwyn) the data becomes this:

Code: [Select]
01 23 11 0D 0D 23 23 1F 1F 06 06 05 80 00 00 00
C7 00 00 FF 00 00 07 09 02 E0 03 00 0B FF 00 00

Byte 00 = Character Level
Byte 01 = Strength
Byte 02 = Agility
Byte 03 = Intelligence

Byte 04 = Charisma
Byte 05 = Current HP
Byte 06 = Max HP
Byte 07 = Current Vitality

Byte 08 = Max Vitality
Byte 09 = Current Spell Points
Byte 0A = Max Spell Points
Byte 0B = Armour Level

Byte 0C = Spells Page 1 (one bit per spell)
Byte 0D = Spells Page 2
Byte 0E = Spells Page 3
Byte 0F = Spells Page 4

Byte 10 = Food Level (max C7)
Byte 11 =
Byte 12 =
Byte 13 =

Byte 14 =
Byte 15 =
Byte 16 = X position
Byte 17 = Y Position

Byte 18 = bits 4-5 (left) Floor position  |  bits 0-1 (right) direction faced
Byte 19 = Character Speed
Byte 1A = Floor
Byte 1B =

Byte 1C =
Byte 1D =
Byte 1E =
Byte 1F =
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: Champion Data (BW)
« Reply #2 on: May 21, 2014, 10:10:15 PM »

I'll try fill this in tomorrow I think there is 3 or 4 bytes left to work out
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: Champion Data (BW)
« Reply #3 on: May 21, 2014, 10:33:46 PM »

I was doing a bit of an update based on your link, whilst also testing stuff out....  Then my laptop over heated!! Grrr.....

A couple of things need changing (you have your spell used /spell timer muddled) and I was trying to work out the exact parameters for levelling up (high values other than FF / -1 do work) and also if there was something similar for a "half level" when wizards gain an extra spell

I guess I will look again tomorrow and see if it makes more sense of the code for me!!!
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: Champion Data (BW)
« Reply #4 on: May 22, 2014, 07:14:49 PM »

Byte 00 = Character Level
Byte 01 = Strength
Byte 02 = Agility
Byte 03 = Intelligence

Byte 04 = Charisma
Byte 05 = Current HP
Byte 06 = Max HP
Byte 07 = Current Vitality

Byte 08 = Max Vitality
Byte 09 = Current Spell Points
Byte 0A = Max Spell Points
Byte 0B = Armour Level

Byte 0C = Spells Page 1 (one bit per spell)
Byte 0D = Spells Page 2
Byte 0E = Spells Page 3
Byte 0F = Spells Page 4

Byte 10 = Food Level (max C7)
Byte 11 = Current Worn Spell (08 = Amour etc..)
Byte 12 = Current Worn Hand Amour

Byte 13 = Related to spell (Unsure how)
Byte 14 = Related to spell cost (Unsure how)
Byte 15 = Spell Cool Down Timer

Byte 16 = X position
Byte 17 = Y Position
Byte 18 = bits 4-5 (left) Floor position  |  bits 0-1 (right) direction faced

Byte 19 = Character speed
Byte 1A = Floor
Byte 1B = Attack cool down (counts down from 07 to 00, also used for attack sequence)

Byte 1C = Levelling Value (change to FF to level, 11 = level 1, 24 = level 2)
Byte 1D = XP to next level (Starts at 255 and then as you hit monsters this is reduced down to 00 and Byte 1C is changed to FF)
Byte 1E = Amount of spells to buy from the fairy
Byte 1F = ?
« Last Edit: May 22, 2014, 07:19:43 PM by MadMunky »
Logged

MadMunky

  • Forum Mod
  • A600
  • *****
  • Karma: 2
  • Offline Offline
  • Gender: Male
  • Posts: 244
Re: Champion Data (BW)
« Reply #5 on: June 05, 2014, 07:40:56 AM »

Horace,

Do you know why the players stats change from what is programming (in the clean data files) to what is configured as soon as the player has started the game.

i.e. the below is champion stats before game start then after is as soon as the game starts. values like the spell points get changed on start.

Code: [Select]
01 23 11 0d 0d 23 23 1f 1f 06 09 05 80 00 00 00
c7 ff 00 00 00 00 07 09 02 00 03 00 00 00 00 00
01 13 17 26 0e 12 12 1a 1a 2b 2d 00 48 00 00 00
c7 ff 00 00 00 00 01 0e 01 00 03 00 00 00 00 00
01 18 13 13 23 18 18 18 18 0d 0d 01 04 00 00 00
c7 ff 00 00 00 00 12 19 00 00 03 00 00 00 00 00
01 10 20 0e 12 18 18 13 13 10 10 00 00 08 00 00
c7 ff 00 00 00 00 05 14 02 00 03 00 00 00 00 00
01 22 15 0f 0f 25 25 1a 1a 06 08 03 08 00 00 00
c7 ff 00 00 00 00 07 19 00 00 03 00 00 00 00 00
01 13 16 23 14 10 10 17 17 2b 31 00 04 80 00 00
c7 ff 00 00 00 00 08 0f 02 00 03 00 00 00 00 00
01 18 14 12 27 19 19 19 19 0d 0e 01 10 00 00 00
c7 ff 00 00 00 00 05 1b 01 00 03 00 00 00 00 00
01 10 1f 13 12 17 17 16 16 10 10 00 00 20 00 00
c7 ff 00 00 00 00 00 17 01 00 03 00 00 00 00 00
01 21 1a 0e 0d 20 20 1c 1c 06 07 02 00 80 00 00
c7 ff 00 00 00 00 00 13 01 00 03 00 00 00 00 00
01 10 18 24 11 11 11 19 19 00 00 00 10 08 00 00
c7 ff 00 00 00 00 08 1d 03 00 03 00 00 00 00 00
01 17 12 15 24 18 18 17 17 0d 0d 03 80 00 00 00
c7 ff 00 00 00 00 09 12 02 00 03 00 00 00 00 00
01 0d 20 14 0b 14 14 12 12 10 10 04 40 00 00 00
c7 ff 00 00 00 00 0d 1a 00 00 03 00 00 00 00 00
01 24 17 10 0b 23 23 1c 1c 03 06 02 10 00 00 00
c7 ff 00 00 00 00 10 1c 02 00 03 00 00 00 00 00
01 12 17 1f 13 11 11 19 19 2b 2b 00 80 20 00 00
c7 ff 00 00 00 00 00 1d 01 00 03 00 00 00 00 00
01 19 14 17 23 1a 1a 1b 1b 0d 0d 01 08 00 00 00
c7 ff 00 00 00 00 0b 0a 03 00 03 00 00 00 00 00
01 12 24 10 0f 16 16 19 19 10 10 01 00 80 00 00
c7 ff 00 00 00 00 03 12 01 00 03 00 00 00 00 00

Code: [Select]
01 23 11 0d 0d 23 23 1f 1f 06 06 05 80 00 00 00
c6 00 00 ff 00 00 ff ff 00 e0 03 00 0b ff 00 00
01 13 17 26 0e 12 12 1a 1a 17 17 00 48 00 00 00
c7 00 00 ff 00 00 02 0e 22 e5 03 00 0b ff 00 00
01 18 13 13 23 18 18 18 18 09 09 01 04 00 00 00
c7 00 00 ff 00 00 12 19 12 e5 03 00 0b ff 00 00
01 10 20 0e 12 18 18 13 13 07 07 00 00 08 00 00
c6 00 00 ff 00 00 ff 14 02 d0 03 00 0b ff 00 00
01 22 15 0f 0f 25 25 1a 1a 07 07 03 08 00 00 00
c7 00 00 ff 00 00 07 17 01 e5 03 00 0b ff 00 00
01 13 16 23 14 10 10 17 17 15 15 00 04 80 00 00
c6 00 00 ff 00 00 ff 0f 02 e5 03 00 0b ff 00 00
01 18 14 12 27 19 19 19 19 09 09 01 10 00 00 00
c7 00 00 ff 00 00 07 1b 11 e5 03 00 0b ff 00 00
01 10 1f 13 12 17 17 16 16 09 09 00 00 20 00 00
c7 00 00 ff 00 00 02 17 11 e5 03 00 0b ff 00 00
01 21 1a 0e 0d 20 20 1c 1c 07 07 02 00 80 00 00
c7 00 00 ff 00 00 01 13 11 e5 03 00 0b ff 00 00
01 10 18 24 11 11 11 19 19 16 16 00 10 08 00 00
c7 00 00 ff 00 00 08 1c 11 e5 03 00 0b ff 00 00
01 17 12 15 24 18 18 17 17 0a 0a 03 80 00 00 00
c7 00 00 ff 00 00 09 14 32 e5 03 00 0b ff 00 00
01 0d 20 14 0b 14 14 12 12 0a 0a 04 40 00 00 00
c7 00 00 ff 00 00 0d 17 30 d0 03 00 0b ff 00 00
01 24 17 10 0b 23 23 1c 1c 08 08 02 10 00 00 00
c7 00 00 ff 00 00 10 1d 21 e5 03 00 0b ff 00 00
01 12 17 1f 13 11 11 19 19 13 13 00 80 20 00 00
c7 00 00 ff 00 00 02 1d 11 e5 03 00 0b ff 00 00
01 19 14 17 23 1a 1a 1b 1b 0b 0b 01 08 00 00 00
c6 00 00 ff 00 00 ff 0a 03 e5 03 00 0b ff 00 00
01 12 24 10 0f 16 16 19 19 08 08 01 00 80 00 00
c7 00 00 ff 00 00 04 12 22 d0 03 00 0b ff
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: Champion Data (BW)
« Reply #6 on: June 05, 2014, 01:57:15 PM »

no idea why theyre are random numbers in the spell points, but basically the code says at the start of the game "your maximum number of spell points is XX, so set the current number of spell points to XX also"

As a result the other spell point data value is redundant.
 
For the others, I gues $FF (being "TRUE" is just a placeholder (since they are all the same) and they are set up exactly as you've described above?  I will have a look at the code to see if anything makes sense of that, but I couldn't see anything special there tbh.
 
« Last Edit: June 05, 2014, 10:17:19 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: Champion Data (BW)
« Reply #7 on: March 14, 2016, 12:25:47 PM »

Byte 00 = Character Level
Byte 01 = Strength
Byte 02 = Agility
Byte 03 = Intelligence

Byte 04 = Charisma
Byte 05 = Current HP
Byte 06 = Max HP
Byte 07 = Current Vitality

Byte 08 = Max Vitality
Byte 09 = Current Spell Points
Byte 0A = Max Spell Points
Byte 0B = Armour Level

Byte 0C = Spells Page 1 (one bit per spell)
Byte 0D = Spells Page 2
Byte 0E = Spells Page 3
Byte 0F = Spells Page 4

Byte 10 = Food Level (max C7)
Byte 11 = Current Worn Spell (08 = Amour etc..)
Byte 12 = Current Worn Hand Amour

Byte 13 = Related to spell (Unsure how)
Byte 14 = Related to spell cost (Unsure how)
Byte 15 = Spell Cool Down Timer

Byte 16 = X position
Byte 17 = Y Position
Byte 18 = bits 4-5 (left) Floor position  |  bits 0-1 (right) direction faced

Byte 19 = Character speed
Byte 1A = Floor
Byte 1B = Attack cool down (counts down from 07 to 00, also used for attack sequence)

Byte 1C = Levelling Value (change to FF to level, 11 = level 1, 24 = level 2)
Byte 1D = XP to next level (Starts at 255 and then as you hit monsters this is reduced down to 00 and Byte 1C is changed to FF)
Byte 1E = Amount of spells to buy from the fairy
Byte 1F = ?


Given Bit's recent comments, i guess the big question is.... has anyone   done this for the Extended Levels data block?? :D
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Bit

  • A600
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 69
Re: Champion Data (BW)
« Reply #8 on: March 14, 2016, 01:43:58 PM »

Player-datas look same, just not the NPC.
But the meaning of those has to checked again!
NPCs got extra bytes at index 0, 6, 7, 12.
In other areas there's another offset of 48.
There are also more NPC-tables.

What really hurts is the fact that it's hard to build classes in C++, because at some points the pointers come together and then separated again by an incoming index, in player, npc or extended npc.
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: Champion Data (BW)
« Reply #9 on: March 14, 2016, 02:11:31 PM »

player data definately has extra, as some bytes become words, and there are things like "monster form" even in the Bext data...
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Bit

  • A600
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 69
Re: Champion Data (BW)
« Reply #10 on: March 15, 2016, 02:12:11 AM »

Oh well, that's a term misunderstanding.
To me 'player' is the party definition (with 98 bytes). All others, including heroes, champions or however you call them is 'npc' to me.
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: Champion Data (BW)
« Reply #11 on: March 15, 2016, 07:47:22 PM »

Oh well, that's a term misunderstanding.
To me 'player' is the party definition (with 98 bytes). All others, including heroes, champions or however you call them is 'npc' to me.


oh ok... you were talking about "current X/Y position" "item picked up" (not pockets)  etc

In the amiga resource, this is relabelled as 'Player1_Data" so i see the confusion, my apologies!

We have several relevant memory points in this respect:

Shared Data / Player1_Data / Player2_Data


@ BW439 Data Positions

$EE2A = Shared Data
$EE7C = Player 1 Data   (your 98 bytes)
$EEDE = Player 2 Data    (your 98 bytes - again!)


PocketContents  (16 champions * $10 bytes)

CharacterStats  (16 champions * $20 bytes)

 ... definition information updated: http://www.ultimateamiga.co.uk/index.php/topic,8908.msg39962.html#msg39962

Monster Blocks (Packed)

... definition information here: http://www.ultimateamiga.co.uk/index.php/topic,8908.msg39960.html#msg39960

NPC / Monster Blocks (unpacked)


Do you have any of these defined anywhere?  (e.g. Player data, npc datas etc)


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

Bit

  • A600
  • *
  • Karma: 5
  • Offline Offline
  • Posts: 69
Re: Champion Data (BW)
« Reply #12 on: March 22, 2016, 08:29:21 AM »

Back again!
After having done that complete reordering of the routines (so that I would need no header - in a C-program, that means, each called routines has to be defined above - which worked well, except for the two 'circles', think I wrote about it before), it is now much easier to track the behaviour of the adressregister. First I solved all stack things, then A3 felt, and now I'm in the middle to solve A5. Because that's not the first time, I know what is to be expected, but this time I do it pretty straight, non-automated, consequent and care for especially for const correctness. Having found a method to make that runnable and debugable after each editing step, the whole thing slowly gets a form.
An assembler command like:
move.b $21(A5), D0
first 'morphs' to a statement like:
DREG0.b0 = AREG5.bpeek(21);
and a short while later, when it is confirmed that it's about a party here, a pointer takes over, jumps as argument into the routine header and it looks like this:
DREG0.b0 = P->bpeek(21);

As you can imagine, all appearances of indices that are related to the party can be found much easier now. In addition, as soon as I'm through with this one, C++-typical microfunctions will replace those anonymous accesses. i.e.:
P->swlpeek(10)
will 'morph' to
P->getgfxy()

Because of C++'s protection mechanism, it will not be possible to access this word in any other way than in well-defined ones.
That way, we will reveal each one of them. I know, there aren't much indirect indices, and if so, it's mostly because of the necessary things like looping through the four party members etc.
Even those things will get their 'microcode' to enhance readability.

So the answer is: Not done yet, but is the next that will happen, and when it happens, then in one rush for all the 98 bytes.
Continuing with AREG4 and the NPC then.
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022