Hey everyone,
I've programmed a game that makes use of box2d physics, it seems to work nicely for a while, not getting any errors, BUT it randomly crashes--the window just closes suddenly. Objects are being created and destroyed approximately every second but theres hardly ever more than 2 objects in existance at the same time. It appears to happen on collision between an object and a sensor, or possibly on destroying the object (just to be clear i destroy both the body and the shape). The machine I'm using is powerful and should be able to handle this. One more thing, It seems totally unpredictable, i can sometimes use it for several minutes before it happens, and other time it'll crash much quicker.
What are the possible causes for crashes like this? If i know the possibilities i might be able to isolate the problem and fix it. Thanks.
How to solve a crash problem
Re: How to solve a crash problem
Hey, the same thing happened here. I had around 400 objects on the screen and it crashed. Not always at 400 but very often so I threw out the physics and working with my own collision detection now. Which will be released as a lib in a couple of days. So: I have no idea what causes the crash..
Re: How to solve a crash problem
I appear to have solved my problem now. It was to do with using sensors to destroy objects. I suspect that theres some sort of overlap between the object actually being destroyed and the collision trigger being called for a second time, somehow, so it was trying to destroy an already destroyed object maybe. Thats just my theory. So, either don't uses sensors for this purpose, or put in a condition to ensure the collision callback can only be called once for each specific object.
Re: How to solve a crash problem
I have the same problem. In my application i destroy objects and their shapes when they collied (call :destroy() functions) and sometimes LOVE crashed (just close window). I think this problem happened when physics engine trying to get access to dead body object. Suggest me please, how to solve this problem.
PS: Nice to have love ingine log with warnings and errors occured. Sorry for the bad english)
PS: Nice to have love ingine log with warnings and errors occured. Sorry for the bad english)
Who is online
Users browsing this forum: Ahrefs [Bot] and 5 guests