Relating to the motion of objects through space and time. Including concepts such as acceleration (thrust and gravity), mass, collision response, friction and more.
120
votes
8answers
23k views
Fixed time step vs Variable time step
What is better for games when developing game loops, fixed time steps or variable time steps? What type of games are better with one or the other?
Variable time steps:
With variable time step, I ...
49
votes
5answers
14k views
Good 2D Platformer Physics
I have a basic character controller set up for a 2D platformer with Box2D, and I'm starting to tweak it to try to make it feel good. Physics engines have a lot of knobs to tweak, and it's not clear to ...
43
votes
7answers
3k views
2D Platformer AABB collision problems
I have a problem with AABB collision resolution.
I resolve AABB intersection by resolving the X axis first, then the Y axis.
This is done to prevent this bug: http://i.stack.imgur.com/NLg4j.png
...
39
votes
4answers
775 views
How to determine which thrusters to turn on to rotate the ship?
The configuration of the ship changes dynamically, so I have to determine which thruster to turn on when I want to rotate the ship clockwise or counter clockwise. The thrusters are always axis aligned ...
29
votes
6answers
3k views
Analysis of Mario game Physics [closed]
I know there's a breakdown of Sonic the Hedgehog physics found here, and I was wondering, does there exist a breakdown of any of the Mario games? Something similar to this but for Mario is what I'm ...
29
votes
4answers
2k views
Movement prediction for non-shooters
I'm working on an isometric 2D game with moderate-scale multiplayer, approximately 20-30 players connected at once to a persistent server. I've had some difficulty getting a good movement prediction ...
27
votes
2answers
2k views
Water/Ocean simulation and physics
I'm looking for some references about water simulation, and how to model it's interaction with bodies (like boats, ships, submarines).
I've found a lot of references on the visual aspects of water ...
25
votes
3answers
3k views
2D water with dynamic waves
New Super Mario Bros has really cool 2D water that I'd like to learn how to create.
Here's a video showing it. When something hits the water, it creates a wave. There are also constant "background" ...
25
votes
2answers
878 views
How'd they do it: Destructible environments in BF:BC2 and BF3
How did the folks at Dice create the destructible environments in the more recent Battlefield games?
Did they just assemble the buildings out of predefined sub-regions that break apart when there is ...
22
votes
4answers
2k views
Momentum and order of update problems in my physics engine
This question is a "follow-up" question from my previous one, regarding collision detection and resolution, which you can find here.
If you don't want to read the previous question, here's a ...
22
votes
7answers
4k views
About floating point precision and why do we still use it
Floating point was always troublesome for precision on large worlds.
This article explains behind-the-scenes and offers the obvious alternative - fixed point numbers. Some facts are really ...
21
votes
6answers
2k views
Implementing a wrapping wire (like the Worms Ninja Rope) in a 2D physics engine
I've been trying out some rope-physics recently, and I've found that the "standard" solution - making a rope from a series of objects strung together with springs or joints - is unsatisfying. ...
19
votes
2answers
915 views
Correctly Implementing a “Double Jump”
I'm working on a 2D iPhone game using Corona (Trial version, so I can't use their forums). The game involves the character falling through the sky, and I'm trying to implement a "double jump" for the ...
18
votes
3answers
5k views
Is there a 2d physics engine that can model fluids and gases?
At this point the platform and programming language don't matter I would just like to know if something out there exists for this. Any help is appreciated.
18
votes
6answers
1k views
Data structures for interpolation and threading?
I've been dealing with some frame-rate jittering issues with my game lately, and it seems that the best solution would be the one suggested by Glenn Fiedler (Gaffer on Games) in the classic Fix Your ...
16
votes
2answers
3k views
How to make a character jump?
I am currently making a game in C# using Direct X 9.0. The game remake is Donkey Kong NES. I have nearly everything completed, but I am having problems with the physics of Mario's jump. I have ...
16
votes
1answer
541 views
Recreating retro/NES style physics with intentional imprecision
Background:
I'm having a problem getting the jump curve correct for a retro platformer remake project of mine. The original game is for the NES, and the player's velocity is stored in two separate ...
16
votes
4answers
2k views
How to deal with corner collisions in 2D?
I'm writing a top down 2d XNA game. Since its my first I'm trying to write the physics and collision stuff myself to learn it.
Whenever my player sprite character attempts to move into a position ...
15
votes
6answers
1k views
AI control for a ship with physics model
I am looking for ideas how to implement following in 2D space. Unfortunately I don't know much about AI/path finding/autonomous control yet.
Let's say this ship can move freely but it has mass and ...
14
votes
2answers
3k views
How are physics or graphics components typically built in a component-oriented system?
I have spent the last 48 hours reading up on Object Component systems, and feel I am ready enough to start implementing it. I got the base Object and Component classes created, but now that I need to ...
14
votes
3answers
527 views
Solids as high viscocity Liquids
A friend of mine and I were discussing different idea for allow materials in a world to be destroyed in a very piecemeal fashion and he proposed the idea of representing solids as very viscious ...
13
votes
5answers
4k views
Lag compensation with networked 2D games
I want to make a 2D game that is basically a physics driven sandbox / activity game. There is something I really do not understand though. From research, it seems like updates from the server should ...
13
votes
3answers
2k views
What is a good book on physics for game development?
I'm looking for a good beginners' book on the subject of physics in game development. Something that focuses on 2D games would be preferable.
13
votes
3answers
799 views
Pros and cons of different integrators
When creating things like physics in games you need an integrator. I've seen Verlet integration mentioned several places as a great alternative to Euler integration. For instance in the famous ...
13
votes
1answer
1k views
Any fixed-point portable open-source 3D physics engines?
I'm looking for a fixed-point 3D physics engine (basic kynematics and collision detection-resolution... nothing too fancy.)
I need fixed-point math because I'd like to have deterministic results, for ...
12
votes
3answers
608 views
Resolving a collision with forces
In my 2D physics engine, I can detect AABB vs AABB collisions, and resolve them by finding the shortest penetration vector and adding it to the AABB's position.
Doing this "pushes" the first AABB ...
12
votes
3answers
2k views
2D game collision response: SAT & minimum displacement along a given axis?
I'm trying to implement a collision system in a 2D game I'm making. The separating axis theorem (as described by metanet's collision tutorial) seems like an efficient and robust way of handling ...
12
votes
1answer
879 views
How do I simulate a doppler effect in a game?
I am trying to simulate the doppler effect in a game (a car racing game). I am not using a specific sound library that simulate the effect, I only have a callback function where I mix the data.
I ...
11
votes
4answers
613 views
How to get object to lose less velocity as its speed increases
I'm developing a game in Flash and I need a little help. It can be considered a math problem.
My object is flying with speed X and my object can collide with stones. When it collides with a stone, I ...
11
votes
5answers
5k views
How can I implement gravity?
How can I implement gravity? Not for a particular language, just pseudocode...
11
votes
3answers
1k views
Pretty open source game/rendering engine?
It might be outside the domain of open source (as there isn't much in the way of open source games that would want/need to implement all these) but is there an existing open source game or rendering ...
11
votes
3answers
470 views
Gravity strength in first person games
In our game, we set the acceleration due to gravity to the appropriate value of 9.8 m/s^2. Although physically correct, it feels more like moving around on the moon.. It feels about right at a value ...
11
votes
2answers
2k views
In a 2D platform game, how to ensure the player moves smoothly over sloping ground?
I'm developing a physics engine for a 2D platform game. I'm using the separating axis theorem for collision detection. The ground surface is constructed from oriented bounding boxes, with the player ...
11
votes
1answer
369 views
Pathfinding on a uneven planetary surface
My question is what would be the best approach to pathfinding on an uneven planetary surface?
Background Information
I have created a planet from displacement mapping 6 sphere projected planes. ...
10
votes
7answers
10k views
How do you calculate where a ball should go when it bounces off the bar?
I'm trying to wrap my head around this very Hello World-y problem in game development. I've created a TicTacToe game in XNA so I guess the next step would be a breakout clone.
Keep in mind that I ...
10
votes
3answers
647 views
Random map generation - strategies for scattering/clustering random nodes
I am doing a simple 4X strategy game in space where each node is a point-of-interest (a planet, an asteroid and etc.).
To randomly generate a map, I would follow the steps below
Decide how many ...
10
votes
3answers
334 views
How to implement collision detection of portals?
For example, take this scenario (excuse my horrible drawing skills):
This is based on "Portal", where the stickman is going through the blue portal (which is linked to the red portal), but there is ...
10
votes
4answers
2k views
Physics engine recommendation which can simulate pool game correctly?
I'm making pool game like game. This game requires correct (or very accurate) reflective bounces.
I tried Box2D and Bullet Physics, but they have this problem.
If there is a wall on top of this ...
10
votes
3answers
482 views
Animated examples of different interpolations formulas: any link?
I remember having spotted a link to a huge page with different equations to non linear interpolation curves, for example if you want to stop a car smoothly, etc.
Those can sometime be useful to ...
10
votes
3answers
4k views
Is there an algorithm for a pool game?
I am looking for algorithm to calculate direction and speed of balls in a pool game. I am sure there has to be some type of open source code for this since pool games are some of the oldest computer ...
10
votes
1answer
520 views
How does pixeljunk shooter simulate its liquids?
I am really impressed by the liquids in pixeljunk shooter. I would love to know how they do it.
10
votes
5answers
834 views
How could you parallelise a 2D boids simulation
How could you program a 2D boids simulation in such a way that it could use processing power from different sources (clusters, gpu).
In the above example, the non-coloured particles move around ...
10
votes
2answers
572 views
Resources of realistic water simulation?
I want to study water simulation, with a a demo with source code which using physically-based methods(Eulerian approaches or Lagrangian approaches).
How can I get some examples?
10
votes
1answer
1k views
Should I write my own physics engine, because of networking integration?
I'm currently developing a top down, realtime, zombie shooter. I'm coding this in Java, using JBox2D as my physics engine. I have been coding the networking this week, and am now up to the physics ...
10
votes
2answers
346 views
Implementing a homing missile [duplicate]
I'm having some trouble implementing a homing missile that satisfies what I'm looking for. I have already tried the Seeking and Arrival behaviours described in this link, but none of them were what I ...
9
votes
6answers
2k views
Ball Physics : Smoothing the final bounces as the ball comes to rest
I've come against another issue in my little bouncing ball game.
My ball is bouncing around fine except for the last moments when it is about to come to rest. The movement of the ball is smooth for ...
9
votes
4answers
1k views
How do fluid dynamics work?
How would I go about implementing fluid dynamics in a game, such as can be seen in this video?
9
votes
4answers
1k views
When should I use a physics engine?
Since I found out Box2D, I'm using it for kind of any game-like application I try to write, from very small prototypes or small programs to test something, to actual projects.
Thanks to it it's so ...
9
votes
1answer
258 views
Getting a 2D “pixel” cloud to follow a mouse
I'm working on a 2D game trying to get a "cloud" of a few hundred tiny cubes or discs to follow my mouse cursor without overlapping each other.
However, using the physics engine introduces ...
9
votes
3answers
759 views
Where to start for implementing vehicle physics?
A little background for myself. I am relatively experienced with 3rd part physics engines such as Havok, Box2D, Bullet and have successfully integrated them in custom engine(s). I have also made a ...
