• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
August 08, 2020, 04:32:25 am

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed. Find out how you can help in the Recruitment section.


LuCT Hacking (PSX)

Started by formerdeathcorps, December 29, 2011, 12:48:32 am

formerdeathcorps

I am simply starting this, but I'm going to post my work.


So far:

PRG.EXE is the ASM file that contains the battle and world routines.
PRG RAM = PRG ROM + 0xF900

SLUS_005.60 is the ASM file that contains the routines only loaded when the game is turned on (up until the New GAme/Continue/Tutorial menu).  As far as I can tell, it is not loaded during the actual game.
SLUS RAM = SLUS ROM + 0x157000

UBF.BIN is the file that contains almost no ASM (I haven't looked too carefully, the LEDecoder decompiled file is 125 MB and takes minutes to open).  I suspect it contains all the storyline events, names, sprites, maps, and possibly sounds as well.  This file is 16 MB, so I doubt all of it is loaded into the RAM; instead probably only the relevant sections are loaded.

UBF2.BIN is the file that contains ASM with variable RAM to ROM translation.  I suspect it contains all the event triggers that tells the game to load only a subset of the events for the different story routes.  The file is 1.4 MB, but I suspect only parts of it are loaded into RAM.

From what I've seen so far of the RAM, it seems like nothing changes much, and most of the RAM consists of tables.  The same RAM data exists between across between the World Map, Formation Screen, and Battle.  I suspect this is to track everything that happened in the storyline (which is more complicated than FFT).  By comparison, in FFT, almost all of the RAM is reloaded between the World Map and Battle Screens (meaning FFT has more data to load when it comes to battle mechanics).


What I Need:

Gameshark Codes (This should help me figure out RAM addresses to track)
Debuggers (You must be proficient in using a PSX debugger.  Hopefully, you have played LuCT before as well.
Hexers (You must be patient.  Scan the UBF.BIN file for patterns and correspondences to game data.  Let's make an event editor by the time we're done.)


Attached Files:
Decompiled by LEDecoder (Thanks, Glain!)

Key.txt (This Post)
UBF2.txt (Decompiled version of UBF2.BIN)
SLUS.txt (Decompiled version of SLUS_005.60)
PRG.txt (Decompiled version of PRG.EXE)
UBF.BIN (Too large to decompile, most of the contents are gibberish, but I suspect TO's meat lie in here; hence why I need hexers and time to unravel this)
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

Pickle Girl Fanboy

December 30, 2011, 01:23:26 pm #1 Last Edit: December 31, 2011, 01:58:15 pm by Pickle Girl Fanboy
Here's some ideas gleaned from data diving in Ogre Battle - The March Of The Black Queen and Tactics Ogre - The Knight Of Lodis.
In OB-MOTBQ, class data is stored by stat, in class order.  So, it looks like this:

Strength Gain On Level Up
02 Fighter
03 Knight
03 Paladin
03 Wild Man
03 Evil One
03 Ninja
03 Ninja Master
And so on...

Since LUCT was coded right after MOTBQ, then it probably is coded similarly.  You should first find or compile accurate data on something, and then search for it in a hex editor.

Before you do anything else, go to RHDN and GameFAQs, and see if anyone dumped any of the game data themselves.  Also, download all PAR code, Gameshark, Game Genie, and Save State hacking guides.  These are very useful resources.

Q: How do I find or compile accurate data on, say, stat gains on level up for each class?
A: In OBMOTBQ, stat games are pseudo randomly chosen, starting with the minimum stat gains, which are then given a pseudo random bonus of +1 or +2.  So, all you have to do is make a save state where you are about to level up, and then level up a few dozen times until you find the minimum stat gain.  That minimum stat gain is what should be listed in the class data.

Q: What now?
A: Find what order the classes are in, in the game data.  This should be in any of the PAR, Gameshark, Game Genie, or Save State hacking guides.  Look for any code which lets you change a characters current class.  Such a code should come with a list of digits for this code, which will be the order in which classes are stored in the game.

Q: Okay, found it, what next?
A: Now we make some educated guesses.  I'll assume that class data is stored by stat, in class order.  So, if we have the following information (NOT THE REAL INFO, JUST HYPOTHETICAL!):

Class order:
00 = Knight
01 = Paladin
02 = Archer
03 = Marksmen (I never played LUCT, so I don't know class names or stat names)

Knight, Minimum stat gains:
Str+3
Agi+2
Int+1

Paladin, Minimum stat gains:
Str+4
Agi+2
Int+2

Archer, minimum stat gains:
Str+2
Agi+3
Int+1

Marksmen, minimum stat gains:
Str+3
Agi+4
Int+1

Then we have enough info to start searching.  Let's organize it.

Strength gains, organized by class:
03
04
02
03

Agility gains, organized by class:
02
02
03
04

Intelligence gains, organized by class:
01
02
01
01

You'll have to do this with at least ten classes if you want to find the data within a few searches.   More classes are better.  Be sure to use the Wildcard functionality in your hex editor while searching, if you have any gaps in your known data.

If this doesn't work, then it means that class data is probably stored by class, in stat order.  That's somewhat more difficult to find, since you don't know what order it's in, but I know how Tactics Ogre - The Knight Of Lodis stored it's class data, so we're not without resources.

I found class data in TO -TKOL by searching for starting stats.  The following is the specific block of data that I looked for, which led me to it.
Starting Strength
Strength Gain on Level Up
Starting Intelligence
Intelligence Gain on Level Up
Starting Agility
Agility Gain on Level Up

In TO - TKOL, the data was stored as the starting minimum stat and the minimum stat gain on level up, so you'll have to do some leveling up and recruiting to determine what the minimums are for TO - LUCT.

****

Finding the actual data should only take a few hours of rom or save state corruption (hint: use save state corruption if you're hacking the PS1 version of TO - LUCT, and use ROM corruption if you're hacking the SNES version).  It goes by really freaking fast.  The only actual difficult part is compiling the data, verifying it, checking it again to make sure you didn't fuck anything up, and then setting up the save state or save location to where you can load it and quickly check if what you corrupted is the relevant data.


http://gamehacking.org/?s=v2&sys=1&gid=1260&sid=5649
http://gamehacking.org/?s=v2&sys=1&gid=1260
^PS1 TO - LUCT codes.

http://gamehacking.org/?s=v2&sys=6&gid=6156
^SNES Japanese TO - LUCT codes.[/spoilers]

I'd volunteer, but I don't have a working PS1 emulator for Linux that is conducive to save state hacking, and I don't really care about TO - LUCT.

Pickle Girl Fanboy

Bump for news:
Quotehttp://www.gamefaqs.com/boards/198881-tactics-ogre/60552288
^A "trainer".  No idea what it is, but it looks useful.

http://db.gamefaqs.com/console/psx/file/tactics_ogre_mech.txt
^LUCT BMG

http://db.gamefaqs.com/console/psx/file/tactics_ogre_character.txt
^Class FAQ

http://db.gamefaqs.com/console/psx/file/tactics_ogre_battle.txt
^Battle Guide.

http://db.gamefaqs.com/console/psx/file/tactics_ogre_stats.txt
^Stat growth guide.

http://db.gamefaqs.com/console/snes/file/tactics_ogre_hacking.txt
^Save state hacking guide for SNES version.  Finding many of these things in a pSX save state should take maybe 20 minutes work with a hex editor.  Plus, we got digits.

One last thing: There's a lot of LUCT fans at RHDN, and, though I didn't find any documents over there, you should make a topic about this project over there, as well as here.  They will want what you find, and they might just help.  And I think I remember a LUCT hacking community somewhere.


Eternal

Edea's already a member of FFH, as a FFTA modder. I'll point her to this topic.
  • Modding version: PSX & WotL
"You, no less human than we? Ha! Now there's a beastly thought. You've been less than we from the moment your baseborn father fell upon your mother in whatever gutter saw you sired! You've been chattel since you came into the world drenched in common blood!"
  • Discord username: eternal248#1817

formerdeathcorps

June 15, 2012, 06:55:00 am #5 Last Edit: June 15, 2012, 07:34:25 am by formerdeathcorps
More information:

http://luct.tacticsogre.com/ogreshark.html
In particular, the job list is
01 = Soldier
02 = Knight
03 = Berserker
04 = Terror Knight
05 = Swordmaster
06 = Dragoon
07 = Ninja
08 = Beast Tamer
09 = Wizard
0A = Warlock
0B = Exorcist
0C = Lich
0D = Gunner
0E = Amazon
0F = Valkyrie
10 = Archer
11 = Dragon Tamer
12 = Siren
13 = Witch
14 = Cleric
15 = Priest
16 = Angel Knight
17 = Fairy
...

Routine for changing jobs in the formation menu is 0x10A744 in file UBF2.BIN or 0x1AA744 in RAM during the formation screen only.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

formerdeathcorps

The specific location of the selected unit's stats is 0x1239A0 RAM in the pre-battle and formation menus.

00 = Job
01 = ???
02 = Unit LVL
03 = Unit EXP
04/05 = Unit curHP
06/07 = Unit maxHP
08/09 = Unit curMP
0A/0B = Unit maxMP
0C/0D = Unit STR
0E/0F = Unit INT
10/11 = Unit AGI
12/13 = Unit DEX
14/15 = Unit VIT
16/17 = Unit MEN
18 = Unit Luck
19 = Alignment (00 = Neutral, 01 = Law, 02 = Chaos)
1A = ???
1B = ???
1C = Unit ID - 1
1D-20 = Unit Equips
21-23 = Spells
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

itoikenza

June 28, 2012, 10:32:14 pm #7 Last Edit: June 29, 2012, 11:26:00 pm by itoikenza
Address   "Length (dec)"   "Length (hex)"   Description   Value
000EBE36   1   01   "spell slot number"   00
000EBE66   1   01   "denim soldier"   03
000EC414   1   01   "mp growth"   03
000EC445   1   01   "denim soldier"   0A
000EC44E   2   02   "white knights"   0A0A
000ED6D5   1   01   "magic spell slot equipability"   FF
000ED706   1   01   "denim soldier"   09
000ED7C5   1   01   "spell 1 slot"   00
000ED7F6   1   01   "denim soldier"   28
000ED7FF   2   02   "white knights"   0000
000ED82E   2   02   "lich nybbas + warrior vice"   0000
000ED8B9   1   01   "spell slot 2"   00
000ED8EA   1   01   "denim soldier"   67
000ED8F3   2   02   "white knights"   0000
000ED9A5   1   01   "spell slot 3"   00
000ED9D6   1   01   "denim soldier"   63
000ED9DF   2   02   "white knights"   0000
000EDBC5   1   01   "slot 4 spell"   00
000EDBF6   1   01   "denim soldier"   4B
000EDBFF   2   02   "white knights"   0000
000EDC1E   1   01   "warlock  radlum"   FF
000EDDA5   1   01   "move rate!!!!!!!!!!!!!!!!!!!!!!!Crashes the game but works in menu!"   05
000EDDDE   2   02   "white knights"   0505
000EFE4D   1   01   "weapon handedness."   02
000EFEA1   1   01   "light bow"   02
000EFEAD   1   01   shotgun   02
000F021D   1   01   "item weights"   03
000F022B   3   03   "white knights"   808080
000F1925   1   01   "luck raise at level up"   00
000F1933   3   03   "white knights"   0A0A0A
000F19F5   1   01   "Item Special Effects (Stuns on hit, Anti-Dragon, etc.)"   00
000F1A03   1   01   zenobia   13
000F1A54   3   03   guns   131313
000F1C15   1   01   "Item Special Skills (used in the Item menu)"   00
000F1C23   3   03   "white knights"   717171
000F1C69   1   01   "light bow"   8B
000F1C75   2   02   guns   8282
000F1CBC   2   02   "neckleces hero's"   4450
000F1CE5   1   01   "Item Status Guards (immunity to petrification, etc.)"   00
000F1CF3   3   03   "white knights"   111111
000F1D44   3   03   guns   111111
000F1FA6   1   01   "mp cost/targeting"   01
000F1FB9   2   02   "magma god"   0101
000F1FE9   1   01   "exorcism 23"   01
000F1FF5   2   02   revivify?   0101
000F1FFB   1   01   "dark law 28"   28
000F20A8   2   02   "deep kiss"   0896
000F2169   1   01   "spell ranges"   07
000F21D9   1   01   "100% 01"   00
000F21EA   1   01   "82 deep kiss"   00     

http://www.clip-studio.com/quma/en/
Some hits you, So miss you, the center too, enter you, hits undone, have some fun, I know! misses come, render none, enter some... Always won!!... incomplete I know...