Page 2 of 2

Re: Love crashes without error, don't know whats wrong 7.1/7

Posted: Thu May 05, 2011 7:47 pm
by Socram
Hey guys thank you so much for the prompt responses I didn't expect so many quick replies.

Just so you guys know the # i used in the code I posted was something just to represent any sort of number I tried to put there anything greater than 1 in the place of those #'s doesn't work. In the actual code I do not use a #, but real numbers.

Also I apologize for not uploading the .love but I assumed you guys wouldn't want to wade through all my crappy code just to help me out but if you guys have the time I would certainly appreciate it! Hopefully the code is understandable ha and not completely terrible. Thanks again!

If you guys have any questions I'll be back in like... 6 hours or so after work.

Re: Love crashes without error, don't know whats wrong 7.1/7

Posted: Thu May 05, 2011 8:12 pm
by bmelts
The error has to do with physics (of course it does...) - it looks like Box2D doesn't like something to do with your RectangleShape creation in TerrainSquare. I'm not sure what yet, though.

Re: Love crashes without error, don't know whats wrong 7.1/7

Posted: Thu May 05, 2011 9:23 pm
by miko
anjo wrote:The error has to do with physics (of course it does...) - it looks like Box2D doesn't like something to do with your RectangleShape creation in TerrainSquare. I'm not sure what yet, though.
Here is what I get on console (hey, its an error message :o )

Code: Select all

love: modules/physics/box2d/Source/Collision/b2BroadPhase.cpp:240: uint16 b2BroadPhase::CreateProxy(const b2AABB&, void*): Assertion `m_proxyCount < b2_maxProxies' failed.
That line in code reads:

Code: Select all

  b2Assert(m_proxyCount < b2_maxProxies);
My suggestion for love would be to redefine b2Assert() to a love-friendly version, so there would be no more "crashes without error". Also, maybe the debug.traceback() would be available, so it would be easier to find the bug.

As for the code error, the terrainSquare:init() is called 2048 times before it crashes (for me), and this for sure is not what you want. I think it has no more resources to create the new shape.

Re: Love crashes without error, don't know whats wrong 7.1/7

Posted: Thu May 05, 2011 9:49 pm
by Lafolie
Robin wrote:
Lafolie wrote:Do you think it would be worth making an announcement/sticky thread regarding this? Not so much a forum rules, but a guideline giving people tips on how to help us help them. The more information they give us the faster their problem will inevitably be solved.
It might very well. I have been thinking that a wiki page on this would be useful, but a sticky will probably be read more often.
I took the liberty of creating such a thread. I tried to write it in a friendly, non-imposing manner since the atmosphere here is nice and relaxed. And personally, I can't stand forums that are full of threads listing rules. I mean, the forum needs to have rules like that enforced then it's no longer a community is it?

Anyway, you can find the thread here if you haven't already seen it.

[/offtopic]

Re: Love crashes without error, don't know whats wrong 7.1/7

Posted: Thu May 05, 2011 11:35 pm
by bmelts
miko wrote:My suggestion for love would be to redefine b2Assert() to a love-friendly version, so there would be no more "crashes without error".
bartbes tried, I'm not sure how much success he had with that endeavor but my suspicion is "not much".

Re: Love crashes without error, don't know whats wrong 7.1/7

Posted: Fri May 06, 2011 2:04 am
by Socram
Hmmm so to be honest I'm a little confused on how to "fix" this issue. I guess it's just too many physics bodies and it crashes?

Maybe if I explain what I'm trying to do you guys can give me a less crashy way to do it.

Basically I'm making a 2d game with dynamic terrain based on blocks. I know... it's basically 2D minecraft how original, but this is mostly for me to learn from and see where I can take it. I have a system in place where I i have a block object that is stored in 64*64 array "chunks", and then I plan to have these chunks fill the world. Making a body for all those squares at once is causing love to crash, so now I need a creative way to make a block only be physically interactive when needed. Any ideas?

Re: Love crashes without error, don't know whats wrong 7.1/7

Posted: Fri May 06, 2011 3:55 am
by BlackBulletIV
Yep, you're creating too many physical shapes. I've had the same problem when using tiles, and so has Taehl. Taehl fixed it by implementing his own custom physics. The only other option I can think of is to use some sort of algorithm to detect when optimisations can be made; for example, if you have 20 tiles in a row, you can just make that into a big rectangle shape. But the practicality of doing that in a Minecraft like game may not be very good.

Re: Love crashes without error, don't know whats wrong 7.1/7

Posted: Fri May 06, 2011 8:45 am
by bartbes
anjo wrote: bartbes tried, I'm not sure how much success he had with that endeavor but my suspicion is "not much".
Well, I could map it to an internal error alright, but then the wrappers needed a whole lot of work. Also, it has been pointed out that the assertions should be disabled in distributed code, but then, how do tell our lovers what happened?