Jump to content
  • Advertisement
Sign in to follow this  
Timpy123

gish-like effects

This topic is 4852 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Not sure how many of you have played Gish (the physics based platform game), but Im trying to recreate similar physics. However, Im not sure how I would go about trying to do that. In particular, things like rotating about an axis. For example, if an object is on one side of the platform, then that side would rotate downwards and the other side of the axis would rotate upwards (or counter-clockwise). Any ideas as to how this is best achieved? I tried looking through the Jakobsen (IO Hitman game) paper and got stuck at the point where I needed to move a stick outside of the triangle because a collision was detected. I manage to detect a collision but everytime I tried to push it out, it would just stutter and the stick would start to behave randomly. I tried different things to fix it, but it wouldnt work. Also, will I have to learn Matrices for 2D physics? Thanks

Share this post


Link to post
Share on other sites
Advertisement
alternatively you could take a look at flatland.sourceforge.net

it’s a 2d wrapper over a capable physics system. This way you can do lots of things like joints and stacking without having to go through the “not to be underestimated” task of writing it your self.

take a look at some of the demos and see if its what your after


(sometimes I think I should get shares in this sdk I seem to be recommending it a lot)

Share this post


Link to post
Share on other sites
Thanks for the replies. I want to make my own engine as a learning thing. I thought of doing circle-circle collisions as they're pretty simple, but if I had a square or something, I dont understand how that would work. Is that where I would do a circle-segment collision instead? Same thing for a stick. Would i just use the circle-segment collision routine? Thanks for the help. If there are any other ideas, then please post.

Share this post


Link to post
Share on other sites
Check out this screenshot here. You can see how I represented a square with four circles, and you could make this even better by using another 8 and filling in the gaps. Overall, the results were realistic enough for a solid game. You could implement a similar system.

By the way, the website is not longer used by me but I am basing my 4e4 entry off of that physics engine. Just letting you know so you don't expect it to ever be updated.

Share this post


Link to post
Share on other sites
[edit: lol I see I just wasted my time writing all that out as skittleo has some excellent links on his page , nice work btw! :)]

Good to hear!!

Well to get you going there’s 2 ways of thinking. In the Jakobsen's paper is really deigned to be a fast way to do ragdolls so just concentrates on keeping things from interpenetrating. It does this by just moving the penetrating part and due to the nature of the system the physics follows with. Its relatively simple to set up and you can make shapes out of connected particles or fix 2 connected particles inside a collision shape.

the problem with this is that its not very realistic, and harder to do things like bouncing objects etc. For this you really need to make a rigid body physics system with some sort of decent collision detection system. This is a bit more challenging mathematically but worth it in the long run (I think)

if the Jakobsen paper will be good for you then try doing that

recommended links would be

for lots of example code:
http://uk.geocities.com/olivier_rebellion/

starting rigid body physics:
http://www.d6.com/users/checker/dynamics.htm

rigid body stuff:
Oliii


collision detection:
http://www.harveycartel.org/metanet/tutorials.html

Share this post


Link to post
Share on other sites
Thanks for the links. How do you make the square actually rotate on it own when tumbling down the ramp? Do you have to do anything extra, or does the verlet integrator do it on its own since your adding gravity to each particle?

Share this post


Link to post
Share on other sites
Each particle has no notion of being a part of a larger body. Each has its own agenda on where it wants to go, but the constraints of the system keep this from happening. The fusion of particles and constraints amazingly creates a structured body that appears to behave as a whole, when in reality there is no such thing. So the verlet-integrator along with the coldet+response system and constraints makes it happen automatically with no extra work.

It was a ton of fun when I first started playing around with it. I never coded anything close to rigid body dynamics, but many times the results were indistinguishable from a more complex physics system. Pretty neat stuff.

Edit: Damn dyslexia.

Share this post


Link to post
Share on other sites
Sneaky ;). Thats good to hear as Im no good at rotation stuff. Thanks for the quick reply. Off I go to try again.

Share this post


Link to post
Share on other sites
the technique is use in molecular dynamics simulations. So in theory, the verlet + stiff constraint + particle mimics atomic binds. Except of billions of particles, you just reduce it to 4 for a box :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!