Page 1 of 1
What does a "High EPA Iterations" warning mean?
Posted: Thu Oct 10, 2013 10:45 am
by pennomi
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?
Re: What does a "High EPA Iterations" warning mean?
Posted: Mon Oct 14, 2013 3:51 pm
by AndyKorth
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.
Re: What does a "High EPA Iterations" warning mean?
Posted: Tue Oct 15, 2013 11:27 am
by pennomi
Thanks! I'll just ignore it unless I start seeing performance problems.
Re: What does a "High EPA Iterations" warning mean?
Posted: Wed Oct 16, 2013 1:39 am
by slembcke
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. :-\
Re: What does a "High EPA Iterations" warning mean?
Posted: Fri Oct 18, 2013 11:05 am
by pennomi
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
Re: What does a "High EPA Iterations" warning mean?
Posted: Fri Oct 18, 2013 12:08 pm
by slembcke
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. :-\
Re: What does a "High EPA Iterations" warning mean?
Posted: Fri Oct 18, 2013 12:27 pm
by pennomi
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.
Re: What does a "High EPA Iterations" warning mean?
Posted: Fri Oct 18, 2013 12:32 pm
by pennomi
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.
Re: What does a "High EPA Iterations" warning mean?
Posted: Sun Oct 20, 2013 7:28 am
by viblo
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.
Re: What does a "High EPA Iterations" warning mean?
Posted: Tue Dec 29, 2015 7:59 am
by p1p1
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/