How to find camera coordinates?

Started by live2play, July 06, 2013, 06:52:22 PM

Previous topic - Next topic

live2play

Anyone have a good method for finding the camera coordinates?

γRB

I've never tried 'editing' that, but does the game you want to hack let you change / move camera in any way easily and normally?

live2play

#2
The game doesn't let you move the camera but I wanted to try to make 3rd person game a first person game.  I think that a good method may be to find my player coordinates and set a read breakpoint.  Hopefully I can then follow the ASM to a section that involves the camera coordinates as they follow the player's moves.  Any other ideas?

γRB

Exactly what I was thinking of. Expect a huge list.

Deathwolf

It could be a consistent float as well. You could try to do a huge multipoke.
lolz

γRB

I've just found one regarding Y coordinate. You're good to go.

live2play

#6
Quote from: γRB on July 08, 2013, 08:01:43 PM
I've just found one regarding Y coordinate. You're good to go.
What do you mean by finding one?  There should only be one camera.

live2play

Quote from: Deathwolf on July 08, 2013, 07:11:25 PM
It could be a consistent float as well. You could try to do a huge multipoke.
I could see a constant float being the camera zoom level, but not the location/coordinates of the camera.

Deathwolf

#8
Quote from: live2play on July 08, 2013, 10:28:33 PM
Quote from: Deathwolf on July 08, 2013, 07:11:25 PM
It could be a consistent float as well. You could try to do a huge multipoke.
I could see a constant float being the camera zoom level, but not the location/coordinates of the camera.

Have you tried to set a breakpoint "read" on it? Perhaps you could get some information via registers. Eventually it *could* work.
lolz

γRB

Well you talked about camera coordinates, so I tried it on a game. Found the Y coordinate, set a read breakpoint (huge list), and found an lfs (or lfd) instruction, tested it, and that's it, it was the camera.

live2play

Quote from: γRB on July 09, 2013, 11:32:03 AM
Well you talked about camera coordinates, so I tried it on a game. Found the Y coordinate, set a read breakpoint (huge list), and found an lfs (or lfd) instruction, tested it, and that's it, it was the camera.

So, when you set the read BP on your player's Y coordinate, and you say that you had a huge list, do you mean that the BP was triggering constantly or that it was triggering in multiple areas in the ASM or both?  Did the camera have three coordinates or just one constant float value?  When you made a change did the camera just zoom in/out or actually change it's location?

live2play

Quote from: Deathwolf on July 08, 2013, 10:53:32 PM
Quote from: live2play on July 08, 2013, 10:28:33 PM
Quote from: Deathwolf on July 08, 2013, 07:11:25 PM
It could be a consistent float as well. You could try to do a huge multipoke.
I could see a constant float being the camera zoom level, but not the location/coordinates of the camera.

Have you tried to set a breakpoint "read" on it? Perhaps you could get some information via registers. Eventually it *could* work.
Sorry for the confusion.   :) I didn't find the float.  I was indicating that I could see that one would exist but probably be for zoom rather than location.

biolizard89

Sorry for bumping a post, but I guess this forum is sufficiently low-activity that no one will object.

@yRB that's awesome that you were able to find the camera coords with a RBP on the player coords.  I need to try that once I get the head tracking stuff working, maybe I can support more games that way.

For what it's worth, in games where you can move the camera, it's not particularly hard (usually) to find the coords with an Unknown Value search.  I did this in Starfox Assault, F-Zero GX, and Super Monkey Ball 2 with minimal difficulty.  The only exception that I've seen is Sonic Adventure 2: Battle... for the life of me I cannot find the camera coords even though it's possible to move the camera... no idea what I'm doing wrong there.

dcx2

One trick is to exploit spatial locality.  That is, related data will likely be found close together.  For instance, you can find Mario's health, and there's a chance his coordinates will be located nearby.

γRB

@biolizard89 , That's not exactly what I meant :P
In games in which when you move the camera moves aswell, it's pretty easy to find the camera, if you get what I mean, it's just like finding a normal coordinate.