Game development: Gravity based space mining game

A few weeks ago I mentioned that I would be working on a game where the player would have a small space ship which you use to explore a universe of randomly generated planets of different sizes and densities, consequently resulting in different gravitational forces. I’ve found some time to work on this and came up with a very basic prototype:

Gravity based planet mining game

Using the built in physics engine that comes with Gamemaker, I’ve managed to make it so that every individual block attracts the ship through gravitational pull. The idea is that these blocks with their built in gravity can be used to create randomly generated planets. So far, it works well when I have two separate blocks, each block attracts the space ship, and the gravitational pull becomes stronger as you move closer. However, when I create a cluster to form a planet out of these blocks (as above), it seems to mess up the physics, and the forces the planet applies to the ship becomes erratic and unpredictable.

If I do decide to pursue this further I’ll definitely have to sort out this issue.


2 thoughts on “Game development: Gravity based space mining game

  1. Do all the blocks have the same “gravity” force individually? If so this will cause all sorts of havoc!

    It might be good to run a check in each block; if it’s next to another block it doesn’t exert its own gravity force. Perhaps the centre block of each world could be the gravity ’emitter’ and it could count how many blocks are attached to it and amplify the gravity accordingly?

    1. Yes, each block has the same gravity force, it was one of those ideas that made sense in my head but didn’t work so well in practice. Good suggestion though, I’ll give that a try!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s