Author Topic: Make 'Sense' Work with 30,000+ HP  (Read 10442 times)

xLostWingx

  • *
  • Posts: 801
  • No Comment
    • View Profile
    • FFVII Lost Wing Mod/Hacks
Make 'Sense' Work with 30,000+ HP
« on: 2011-03-13 22:15:16 »
Is there a reason why Sense only works with enemies with HP below 30,000?  It seems like a fairly arbitrary number, and so many enemies have HP higher than this.  Is there any way to change this limitation?

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: Make 'Sense' Work with 30,000+ HP
« Reply #1 on: 2011-03-13 23:50:33 »
You would have to trace the assembler to do this, and find where the comparison to 30,000 is invoked.

This is quite beyond my abilities, but as I understand it, with a debugger, you should be able to stop an emulator when the enemy HP address is read, or when the value 30,000dec is put in a register.

From there, you should be able to either trace back the origin of the 30,000 value, or find the 'branch' instruction that makes sense succeed / fail and make it non-conditional / a NOP (delete as appropriate).

I'd love to know more about this sort of stuff, but I wouldn't know where to even begin...

xLostWingx

  • *
  • Posts: 801
  • No Comment
    • View Profile
    • FFVII Lost Wing Mod/Hacks
Re: Make 'Sense' Work with 30,000+ HP
« Reply #2 on: 2011-03-13 23:58:25 »
I'd love to know more about this sort of stuff, but I wouldn't know where to even begin...

My feelings exactly.

Aali

  • *
  • Posts: 1196
    • View Profile
Re: Make 'Sense' Work with 30,000+ HP
« Reply #3 on: 2011-03-14 00:44:32 »
The reason for this 30000 limit is that the max hp value at some point needs to fit in 16 bits. It is not as easy as removing the code that checks for this.

It can still be fixed of course but its not very easy to do.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Make 'Sense' Work with 30,000+ HP
« Reply #4 on: 2011-03-14 00:54:16 »
yeah, for some reason the developers decided to use a 16 bit value for monster sense, when they can have way more than 65535 HP (think FF9... that limited HP to 16 bit values).  And then it is signed, so the actual limit is 32767(?)

It shouldn't be hard to raise the limit to 65535 though aali? (i cant see a reason)

I am guessing FF7 uses 32 bit value for HP?  Potentially 4294967296 HP?
« Last Edit: 2011-03-14 00:58:35 by DLPB »

Kudistos Megistos

  • Banned
  • *
  • Posts: 3929
    • View Profile
Re: Make 'Sense' Work with 30,000+ HP
« Reply #5 on: 2011-03-14 01:58:18 »

I am guessing FF7 uses 32 bit value for HP?  Potentially 4294967296 HP?

For enemies, yes.

But I think it's a signed value (it is for player characters); if that's the case, the max is 2147483647.

Bosola

  • Fire hazard!
  • *
  • Posts: 1752
    • View Profile
    • My YouTube Channel
Re: Make 'Sense' Work with 30,000+ HP
« Reply #6 on: 2011-03-14 02:37:38 »
The reason for this 30000 limit is that the max hp value at some point needs to fit in 16 bits. It is not as easy as removing the code that checks for this.

Oh, is it a signed integer?

In that case, the fix will be non-trivial.

The easiest solution is to rework your mod so that enemies have far less health  :-\

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Make 'Sense' Work with 30,000+ HP
« Reply #7 on: 2011-03-14 03:57:57 »

I am guessing FF7 uses 32 bit value for HP?  Potentially 4294967296 HP?

For enemies, yes.

But I think it's a signed value (it is for player characters); if that's the case, the max is 2147483647.

It isn't for Gil though  :-D

xLostWingx

  • *
  • Posts: 801
  • No Comment
    • View Profile
    • FFVII Lost Wing Mod/Hacks
Re: Make 'Sense' Work with 30,000+ HP
« Reply #8 on: 2011-03-14 04:03:04 »
In that case, the fix will be non-trivial.

The easiest solution is to rework your mod so that enemies have far less health  :-\

Heh, well that isn't an option for many enemies, but most random encounters for the first 2 disks will be in that range.  The main reason I wanted to increase sense's capabilities was so that players could sense boss HPs to know if they could beat the thing hard and fast, or if they should take a more cautious, defensive approach.  Not a big deal though, not knowing boss HP adds a nice element of uncertainty.

Tenko Kuugen

  • Public Enemy
  • *
  • Posts: 1416
    • View Profile
    • Twitter
Re: Make 'Sense' Work with 30,000+ HP
« Reply #9 on: 2011-03-14 08:22:58 »
It does kinda make sense one of the most useless materia in the entire game after a certain part
I wanted to change this as well but had little luck
I asked a few people that roam on different hacking forums ( GAME hacking before anyone gets on my butt for this ) but none of them knew any specifics or were willing to waste their time

xLostWingx

  • *
  • Posts: 801
  • No Comment
    • View Profile
    • FFVII Lost Wing Mod/Hacks
Re: Make 'Sense' Work with 30,000+ HP
« Reply #10 on: 2011-03-14 09:30:23 »
Sucks pretty bad that such simple issues require such complicated solutions.  30,000 HP?  Why?  This is fine though.  You don't really use sense in dire situations, so it doesn't really matter.  Maybe I can replace it with some sweet new command materia.

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Make 'Sense' Work with 30,000+ HP
« Reply #11 on: 2011-03-14 15:58:00 »
In that case, the fix will be non-trivial.

The easiest solution is to rework your mod so that enemies have far less health  :-\

Heh, well that isn't an option for many enemies

Why not?  If you reduce all enemies HP by 1000000/65535 = 15.26

Around 16X, you will be able to have all enemies in the game accounted for?  As long as someone can make the limit 65535, if not scale by 32X. (you might need a rethink)

Breath of Fire 3 did it OK and its enemies never go over 30000.  The hardest creature in the game is Berserker at 30000, followed by Arch Mage at 2500.  You would also have to scale the strength stats and player HP etc.




ice_cold513

  • *
  • Posts: 494
    • View Profile
Re: Make 'Sense' Work with 30,000+ HP
« Reply #12 on: 2011-03-14 17:08:09 »
A little off topic as it don't got anything to do with how to get Sense to work over 30k
 but i alway though it would be nice, if to sense higher HP enemys the higher Sense Materia level would have to be

DLPB_

  • Banned
  • *
  • Posts: 11006
    • View Profile
Re: Make 'Sense' Work with 30,000+ HP
« Reply #13 on: 2011-03-14 17:32:44 »
Yeah thats a cool idea ;)

xLostWingx

  • *
  • Posts: 801
  • No Comment
    • View Profile
    • FFVII Lost Wing Mod/Hacks
Re: Make 'Sense' Work with 30,000+ HP
« Reply #14 on: 2011-03-14 17:43:30 »
Why not?  If you reduce all enemies HP by 1000000/65535 = 15.26
Around 16X, you will be able to have all enemies in the game accounted for?  As long as someone can make the limit 65535, if not scale by 32X. (you might need a rethink)

^At that ratio, I would be doing like 15 Damage for the Bombing Mission and Enemies would be dealing about 6 or 7 damage, not to mention my HP would be scaled down to about 70.  The particular mod that I'm working on right now revolves around the fact that enemies are as powerful as they are and the ability of the player to have more options for causing high damage early in the game.  I've played with everything scaled down before, but having the ability to sense enemy HP does NOT take priority over the range of HP available to enemies.  Thanks for the suggestion, but I'm confident in the scale I intend to use :)

At 30,000 Random Encounters up to Mideel would be covered, and Bosses up to the Red Dragon at Ancient Temple.  At 60,000 Random Encounters on Disks 1 and 2 are all good except for Unknowns, Behemoths, and a few others.  Bosses would be good until Schizo, only because he has multiple parts...but Schizo isn't there anymore so maybe not.
« Last Edit: 2011-03-14 19:31:01 by xLostWingx »

Dark_Ansem

  • *
  • Posts: 320
    • View Profile
Re: Make 'Sense' Work with 30,000+ HP
« Reply #15 on: 2011-03-16 10:22:54 »
a possible update for the damage/hp limit patch this could be, perhaps?