Relating to the motion of objects through space and time. Including concepts such as acceleration (thrust and gravity), mass, collision response, friction and more.

learn more… | top users | synonyms

171
votes
9answers
43k 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 ...
22
votes
2answers
11k 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 ...
14
votes
7answers
17k 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 ...
62
votes
5answers
24k views

Good 2D Platformer Physics [closed]

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 ...
10
votes
3answers
7k 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 ...
18
votes
5answers
14k views

How can I implement gravity?

How can I implement gravity? Not for a particular language, just pseudocode...
4
votes
3answers
3k views

Why is my velocity decaying?

Programming in Java. Tinkering around with physics. My entities all have position and velocity. In the main loop, all I'm doing is applying gravity and bouncing off the edges, like so: // add ...
12
votes
4answers
2k views

How do I calculate rotation caused by bounce friction?

Following on from my previous question: I have the ball quite realistically bouncing from surfaces it hits. Now I'd like to make it spin from the friction of the hit. Showing this is simple enough: I ...
22
votes
5answers
6k 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 ...
46
votes
7answers
5k 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 ...
17
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 ...
6
votes
1answer
964 views

How do I detect ledges?

In my game, I'd like my character to be able to grab and hold onto ledges, and to be able to pull themselves up if there's room to do so. How do I detect if there's a ledge, and if the character has ...
8
votes
5answers
4k views

How do I detect the direction of 2D rectangular object collisions?

After this question, I need some more help. How can I find out which side of a rectangle a collision came from and react accordingly? The blue arrows are the paths that some circular objects ...
4
votes
4answers
2k views

Which Side Was Hit?

I am working on an Android game and I have two objects A and B (both rectangles) and when they collide I simply want to know which side of B was hit. I have detected the collision fine, but I am ...
9
votes
3answers
619 views

Impulsioned jumping

There's one thing that has been puzzling me, and that is how to implement a 'faux-impulsed' jump in a platformer. If you don't know what I'm talking about, then think of the jumps of Mario, Kirby, and ...
5
votes
3answers
4k views

Determine Resulting Angle of Wall Collision

So I have an object moving in a direction towards a fixed horizontal or vertical wall. How do I compute the angle that the object should bounce off at? The object can approach the wall at an arbitrary ...
41
votes
3answers
1k 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 ...
32
votes
6answers
5k 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 ...
11
votes
2answers
942 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 ...
11
votes
2answers
876 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?
16
votes
2answers
4k views

Why is RK4 better than Euler integration?

At the end of these great slides, the author compares all the different integrators presented. One way or another, they all fall short except for Improved Euler Integration and Runge Kutta 4 ...
11
votes
3answers
726 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
1answer
3k views

Angle of Reflection

I have this "Breakeout style" game. I have a cannon at the center, blocks around the cannon and pads around the blocks. This is how the game looks like: I've managed to get the collision per ...
18
votes
4answers
4k 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 ...
12
votes
3answers
1k views

Where to start for implementing vehicle physics? [closed]

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 ...
8
votes
5answers
1k views

How can I simulate shattering glass?

I need to make a simulation with stone thrown through a glass window. How can I accomplish that? I mean, I was thinking about making a 3D model of a stone and glass in 3D Studio Max 2012, shatter the ...
5
votes
3answers
2k views

Resources to learn programming rigid body simulation

Where I can start learning about simulating rigid bodys 2d and 3d ?
11
votes
4answers
3k views

Physics engine recommendation which can simulate pool game correctly? [closed]

I'm making a pool-game like game. This game requires correct (or very accurate) reflective bounces. I tried Box2D and Bullet Physics, but they both have this problem. If there is a wall on top of ...
8
votes
3answers
973 views

Are collision detection always O(n^2)?

Are physics engine able to decrease that complexity, for example by grouping objects who are near each other and check for collisions inside this group instead of against all objects ? (for example, ...
6
votes
2answers
663 views

Show path of a body of where it should go after linear impulse is applied

I am making a game with Andengine and Box2D. I have a dynamic body and I apply linear impulse on the body to move it around when the user have touched the screen. Now I want to show the path where ...
4
votes
1answer
1k views

Friction in 2D game

I'm developing a 2D platformer, although this question could probably apply to just about any 2D type physics; What is the equation for friction? I have sort of a hacky type of friction set up in my ...
3
votes
2answers
355 views

How to account for speed of the vehicle when shooting shells from it?

I'm developing a simple 3D ship game using libgdx and bullet. When a user taps the mouse I create a new shell object and send it in the direction of the mouse click. However, if the user has tapped ...
2
votes
1answer
199 views

Using Box2D for range detection?

I have two entities. One has a sword, one has a bow and arrow. When the bow entity is 100 units away, he needs to begin attacking. Likewise, when the sword entity is 10 units away, he needs to begin ...
42
votes
3answers
9k 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" ...
33
votes
2answers
4k 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 ...
27
votes
6answers
7k views

About floating point precision and why do we still use it

Floating point has always been troublesome for precision on large worlds. This article explains behind-the-scenes and offers the obvious alternative - fixed point numbers. Some facts are really ...
26
votes
6answers
4k 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. ...
11
votes
5answers
1k 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
4answers
807 views

Run a physics simulation on both client and server?

I'm implementing a multiplayer asteroids clone to learn about client/server network architecture in games. I have spent time reading GafferOnGames and Valve's publications on their client/server ...
4
votes
1answer
2k views

The Physics behind 2D Platformer Games? [closed]

Is there any good book or tutorial that explains the physics behind creating a 2D Platformer game? Such as tile rendering, tile map reading, collision detection, camera movement etc.?
4
votes
2answers
414 views

Modular spaceship control

I am developing a physics based game with spaceships. A spaceship is constructed from circles connected by joints. Some of the circles have engines attached. Engines can rotate around the center ...
6
votes
2answers
2k views

How can I implement rectangle collision response?

I am working on a game in JavaScript and my current implementation of collision uses the shortest distance to push the intersecting object away, which isn't always correct. I've made this diagram of ...
2
votes
3answers
1k views

simplest way of making a sphere roll in a realistic way

rather than just moving a sphere across a plane, I want to make it roll like a ball. What is the simplest way of doing this? I assume it will have something to do with the circumference of the ball ...
7
votes
3answers
2k views

Finding the contact point with SAT

The Separating Axis Theorem (SAT) makes it simple to determine the Minimum Translation Vector, i.e., the shortest vector that can separate two colliding objects. However, what I need is the vector ...
6
votes
2answers
672 views

“Super meatboy”-ish replay

I'm making a platformer built from mini-levels - and I want to create a sort of a replay of all the player tries that the player did for the level. My question is - what is the best way to record the ...
6
votes
2answers
4k views

how to ignore physics collision of some objects in box2d

I know this sounds silly but I would like some objects to follow physics while others not to collide each other. I tried to achieve them by setting their position exclusively. But then it will ...
6
votes
1answer
1k views

Character bouncing off ground due to gravity

Implementing gravity in the game, the character keeps bouncing up and down slightly when he hits the ground, upon debugging the character is essentially bouncing on and off the ground. Not quite sure ...
4
votes
2answers
398 views

What are the properties of “position, velocity, acceleration, rotation” collectively named?

They say naming things is one of the hardest problems in computer programming. They were right. Given the pseudocode below, what is a more appropriate name for this collection of properties? ...
4
votes
1answer
2k views

New Vector Calculation for Elastic Collision of Circle and Fixed Rectangle

I am writing a fairly simple breakout-style game for Android phones. I have successfully detected the collisions between the ball(s) and bricks. The problem that I am having is in calculating the new ...
1
vote
3answers
559 views

How to move around a player in a curved tunnel?

In a scenario where the player moves freely along the walls of a tunnel (like this), what is the best way to move the player along the walls of the tunnel? I'm using Unity3d game engine. I've tried ...