Love crashes without error, don't know whats wrong 7.1/7.2

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Socram
Prole
Posts: 3
Joined: Thu Aug 05, 2010 1:50 am

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

Post 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.
Attachments
Fraction.love
(153.4 KiB) Downloaded 67 times
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

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

Post 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.
User avatar
miko
Party member
Posts: 410
Joined: Fri Nov 26, 2010 2:25 pm
Location: PL

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

Post 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.
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

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

Post 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]
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
User avatar
bmelts
Party member
Posts: 380
Joined: Fri Jan 30, 2009 3:16 am
Location: Wiscönsin
Contact:

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

Post 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".
Socram
Prole
Posts: 3
Joined: Thu Aug 05, 2010 1:50 am

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

Post 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?
User avatar
BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

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

Post 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.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

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

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

Who is online

Users browsing this forum: No registered users and 82 guests