Jump to content

  • Log In with Google      Sign In   
  • Create Account

2D Physics Engine for Mining Game


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 Venture   Members   -  Reputation: 100

Like
0Likes
Like

Posted 20 August 2011 - 01:12 PM

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.

Sponsor:

#2 Gamer Gamester   Members   -  Reputation: 136

Like
0Likes
Like

Posted 20 August 2011 - 01:59 PM

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.

#3 Venture   Members   -  Reputation: 100

Like
0Likes
Like

Posted 21 August 2011 - 02:56 PM

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.

#4 BeerNutts   Crossbones+   -  Reputation: 2999

Like
0Likes
Like

Posted 22 August 2011 - 03:57 PM

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)

#5 Venture   Members   -  Reputation: 100

Like
0Likes
Like

Posted 22 August 2011 - 06:23 PM

Thanks. I'll check it out.

EDIT:

It looks really impressive! Thanks for the tip.

:)

#6 laztrezort   Members   -  Reputation: 972

Like
1Likes
Like

Posted 22 August 2011 - 10:43 PM

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.

#7 Venture   Members   -  Reputation: 100

Like
0Likes
Like

Posted 23 August 2011 - 01:18 AM

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?

#8 BeerNutts   Crossbones+   -  Reputation: 2999

Like
0Likes
Like

Posted 23 August 2011 - 07:43 AM


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?


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)

#9 laztrezort   Members   -  Reputation: 972

Like
0Likes
Like

Posted 23 August 2011 - 08:56 AM


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?


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.

#10 Venture   Members   -  Reputation: 100

Like
0Likes
Like

Posted 24 August 2011 - 03:24 PM



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?


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.


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?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS