Gay
Former player
Joined: 6/21/2015
Posts: 58
I managed to find some addresses of RAM, but can not when searching subpixel. How can I know if I've found is an address of subpixels and not a false positive? Please give me some advice.
Gay Dominguez Jr.
Senior Moderator
Joined: 8/4/2005
Posts: 5770
Location: Away
1) More often than not the address for a subpixel is right next (or within a dozen addresses away or so) to the address of a full pixel. 2) You can confirm it's a subpixel if the value corresponds to the rate of full pixel change when character moves, and if it always remains static when they don't (i.e. if the character's movement speed is 1.5 pixels per frame, then, if it's moving to the right, you should see the full pixel address's value oscillate between +1 and +2 and the subpixel's value adding something like +128 or +32768 on every frame—depending on the bit-size of the value). Keep in mind that some games, such as those based on Wario Land 4 engine (Metroid Fusion, Metroid Zero Mission), measure distance in quarter-pixels or other arbitrary units rather than treating subpixels as a proper fraction of a pixel. Additionally, while subpixels' values may be 16-bit in size, the actual precision could be way lower. For instance, Super Metroid's 16-bit-sized subpixel addresses only track 512 possible values for subpixels (which corresponds to 9 bits of information), while the popular hack Super Metroid Redesign makes use of the full range. It can be similar with 8-bit-sized addresses as well, with the actual precision being 4-bit, for instance, and thus only changing in the increments of 32.
Warp wrote:
Edit: I think I understand now: It's my avatar, isn't it? It makes me look angry.
Site Admin, Skilled player (1235)
Joined: 4/17/2010
Posts: 11264
Location: RU
If there's acceleration in the game, subpixels will roll seemingly randomly as the pixel speed increases or decreases. Otherwise, subpixels can be used to move the character for a non-integer amount if pixels, then they won't roll "randomly" as your speed changes, but will rather alternate between a limited amount of variations. Note that structs used to store object attributes can be implemented in several ways: 1) List all attributes of on object, then another one's, etc. 2) List one attribute for all objects, then another attribute, etc. 3) Separate some attributes of an object from the rest. 4) Dynamically allocate memory for newly spawned objects in a weird way. This is to help you get the idea of how far subpixels can be from a pixel coordinate. And of course, it is all assuming the game does have subpixels in the first place. If you can afford a debugger, set write breakpoint to your pixel coordinate and see if something gets incremented/decremented by a certain value just before the pixel address. It is very common that subpixel value gets added a subpixel speed for the given state of the object, and if it overflows, the integer part goes to pixel coordinate.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.