What does a "High EPA Iterations" warning mean?

Official forum for the Chipmunk2D Physics Library.

What does a "High EPA Iterations" warning mean?

Postby pennomi » Thu Oct 10, 2013 10:45 am

I'm using Pymunk and my app is seeing the following warning:

Code: Select all
Chipmunk warning: High EPA iterations: 30
   Failed condition: i<WARN_EPA_ITERATIONS
   Source:chipmunk_src/cpCollision.c:286


A Google search revealed nothing about the error and how to fix it, only that one other person has had it before.

What does this mean and how can I avoid triggering it?
User avatar
pennomi
 
Posts: 7
Joined: Mon Nov 05, 2012 3:43 pm

Re: What does a "High EPA Iterations" warning mean?

Postby AndyKorth » Mon Oct 14, 2013 3:51 pm

It looks like that's just a warning in the PyMunk binding that they consider that iteration count to be pretty high. It's probably to prevent people form accidentally setting the iteration count higher than expected.

EPA and GJK are two collision detection algorithms that Chipmunk2D uses. It seems like Pymunk just has different warnings for high iteration counts for each type.

So you can feel free to ignore that warning, especially if you knowingly and purposely increased your iteration account to deal with jittering objects or high speed objects. If you don't need a higher iteration count or have performance problems, you can reduce the number.
User avatar
AndyKorth
Site Admin
 
Posts: 36
Joined: Wed Aug 15, 2007 3:56 pm

Re: What does a "High EPA Iterations" warning mean?

Postby pennomi » Tue Oct 15, 2013 11:27 am

Thanks! I'll just ignore it unless I start seeing performance problems.
User avatar
pennomi
 
Posts: 7
Joined: Mon Nov 05, 2012 3:43 pm

Re: What does a "High EPA Iterations" warning mean?

Postby slembcke » Wed Oct 16, 2013 1:39 am

Oh. :-\ So that actually is a warning coming from the Chipmunk collision detection algorithm.

It's almost certainly caused by a bug, although not a very serious one. It happens when it gets stuck between two collision solutions that are both correct (correct-ish anyway, floating point numbers are sort of fuzzy). It's supposed to detect that correctly, but apparently not perfectly still. :-\
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: What does a "High EPA Iterations" warning mean?

Postby pennomi » Fri Oct 18, 2013 11:05 am

slembcke, my code is open source. If it helps at all, I'd be happy to help you reproduce and squash the bug (if it still exists).

https://github.com/pennomi/nihil-ace
User avatar
pennomi
 
Posts: 7
Joined: Mon Nov 05, 2012 3:43 pm

Re: What does a "High EPA Iterations" warning mean?

Postby slembcke » Fri Oct 18, 2013 12:08 pm

How often does it happen? Once every few seconds? A dozen times a second? Thousands of times a second?

If the library is compiled in release mode, it disables the warnings entirely so you wouldn't be getting the IO cost of printing the errors. It is unfortunately very hard to reproduce which is a little worrisome. :-\
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
slembcke
Site Admin
 
Posts: 4164
Joined: Tue Aug 14, 2007 7:13 pm

Re: What does a "High EPA Iterations" warning mean?

Postby pennomi » Fri Oct 18, 2013 12:27 pm

I think I'm on the order of a dozen times a second. I have noticed that it only happens when I'm accelerating one of my ships*, not when they're simply at rest.

If it makes a difference, I did notice that Pymunk claims to be compiled against "the new Chipmunk version (6.2 beta)". Which may mean it's a bit old. I'll do the research on that to see if it can be updated.

* For reference, my project is just a tiny tech demo of block-based space ships. Each ship is made of 15 or less squares bound together by pin and gear joints.
User avatar
pennomi
 
Posts: 7
Joined: Mon Nov 05, 2012 3:43 pm

Re: What does a "High EPA Iterations" warning mean?

Postby pennomi » Fri Oct 18, 2013 12:32 pm

Ooh, and I should also mention, I slightly revised the code recently to use a radius on my boxes, and now I'm getting the same warning, except with GJK, not EPA.
User avatar
pennomi
 
Posts: 7
Joined: Mon Nov 05, 2012 3:43 pm

Re: What does a "High EPA Iterations" warning mean?

Postby viblo » Sun Oct 20, 2013 7:28 am

Wrote an answer on github at https://github.com/viblo/pymunk/issues/80, but copied the whole thing here as well:

The currently released pymunk uses Chipmunk rev 3bdf1b7b3c, its from Aug 17. (To see the version used just print pymunk.chipmunk_version).

Its relatively easy to compile chipmunk if you are on Linux, on windows you need to have gcc setup which can be a bit tricky. The best is to use the setup.py script to do it, that way all compile flags will be correct. Start by verifying that you can compile the current version:
Code: Select all
$ python setup.py compile_chipmunk
$ cd tools
$ python run_tests.py

Then update the chipmunk source to whatever version you want to use. It should be placed inside the chipmunk_src folder. (There is a helper script that will copy the source from a downloaded chipmunk repo in the tools folder that I usually use, but manual copying should work just as good). Then run the commands again.

I should add that the latest latest git revision of chipmunk contains new stuff, so no guarantees that it will work with that version.
http://www.pymunk.org - A python library built on top of Chipmunk to let you easily get cool 2d physics in your python game/app
viblo
 
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm

Re: What does a "High EPA Iterations" warning mean?

Postby p1p1 » Tue Dec 29, 2015 7:59 am

Here's a very good explanation of EPA and the meaning of EPA iterations : http://www.dyn4j.org/2010/05/epa-expand ... algorithm/
Here's another useful article about GJK and the meaning of GJK iterations: http://www.dyn4j.org/2010/04/gjk-gilber ... n-keerthi/
p1p1
 
Posts: 7
Joined: Sun Jul 19, 2015 7:17 am


Return to Chipmunk2D Physics

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 1 guest

cron