Matics: a 2.5d physics platformer

Congratulations! It looks marvelous!  (I wish my students would do such games in 2 months as well :))


We had a difficult time controlling physics reactions. For instance, we tried to turn off all angular velocity when Gin has jumped in the air, because he'd start spinning wildly if he struck an object in the air, but the fix just caused more problems than it solved.

Well, sadly two translational axes are not supported by ODE. But did you try using two joints with a single translational axis and a dummy physics node in between? I think that should work well.

Can you tell more about difficulties with physics? Probably we could start a tips section (or known problems) in the wiki afterwards...

i'm extremely impressed  :-o



if you would make a prioritized wishlist for jme, how would that look? :slight_smile:

simply awsome

Sweet!

Wow, from the pics and screenshots, I really want to play it!! :)  I hope you'll take this idea and run with it.  I can see a money making game here.

Really impressive stuff both here and for LoF.  Makes me want to go back to school!

Very cool!

Here's an "intro / promo video" we made for the class:

hehe, very nice work. :slight_smile:

  Hey, I'm the guy who programmed most of this, and I'd just like to chime in about some of the problems we had and some wishlist-y stuff for this upcoming semester…



  Let me preface this by saying I really have no experience in using physics engines, so I was really flying blind when I wrote most of the simulation code…for example we don't use any joints.  To lock everything to a plane I just clear all motion/forces/rotations in the Z direction every frame.  It's a hack, and it has the potential to cause physics issues, but it worked for what we were doing at the time…I plan on looking into more advanced techniques for that this semester.



  Our main issue comes when the main character is in the air…the realistic simulation causes him to spin around like crazy depending on how he collides with things, and this ain't so great for gameplay.  I basically want a way of keeping him upright or nearly upright at all times when he is in the air, but still allow him to rotate freely around the Z axis when he is on the ground, so that his feet will stick to the ground properly…suggestions for ways to do this are much appreciated!



  In addition, I'm looking for better ways to do collision detection on our guy…mainly ways to determine accurately if he is on the ground or not, so for example we can determine when it's OK to jump or not.  Right now I use detector volumes that stick out of his feet and drive a state machine with those and button presses to determine his behavior and animations.  It works pretty well; I just think I need a better strategy for where to place the detector volumes and how to use them.

  The main problems it has right now are:  you can walk on walls if you do it right, and he gets stuck sometimes on concave objects like gears because it thinks he's in the air when he isn't.  However, ODE in general seems to have issues with concave objects, right?



  Finally, ODE seems to have performance issues with >50 objects or so, and also some collision detection bugs with rotated boxes.  What's the status of the JPhysX wrapper?  I'd really like to try switching to that as PhysX seems to be a MUCH better engine than ODE.



Oh yeah, and is there a tutorial or an explanation anywhere on how to use shaders with jME?  We'd love to try them out, but documentation seems to be woefully nonexistant (as usual :().

Arbreng said:

  Our main issue comes when the main character is in the air...the realistic simulation causes him to spin around like crazy depending on how he collides with things, and this ain't so great for gameplay.  I basically want a way of keeping him upright or nearly upright at all times when he is in the air, but still allow him to rotate freely around the Z axis when he is on the ground, so that his feet will stick to the ground properly...suggestions for ways to do this are much appreciated!

You should try two joints as I suggested above. On the ground you can either detach one of the joints or you can increase the springiness of a joint...



  In addition, I'm looking for better ways to do collision detection on our guy... [...]  However, ODE in general seems to have issues with concave objects, right?

I don't think so (from own experience and reading the mailing list). The approach you described sounds ok. Maybe you can use the actual collision of your avatar instead of the additional detector volumumes? Then you could check the normal to point upwards (to avoid walking upwards).



  Finally, ODE seems to have performance issues with >50 objects or so, and also some collision detection bugs with rotated boxes.  What's the status of the JPhysX wrapper?  I'd really like to try switching to that as PhysX seems to be a MUCH better engine than ODE.

There should not be issues with rotated boxes (but I had some with boxes having the exact same rotation). >50 should not be a problem. Many joints or contacts points are a problem. PhysX can handle more contact points but is slower for many objects (hundreds). Currently the PhysX binding is not complete because I was very disappointed by the quality of the PhysX engine.

I'm currently trying the joint solution you've proposed and am having some issues.



First, what do the parameters to the setSpring method on a joint actually mean?  I'm not really sure and the javadocs don't say much.



Also, the dummy joint has a real tendency to "wiggle" under large forces.  Is this a consequence of the springiness?  Is there a way to make

the joint rigid so this doesn't happen (is this what the setSpring method is for?  I tried a bunch of numbers in it and couldn't really get the effect I wanted).



Thanks for the help!