Time based movement Vs Frame rate based movement?

silent
  • Time based movement Vs Frame rate based movement? silent

    I'm new to Game programmming and SDL, and I have been following Lazyfoo's SDL tutorials. My question is related to time based motion and frame rate based motion, basically which is better or appropriate depending on situations?. Could you give me an example where each of these methods are used?.

    Another question I have is that, in lazyfoo's two Motion tutorials (FPS based and time based) The time based method showed a much smoother animation while the Frame rate based one was a little hiccupy, meaning you could clearly see the gap between the previous location of the dot and its current position when you compare the two programs.

    As beginner which method should I stick to?(all I want is smooth animations).

  • What's being shown as "FPS based" there is . . . well, basically, it's awful. It's pinning the game's speed to the performance of one particular computer. If you upgrade to a nice fast computer, your game will suddenly run in turbo speed, if you downgrade to a slower computer you'll be grinding around in slo-mo.

    The real choice is fixed time step vs. variable time step, and at that point I will defer to this excellent post which goes into great depth.

Tags
game-design c++ motion-control sdl
Related questions and answers
  • are examples of actual calculated interpolation value i.e. the proportion of the physics update that is complete at the time the frame is being drawn. I am going to have to change the draw code to draw the objects at a fraction of the distance between their previous and current value positions and rotations. That is yet to be done. Question: Will I also have to do move my collision detection code... my game working at the moment without interpolation. It does physics updates using fixed step time deltas. The frame display rate is decoupled from this. So, it might be doing 40 Physics updates per

  • I been working in the animation of a 2D platformer game in C++/SDL/OpenGL, and my team and I reach the point where we need to establish that every animation of the player (Walking, Running, etc... the movement and the changes of frames. To clarify what I mean I have in my Sprite class these parameters: std::vector< Vector2f > delayMovementSprite; std::vector< int > frameDelayPerAnimation...(); playerMoveInX = true; return; } playerMoveInX = false; } } And for the frames I have a class Animation which handles the following information: Uint32 frameRate, oldTime; int frameDelay

  • , this approximation could mislead the A* algorithm. For the LeastCostEstimate method : I just take the midpoint of the two sectors. So, as you understand, I'm always working with sectors' centers, and it's working.... Micropather exposes a pure virtual Graph class that you must inherate and overrides 3 functions. I understand how pathfinding works, so there's no problem in overriding those functions. Right now, my implementation give me results, i.e I'm able to find a path in my map, but I'm not sure I'm using an optimal solution. For the AdjacentCost method : I just take the distance between sector's centers

  • caps. Sweet. Still, I have some worries regarding possible Field of View and Line of Sight issues. C) The total overhaul variant. Or, I could just create borders and corners as separate containers...After spending time today to jot down some notes regarding the implementation of walls into my tile-based game, I've suddenly realized it's not going to be as simple as I imagined before. While... with doubling the existing wall. That's not desirable. Sure, I could include a procedure that forbids double-walling, but it will have a bad feel to it. B)The smart(?) approach. Instead of letting

  • to do that. The challenge is how to make the game activate the function efficiently. This is what I've thought of so far: The algorithm can calculate a lot of time steps in a short time, so I could... would simply have to follow predefined trajectories, no need for an algorithm. The timer object could take care of updating all the trajectories at the right times. Also, if you think...Suppose I have a Spacecraft object in 3D space, controllable by the player. I want it to update its own trajectory, so I give it a function for that (actually it might be inside a controller

  • Collision Resolution ultifinitus

    ," on the stack. What's I think is happening is the object's collision system checks and resolves for collisions based on creation time, so If I check one axis, then the other, the object will "sink... with a working algorithm, but I'd rather not =). So what in the heck do you think I should do? How could I change my collision resolution system to fix this? Here's the program (temporary link, not sure how... collision resolution is ridiculous! Currently I have a little formula like this: if (colliding(firstObject,secondObject)) firstObject.resolve_collision(yAxisOffset); if (colliding(firstObject

  • Possible Duplicate: Are there existing FOSS component-based frameworks? What open source game engines with component-based design of game objects do you know? And which best of them? I mean best not in Graphics or Physics, but best in context of Behaviour, Messaging, etc. This question is the result of inspiration by another question Thank you!!!

  • not seem to have joystick input support, which would require that SDL or some other library also be used. So my question can be summed up as this: What is the best way to get SVG and joystick...I'm looking into building a cross-platform opensource 2D RPG style game engine for ChaiScript. I want to be able to do all of the graphics with SVG and need joystick input. I also need the libraries I use to be opensource and compatible with the BSD license. I'm familiar with allegro, ClanLib, and SDL. As far as I can tell, none of these libraries have built in or obvious integration for SVG

  • 1st Question is I want to write a board game for iOS and Android so I'm coming up with CoronaSDK and AirPlay. Since I have a mac, development platform is not an issue but the problem is which one should I choose. I'm fluent with PHP and web languages and familiar with C but it's a new language for Lua. I know a lot of people prefer Corona but why not Airplay? It even provides more devices and able to write in C/C++. 2nd Question is I want a SDK with shortest development time and easier coding. I don't need complex 3D or animation engine since the game is a board game like chess or monopoly

Data information