2D Physics Engine for Mining Game

Started by
8 comments, last by venture 12 years, 7 months ago
Just curious about something. This would be for a project I would be starting in, at the bare minimum, 1.5 years(after I've experimented with programming and am sufficiently comfortable with it. So, no, I'm not planning on jumping into a complex project initially :wink:)



I was wondering if there was a 2D physics engine available that would be able to handle a mining game.

Essentially, 2D, "Minecraft-esque" but not based around blocks. Using a pickaxe, drill or other tool would dislodge and fragment earth, stone etc. which could then be placed by the player. Dropping a handful of dirt would cause it to fall and spread like, well, dirt.

Players would also have to reinforce their tunnels to prevent a collapse, and would have to process stone chunks into, for example, brick before they would be able to build.

Ideally, it would also be able to handle things like rock slides, pressurized oil underground and other such things.


Does a physics engine exist that will be able to do this? If one does not, I will either have to seriously re-think or scrap this project, as creating my own engine would be a monumental undertaking of which I will likely never be ready for.
Advertisement
What programming language are you considering? See if there's a version of Box2D for it. Box2D is a great physics engine that is free, open-source, and pretty easy to figure out if you understand basic physics concepts.
C++, if that matters.


I've done a bit of research, and was currently planning on going with Farseer, which appears to be based on Box 2D. I was just wondering if:
A. It has the capabilities I need(from what you are saying, it appears it does)
and
B. If there were any other engines I have missed.
Chipmunk physics is a great 2D physics library. It out performs Box2D. Box2D has been out longer, so it's more well known, but I'd check out Chipmunk Physics

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

Thanks. I'll check it out.

EDIT:

It looks really impressive! Thanks for the tip.

:)
I don't know anything about Chipmunk, but Box2D (and similar) libraries typically model rigid bodies. What you seem to be talking about are fluid dynamics, which AFAIK much more complex and processor hungry. The large worlds of Minecraft and Terraria depend on simplifying things by basing everything on cells (blocks), greatly simplifying physics, and even then need to be optimized. Here is an article about the use of cellular automata in these types of games, if you are interested.

I don't know anything about Chipmunk, but Box2D (and similar) libraries typically model rigid bodies. What you seem to be talking about are fluid dynamics, which AFAIK much more complex and processor hungry. The large worlds of Minecraft and Terraria depend on simplifying things by basing everything on cells (blocks), greatly simplifying physics, and even then need to be optimized. Here is an article about the use of cellular automata in these types of games, if you are interested.


Chipmunk is based on Box2D to my knowledge. Thank you for that article- reading it currently.

I still have a lot to grasp and figure out about this whole process but: to your knowledge, can what I desire be handled? And if not, could I replicate it, perhaps by scaling down the size of cells, or by other means?

[quote name='laztrezort' timestamp='1314074624' post='4852647']
I don't know anything about Chipmunk, but Box2D (and similar) libraries typically model rigid bodies. What you seem to be talking about are fluid dynamics, which AFAIK much more complex and processor hungry. The large worlds of Minecraft and Terraria depend on simplifying things by basing everything on cells (blocks), greatly simplifying physics, and even then need to be optimized. Here is an article about the use of cellular automata in these types of games, if you are interested.


Chipmunk is based on Box2D to my knowledge. Thank you for that article- reading it currently.

I still have a lot to grasp and figure out about this whole process but: to your knowledge, can what I desire be handled? And if not, could I replicate it, perhaps by scaling down the size of cells, or by other means?
[/quote]

No, it's not based on Box2D, he used some idea for his original implementation from box2d, but it's since been improved upon. The author made his own 2d physics implementation, and his latest release, v6.0.1 is really fast.

As far as what you want to do, it depends on the scale of "particles" you plan on using. If you can assign each piece of "earth" that becomes dislodged as separate body/shape, then you'll be OK. Otherwise, I'm not sure how you'd accmoplish what you want.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)


[quote name='laztrezort' timestamp='1314074624' post='4852647']
I don't know anything about Chipmunk, but Box2D (and similar) libraries typically model rigid bodies. What you seem to be talking about are fluid dynamics, which AFAIK much more complex and processor hungry. The large worlds of Minecraft and Terraria depend on simplifying things by basing everything on cells (blocks), greatly simplifying physics, and even then need to be optimized. Here is an article about the use of cellular automata in these types of games, if you are interested.


Chipmunk is based on Box2D to my knowledge. Thank you for that article- reading it currently.

I still have a lot to grasp and figure out about this whole process but: to your knowledge, can what I desire be handled? And if not, could I replicate it, perhaps by scaling down the size of cells, or by other means?
[/quote]

As Beernutts suggested, you can use small(ish) bodies to represents fragments of earth and rock to simulate falling chunks, rockslides, etc. However, pressurized fluids may be a whole different matter. Also, at some point, all physics simulations no matter how fast will be limited by the number of active bodies. These libraries are typically highly optimized, however, such as putting bodies to "sleep" if they are not in motion, and using broad phase collision to limit collision checks. In the end it will depend on how large of a world you are trying to represent, and how small the bodies will be. My advice would be to experiment with a particular library, and see what can and cannot be accomplished with it. You may have to mix methods, such as rigid bodies, cellular automata and "just plain faking it" to get what you are looking for.

[quote name='Venture' timestamp='1314083923' post='4852679']
[quote name='laztrezort' timestamp='1314074624' post='4852647']
I don't know anything about Chipmunk, but Box2D (and similar) libraries typically model rigid bodies. What you seem to be talking about are fluid dynamics, which AFAIK much more complex and processor hungry. The large worlds of Minecraft and Terraria depend on simplifying things by basing everything on cells (blocks), greatly simplifying physics, and even then need to be optimized. Here is an article about the use of cellular automata in these types of games, if you are interested.


Chipmunk is based on Box2D to my knowledge. Thank you for that article- reading it currently.

I still have a lot to grasp and figure out about this whole process but: to your knowledge, can what I desire be handled? And if not, could I replicate it, perhaps by scaling down the size of cells, or by other means?
[/quote]

As Beernutts suggested, you can use small(ish) bodies to represents fragments of earth and rock to simulate falling chunks, rockslides, etc. However, pressurized fluids may be a whole different matter. Also, at some point, all physics simulations no matter how fast will be limited by the number of active bodies. These libraries are typically highly optimized, however, such as putting bodies to "sleep" if they are not in motion, and using broad phase collision to limit collision checks. In the end it will depend on how large of a world you are trying to represent, and how small the bodies will be. My advice would be to experiment with a particular library, and see what can and cannot be accomplished with it. You may have to mix methods, such as rigid bodies, cellular automata and "just plain faking it" to get what you are looking for.
[/quote]

Alright. Some more research is probably required on my part. No real worry, as I have plenty of time.

But would the overall consensus be Chipmunk? Farseer?

Which is the overall more powerful?

This topic is closed to new replies.

Advertisement