# Consistent Space Gravity Simulation

I have done some reading into this subject but haven't been able to come to a conclusion that I'm really satisfied with so far, so here is the situation. I have a game set in space, its top down and essentially 2D as far as physics is concerned and it revolves around the gravitational interaction between planets and black holes. I'm using Unity, so I have the ability apply forces to bodies. However, I have to do all the gravity calculations myself... This is where I get stuck.

Now it's not the maths that I'm having trouble with, maths I can do, its general game "feel" that is the sticking point. Originally I tried Newtons standard gravitational equations but I found that to a general user they produce unexpected behaviour. If you place two different mass planets on either side of a central black hole, both the same distance away, they will reach the central black hole at the same time (which "feels" odd). I also played around with more primitive implementations that just manipulate distance and mass in different ways but I always ended up with the same issue; as the planets im using undergo dramatic shifts in mass over the course of the game, the effect of the black holes always starts off being overly erratic (at low body masses) and then moves to being overly sluggish (at high masses) giving the game a very inconsistent feel at the moment.

Has anyone run into the same issue here and come out with a good way of simulating gravity in space? Does anyone know of examples of where this has been done before? What are some things that I may have overlooked or may want to take into consideration in the calculations? Remember that realism isn't the main concern here, its game "feel".

I'm open to any and all suggestions here so don't hesitate to put forward any sort of crazy answers!

• If it "feels wrong" you can try treating gravity as a constant force per exerting body, rather than being proportional to the body experiencing the pull. Aug 5, 2014 at 14:14
• Do you also want to consider that, probably, objects nearer to a black hole are seen to move slowly from an outer eye due to the fact that immense gravity affects how time flows? Aug 5, 2014 at 14:45