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 have two questions about box2d.

Author
Message
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 22nd May 2012 06:36 Edited at: 22nd May 2012 06:43

I created 100 sprite, and then turn on physics, the fps fell down to 15. Are 100 too much? then I reduced sprite number to 10, then fps can keep 60. otherwise , it can't be.

another one: when I use SetSpriteShape(3), it don't take effect. the actually is like using SetSpriteShape(2).
following is the picture:


The Miracrea Games

Attachments

Login to view attachments
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 22nd May 2012 15:31
Thats odd, I have created a few hundred physics sprites and kept steady framerate...

Hmm, I had no idea you used Tier 2...
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 22nd May 2012 16:26
@The Zoq2, I think it is just the same. Tier 1 and Tier2. I feel very puzzled about this. only 100 physics sprites, then fps fell down to 15.

The Miracrea Games
MarcoBruti
12
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 22nd May 2012 16:34
I had a similar problem in Tier-1 when I created a big baground physics sprite at the left of the pinball.
The frame rate decreased from 60 to 10 fps. I remove that sprite, and all went OK.
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 23rd May 2012 15:04
Haley make sure you are using 1074 for SetSpriteShape(3) to work. there were problems in past versions.
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 23rd May 2012 15:52
@bjadams, OK, I'm downloading the 1074 version. Thank you very much!

The Miracrea Games
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 24th May 2012 01:02
there's 1075 now Halley!
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 24th May 2012 09:28 Edited at: 24th May 2012 12:22
I am using version 1075 now, but agk::SetSpriteShape() still don't take effect. Please give me a hand, I'm very puzzled.

The Miracrea Games
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 24th May 2012 11:47
Helley

use agk::SetPhysicsDebugOn() to get a visual idea of what is going on!
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 24th May 2012 11:55 Edited at: 24th May 2012 12:22
@bjadams, I'm using SetPhysicsDebugOn();

void agk::SetSpriteShapeBox( UINT iSpriteIndex, float x, float y, float x2, float y2, float angle )
angle doesn't take effect.

The Miracrea Games

Login to post a reply

Server time is: 2024-04-28 15:46:54
Your offset time is: 2024-04-28 15:46:54