Me and my friend are aspiring Indie Game devs. and we're hoping to get some help. As the developer of the duo (him being artwork and music), I need to create a physics engine for the game. I am sure there are some out there, but I think building one will be best for me. If anyone could direct me towards a tutorial, book and/or any learning utility for this project, it will be most appreciated. Though it isn't my first choice, suggestions for 2D/8-Bit physics engines would be great (links, please?). Again, thank you in advance for helping.

One word - Steam. Physics engines are very difficult. If you want to do your own, you will need to work on your maths (calculus) skills. Anyway, remember that Google (search) is your friend! :-) And do have fun!

I understand that I need to have certain math skills and of course, the first place I referred to was Google. Please do not let my picture decieve you. :) Anyway, I don't understand what you mean by Steam? Are you saying that Steam offers Physics/Game engines? Thank you for replying, by the way.

I think what rubberman meant by steam is a digital distribution, digital rights management, multiplayer and communications platform developed by Valve Corporation. The most popular game on steam is Counter Strike 1.6.

The physics engine is actually the easiest thing you can possibly do when designing a 2D game like you describe, especially if the framework of the game engine is written in such a way that time is cut up into "ticks" and the physics updates on each of these ticks (as opposed to writing the graphics/sound portion which 99% of the time requires you to use somebody else's library). Unless you're going to be doing crazy stuff like rotating boxes crashing into one another and having to deal with center of masses, etc, then you only need to have a basic knowledge of physics in order to do this sort of thing.

Each moving object will probably have to have its own position variable, both x and y. They will probably have their own velocity value, both x and y. If it's a falling object, increment the y velocity by a constant amount each during physics step to apply gravity. After that, you'll increment the position value by the object's velocity to move it, and do some collision detection to make sure you're not going through objects. This is basically what you'll be doing.

We don't know how much you have done so far, but what you'll be doing also depends on if you're writing a simple game engine from scratch or using something written by somebody else.

@Tumlee Well, me and my friend have not necessarily decided on what the game is about, what is going to happen, etc. All we do know is that I need the basic understanding and ability to make an engine. I do have one more question though. How would you compile it? On Windows, I compile all my c++ using the GNU GCC Compiler and command prompt. If I were to make the engine and game and such, how would I compile and/or run that? Thank you for helping, by the way.

You can use whatever compiler you want. Obviously, you would have to link in whatever libraries you are going to use for the graphics, sound, and timing (something like SDL, DirectX, etc.) If you're doing this all through the command line, you'll have to google the exact command line switches you would use to do that, because I personally use an IDE for all that stuff anyway.

The "game engine" is basically the code you've written that ties all those timing, graphics, and sound functions together in such a way that they can be used to build a game (I'm sure there are plenty here who would disagree with me on definition). For example, the main loop that waits a specific period of time and skips frames if the game is falling behind would be part of the "engine". It could be just a collection of .cpp and .h files that you include with your project, or it could be a library you've put together beforehand.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.