+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Tactics Ogre (LUCT) (SNES): Need help interpreting stat locations (ASM dump)
Pages: [1]
Author Topic: Tactics Ogre (LUCT) (SNES): Need help interpreting stat locations (ASM dump)  (Read 1 times)
Edea
Guest
« on: March 01, 2011, 08:47:45 pm »

This data was recovered from a point in the game where the Exorcist-class unit Presance leveled from 17 to 18.  His Level 17 stats (HP/MP/Str/Int/Agi/Dex/Vit/Men) were 191/148/104/157/100/115/117/121, while his level 18 stats were 197/154/106/166/103/119/122/128.  In hex, these are c5/9a/6a/a6/67/77/7A/80 (these values crop up in the spoiler block below).  Version of the game was 1.2, English patch applied (Aeon Genesis team).

Spoiler: (View)
http://pastebin.com/meAqTfsj  (I hope this stays up, the data block was too big for one post).

What I'm trying to discover is the location of the character class data in the ROM, and I think that this dump could be used to that effect.  However, I am unfamiliar with ASM or opcodes, so I was wondering if someone else who happens to be familiar with the game (or not, really don't care at this point) would mind taking a little look at it and leaving some tips or comments.  Any help you guys could provide will be greatly appreciated.


March 01, 2011, 09:34:47 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
*Sigh* Well, it seems like everybody's growth parameters are, sadly, in arrays separated by stat instead of class (ugh, thanks to Deathlike for the tip).  I'll post some of the ROM locations later, apologies for the double post (please don't hesitate to contribute whatever you wish to the thread, still need a LOT of help).
« Last Edit: March 01, 2011, 09:34:47 pm by Edea »
FinS
Guest
« Reply #1 on: March 01, 2011, 11:13:52 pm »

Before you find the locations in the rom it would help you immensely to map out some of the locations in ram. Then when you figure that out you have a focal point to see where the data is going. I'm not looking at the rom but I can give you a couple tips from your output.

Here is the hp array : $184E, the x after it means it's indexed, x is 2 there so Presance must be your 2nd character.
6 is added to the number stored there and it comes from $88:B0C5 which could be a rom location. You need to download "Lunar Address" and plug that number into it then select your rom type and whether it has a header and it will give you the correct address. You may find it does not match so then it would probably be a ram address minus the bank number.

The next one, $9a for magic points, comes from a ram index at $189E which is added to the previous hit point bonus of 6 which is added to a random number from 0 to 2.

I'll let you figure out the rest or maybe someone else who has the rom in front of them can help. Once you get the ram addresses you can set breakpoints on them and you will see what is loaded into them.
Deathlike2
Guest
« Reply #2 on: March 02, 2011, 12:59:32 am »

I believe there's a guide on Gamefaqs that can be a reference to finding the data... I'm sure it still applies to this version anyways.
http://www.gamefaqs.com/snes/588770-tactics-ogre/faqs/32399
creeperton
Guest
« Reply #3 on: March 03, 2011, 05:47:34 pm »

You can host spreadsheets and stuff like that here.
Edea
Guest
« Reply #4 on: April 17, 2011, 01:04:01 pm »

OK, so it's been awhile, I found -quite a bit- of stuff regarding character data (if anyone needs it just let me know).   But I've come across a stumbling block and I need help getting over it.

Some of the character classes have special little 'extras' attached to them.  For any who've played the game before, these include things like the Terror Knight's Fear effect, the Beast Tamer's Beast Support, and the Gunner's Gunnery, to name a few.  I think the full list is as follows:

Fear (Terror Knight, Tiamat, a fair number of creatures in Hell Gate, any equipment from the Grim set)
Beast Support (Beast Tamer, Beast Master, an Aileron feater)
Dragon Support (Dragon Tamer, a Dragos stone)
Golem Support (Warlock, a WordRock item)
Anti-Dragon (Dragoon, numerous pieces of equipment)
Gunnery (Gunner)
Acrobatics (Ninja, Dark Stalker)
Undeath (Ghost, Skeleton, Zombie, Death creatures)

This looks like it might follow a '01 02 04 08 10 20 40 80' pattern, taking up one byte per character class which should be located in a table/array somewhere in the ROM.  Or, maybe there's some ASM routines that could easily be traced if it was something that was only 'active' during a battle.  Shouldn't be that bad...

Man, I cannot find this crap -anywhere-.  First thing I do is try to look for a table/array in the ROM.  The problem here is, I really don't know how the data is formatted (is it, in fact, the aforementioned pattern, or a sequence of values that I have no information on, etc.), so I've tried a bunch of different searches w/a hex editor.  Nada. 

Then I try looking for this info in the RAM during a battle sequence.  What happened was that I eventually changed the current in-battle class ($7e17af) -without- changing anything else, and got the special quality to appear (in case Acrobatics).  Nothing else was changed (including the movement type, it was odd seeing a character with the 'Slow' movement type suddenly leaping down 4 squares), did a full RAM comparison and didn't get any hits, which tells me that these qualities are, in fact, not part of a battle subroutine and should probably be in an array somewhere in the ROM (which...I didn't find, as stated before), or maybe a branch instruction if the accumulator/x/y/whatever currently equals the correct class ID, -I DUNNO-.

I really need some advice for locating this data, if not outright helping me find it.  Anyone who can assist, I'd greatly appreciate it.  If you need clarification, post the question here and I'll try my best to answer it.

« Last Edit: April 17, 2011, 02:42:46 pm by Edea »
creeperton
Guest
« Reply #5 on: April 18, 2011, 10:47:49 am »

I'm interested in whatever you have.
Edea
Guest
« Reply #6 on: April 18, 2011, 04:37:08 pm »

I should probably just upload the .tbl file I've been using to keep track, but I dunno if hex editors other than GoldFinger (the one I'm using atm) can read it.

These are ROM offsets for the starting points of each section (all in hex), pretty sure it's headerless (latest ROM revision, has Lakmir's translation patch applied to it):

42703 - Character Sprite pointers
429e3 - Character Name pointers
42ad2 - Job IDs
42bc2 - Starting Elements
42cb0 - Starting Alignments
42dbf - Number of Magic Slots
42ead - Starting Level
42f9b - Starting HP
430bb - HP Growth
4314b - Starting MP
4326b - MP Growth
432fb - Starting Strength
4338b - Strength Growth
4341b - Starting Vitality
434ab - Vitality Growth
4353b - Starting Intelligence
435cb - Intelligence Growth
4365b - Starting Mentality
436eb - Mentality Growth
4377b - Starting Agility
4380b - Agility Growth
4389b - Starting Dexterity
4392b - Dexterity Growth
43a4c - Class Weight Penalties
43add - Physical Resistance
43b6e - Air Resistance
43bff - Fire Resistance
43c90 - Earth Resistance
43d21 - Water Resistance
43db2 - Virtue Resistance
43e43 - Bane Resistance
43ef4 - Attack+ Capability
440b1 - Species Table
441a1 - Basic Indirect Attack Type
442b0 - Magic Set that can be equipped
443a0 - Class Special Attacks (Slot 1)
4448f - Class Special Attacks (Slot 2)
4457e - Class Special Attacks (Slot 3)
4466d - Class Special Attacks (Slot 4)
4475b - Movement Types
44849 - Movement Rates
44937 - Starting Loyalties
44a26 - Weather Tolerance
451da - Item Types
452ca - Item Elements
453ba - Weapon Handedness
454aa - Item Equip Slot Locations (Finger, Head, etc.)
45655 - Item Weights
4572e - Item Strength Modifiers (Atk. Power)
4580e - Item Intelligence Modifiers
458ee - Item Agility Modifiers
459ce - Item Dexterity Modifiers
45aae - Item Vitality Modifiers
45b8e - Item Mentality Modifiers
45c6e - Item Luck Modifiers
45d4e - Item Physical Resistance (Def. Power) (signed)
45e2e - Item Air Resistance (signed)
45f0e - Item Fire Resistance (signed)
45fee - Item Earth Resistance (signed)
460ce - Item Water Resistance (signed)
461ae - Item Virtue Resistance (signed)
4628e - Item Bane Resistance (signed)
4646f - Item Prices (multiplied by 10 in-game)
46612 - Item Strength Raise at Level Up
466e4 - Item Intelligence Raise at Level Up
467b4 - Item Agility Raise at Level Up
46884 - Item Dexterity Raise at Level Up
46956 - Item Vitality Raise at Level Up
46a26 - Item Mentality Raise at Level Up
46af6 - Item Luck Raise at Level Up
46bc6 - Item Special Effects (Stuns on hit, Anti-Dragon, etc.)
46cb6 - Item Special Skills (used in the Item menu)
46d86 - Item Status Guards (immunity to petrification, etc.)
46e76 - Item Passive Effects (wearer can fly, HP regen, etc.)
47047 - Spell MP cost/Targeting Information
47172 - Spell Elements
47208 - Spell Ranges
4732f - Spell Prices (multiplied by 10 in-game)
47431 - Spell Set Modifiers
ea0dc - Class Grids (determines what you can change into)
ebba7 - Denim's Base Class
ebca1 - Denim's Initial Equipment (Slot 1)
ebcac - Denim's Initial Equipment (Slot 2)
ebcb7 - Denim's Initial Equipment (Slot 3)
ebcc2 - Denim's Initial Equipment (Slot 4)
ebc94 - Denim's Initial Spells (doesn't insert into Magic menu, need to use a JMP routine to get anything out of it)
ed61e - Item Shop pointers/data
ed6d9 - Magic Shop pointers/data

That's it so far, I dunno where the Item Sprite pointers/palettes are, and I don't know where those god damn character passives are (the Fear/Beast Support stuff).  Anyone out there think of anything?

FinS
Guest
« Reply #7 on: April 18, 2011, 04:48:55 pm »

Some of these codes may be helpful to you.
http://ogre.org/ogrebattle/TO-SFCcode.html

Edea
Guest
« Reply #8 on: April 18, 2011, 06:10:58 pm »

Oooh, thanks for the link.  So that's where the Chaos Frames are in the RAM.


Sadly no data regarding character passives >_<
Edea
Guest
« Reply #9 on: May 07, 2011, 08:18:48 pm »

Found a new data area:

$f3195: Job Stat Requirements (what's needed to change into that job stat-wise, might also cover alignment but I couldn't tell from a glance).

Still watching this thread if anyone's willing to help, tried tracing before and during a move action while a Ninja and still couldn't find the location of the data responsible for giving them the 'Acrobatic' attribute.
Aerdan
Guest
« Reply #10 on: May 07, 2011, 08:39:02 pm »

I and everyone else here at RHDN would appreciate it muchly if you posted this information on the Data Crystal.
Edea
Guest
« Reply #11 on: May 07, 2011, 09:55:28 pm »

Done 'n done XD

OK, next thing I need help with:


This is the routine for when a Ninja executes a Move action on the map:
------------------------------------------------------------------------------------------------------------
$86/A1AE C9 07       CMP #$07                A:0007 X:0087 Y:0001 P:envMxdizC
$86/A1B0 F0 04       BEQ $04    [$A1B6]      A:0007 X:0087 Y:0001 P:envMxdiZC
$86/A1B6 68          PLA                     A:0007 X:0087 Y:0001 P:envMxdiZC
$86/A1B7 3A          DEC A                   A:001E X:0087 Y:0001 P:envMxdizC
$86/A1B8 D9 B4 A2    CMP $A2B4,y[$86:A2B5]   A:001D X:0087 Y:0001 P:envMxdizC
$86/A1BB B0 16       BCS $16    [$A1D3]      A:001D X:0087 Y:0001 P:eNvMxdizc
$86/A1BD 1A          INC A                   A:001D X:0087 Y:0001 P:eNvMxdizc
$86/A1BE 1A          INC A                   A:001E X:0087 Y:0001 P:envMxdizc
$86/A1BF D9 C8 A2    CMP $A2C8,y[$86:A2C9]   A:001F X:0087 Y:0001 P:envMxdizc
$86/A1C2 90 0F       BCC $0F    [$A1D3]      A:001F X:0087 Y:0001 P:envMxdizC
$86/A1C4 80 0B       BRA $0B    [$A1D1]      A:001F X:0087 Y:0001 P:envMxdizC
$86/A1D1 18          CLC                     A:001F X:0087 Y:0001 P:envMxdizC
$86/A1D2 60          RTS                     A:001F X:0087 Y:0001 P:envMxdizc


Here's on for a Terror Knight (really it can be any class other than Ninja):
------------------------------------------------------------------------------------------------------------
$86/A1AE C9 07       CMP #$07                A:0004 X:0087 Y:0001 P:envMxdizC
$86/A1B0 F0 04       BEQ $04    [$A1B6]      A:0004 X:0087 Y:0001 P:eNvMxdizc
$86/A1B2 C9 61       CMP #$61                A:0004 X:0087 Y:0001 P:eNvMxdizc
$86/A1B4 D0 10       BNE $10    [$A1C6]      A:0004 X:0087 Y:0001 P:eNvMxdizc
$86/A1C6 68          PLA                     A:0004 X:0087 Y:0001 P:eNvMxdizc
$86/A1C7 D9 B4 A2    CMP $A2B4,y[$86:A2B5]   A:001E X:0087 Y:0001 P:envMxdizc
$86/A1CA B0 07       BCS $07    [$A1D3]      A:001E X:0087 Y:0001 P:eNvMxdizc
$86/A1CC D9 C8 A2    CMP $A2C8,y[$86:A2C9]   A:001E X:0087 Y:0001 P:eNvMxdizc
$86/A1CF 90 02       BCC $02    [$A1D3]      A:001E X:0087 Y:0001 P:envMxdiZC
$86/A1D1 18          CLC                     A:001E X:0087 Y:0001 P:envMxdiZC
$86/A1D2 60          RTS                     A:001E X:0087 Y:0001 P:envMxdiZc


So apparently, a Ninja's Acrobatic ability is the result of a branch instruction in the ROM that targets its class ID ($07) with a CMP command.  If they match, the program hops on over to $86/A1B6, -decrements the accumulator-, then compares that to the friggin' table.  The difference between the accumulator and the indexed table value becomes the unit's ability to ascend or descend tiles (so the lower the accumulator, the more tiles are cleared).  It should be noted that the second potential branch instruction (for $61) is Vice's version of the Ninja class -_-.

Welp...to expand this to other classes, I'm kinda lost.  The $86/8000-ffff memory bank has no free space to speak of, and I've never expanded a ROM before.  Can someone help me relocate this routine so I can write additional code for other classes (as if I actually could)?
« Last Edit: May 08, 2011, 06:58:04 pm by Edea »
Edea
Guest
« Reply #12 on: May 27, 2011, 07:20:26 pm »

Found something new recently: the Summon-E command (which was originally thought to not work unless the unit was AI-controlled) is actually dependent on the current battlemap.  The user of the technique is irrelevant, if -anyone- uses Summon-E in Heigm's interior, you'll get an Angel Knight that is on the enemy's side.  It also doesn't matter if it's a story battle or a random one; even in Training mode, if you use Summon-E on Gruborza Plains, you'll get Ghosts and Skeletons, while if you use it at Fort Bodo (no Summoners ever go there in the original storyline) it'll glitch.

Still trying to figure out how to manipulate this (I did at least find where the game stores 'enemy battle party sizes', it's at $059f0f).  Man, I wish this had the same following FFT does ;_;
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC