News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Samus movement values and collision

Started by Grimstar, April 30, 2018, 10:51:32 AM

Previous topic - Next topic

Grimstar

Note: I've been skimming through the disassembly of Metroid, but I am very bad at reading assembly code, which is why I'm asking.

This post is just some questions related to values in $0300 to $0316, i.e. Samus' Object RAM.

I:
First question is about Samus' collision box. After reading a bit, it seems the box is a rectangle of width 8 pixels and height 30 pixels when standing/running/jumping or height 16 pixels  when in ball form, with the box centered on Samus' object position in all cases. Is this correct?

II:
Regarding Samus' collision box. Does anyone know where the hotspots/tracers/sensor points used to sample/probe the tilemap for collisions are located? (relative to her center, object possition, or topleft or whatever). I have a rudimentary idea, assuming the collision box above (outlined in green) and with red pixels as possible hotspots:

but I don't know where they actually are

III:
Is it correct that collision with the tilemap is only checked every 8 pixels?

IV:
It seems each sprite frame during animation lasts 3 render frames, except when spin jumping or in ball form, where it lasts 2 frames, is this correct?

V:
What is Samus' maximum horizontal movement and vertical movement per frame? I honestly can't figure this out, it seems to be about 2 pixels for horizontal and maybe 6 pixels for vertical?

VI:
Related to that above, anyone know the formula used for calculating number of pixels to move samus  in each direction when starting movement from rest? I mean how acceleration and velocity is used to calculate displacement as a function of how many frames have passed holding the left, right, jump key, or falling? I know this is probably way too complicated, but an approximation would be useful too. I've been trying to use Mesen to step through each frame but I can't figure out how the different counters and such relate to actual pixels moved, and the disassembly code I can't make sense of.
My buest guess for horizontal movement is
displacement/frame = [0, 0.25, 0.5, 0.75, 1, 1.1, 1.2, 1.3, 1.4, 1.5],
but with friction and turning I have no idea.