FORUM CLOSED, PLEASE REGISTER AT FORUM.SIO2INTERACTIVE.COM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

tutorial16 (soft bodies) runs very slowly

3 posters

Go down

tutorial16 (soft bodies) runs very slowly Empty tutorial16 (soft bodies) runs very slowly

Post  doctorgonzo Wed Jul 01, 2009 9:04 pm

I just tested out the soft bodies tutorial, and it looks great except that the performance is incredibly choppy, it will run for a quarter second then stops for a half second. I am testing this on an iPhone 3G and a 2nd gen iPod Touch both running version 3.0 of touch OS, with similar results on each device. Also, the PRODUCT_NAME macro was set to "tutorial06_2" and this was popping up a compiler error, I had to change this to get it running. I haven't tested all of the tutorials but none of the others seem to have this problem, even the other tutorials that use Bullet.

Do I just have to use much simpler shapes than are in the demo currently to get acceptable performance?


Last edited by doctorgonzo on Wed Jul 01, 2009 9:22 pm; edited 1 time in total

doctorgonzo

Posts : 6
Join date : 2009-07-01

Back to top Go down

tutorial16 (soft bodies) runs very slowly Empty Re: tutorial16 (soft bodies) runs very slowly

Post  doctorgonzo Wed Jul 01, 2009 9:12 pm

Also I failed to get tutorial16 running in the simulator at all. It compiles and installs and then crashes after loading the splash screen... It runs fine on the device except for the choppiness.

doctorgonzo

Posts : 6
Join date : 2009-07-01

Back to top Go down

tutorial16 (soft bodies) runs very slowly Empty Re: tutorial16 (soft bodies) runs very slowly

Post  sio2interactive Wed Jul 01, 2009 10:55 pm

Soft body physic is like the worst thing that you can do on iphone, the processing power necessary for the simulation is really high. You can of course use more basic shapes (like just a cube) that will speed up but on a large scale is just not usable on the device as long as Bullet does not HEAVILY optimize the algorithm... They claim that the performance have been enhance in 2.74 but honestly I haven't seen any noticeable difference on the device...

In other words you can use soft body physic but in small doses Wink

Also its kinda weird that its not working on your device cuz Im personally using an iPod Touch 2nd Gen to test and its running fine... its only choppy at the beginning then its fine... but it does not crash...

Cheers,
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

tutorial16 (soft bodies) runs very slowly Empty Re: tutorial16 (soft bodies) runs very slowly

Post  doctorgonzo Wed Jul 01, 2009 11:01 pm

Actually I did get it to run without crashing in the device, it only crashed in the simulator (oddly enough). When I look again at performance on the 2nd gen iPod device, the choppiness does go away after the objects fall. The only other problem I had was that the example would not compile until I changed the PROJECT_NAME macro from "tutorial06_1" to "tutorial16". I think maybe the 3.0 SDK update doesn't like underscores in project names... This is also a problem in tutorial06_1 and tutorial06_2. Thanks for the feedback Smile

doctorgonzo

Posts : 6
Join date : 2009-07-01

Back to top Go down

tutorial16 (soft bodies) runs very slowly Empty Re: tutorial16 (soft bodies) runs very slowly

Post  sio2interactive Thu Jul 02, 2009 1:22 am

Yeah that's because of 3.0 for some reason...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

tutorial16 (soft bodies) runs very slowly Empty Re: tutorial16 (soft bodies) runs very slowly

Post  Sensiblemonkey Sat Jul 04, 2009 1:20 am

Actually I did get it to run without crashing in the device, it only crashed in the simulator (oddly enough).

I just ran into the same problem myself. Applying the fix mentioned in this thread should do the trick:

https://sio2interactive.forumotion.net/about-the-sdk-f1/tutorial-16-error-t467-15.htm

Sensiblemonkey

Posts : 2
Join date : 2009-07-04

Back to top Go down

tutorial16 (soft bodies) runs very slowly Empty Re: tutorial16 (soft bodies) runs very slowly

Post  sio2interactive Sat Jul 04, 2009 1:45 am

Man where did you download your SIO2 SDK? cuz I think this have been announced & patched a long time ago...
sio2interactive
sio2interactive

Posts : 1526
Join date : 2008-08-26
Age : 45
Location : Shanghai

http://sio2interactive.com

Back to top Go down

tutorial16 (soft bodies) runs very slowly Empty Re: tutorial16 (soft bodies) runs very slowly

Post  Sensiblemonkey Sat Jul 04, 2009 5:15 am

Man where did you download your SIO2 SDK? cuz I think this have been announced & patched a long time ago...

It's the current version (1.3.5) that you can download via the free download link on this page that seems to be unpatched:
http://sio2interactive.com/DOWNLOAD.html

To clarify, it's the link on the left; the one in black that only becomes active after you mark the check-box to accept the EULA.

The file in the SDK I'm looking at is: sio2_utils.cc

and the function is: sio2ExtractPath( )

Here's the code for the entire function as it currently looks (I just downloaded it again to be sure it's current):
Code:
void sio2ExtractPath( char *_fname,
                 char *_ppath,
                 char *_aname )
{
   unsigned int i = 0,
             s = sio2StringLen( _fname );
            
   char *curr_pos;

   while( i != s )
   {
      if( _fname[ i ] == '\\' )
      { _fname[ i ] = '/'; }
      
      ++i;
   }
   
   curr_pos = strrchr( _fname, '/' );
   
   if( curr_pos )
   {
      memcpy( _ppath, _fname, s - sio2StringLen( curr_pos ) + 1 );
      
      if( _aname )
      { memcpy( _aname, ( curr_pos + 1 ), s - sio2StringLen( curr_pos ) ); }
   }
}

And this is the replacement code from the thread I referenced that fixes the crash in the simulator:
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 ) ); }
  }
}


Hope this helps. Awesome job on the SDK, btw. You are totally ruling my world these days! cheers

Sensiblemonkey

Posts : 2
Join date : 2009-07-04

Back to top Go down

tutorial16 (soft bodies) runs very slowly Empty Re: tutorial16 (soft bodies) runs very slowly

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum