Resources for 2d physics games

I am looking for good links to learn how to simulate 2d physics in games. I am not looking for a library to do this for me - I want to think and learn, and not blindly use someone else.

I did a little work on Googling, and although I found several guides on GameDev, etc., I find their tutorials difficult to understand because they are either poorly written or suggest a level of mathematical understanding that I don't already have.

For the specifics, I’m looking for how to simulate a top-down 2d game, like a tank fighting game, and I want to accurately simulate (among other things) acceleration and speed, the accumulation of heat from components, “collisions between models and level boundaries and missile-type weapons”.

Sites, recommended books, blogs, code examples are all welcome if they help to understand. I am considering using C # and F # to create my game, so code examples in any of these languages ​​would be great, but don't let the language stop you from posting a good link. =)

Change I don’t mean that I don’t understand mathematics - this is more than the case when I don’t know what I need to know in order to understand the systems involved and “I really know how to find resources that will teach me in an understandable way.

+42
c # f # 2d physics
Oct 03 '08 at 2:13
source share
8 answers

Here are some resources that I collected a few years ago. It should be noted the integration of Verlet. I also include links to some of the open and commercial physics engines that I found at the time. There's an article on stack overflow here: 2d game physics?

Physical methods

the books

  • "Developing a game physics engine," Ian Millington - I own this book and highly recommend it. The book builds a physics engine in C ++ from scratch. The author begins with the basics of particle physics, and then adds the "laws of motion", restrictions, solid state physics, and so on. It includes well-documented source code.

Physics Engines

+19
Oct 03 '08 at 7:20
source share
+7
Oct 03 '08 at 3:47
source share

Speaking from experience, introducing a 2D physics engine is quite difficult. I will tell you in detail about several steps that I took when creating my engine.

  • Collision Detection. Collision detection can be a difficult problem, even if you are not dealing with 3D worlds or network simulators. For 2D physics, you definitely want to use the separation theory of axes . After you implement SAT, you will halfway make the dynamic part of your engine.

  • Kinematics / Dynamics. Chris Hecker wrote an excellent online resource that went step by step through the response to the collision.

  • All the rest. Once you learn about the detection / response to a collision, it is a matter of implementing everything else that you want in the engine. This can include friction, contact forces, joints, and anything you can think of.

Good luck Creating your own physics simulation is an incredibly rewarding experience.

+6
Mar 10 2018-11-23T00:
source share

This is a great tutorial that demonstrates the concepts of 2D physics using flash memory and is not relevant to flash memory. http://www.rodedev.com/tutorials/gamephysics/game_physics.swf

+3
Oct 14 '08 at 20:44
source share

Even if you want to learn all of this from the bottom up, the open source library, which is well-coded and documented, contains much more information than a book. How can I handle situation x ... find in files can be faster than paper index.

Original answer:

What Box2D is not mentioned? His open source project is a blizzard employee, has a good community, and works well.

In my (brief) experience with Box2D, integrating it with Torque Game Builder, I found the API clean to use, the documentation was clear, it supported all the physics objects that I expected (in particular, joints), and the community looked friendly and active (around the beginning of 2010).

Judging by the posters of the forum, it also turned out that the managers were susceptible to the initial fees (which did not carry licensed baggage).

The solver on the island was pretty fast, as I expected from its reputation, and not because I did some serious performance testing.

+3
24 Oct '08 at 0:13
source share

F # has a function called Units that does size analysis for you, providing errors if you make a mistake. For example, if you say:

let distance : float<meters> = gravity * 3.0<seconds> 

This will give a compilation error, since gravity is <meters / second ^ 2> meters>. In addition, since F # is just .NET, you can write your mathematical / physical code in the class library and reference it from your C #.

I would recommend you check out these blog posts for more information:

+2
03 Oct '08 at 17:54
source share

This is a great resource for writing your first engine. It is in 3D, but it is very easy to convert to 2D. I know at least one large company that followed this guide for its internal engine, and I personally followed its steps for my own engine. It explains all the basic concepts of physics in spring / momentum physics and shows you how to write your own intergrater.

+1
Oct 18 '08 at 17:33
source share

F # .NET magazine has published two articles about this:

0
Feb 19 2018-10-19T00
source share



All Articles