• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

does anyone know much about the memory addresses related to the camera?

nqztv

Smash Journeyman
Joined
Feb 25, 2014
Messages
499
i'm trying to create a function that will map a characters position in the game to their position on screen. so i figure i need to know more about how the camera works.

according to the ssbm data sheet, 0x80452C7C holds the value the camera's vertical pivot. after probing around that memory space, i'm more inclined to believe that:

0x80452C7C is the x position (these addresses also seem equivalent: 0x80452C88, 0x80452CB4, and 0x80452CC0)
0x80452C80 is the y position (these addresses also seem equivalent: 0x80452C8C, 0x80452CB8, and 0x80452CC4)
0x80452C84 is the z position (these addresses also seem equivalent: 0x80452C90, 0x80452CBC, and 0x80452CC8)

however, trying to poke these addresses to different values doesn't seem to do anything so i'm guessing there's a in-game function that updates these values every frame.

i figure before i try to delve some more and perhaps repeat someone else's work, i would ask here to see if anyone here knows how to do what i'm trying to accomplish already, or if someone knows enough to perhaps lead me in the right direction.

thanks in advance!

also, am i wrong in using the following as each character's in-game position?

(0x80453090, 0x80453094) for player 1's position (this seems equivalent to (0x80453130* + 0x110, 0x80453130* + 0x114))
(0x80453F20, 0x80453F24) for player 2's position (this seems equivalent to (0x80453FC0* + 0x110, 0x80453FC0* + 0x114))
(0x80454DB0, 0x80454DB4) for player 3's position (this seems equivalent to (0x80454E50* + 0x110, 0x80454E50* + 0x114))
(0x80455C40, 0x80455C44) for player 4's position (this seems equivalent to (0x80455CE0* + 0x110, 0x80455CE0* + 0x114))

once again, if i'm wrong in any of this, i'd appreciate if someone would point that out :-p.
 

DRGN

Technowizard
Moderator
Joined
Aug 20, 2005
Messages
2,179
Location
Sacramento, CA
You're right in that the values are axis positions, rather than pitch or yaw (even thought that's what it looks like when you change one of them, because the camera then adjusts to track a specific point). The reason you're finding multiple sets of similar values, is because there are multiple camera modes that the game uses in different scenarios. 9 modes to be exact (there's a value in RAM that tracks what mode the camera is in at any given time). And the reason you're not seeing your updates take effect is because all of the modes update automatically each frame (so they're difficult to do anything useful with), except one. Camera Mode 8 is used in Debug Mode when you manually adjust the camera, and it doesn't track anything, so when you update its RAM values, the camera will update to that position and stay there. Very useful.

The mode switch is at 0x80452C6C. The value here is an integer, and needs to be set to 8.

In this mode, you can set the point where the camera is, as well as the point that it tracks with these addresses:

Degree of movement: Memory address (static):

X coordinate to track: 80453040
Y coordinate to track: 80453044
Z coordinate to track: 80453048

X coordinate of cam: 8045304c
Y coordinate of cam: 80453050
Z coordinate of cam: 80453054


As for getting the coordinates of the characters, the values for those are in dynamic addresses, meaning they're not always in the same place. The "0x80453130" that you found isn't meant to be added to 0x110 itself. Instead, that's the location that contains the starting point for P1's info. 0x110 is then the offset from that reference point. So you go to 0x80453130, get the value there, and then add 0x110 to the value you got. Then you'll have the character's x-coordinate. It's the same for the y-coordinate, except with 0x114, and iirc, the value is always 0 if you're not in the air.

Alternatively, you can get coordinates of the character's ECB (Environment Collision Boxes), which are the orange diamonds you can see in Debug Mode, by using the address found at 0x453130 + one of these:

Top: +0x7D4
Bottom: +0x7DC
Right: +0x7E4
Left: +0x7EC

I'm not really sure what your function is supposed to do.
 
Last edited:

nqztv

Smash Journeyman
Joined
Feb 25, 2014
Messages
499
thanks! the debug camera should be useful for figuring things out! and ya, i know the position coordinates are pointers (i tried to indicate that with the asterisk), although the offsets from the pointers seem to give the same values as the given static address. it would be interesting to see if those match up with any of the ecb coordinates though. thanks again! i knew there would be someone who would be able to help out :-p.
 
Top Bottom