How to speed up cellular simulation

Official forum for the Chipmunk2D Physics Library.
Post Reply
User avatar
Ameisen
Posts: 1
Joined: Sat May 10, 2014 7:58 pm
Location: United States
Contact:

How to speed up cellular simulation

Post by Ameisen »

Hello.

I'm using Chipmunk to handle object collisions and attachment in a very peculiar simulation that seems to not be common.

I am currently simulating a field of bytecode-driven cells to simulate virtual evolution. This is basically a simulation/toy that I do plan to put on my site/portfolio for free at some point (when it's done).

http://imgur.com/a/z8QLl

So far, I find that Chipmunk, from what I presume due to its serial nature (and the profiler agrees) tends to start stalling the Simulation system once there are around 40,000 objects, and it becomes almost unusable at 100,000. It appears as though Chipmunk is generally stalling in the impulse solvers. I've considered going through and attempting to make them threadsafe, but I'd rather see if anyone else has tried to do similar as spending time improving Chipmunk would detract from actually working on the simulation itself (which isn't done).

Other than that, I do have certain settings changed... I've reduced the number of iterations to 5, collision 'slop' to 0.3, and I am using a spatial hash with a size of 0.1 (which is the average cell size) and a count of 100,000. The only other 'special' thing is I have a very lightweight collision handler that just sets a boolean.

Any thoughts?
Post Reply

Who is online

Users browsing this forum: Heise IT-Markt [Crawler] and 11 guests