ID:1011206
 
I've been working on this platformer framework for a week or so now. Using my multitude of Megaman graphics I have lying around, I couldn't help by at least try to imitate actual Megaman physics. What I've found particularly is that I can't seem to get the jump quite perfect. I've worked on it a lot and I think it's at a point where it's pretty darn close. I lowered the FPS to 20 (it was first 30, then 25) because I want it to perform optimally over a network. I'm gonna put the link to the game at the bottom for you to try out.

Secondly, I've been experimenting with different layers in the background that move at different speeds. I'm not sure if it's been done on BYOND, but I've found my method to work great even over a network.

All I do is create an object which outputs images to you and follows you around, offsetting itself by a certain amount depending on how fast it moves with you.



There's a screenshot. You'll notice you have the foreground: the towers, the floor, the blocks, and the fence. Below that you have the different layers: the two clouds move the fastest, the big cloud cover at the top moves slightly slower, and the cityscape in the background moves the slowest.

Here's a link to the game itself: Click me

S is to jump, F is to shoot. Move with the arrow keys.


Any opinions on how to make the physics better is appreciated.
All I did was look at the screenshot and all I can say is wow.

This is a framework? Does that mean I can use it to make my sidescroller dream come true? I must ask does Diagonal movement (up ramps) work and how is the gravity?

I will edit with more after I finish reading the post lol...

Edit: As for physics, perhaps tie everything to a weight class that defines how fast they fall and move.
There is no ramp movement, no. At least not yet, but it is planned. I also wanna add in ladders soon.

And I may release it in a less Megaman-y form eventually. I'm not sure though. As of right now it's just something I'm working on, trying out all different concepts to put together a side-scroller framework that works for me.
In response to Fugsnarf
Fugsnarf wrote:
There is no ramp movement, no. At least not yet, but it is planned. I also wanna add in ladders soon.

And I may release it in a less Megaman-y form eventually. I'm not sure though. As of right now it's just something I'm working on, trying out all different concepts to put together a side-scroller framework that works for me.

Okay well if you're interested in making it into a game I have had a design waiting for awhile now. Page me if interested.
I love how you implemented different jump heights based on how long you hold down the button, but the reversal of motion happens too fast (i.e. instantly). Unless this is original megaman behavior (didnt play enough to remember) that you want to keep, I would suggest having the player continue going up for another step or two after releasing the jump key. If you just tap S it looks like you smack your head on something :)

Otherwise I think it works quite well. I will note that the brown platforms look really bad against the towers though :D
In response to Magicsofa
It actually isn't instantaneous, there's a small cushion of two pixels before you go full speed. Any more and it looks like you're moon jumping, any less and it looks like you're a pile of bricks falling suddenly.

That is, I must admit, something I've been having issues with. Finding the balance between changes in velocity and the speed and intuitiveness of Megaman game-play.
Well it looks fine when you jump higher, in any case tapping S won't get you over a 1-tile obstacle so you might want to change that :D
FYI: FA's SS library has had multiple background layers from pretty early on, IIRC. It's a couple lines of code to get them moving at different speeds.
Ah, didn't know that. How did he go about it? I know screen objects would not be the best option for this if I want the game to play well over a network.
if it was one huge icon with a million states, it'll run just fine XD
I'm going to assume this flash game mimics Megaman physics properly: http://www.2flashgames.com/f/f-233.htm

The difference seems to be that your jump has only two, maybe four velocities, but Megaman's jump is actually a continuous (very fast) deceleration. Instead of moving the avatar up by say, 5 pixels, for half a second, and then moving him back down by -5 pixels for half a second, you want to move him by intervals of say, 5, 4, 3, ..., 0, -1, -2, ... which would result in a smoother "more physically correct" jump.
What you're saying seems accurate. I definitely was noticing the faster deceleration.

I'll have to try that and see how it looks and feels.
In response to Fugsnarf
The key is true acceleration, which is the change in velocity over time, which is the change in position over time. If velocity starts out upward (the beginning of a jump) and the acceleration is a downward constant, then you get proper projectile motion.

In code, this translates to:
var vy = 10
var g = -1

while(1)
vy += g
step_y += vy
sleep(world.tick_lag)
The only problem I see with this is that it's starting out by moving the player by the greatest amount of pixels. This would be pretty "jumpy" looking as he would bounce upward a large amount when you tap the button. Megaman's jumps were very responsive, there wasn't a big wait to gain velocity; but he also didn't bounce upwards by a lot initially when you tapped the jump button.

Also @Toadfish: That flash game does not replicate Megaman's physics very well.
In response to Fugsnarf
On the contrary, it's realistic. Once you're off the ground, you don't speed up at all.
Well, Megaman is not realistic at all from that standpoint. On the other hand, it's fun to play and responsive. That's what I'm going for.
Just played your demo. In my opinion, I think the transition from jumping to falling should be just a little smoother. That and the fall speed you've got seems rather slow. Just my two cents.
That demo is actually pretty old. I've updated it to reflect how I've changed the physics since I first posted this. For one, the movement speed was decreased as it was way too fast. For two, I did change the jumping velocities a lot since then. Granted, it's still not perfect and I'm working on what Toadfish and Kaio suggested.

http://files.byondhome.com/Fugsnarf/ Megaman%20Files%20Update.zip
Speed up the fps a bit!
I would, but I'm trying to make this game work as well as it possibly can over a network. Originally it was 30 fps, but I lowered it to 25. I then lowered it to 20 to see the difference and noticed that the difference actually was pretty significant without losing too much game-play-wise.
Page: 1 2 3