News:

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

Main Menu

Super Metroid engine in Construct 2, need help on movement values.

Started by BigSharkZ, April 05, 2014, 04:48:18 PM

Previous topic - Next topic

BigSharkZ

Hi there everyone! I've started understanding how Construct 2, a game maker, works and my idea was to make a literal Metroidvania game. Basically, Samus in a modernized Dracula's Castle. At first I wanted to add Alucard as well, but then I scratched the idea and instead opted for Zero Suit Samus with Belmont gameplay and then being able to play with the Power Suit with Super Metroid controls.

Problem is, I need help related to her movements. Does anyone have data, in pixels per second, of stats such as maximum speed, acceleration, deceleration, jump strength, gravity, maximum fall speed and more (for when she gets additional items, is in water, etc.)? I've been doing this so far through trial and error as I'm more of an artist than a programmer, but if anyone could provide me with those values then it would be greatly appreciated, I could also credit you if I ever get to finish this in the far future.

Thanks in advance!


Crashtour99

LOL  I was just about to post that Smiley.

The main thing to remember BigSharkZ is that in Super Metroid the physics engine does calculations based on pixels/sub-pixels per frame movements (NTSC version runs at around 60 fps), and there are additional modifiers for momentum based on movement type.  That table should have everything you need though to replicate the physics.  Best of luck to ya in your endeavors.  I'm interested to see what this creation of yours will be like.

BigSharkZ

Awesome, thank you both, I greatly appreciate it. However, I'm not too sure about how this data works (I'm a quick learner though so I shouldn't be bothering you lot too much!). For example, this:

ORG $909F07  ;samus running horizontal speed acceleration (sub-pixels/frame)

That is an hexadecimal value, correct? And a sub-pixel is 1/2 of a pixel? If so, would that make it, in decimal, 4738947.5 pixels per frame? If so, seems like a pretty big amount to me, but I feel like I am wrong, besides I haven't done hex editing in years. How would I go to convert that to pixels per second?

Zero One

Nope, ORG $909F07 is merely a location. The data you're looking for is underneath that:

DW $1000          ;air or with gravity suit
DW $0400          ;water no gravity suit
DW $0400          ;lava/acid no gravity suit

So the top one is, according to your math, 2048 pixels/frame, but I'd be willing to bet it's not that straightforward*. As for pixels/second, that'd depend entirely on the framerate of your game.

*When I say not as straightforward, it could be interpreted as 8 pixels/frame, or half a tile. There are instances where the bytes in the ROM aren't read left to right. It may be 10 00 in the ROM, but is actually 00 10 in game, if that makes sense. 0x0010 (16) sub-pixels/frame as opposed to 0x1000 (4096).

Crashtour99

A pixel is 65,536 sub-pixels (decimal).  A sub-pixel value of FFFF is one sub-pixel away from a whole pixel.  (Zero One, the pixel/sub-pixel values in SMs physics calculations are unsigned.  :P )

ORG identifies where in the ROM the assembler (usually xkas) should place data.
The information you're looking for will be the next lines down.

For example:
ORG $909EB9      ;vertical jump acceleration pixels/frame (includes springball)
DW $0004        ;air or gravity suit
DW $0001        ;water (no gravity suit)
DW $0002        ;lava/acid (no gravity suit)

0004 is the vertical jump acceleration in pixels/frame for when Samus is in air, or affected by liquid fx WITH the gravity suit.   So, 4 pixels/frame.  :wink:

BigSharkZ

Okay, thank you both for the clarification, I tested it out with my game running at 60 frames per second, and she seems to be running properly with a base speed of 120 pixels per second (420 in speed boost) and an acceleration of 480. Are those the correct values?

I'll be trying to replicate her jump values now, thanks again! This is still in very early stages so I unfortunately do not have any preview, but thank you for being interested. :)

JAM

Quote from: BigSharkZ on April 05, 2014, 05:56:27 PM
Okay, thank you both for the clarification, I tested it out with my game running at 60 frames per second, and she seems to be running properly with a base speed of 120 pixels per second (420 in speed boost) and an acceleration of 480. Are those the correct values?
Wrong.
Wrong.
Wrong.

165 for walking.
285 for running.
585 for running with speed booster.

Acceleration is wrong too.