Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

MMF Static Movement speed


bubblesnout

Recommended Posts

I'm getting back in to MMF for a bit of fun and I'm making a simple static movement engine that honestly works fine for what it's doing. I'm curious about how one could fine tune it if they had very specific requirements for the speed at which their character moves. The basic idea of it at the moment is simply as such:

Repeat while 'right' is pressed: set X to X+1.

Simple stuff. What governs the speed at which this happens though? At what frequency does this fire?

To add a level of control to this, I've added the 'Every' condition to this event, so it fires every 1 hundredth of a second, or every 2 hundredths of a second. This doesn't seem to be overly accurate though. As with that example, you'd expect that when I change it from firing every 1 hundredth of a second to every 2 hundredths of a second that the characters speed would be chopped in half. This is not the case, in fact it doesn't appear to change at all.

What sort of thresholds are there here? or am I thinking about this all in the wrong way?

I figure with the accuracy of the Sonic Worlds engine to the classic sonic movement it must be possible to be perfectly precise.

Link to comment
Share on other sites

An always command means once every frame... Any command currently met will count as always until it's not true. So in yours, its saying that after one second, your X speed will be 60, which is ridiculous. To put that in perspective, Sonic Rush tops off at like... 24-ish.

To control it, have X Speed be added to in decimals, like 0.2, instead of one. Whole numbers don't do it with static engine acceleration factor.

Link to comment
Share on other sites

Alright great, thanks for the clarification. So basically if my app is running at 60fps, then my character would move 60 pixels per second which sounds right. I haven't built any form of acceleration in so it's either moving or it's not (this is a top-down kind of game by the way, not a side scrolling platformer).

Thanks for letting me know how that works, clears things up a bit,

Link to comment
Share on other sites

Yeah that's right, so at the moment because I'm adding 1 pixel to Character.X (ie. a speed of 1), he would move 60 pixels every second. If I were to change this to 2, he would move 120 pixels every second. What I'm interested in then, is how I would go about having him move 90 pixels every second for example. Simply setting this 'speed' variable to 1.5 wouldn't work, an object can't move one and a half pixels.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...