Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / I am amused (sort of)

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Mar 2013 23:16
I have been trying to track down a bug that causes my Tier 2 WIP to crash when I attempt to replay a specific level. If I fail the level, I can retry it with no problem. But, if I pass it and use the Retry option, it crashes. The problem appears to be in timing of creating/deleting sprites, syncing and physics. I'll figure it out.

But the thing that amuses me is the error message that pops up (assertion fails!):
[quote]File: C:\TGCSHARED\AGKWorkspace\GDKPro\.../b2DynamicTree.h line 159"

GDKPro? Really?

And, of course, there is no such directory (at any level mentioned) on the computer. And The file mentioned (as either b2DynamicTree.h or DynamicTree.h) does not exist on my computer.

But the call stack does show (in reverse order):
app::Loop()
the_player::step_physics()
AGK::agk::StepPhysics(float time)
b2World::Step(....)
b2ContactManager::Collide()
b2BroadPhase::TestOverlap(...)
b2DynamicTree::GetFatAAB(...)
_wassert(...)

But, clearly, AppGameKit was based on the GDK library and some assertions and things are still hanging around.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 6th Mar 2013 00:27
I would not read too much into that.

My Dark Dynamix plugin was originally called Fulcrum Physics Pro, then Dark Physics 2 and finally Dark Dynamix, yet some of the directories for the source on my machine use the previous naming conventions

Dar13
15
Years of Service
User Offline
Joined: 12th May 2008
Location: Microsoft VisualStudio 2010 Professional
Posted: 6th Mar 2013 01:02
And in any case assertions are signs of good coding practice for C/C++ programmers, as they tell you when you have bad data moving around your program(or catch stupid programmer typos/errors).

Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Mar 2013 18:39
Quote: "GDKPro?"


Originally it was going to be a sequel to the GDK library but was then renamed AGK.

Quote: "But the thing that amuses me is the error message that pops up (assertion fails!)"


Can you send me the source that caused the error? It looks like it is occurring in Box2D but I'm not sure why.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 11th Mar 2013 19:51
The issue appeared to be with sprites not being cleared properly after being deleted and the Box2D stuff tried to process its physics in the next Sync() call.

Since I have managed to get rid of the error, I cannot reproduce the problem. It involved a vector of sprites that were being deleted in a function call well before the Sync(). I changed the way the code was handling that particular 'reset' function (I stopped deleting and recreating the sprites) and the problem went away.

The quote in my original post shows as much information as I can. Since I could not get to the .h file mentioned (since it does not exist anywhere on my computer), we only have what was stated by the error message.

The assertion occured somewhere in b2DynamicTree::GetFatAAB. That's the best I can do.

I think that the agk:eleteSprite command sometimes doesn't actually delete things from all the relevant lists.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 12th Mar 2013 13:26
From what you've said AL I would guess that you deleted a sprite without first deleting the physics for that sprite, then created another physics sprite using the same ID. Perhaps this could be causing the error?


this.mess = abs(sin(times#))
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 12th Mar 2013 15:25
Since when do you need to delete physics on a sprite? Do you mean call SetSpriteActive(spriteid,0)?

The only 'delete' I know of for physics is when you use a joint, and none are used in this case. Strike that, I just found the 'SetSpritePhysicsDelete' command, but it doesn't appear to apply to when you are deleting the sprite, only when you want to change the settings.

And the ids are all the autogen ones, so that should not have to be done.

I could try to reproduce the original resetTheObject method (the one that used to delete and recreate the sprites) and add the SetSpriteActive(spriteid,0) command and see if that clears it up.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 12th Mar 2013 15:27
I didn't mean to say you should have to delete the physics for a sprite, just that perhaps the physics system is not recognise that the original physics sprite has been replaced and that it might be that causing the bug. Sorry AL I should have been more clear


this.mess = abs(sin(times#))
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 12th Mar 2013 17:17
Okay, understood.

The original sprites were deleted completely and new ones create with different ids.

When I finish the current updates (creating a button set class), I'll try putting back the 'old' code and see if turning off the physics fixes it (assuming I can get the original bug to manifest).

I'll post the update later.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-06 17:51:24
Your offset time is: 2024-05-06 17:51:24