Box2DFlash 2.1a RELEASE!

Discuss issues specific to the Flash/AS3 port of Box2D
Don Pipo
Posts: 34
Joined: Tue Dec 01, 2009 2:19 pm

Re: Box2DFlash 2.1a RELEASE!

Postby Don Pipo » Wed Mar 03, 2010 8:50 am

Since I ported my project from 2.0.1 to 2.1a I get a very odd and random bug, which freezes my program. It seems that every function still works after the freeze except the function that contains "world.Step(timeStep, iterations, iterations);", "world.ClearForces();" and "world.DrawDebugData();". I try to figure out what causes this bug since days, but I have absolutely no clue. Sometimes it even seemed that an empty(!) function which is never called would significantly increace the chance of freezing, but I know that this can't be. Sadly I can't describe the problem further, becaue I really couldn't find the origion of this bug. I tried out the Flash 9 and Flash 10 version of Box2DAS3 2.1a, but I got the bug in both versions.
I think I have to port everything back to 2.0.1 to see, if the bug remains and maybe I find out which piece of code causes the error.
Maybe I can make a testbed, too, to show you the bug.

Anyone else who got random freezes with 2.1a?

EDIT:
Here is a testbed for the freeze-bug. You will get the freeze-bug mostly within the first 2000 frames. (I trace the current number of frames.)
I would be really thankful if anybody could find the reason for the bug. Excuse me for bad coding. I'm not very experienced in programming. Sorry if I left some german comemnts, too.
Attachments
FreezeBug.rar
(166.88 KiB) Downloaded 124 times

BorisTheBrave
Posts: 1911
Joined: Mon Jan 07, 2008 10:51 am
Contact:

Re: Box2DFlash 2.1a RELEASE!

Postby BorisTheBrave » Wed Mar 03, 2010 2:49 pm

Though I appreciate a small test program, I do not have the latest version of Flash, and thus cannot run this. Do you think you could refactor it to compile with Flex (this means adding a Main class). Or even better, is refactor so that it works in the TestBed itself, by modifying one of the existing examples. This helps eliminate programming errors from incorrect setups, etc, which it seems better than evens is your problem.

For anyone else reading this, never bother testing on Flash 9 vs Flash 10. It's very unlikely to be different, as the Flash 9 one is automagically generated.

Don Pipo
Posts: 34
Joined: Tue Dec 01, 2009 2:19 pm

Re: Box2DFlash 2.1a RELEASE!

Postby Don Pipo » Thu Mar 04, 2010 7:54 am

I tried to compile the code with Flex and while doing this I hope I finally found the reason for the freeze-bug: the flash player itself. While the Flash CS4 intern player freezes nearly everytime, the current player for IE and firefox freezes sometimes for a second and rarely completly. And with the current standalone debug player (http://download.macromedia.com/pub/flas ... _debug.exe) everything works fine except that the swf doesn't start correctly the first time you try to open it. You have to open the swf through the standalone player twice and than it seems to work correctly. :| Very strange.

Swah
Posts: 18
Joined: Wed Sep 09, 2009 6:29 pm

Re: Box2DFlash 2.1a RELEASE!

Postby Swah » Thu Mar 04, 2010 1:45 pm

Not sure if this helps, but I've been getting hangs as well using latest through SVN. Using trace debugs I've narrowed the problem to be around the b2World:SolveTOI() function. The for(;;) loop (// Find TOI events and solve them.) never ends, and the next for loop right after it (for (c = m_contactList; c; c = c.m_next)) loops 4-5 times, about 1 second per cycle. Box2D also tells me I have a large number of contacts (see thread)

I should add that I'm using FlashDevelop, Flash 10, and the external debug player from Adobe (flashplayer_10_sa_debug.exe).

BorisTheBrave
Posts: 1911
Joined: Mon Jan 07, 2008 10:51 am
Contact:

Re: Box2DFlash 2.1a RELEASE!

Postby BorisTheBrave » Thu Mar 04, 2010 1:57 pm

Both of you have created separate threads to discuss these, I shall address the issues there. Don't just file issues in this thread, we have the whole Flash forum to use.

arcocg
Posts: 1
Joined: Mon Mar 22, 2010 9:16 am

Re: Box2DFlash 2.1a RELEASE!

Postby arcocg » Mon Mar 22, 2010 9:26 am

Hi, Boris. Thank you for your work.
Small bug report.
It seems like b2Body.Merge doesn't works.

Code: Select all

body1.m_fixtureCount = 0;
// Recalculate velocities
var body1:b2Body = this;
var body2:b2Body = other;

First error about null ref (584 line in src, here - 1st). But even if place

Code: Select all

body1.m_fixtureCount = 0;
under variable definition, error raised on b2World.Step() in b2ContactManager at 62.

BorisTheBrave
Posts: 1911
Joined: Mon Jan 07, 2008 10:51 am
Contact:

Re: Box2DFlash 2.1a RELEASE!

Postby BorisTheBrave » Wed Mar 24, 2010 4:17 pm

Yeah, this function is so buggy I'm rewriting it completely. It was meant to be a 5 minute thing, but now I've defined it, i guess I have to write it *properly*.

adq
Posts: 34
Joined: Sat Mar 27, 2010 1:47 pm

Re: Box2DFlash 2.1a RELEASE!

Postby adq » Sat Mar 27, 2010 2:04 pm

Hi, I have approached a weird bug in 2.1a version.

I have a ball flagged as bullet. When I launch it at high speed, it goes through dynamic wall, even when it's flagged as bullet. Dynamic wall seems untouched.
All is good when I launch ball at low speed but it is nothing that I want.

What I have to do?

sketchbookgames
Posts: 564
Joined: Tue Feb 24, 2009 4:10 pm
Location: Michigan
Contact:

Re: Box2DFlash 2.1a RELEASE!

Postby sketchbookgames » Sat Mar 27, 2010 4:35 pm

@adq

I believe Erin is reworking high speed collisions now.
he was unsatisfied with the previous system since there were times that it would fail between dynamic and static bodies.
he says the new system should entirely prohibit anything from passing through a static body unintentionally.

since its a new foundation, the dynamic to dynamic collisions are not as sturdy as the old way. Yet.
MayoButter in WCK stopped using the latest svn version of the C++ Box2D due to this, since he was happier with the old continuous collision detection so far.

BorrisTheBrave would know more about if there is a svn version of Box2DFlash which was sturdy, and prior to the new collision system, if thats what you are looking for.


i looked for the thread that i read this info on, but i can't find it currently. hopefully my summary is helpful and accurate.

adq
Posts: 34
Joined: Sat Mar 27, 2010 1:47 pm

Re: Box2DFlash 2.1a RELEASE!

Postby adq » Sun Mar 28, 2010 12:34 am

So I have two choices?
1. Wait for new release?
2. Go back to version 2.0.2?


Return to “Flash”



Who is online

Users browsing this forum: No registered users and 2 guests