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

Author Topic: Super Mario RPG: Level Cap over 30.  (Read 6892 times)

DarkkefkaFFX

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Super Mario RPG: Level Cap over 30.
« on: September 01, 2013, 01:37:56 pm »
I'll simply die if I don't learn how to do this....

Hi guys, I'm Dark Kefka. I have a Hack Called Super Mario RPG Armageddon.

It's the main game with a few twist and turns and insane difficultly. It's currently on Version 6, I'm upgrading it to version 7 right now. The 2 major things I wanted was the coin limit past 999 and the level cap past 30.

There's a Coin limt Expansion, but it messes up my game when I use it. I was able to figure out the offsets to set the coin limit yourself.
However, the level cap is a different story.

Offset 3A1AFF contains the information needed to control the exps needed to level up. You're suppose to find the "Pointer"  of this offset or something like that and move it to another location in the rom so you can make your own offsets to increase the level cap. But I just can't seem to learn how to find the pointer. I've read many guides but it' too confusing to me. Can somebody PLEASE tell me how to to do this? What is the pointer location of this offset?

FAST6191

  • Hero Member
  • *****
  • Posts: 3089
    • View Profile
Re: Super Mario RPG: Level Cap over 30.
« Reply #1 on: September 01, 2013, 04:43:26 pm »
I can not say I have ever hacked Super Mario RPG and do not have any great desire to start now (likewise if we were discussing the least hacked non educational mario games it would be among the forerunners) but in the meantime I will try to get you heading in the right direction. What you say may well be true and what you have been told to do may well be a way to do it (until I can argue otherwise I will have to assume it is) but it seems kind of odd.

Going by what has been said that area in the ROM contains a hardcoded lookup table for level progression or something along those lines. Odd as I would have thought it would have been somewhat algorithmic but I have certainly been surprised in the past and that would make fine tuning a bit easier.
Alternatively that is actually a section of assembly code for levelling but that does not seem as likely if that was the information you were given/path you were sent down.

If you were doing a minor rebalancing hack you would have probably just been told to edit that area. However if you want to expand the scope of the levelling system you will probably* want to have more space hence the "move it to another location" part.
*it is possible to leave it all and algorithmically sort it from there but I would avoid that for a first pass.
Back on topic though what I imagine the game will be doing is something like reading that location (or more likely that location plus character level multiplied by some number depending upon how big the numbers are and if that table also includes stat or spell progressions -- not wishing to confuse you too much but in normally programming such a thing happens as the result of "pointer arithmetic" though the pointers there are not quite the same as you are dealing with here) to get the value for level ups.
Your job is then to find the thing in the game that tells it to look in that location. This is best accomplished by tracing I would imagine.
I am not sure if you have learned tracing yet but it is a basic assembly hacking technique, though a truly powerful one. I am not going to cover it as it is done far more extensively elsewhere.
So anyway the game will at some point refer to that location or something after it for the level value. This may or may not be often as it could read it once and not have to read that location until the next level/a new character joins the party.
Still set a breakpoint for a read from that location plus however much the rest of the table needs. When something reads it your emulator will halt everything and say "this command is reading from this location and this is where the command is found".
From here you get to work backwards. It might be that it is just a single instruction wanting to read it but more likely you will have a small routine to build the number it needs to read from the location.
Your job is then to understand the routine that led to the read from that location. Once you understand it you can change it (in your case move it to a larger area of what was free space in the ROM to have it instead see your table.

That might also only be the start of things for reasons I will get into in a moment.

I do also have to warn you that if the game is hardcoded to level 30 then it may well be the start of a very deep rabbit hole as you then get to rebalance the entire game, you seem to be heading that way anyway so that is probably not going to be a huge obstacle.

Another possible downfall is 30 is quite close to 31 (5 bits all 1) much like 999 is quite close to 1023 (10 bits all 1), it is quite possible to change variable size but it is far from an easy thing if you have all sorts of functions and routines expecting a variable of given size. Moreover if it is limited to this I have often found the rest of the byte/word/dword/whatever might be given over to another variable or something else and trying to separate such things is less than fun.

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 7088
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Super Mario RPG: Level Cap over 30.
« Reply #2 on: September 01, 2013, 07:18:16 pm »
Level 30 also requires 9,999 experience. Another value that could be a problem to expand if it is BCD.

Another thing to consider is that as you get in higher level, stat boosts get lower.
I imagine that is to avoid them reaching 255 to avoid overflow, which I assume is the limit (1 byte stats).
"My watch says 30 chickens" Google, 2018

DarkkefkaFFX

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Super Mario RPG: Level Cap over 30.
« Reply #3 on: September 02, 2013, 01:29:40 pm »
I can not say I have ever hacked Super Mario RPG and do not have any great desire to start now (likewise if we were discussing the least hacked non educational mario games it would be among the forerunners) but in the meantime I will try to get you heading in the right direction. What you say may well be true and what you have been told to do may well be a way to do it (until I can argue otherwise I will have to assume it is) but it seems kind of odd.

Going by what has been said that area in the ROM contains a hardcoded lookup table for level progression or something along those lines. Odd as I would have thought it would have been somewhat algorithmic but I have certainly been surprised in the past and that would make fine tuning a bit easier.
Alternatively that is actually a section of assembly code for levelling but that does not seem as likely if that was the information you were given/path you were sent down.

If you were doing a minor rebalancing hack you would have probably just been told to edit that area. However if you want to expand the scope of the levelling system you will probably* want to have more space hence the "move it to another location" part.
*it is possible to leave it all and algorithmically sort it from there but I would avoid that for a first pass.
Back on topic though what I imagine the game will be doing is something like reading that location (or more likely that location plus character level multiplied by some number depending upon how big the numbers are and if that table also includes stat or spell progressions -- not wishing to confuse you too much but in normally programming such a thing happens as the result of "pointer arithmetic" though the pointers there are not quite the same as you are dealing with here) to get the value for level ups.
Your job is then to find the thing in the game that tells it to look in that location. This is best accomplished by tracing I would imagine.
I am not sure if you have learned tracing yet but it is a basic assembly hacking technique, though a truly powerful one. I am not going to cover it as it is done far more extensively elsewhere.
So anyway the game will at some point refer to that location or something after it for the level value. This may or may not be often as it could read it once and not have to read that location until the next level/a new character joins the party.
Still set a breakpoint for a read from that location plus however much the rest of the table needs. When something reads it your emulator will halt everything and say "this command is reading from this location and this is where the command is found".
From here you get to work backwards. It might be that it is just a single instruction wanting to read it but more likely you will have a small routine to build the number it needs to read from the location.
Your job is then to understand the routine that led to the read from that location. Once you understand it you can change it (in your case move it to a larger area of what was free space in the ROM to have it instead see your table.

That might also only be the start of things for reasons I will get into in a moment.

I do also have to warn you that if the game is hardcoded to level 30 then it may well be the start of a very deep rabbit hole as you then get to rebalance the entire game, you seem to be heading that way anyway so that is probably not going to be a huge obstacle.

Another possible downfall is 30 is quite close to 31 (5 bits all 1) much like 999 is quite close to 1023 (10 bits all 1), it is quite possible to change variable size but it is far from an easy thing if you have all sorts of functions and routines expecting a variable of given size. Moreover if it is limited to this I have often found the rest of the byte/word/dword/whatever might be given over to another variable or something else and trying to separate such things is less than fun.


I was able to get Mario to level 34, but I need to move the pointer to another location to get to any level want. You said it was explained else on how I can trace it elsewhere. Where was it explained?

FAST6191

  • Hero Member
  • *****
  • Posts: 3089
    • View Profile
Re: Super Mario RPG: Level Cap over 30.
« Reply #4 on: September 02, 2013, 06:58:55 pm »
Ah yes BCD... not my favourite thing and fortunately I have not really encountered it in game logic in recent years (too many people like their pointer maths and fun operations in not so strongly typed languages) so I tend to forget about it.

Back on topic I hopefully did not quite say that the actual tracing session needed for this hack was covered elsewhere, rather that the technique otherwise known as tracing is covered elsewhere. Tracing is a fundamental skill for those aspiring to do more than play with premade tools, edit basic text, edit basic graphics and the like. Technically it falls under the remit of assembly hacking though most will first learn/use it as something that is not quite assembly hacking. I mainly did not link a guide as I did not have one that I can rate for teaching people to trace using the SNES as a basis for the tutorial, once it is taught it is pretty easy to reskill for a new machine but I am not sure it would be the best for me to link one for the NES or the GBA (where there are tutorials I can rate/have read and rated) and then tell you to move sideways from there as they tend to also include a healthy dose of the system architecture they are concerned with. Likewise the SNES debugging emulation world has got a bit of a shakeup in recent years and for debugging purposes a lot of people shifted to new and improved emulators but did not bring the nice old tutorials with them.

To that end I will have to leave it at here are a bunch of debugging emulators
http://www.romhacking.net/?page=utilities&category=17&platform=9&game=&author=&os=&level=&perpage=20&title=&desc=&utilsearch=Go
They may or may not be the latest versions of each of them but get one that works for you and read the help files.
Though I said I would rather not start you on the NES stuff and tell you to apply it to the SNES I will link up the FCEUX stuff as it is very nice
http://www.fceux.com/web/help/fceux.html?Debug.html

DarkkefkaFFX

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Super Mario RPG: Level Cap over 30.
« Reply #5 on: September 03, 2013, 09:56:24 am »
I downloaded Geiger's Snes9x Debugger since I use snes to play my games.

Of course I'm new at this, so I'm going to need some help.


Okay....the thing I'm looking for is the pointer location of offset 3087999 (0x3A1AFF) SO how do I get started? Do I need to load the game in the debugger and get to a certain point in the game that loads a level up or something?

justin3009

  • Hero Member
  • *****
  • Posts: 1656
  • Welp
    • View Profile
Re: Super Mario RPG: Level Cap over 30.
« Reply #6 on: September 03, 2013, 12:30:42 pm »
Load the rom up in Geiger's SNES9X
Hit run, etc..
Click 'Show Hex'
On the far right side, make sure 'Trace Once' is checked'

What that does is when you click 'CPU', it'll trace code with all the actions you do.  Basically, you do all the actions you don't WANT to do and let those trace first.  Basically, do what you need to do in battle.  Then when you know you're going to level up, uncheck CPU, go back to home so it knows it's stopped, then set CPU checked again.  When you level up, it'll trace the code for it.

That's the basics of that.  It'll appear in a 'Log' folder in your SNES9X unless you change the directory.
'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.'

DarkkefkaFFX

  • Jr. Member
  • **
  • Posts: 8
    • View Profile
Re: Super Mario RPG: Level Cap over 30.
« Reply #7 on: September 04, 2013, 09:14:28 am »
After reading all the help I got from everybody and combining many many tips together, I finally figured it out.

I still have a long way to go, but at least now I have an understanding of how it works. I can't believe how complex it realy is. That's for all your help guys.




Only thing now is, I need to decide what I want the level cap to be. I needs to be different from level 50 or 70 to prevent anybody from accusing me of using other hacks as a base. I have indeed learned how to do it myself.

Celice

  • Hero Member
  • *****
  • Posts: 646
    • View Profile
Re: Super Mario RPG: Level Cap over 30.
« Reply #8 on: September 04, 2013, 01:54:03 pm »
I don't think you have reason to assume you'd be accused of anything. 20, 30, 50, and 70 are fairly common level caps in other games.

keithisgood

  • Full Member
  • ***
  • Posts: 192
  • [DANGER ! ! ! ! ! ! ] [TERROR HORROR]
    • View Profile
    • keithisgood
Re: Super Mario RPG: Level Cap over 30.
« Reply #9 on: September 05, 2013, 02:12:08 pm »
Only thing now is, I need to decide what I want the level cap to be. I needs to be different from level 50 or 70 to prevent anybody from accusing me of using other hacks as a base. I have indeed learned how to do it myself.
The Answer to the Ultimate Question of Life, the Universe, and Everything is 42.

Jeville

  • Sr. Member
  • ****
  • Posts: 397
    • View Profile
Re: Super Mario RPG: Level Cap over 30.
« Reply #10 on: September 05, 2013, 05:01:21 pm »
I'd go with 45.