You've done a great job here - way to go! Try setting ph_iterations = 5; See if that takes away the stack overflow problem. I know in some tests I did by using ph_iterations I was allowed ALOT more entities before I ran into trouble. It also depends what your doing... I know having ph_iterations set when using a vehicle was much slower than the ordinary physics solver.