Tutorial 16 error
3 posters
Tutorial 16 error
Just downloaded the latest SDK as of today, and tutorial 16 crashes.
if( _SIO2physic->state == SIO2_PHYSIC_PLAY )
{
float sub = _timestep / ( float )_pass;
The file is sio2_physic.cc and the error is EXC_BAD_ACCESS.
My Mac is:
Model Name: MacBook
Model Identifier: MacBook5,2
Processor Name: Intel Core 2 Duo
Processor Speed: 2 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L2 Cache: 3 MB
Memory: 2 GB
Bus Speed: 1.07 GHz
Boot ROM Version: MB52.0088.B00
SMC Version: 1.38f5
Serial Number: W89090FW4R3
Sudden Motion Sensor:
State: Enabled
if( _SIO2physic->state == SIO2_PHYSIC_PLAY )
{
float sub = _timestep / ( float )_pass;
The file is sio2_physic.cc and the error is EXC_BAD_ACCESS.
My Mac is:
Model Name: MacBook
Model Identifier: MacBook5,2
Processor Name: Intel Core 2 Duo
Processor Speed: 2 GHz
Number Of Processors: 1
Total Number Of Cores: 2
L2 Cache: 3 MB
Memory: 2 GB
Bus Speed: 1.07 GHz
Boot ROM Version: MB52.0088.B00
SMC Version: 1.38f5
Serial Number: W89090FW4R3
Sudden Motion Sensor:
State: Enabled
Madrayken- Posts : 8
Join date : 2009-03-25
Re: Tutorial 16 error
Have you try it on the device ? And can you tell me the value of _pass cuz it should be greater than 0 as well as _timestep...
Re: Tutorial 16 error
I don't have a full development account yet - only the SDK, so I've only tested on the emulator.
_pass == 2 by the way.
_pass == 2 by the way.
Madrayken- Posts : 8
Join date : 2009-03-25
Re: Tutorial 16 error
Can someone confirm this issue can I double check both on the simulator & the device and tutorial16 work perfectly debug/release thumb on/off.
The only thing is I replace this block to have a better smooth animation since the new sio2PhysicRender execute full passes this smooth the soft body physic:
in EAGLview.mm
Tks in advance,
ps: The pass value should be set to 1
The only thing is I replace this block to have a better smooth animation since the new sio2PhysicRender execute full passes this smooth the soft body physic:
in EAGLview.mm
- Code:
- (void)drawView {
if( sio2->_SIO2window->_SIO2windowrender )
{
if( sio2->_SIO2physic )
{
// Use directly the Bullet API to step into the simulation
sio2->_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sio2->_SIO2window->d_time, 2 );
}
sio2->_SIO2window->_SIO2windowrender();
sio2WindowSwapBuffers( sio2->_SIO2window );
}
glBindRenderbufferOES(GL_RENDERBUFFER_OES, viewRenderbuffer);
[context presentRenderbuffer:GL_RENDERBUFFER_OES];
}
Tks in advance,
ps: The pass value should be set to 1
Same issue with 1.3.5 and tutorial_16
I can confirm there is some issue with tutorial_16 and SDK 1.3.5
If I try to use the bullet API as you suggested I get the same error as suggested on post #1
sio2->_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sio2->_SIO2window->d_time, 1 );
(tried with a pass of 1 or 2)
if I leave it with the default that is calling sio2PhysicRender() and I set a pass of 1 or 2, the soft bodies are pretty much going through the floor or one will show but will be badly rendered with lots of missing faces...
It is behaving better in 1.3.3 from what I can see on my system but 1.3.3 shows performance issue with physics rendering..
If I try to use the bullet API as you suggested I get the same error as suggested on post #1
sio2->_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sio2->_SIO2window->d_time, 1 );
(tried with a pass of 1 or 2)
if I leave it with the default that is calling sio2PhysicRender() and I set a pass of 1 or 2, the soft bodies are pretty much going through the floor or one will show but will be badly rendered with lots of missing faces...
It is behaving better in 1.3.3 from what I can see on my system but 1.3.3 shows performance issue with physics rendering..
Francescu- Posts : 136
Join date : 2009-03-18
Re: Tutorial 16 error
Ok can you please tell me where it crash, and maybe try to use MallocDebug and Instruments to give me a bit more info on that on cuz over here everything is fine... I kinda don't know where to start
Can you guys download back 1.3.5 (cuz I update it again this morning) and do the test again...
Cheers,
Can you guys download back 1.3.5 (cuz I update it again this morning) and do the test again...
Cheers,
Physics are not being played yet
I have downloaded the latest 1.3.5 and ran it again - same issue
timestep (or sio2->_SIO2window->d_time) that is passed to stepSimulation() is 0 (zero).
But the problem is due to the fact that the physics haven't started playing yet and the 'state' is not yet set to PLAY when calling stepSimulation()
Could it be something to do with the speed of the CPU and people with faster machines getting into some kind of race condition...
If I test for the physics state before calling stepSimulation() then all is fine:
if( sio2->_SIO2physic->state == SIO2_PHYSIC_PLAY )
Romain, you already have that test in sio2PhysicRender()...
--francois
timestep (or sio2->_SIO2window->d_time) that is passed to stepSimulation() is 0 (zero).
But the problem is due to the fact that the physics haven't started playing yet and the 'state' is not yet set to PLAY when calling stepSimulation()
Could it be something to do with the speed of the CPU and people with faster machines getting into some kind of race condition...
If I test for the physics state before calling stepSimulation() then all is fine:
if( sio2->_SIO2physic->state == SIO2_PHYSIC_PLAY )
Romain, you already have that test in sio2PhysicRender()...
--francois
Francescu- Posts : 136
Join date : 2009-03-18
Re: Tutorial 16 error
Try this:
Lemme know if it still crash by adding the extra checks.
- Code:
void sio2PhysicRender( SIO2physic *_SIO2physic,
float _timestep,
int _pass )
{
unsigned int i = 0;
if( _SIO2physic->state == SIO2_PHYSIC_PLAY && _timestep && _pass )
{
float sub = _timestep / ( float )_pass;
while( i != _pass )
{
_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sub, 0 );
++i;
}
}
}
Lemme know if it still crash by adding the extra checks.
Re: Tutorial 16 error
sio2interactive wrote:Try this:
- Code:
void sio2PhysicRender( SIO2physic *_SIO2physic,
float _timestep,
int _pass )
{
unsigned int i = 0;
if( _SIO2physic->state == SIO2_PHYSIC_PLAY && _timestep && _pass )
{
float sub = _timestep / ( float )_pass;
while( i != _pass )
{
_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sub, 0 );
++i;
}
}
}
Lemme know if it still crash by adding the extra checks.
Still a problem. I should have checked before, but it looks like _SIO2physic is unassigned. None of the variables contained in the struct are initialised, so the ->state value is invalid.
Placing a breakpoint in:
SIO2physic *sio2PhysicInit( char *_name )
{
>>> SIO2physic *_SIO2physic = ( SIO2physic * ) calloc( 1, sizeof( SIO2physic ) );
...
}
And the reason that's not set is that in Tutorial 16, debugging through the Main.mm:
int retVal = UIApplicationMain(argc, argv, nil, nil);
seems to leap straight to sio2PhysicRender(), bypassing templateLoading()!
Last edited by Madrayken on Thu Mar 26, 2009 5:02 pm; edited 3 times in total (Reason for editing : Further explanation)
Madrayken- Posts : 8
Join date : 2009-03-25
Re: Tutorial 16 error
hummmm how's that possible can you please investigate a bit more cuz over here everything work flawless...
Also with SDK version you are using?? Me in still using 2.2.1
Also with SDK version you are using?? Me in still using 2.2.1
Re: Tutorial 16 error
sio2interactive wrote:hummmm how's that possible can you please investigate a bit more cuz over here everything work flawless...
Also with SDK version you are using?? Me in still using 2.2.1
Ooh - I'm using XCode 3.1.2. The simulator is v 2.2.1
Madrayken- Posts : 8
Join date : 2009-03-25
Re: Tutorial 16 error
Ok this is weird... Here's what I got:
XCode: 3.1.2
SDK: 2.2.1
Device: iPod Touch 2gen 8G
From here I can't seems to be able to reproduce the bug...
XCode: 3.1.2
SDK: 2.2.1
Device: iPod Touch 2gen 8G
From here I can't seems to be able to reproduce the bug...
Re: Tutorial 16 error
sio2interactive wrote:Ok this is weird... Here's what I got:
XCode: 3.1.2
SDK: 2.2.1
Device: iPod Touch 2gen 8G
From here I can't seems to be able to reproduce the bug...
Oh dear. Seems like we have an impasse!
So far, every other tutorial file has worked. This one's just... dead. Do you have any idea why templateLoading() would ever be skipped? Missing resource? Corrupt SIO2 data file? My Mac having x386 architecture?
Madrayken- Posts : 8
Join date : 2009-03-25
Re: Tutorial 16 error
Romain, I still think there should be a check to test the physic state before calling stepSimulation() like you do in sio2PhysicRender().
if( sio2->_SIO2physic->state == SIO2_PHYSIC_PLAY )
sio2->_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sio2->_SIO2window->d_time, 1 );
Without that check it won't work for me and causing BAD_ACCESS errors. With the check, everything is peachy...
I understand calling sio2PhysicRender() adds a call onto the stack and 1 more branching test _but_ not testing at all for the state might lead to particular situations on machines of different CPU speed (e.g. if physics haven't started yet)...
Just my 0.02 cents
if( sio2->_SIO2physic->state == SIO2_PHYSIC_PLAY )
sio2->_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sio2->_SIO2window->d_time, 1 );
Without that check it won't work for me and causing BAD_ACCESS errors. With the check, everything is peachy...
I understand calling sio2PhysicRender() adds a call onto the stack and 1 more branching test _but_ not testing at all for the state might lead to particular situations on machines of different CPU speed (e.g. if physics haven't started yet)...
Just my 0.02 cents
Francescu- Posts : 136
Join date : 2009-03-18
Re: Tutorial 16 error
Hummmmm please confirm that you have the following code in tutorial16 in EAGLview.mm
I release a new version yesterday morning if you have downloaded 1.3.5 before yesterday please download again... a few mistake found their way up to the final package somehow... please download it again if you do not have the code above within tutorial16.
ps: Just call me ROm
- Code:
if( sio2->_SIO2window->_SIO2windowrender )
{
if( sio2->_SIO2physic )
{
// Use directly the Bullet API to step into the simulation
sio2->_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sio2->_SIO2window->d_time, 2 );
}
sio2->_SIO2window->_SIO2windowrender();
sio2WindowSwapBuffers( sio2->_SIO2window );
}
I release a new version yesterday morning if you have downloaded 1.3.5 before yesterday please download again... a few mistake found their way up to the final package somehow... please download it again if you do not have the code above within tutorial16.
ps: Just call me ROm
Re: Tutorial 16 error
Not sure if this was directed to me but I have just downloaded it again (like right now) and what I have in EAGLview.mm of tutorial 16 is a pass of 1, NOT 2.
sio2->_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sio2->_SIO2window->d_time, 1 );
otherwise the rest is the same...
Like I said before, if I put the state test before stepSimulation() it works very fine (even with a pass of 1)...no more issues...
sio2->_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sio2->_SIO2window->d_time, 1 );
otherwise the rest is the same...
Like I said before, if I put the state test before stepSimulation() it works very fine (even with a pass of 1)...no more issues...
Francescu- Posts : 136
Join date : 2009-03-18
Re: Tutorial 16 error
All right guys tks to Francescu I manage to find the problem... its just really weird that the problem only shows up in tutorial16 cuz basically the whole SIO2 initialization is affected any please replace the sio2ExtractPath function with that one:
That should fix all the problems
- Code:
void sio2ExtractPath( char *_fname,
char *_ppath,
char *_aname )
{
unsigned int s = sio2StringLen( _fname );
char *curr_pos;
curr_pos = strrchr( _fname, '/' );
if( curr_pos )
{
memcpy( _ppath, _fname, s - sio2StringLen( curr_pos ) + 1 );
if( _aname )
{ memcpy( _aname, ( curr_pos + 1 ), sio2StringLen( curr_pos ) ); }
}
}
That should fix all the problems
Re: Tutorial 16 error
Cool - that fixes the crash. But now the three gel boxes fall through the world. :-)
Madrayken- Posts : 8
Join date : 2009-03-25
Re: Tutorial 16 error
sio2->_SIO2physic->_btSoftRigidDynamicsWorld->stepSimulation( sio2->_SIO2window->d_time, 2 );
Re: Tutorial 16 error
That's interesting as it does not on my system (I use a pass of 1).Madrayken wrote:Cool - that fixes the crash. But now the three gel boxes fall through the world. :-)
Does it do it on the device as well? I'm not sure you can test it as you mentioned you did not have an iDevice yet?
Francescu- Posts : 136
Join date : 2009-03-18
Re: Tutorial 16 error
Francescu wrote:That's interesting as it does not on my system (I use a pass of 1).Madrayken wrote:Cool - that fixes the crash. But now the three gel boxes fall through the world. :-)
Does it do it on the device as well? I'm not sure you can test it as you mentioned you did not have an iDevice yet?
Oh, I have one... I just haven't signed up for the developer program yet.
Madrayken- Posts : 8
Join date : 2009-03-25
Similar topics
» v1.2 Tutorial 08 error
» Error when using sound files
» CodeSign error
» btPoolAllocator error
» SIO2 Exporter v0.1.2 export error on Mac OS X 10.5
» Error when using sound files
» CodeSign error
» btPoolAllocator error
» SIO2 Exporter v0.1.2 export error on Mac OS X 10.5
Permissions in this forum:
You cannot reply to topics in this forum