What does a "High EPA Iterations" warning mean?

Official forum for the Chipmunk2D Physics Library.
Post Reply
User avatar
pennomi
Posts: 7
Joined: Mon Nov 05, 2012 3:43 pm
Contact:

What does a "High EPA Iterations" warning mean?

Post 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?
User avatar
AndyKorth
Site Admin
Posts: 36
Joined: Wed Aug 15, 2007 3:56 pm

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

Post 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.
User avatar
pennomi
Posts: 7
Joined: Mon Nov 05, 2012 3:43 pm
Contact:

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

Post by pennomi »

Thanks! I'll just ignore it unless I start seeing performance problems.
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

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

Post 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. :-\
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
pennomi
Posts: 7
Joined: Mon Nov 05, 2012 3:43 pm
Contact:

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

Post 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
User avatar
slembcke
Site Admin
Posts: 4166
Joined: Tue Aug 14, 2007 7:13 pm
Contact:

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

Post 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. :-\
Can't sleep... Chipmunks will eat me...
Check out our latest projects! -> http://howlingmoonsoftware.com/wordpress/
User avatar
pennomi
Posts: 7
Joined: Mon Nov 05, 2012 3:43 pm
Contact:

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

Post 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.
User avatar
pennomi
Posts: 7
Joined: Mon Nov 05, 2012 3:43 pm
Contact:

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

Post 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.
viblo
Posts: 206
Joined: Tue Aug 21, 2007 3:12 pm
Contact:

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

Post 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.
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
p1p1
Posts: 7
Joined: Sun Jul 19, 2015 7:17 am
Contact:

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

Post 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/
Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests