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

Author Topic: Making an off-camera area visible (GBA game)  (Read 436 times)

NoControlSR

  • Newbie
  • *
  • Posts: 2
    • View Profile
Making an off-camera area visible (GBA game)
« on: March 07, 2019, 12:48:17 pm »
Hello all!

First of all, my knowledge of these things is very limited, so please excuse my ignorance in case anything I write doesn't make any sense.

So, in the Spongebob Movie game for GBA, you can glitch yourself out of bounds and enter a strange area that has all kinds of weird stuff in it, including game crashes, level exit triggers, etc. (This area might be the game's memory, right?) The problem is that you can't see this area, because the camera will not follow the character down there.
Here's what I'm talking about:
https://www.youtube.com/watch?v=LGJ1CxvEP7I

Now my question is: Is it possible to somehow make this area visible? If yes, how hard would it be to accomplish? I have already identified some important addresses within the ROM, like the address for character coordinates and camera coordinates, and tried some stuff, but haven't really been successful...

Thanks in advance!

Jorpho

  • Hero Member
  • *****
  • Posts: 4051
  • The cat screams with the voice of a man.
    • View Profile
Re: Making an off-camera area visible (GBA game)
« Reply #1 on: March 07, 2019, 11:23:22 pm »
So, in the Spongebob Movie game for GBA, you can glitch yourself out of bounds and enter a strange area that has all kinds of weird stuff in it, including game crashes, level exit triggers, etc. (This area might be the game's memory, right?)
I suppose you're thinking of that SML2 thing?
https://www.youtube.com/watch?v=FPzuYWbnln4

Considering the GBA is considerably more sophisticated than the original Game Boy, I doubt it's anything quite so simple.

Quote
I have already identified some important addresses within the ROM, like the address for character coordinates and camera coordinates, and tried some stuff, but haven't really been successful...
I would think that adjusting the camera coordinates would be the way to go.  Are you actually able to move the camera where you want?

Quote
If yes, how hard would it be to accomplish?
Fumbling around in the dark is hard, yes.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

FAST6191

  • Hero Member
  • *****
  • Posts: 2465
    • View Profile
Re: Making an off-camera area visible (GBA game)
« Reply #2 on: March 08, 2019, 03:47:33 am »
What Jorpho said, though I will contemplate three things.

Normally when I see someone want to make an off camera area visible it involves moving it like it is a 3d world*. This is typically not a thing that is done.

*though I suppose even they have their fun. https://www.youtube.com/watch?v=kpk2tdsPh0A 10:40 or so.

Anyway started off on a tangent... I think I am getting worse.

Three scenarios I can see playing out here, or at least those things I would look at and eliminate first.

1) The game has some kind of bounds constraining you to a level despite otherwise being somewhere. 3d games will do this at their heart, though some will go further than that and border on 3). By no means a definitive test but many games will have a parallel coordinates system between what is on screen (handled by the OAM area of the GBA), the enemy/NPC/player location, animated stuff, the visual level and such. If in this glitch the player is no rendered or rendered oddly this could be what is happening.

2) The game did indeed jump you to some area of memory and it is doing its best to make a level from the data. If you are familiar with somewhat modern PC hacking techniques then think ROP (very short version is modern PC security blocks a lot, so hackers instead used things the program would allow to generate a new program as it is already in its safe area, best analogy I heard was think how a ransom note will use existing benign printed works to make something new), if you prefer older this what many a game does and has done over the years when it tries to interpret things it should not.
If this is so then most vaguely modern game consoles (of which the GBA is definitely one) will not interpret a level graphically and instead use a separate track to note the level design, enemy placement, objects... and that is often what you will glitch into, whatever happens on the visual side of things being the game still trying to make some sense of things.
Theoretically you could try to generate a visually... appealing thing from the glitch (it could possibly just be a marginal twist on classic level hacking) but it would essentially be made from whole cloth from your interpretation of matters.

3) You found some kind of developer hidden debug area, albeit one with the entrance hidden from the game's final code. Crashes might be because it tries to take items or call routines that no longer exist (the GBA is a compiled system so you can do such things far more easily than older devices), exist in that location (again compiled so if it was hardcoded to jump somewhere it might not be there right now) or make sense to the game. You could unhide this and fix the cause of crashes, might take some creative thought to figure out what the crashy bits should be, or you could just block the crash bits.

As far as "in memory" then yes but possibly not what you mean or understand from older systems. The GBA does have memory, obviously, but the carts themselves are blisteringly fast (even today they are pretty fast, hence the cost and complexity of flash carts for it where stuff like the DS was reduced to it often being more expensive to buy a swish microSD to stick in it) and are visible completely in normal memory (no banks, mappers, mbcs, pages... outside of flash carts and a couple of films that were only dumped in late 2015 https://mgba.io/2015/10/20/dumping-the-undumped/ ). To that end it is essentially a bunch of read only memory (32 megabytes of glorious high speed Read Only Memory) inside the game that you can happily put a level in. Ultimately it might still be in RAM, or a snapshot thereof might be/might be streamed in but be aware of that one.

In any case I don't know if I would suggest this as a first hack, though it could be a reasonable way to start learning some assembly (you might dodge knowing some assembly for this but most likely it will require some in fairly short order to do properly).

Jorpho

  • Hero Member
  • *****
  • Posts: 4051
  • The cat screams with the voice of a man.
    • View Profile
Re: Making an off-camera area visible (GBA game)
« Reply #3 on: March 08, 2019, 09:51:04 am »
1) The game has some kind of bounds constraining you to a level despite otherwise being somewhere. 3d games will do this at their heart, though some will go further than that and border on 3). By no means a definitive test but many games will have a parallel coordinates system between what is on screen (handled by the OAM area of the GBA), the enemy/NPC/player location, animated stuff, the visual level and such. If in this glitch the player is no rendered or rendered oddly this could be what is happening.

Oh right, that would be like the SM64 "parallel universe", wherein the game can keep track of some interactions between the player sprites and the level objects, but others don't act properly because the camera isn't where it should be.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

NoControlSR

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Making an off-camera area visible (GBA game)
« Reply #4 on: March 09, 2019, 08:40:17 am »
Cool, thank you both for the valuable input!

I would think that adjusting the camera coordinates would be the way to go.  Are you actually able to move the camera where you want?
If only it were that easy... Unfontunately the camera snaps back to the character immediately. Also it doesn't go beyond the intended bounds of the level.

3) You found some kind of developer hidden debug area
Good idea, but unlikely (I think) because the area is huge (in total it's bigger than than the actual level itself) and very random.

In any case I don't know if I would suggest this as a first hack, though it could be a reasonable way to start learning some assembly
No worries, this project is kind of a long term goal of mine, I'm mainly attempting to do easier things at this point (like eliminating all sources of death in the game) to familiarize myself with assembly.