Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (482)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (548)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Phys2D FixedJoint unstable?  (Read 2149 times)
0 Members and 1 Guest are viewing this topic.
Offline Bananadine

Junior Newbie





« Posted 2008-05-20 03:48:18 »

Hi, I've recently tried Phys2D and found it generally good, and possibly applicable to the game I'm making.  However I'm troubled by an instability I've observed:  When I connect a chain of several objects via FixedJoints--say, four small boxes widely spaced in a U-shape, sort of like in Phys2D's Demo19--and drop the resulting shape onto a floor, it bounces and wiggles a bit, as one might expect, but the bouncing gradually becomes worse until the shapes simply fly out of sight.  Demo19 looks deceptively stable in comparison to this scenario, but I tried copying its setup and tweaking it a little, and I reproduced the same thing pretty easily.  Why does this happen?  Does Phys2D belong to some general class of physics engines of which this sort of instability is a basic feature?  Or is it conceivable that somebody could write a nicer, stabler FixedJoint without too much trouble?  My game is currently using ODE, which hasn't this problem...  though it is very unfortunately saddled with that nasty third dimension.  I don't know what people see in that thing.  Smiley

Special bonus question:  Cursory online research suggests that ODE is nondeterministic; experimentation suggests that Phys2D (and therefore perhaps Box2D et al) is deterministic.  Is this correct?  Is JOODE nondeterministic?  My game likes determinism!
Offline kevglass

JGO Kernel


Medals: 153
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2008-05-20 06:26:46 »

Phys2D is deterministic.

However there are two reasons for the instability:

a) There are still a few bugs here and there which are generally improved by changing the world iterations and/or step size. However, this takes time and tuning

b) The simulation doesn't use continuous collision detection, as such it it accept some penetration and tries to resolve it. This is only an approximation and sometimes introduces error.

It's worth noting the new version of Box2D supports continuous collision detection and appears (to me at least) to be generally more stable. You can find it at http://www.jbox2d.org/

Kev

Offline irrisor

Junior Member





« Reply #2 - Posted 2008-05-20 07:14:55 »

Cursory online research suggests that ODE is nondeterministic
That's definately not the case: ODE is deterministic, as well. (At least in the common sense of "deterministic" in computer science... maybe you meant something else?)
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Bananadine

Junior Newbie





« Reply #3 - Posted 2008-05-20 18:47:00 »

I don't remember what determinism is in computer science.  Smiley  I meant that if you set up a physical scenario with ODE, and let it run twice, you'll get two different outcomes.  A box that falls on its corner near a ledge might topple off the ledge on one run, and then on the next run, tip back and settle on the ledge.  Like this guy says:  http://gamecreator.blogspot.com/2007/03/ode-determinism.html

Box2D does appear to be worth trying, so I'll move on to that and keep my Phys2D exploration on hold for now.  I know of JBox2D, and I would prefer to use that since it's pure Java--but maybe Java bindings to Box2D itself would also be worthwhile.  I don't immediately see any of those around though.
Offline irrisor

Junior Member





« Reply #4 - Posted 2008-05-21 07:41:58 »

uh, I couldn't believe it, because I thought I have read some posts on the ODE list about ODE being deterministic... but looking at the code it really uses random numbers Shocked
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (27 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38

BurntPizza (67 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!