Fast Moving 2D Animation Tricks ?

Started by
10 comments, last by Bad_Maniac 21 years, 6 months ago
First things first: MS Visual C++ 6.0 DirectX 8.1 SDK (DDRAW7) Windows XP pro FAST PC/256Mb RAM Right, I've been checking out a lot of tutorials, checked through some books at the library, and found that they all recommend running your average 2D scroller in 30fps. Locking it to that is not a problem, I just let my windows message handler take up those extra cycles for now. =D It does have a drawback though. If I want something travelling REALLY fast, say 90 pixels per second, that's 3 pixels per frame. and that looks JERKY and BAD! Just post briefly how you have solved this problem either using neat tricks or other angles to tackle the problem. and uhm, I'd rather not up the framerate to 60 or even 75 fps, since... I want my game to run on old(ish) computers, and it should. I just want the animations to look nicer. So any ideas? It''s nice to be important, but it''s more important to be nice. [edited by - Bad_Maniac on October 2, 2002 5:51:32 PM]
Don't we all still remember and miss the day we plotted our first pixel?
Advertisement
I don''t know who told you to run a 2D scroller in 30fps but that is complete rubbish. You need 50fps+ for a 2D scroller to look smooth unless you do motion blurring.
The best way to get this running quickly on older computers is to support lower resolutions - i.e. get the required fillrate down.
Motion blur,

I think 30fps is fine for a 2D game.
Why lock it to 30fps at all?

Let the system do as many fps as it can..
Sometimes the frame rate can actually establish the character of a game.

A 30fps game might have a different playability than a 60fps game just from the smoothness of the animation.

Who knows, it might have to do with the fact that movies play at 24fps.
It's not what you're taught, it's what you learn.
Why lock a game at 30 fps, well I want to do a very simple scrolling 2D game, and I want it to run on almost any machine. and well, if I don''t lock the fps the game will run too fast to play on fast Athlons, I would rather have it run the same speed on any system. And at the moment I do that by locking fps, not by timing.
I didn''t ask this to hear how stupid I am and how wrong my method is. it is the way all games have been made for about 10 years, so it''ll work for me.

Motion blur, any hints on that, or tutorials around?

It''''s nice to be important, but it''''s more important to be nice.
Don't we all still remember and miss the day we plotted our first pixel?
Letting the FPS go wild doesn''t stop you from having your game run reasonably on any PC. You can write your code so that the graphics are time-synched.

I agree with letting the FPS go crazy. 60 fps looks a lot better than 30..


Cheers!
------------------http://www.nentari.com
quote:Why lock a game at 30 fps, well I want to do a very simple scrolling 2D game, and I want it to run on almost any machine. and well, if I don't lock the fps the game will run too fast to play on fast Athlons, I would rather have it run the same speed on any system.


You can have the best of both worlds

In my game I when I'm moving a sprite, I create an "event" that keeps track of how fast it needs to move. For example, I'm creating an 2D tile-esque RPG, where every time the player hits an arrow key, their character moves one tile (16x16pixels).

Here's some pseudo-C


struct Step
{
pointer to the sprite it's moving
distance
start position
time length(amount of time the move should take)
delta (time length / distance)
time of last update
}

The delta time is the amount of time that needs to pass before the object should be moved one pixel.

Thus, every game loop I iterate through the steps:

void ProcessSteps()
{
For each step:
if(time of last update + delta < current time)
move the sprite one pixel
}


Oversimplified, but I hope it makes some sense.

[edited by - tls284 on October 3, 2002 3:28:01 PM]
quote:Original post by Waverider
Who knows, it might have to do with the fact that movies play at 24fps.


And movies are very jerky - just watch the background scroll by. You don''t notice it much because of the automatic motion blurring.

Locking the framerate has many advantages, and is much easier to program for, but 30fps is too low for a smooth scrolling game. Ideally you should lock at some division of the refresh rate. If all monitors support 60Hz, then lock at that.

I think there are some tutorials on motion blurring on this site, failing that try www.flipcode.com
If you draw textures with the characters, you could add alphablending to some trailing frames (dunno how ddraw would handle this, I don''t use dx). Say you want something to move 3 pixels, which you mentioned. Just add one or two alpha-blended images behind, or something. I don''t know how it will look, but it should work You better do some research on this anyway...
And I will _not_ discuss whether you should use fps-fixed or time-synced physics

This topic is closed to new replies.

Advertisement