News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Lufia II monster stats  (Read 2609 times)

ze10

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Lufia II monster stats
« on: December 07, 2012, 01:17:08 am »
In Lufia 2, monsters' stats can go up to 999. However, some of those stats, such as AGL and INT are stored as 1 byte in memory. What the game does when you battle them is to multiply these stats by 2. Therefore, the max these stats can reach is 510.
So, I've been fiddling around with Lufia II rom and at the moment I'm trying to find out where the game does that multiplication thing in order to increase the value (e.g. multiply monsters's stats by 3 or something).
However, I'm a ROM hacking n00b. All I've done so far was to read monster data and write them back in the ROM. I haven't done that alone, of course. I've been following the Lufia II documents I've uploaded to this site to help me (obviously, I wasn't the one who wrote them =P).
So, can anyone give me a hint of how to start? Or maybe if this is even possible at all? I was wondering that maybe this might not be possible without massively editing the rom. I'm not sure if the SNES processor knows how to multiply... but if it doesn't I think I'm gonna have trouble... =/

justin3009

  • Hero Member
  • *****
  • Posts: 1615
  • Welp
    • View Profile
Re: Lufia II monster stats
« Reply #1 on: December 07, 2012, 01:23:40 am »
It can definitely multiply but that's interesting.  But if it can double and reach 510, then something in RAM STORES that value so it technically is already doing 2-byte storage or something along those lines.  That's quite interesting to know actually.

You'd probably have to trace the code and such and figure out which part loads the enemy stats.  Maybe an easier method would be to use SNES9X Geiger's Debugger and in Breakpoints, put in one of the monsters AGL RAM location (A cheat code probably has that.  If not, maybe use one of the addresses that you have labeled down) and have it 'Read'.  It may pick up on that and then 'Step Into' to view what the code does.

This is a pretty shoddy explanation as I don't have any of the offsets in front of me and I'm about to head to bed for work early tomorrow, but maybe someone else can expand and explain this more.
'We have to find some way to incorporate the general civilians in the plot.'

'We'll kill off children in the Juuban district with an infection where they cough up blood and are found hanging themselves from cherry blossom trees.'

LostTemplar

  • Hero Member
  • *****
  • Posts: 906
    • View Profile
    • au-ro-ra.net
Re: Lufia II monster stats
« Reply #2 on: December 07, 2012, 02:34:03 am »
For reference, while there is multiplication on the SNES, the game's probably using ASL (arithmetic shift left) to multiply by 2 because it's faster. So, to change the factor, you'll have to let it jump to a new custom routine that implements it.

FAST6191

  • Hero Member
  • *****
  • Posts: 2612
    • View Profile
Re: Lufia II monster stats
« Reply #3 on: December 07, 2012, 06:50:56 am »
I have no qualms with the logic of the others that have come before me but I have found that increasing stats like this (assuming you are not dealing with a text engine although that is not so nice either) is a right pain. To that end I call forest for the trees and say might it instead be better to slightly nerf your character stats? I have never actually played the series at length so I leave rebalancing to you. If you are especially worried about the numbers displayed appearance factor (see something costing ?.99 where adding one would make it in the next multiple of ten) you could probably do better by cheating the number display routine.

ze10

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: Lufia II monster stats
« Reply #4 on: December 07, 2012, 10:53:42 am »
I have discovered (messing around with PAR codes) that, once the battle has started, the codes you use to change the monsters' stats have 2 bytes. So, for example, to edit monster 1's AGL, you can use the codes:
7E164AXX
7E164BXX
However, the values used in these codes (the ones I used to find these codes) are from the enemy's original stats and not its double. So, I'm wondering if the stat multiplication is done only when the game uses the stat for some calculation. But I'm probably wrong considering that the space to store the value has two bytes...

I'm still struggling to understand Geiger's Debugger, so this will probably be slow... =( Or maybe this is just out of my league, since I'm a newbie and everything...
« Last Edit: December 07, 2012, 06:14:02 pm by ze10 »

Vegetaman

  • Jr. Member
  • **
  • Posts: 79
  • Child of Doom
    • View Profile
Re: Lufia II monster stats
« Reply #5 on: December 07, 2012, 07:25:22 pm »
I realize Lufia II is probably not the same "core" as Lufia I, but back in 2006 over at gamefaqs we did some digging into monster data. Perhaps you may find some interesting tidbits on how to wander thru the monster data in this topic:

http://www.gamefaqs.com/boards/588452-lufia-and-the-fortress-of-doom/30424903

For example, the 23rd byte apparently turned out to be the "item that may drop" when they are killed, and the 24th byte is the probability of it dropping when you kill them.