Hello, I have a tile based game that loads and unloads geometry from the level on the fly as the player move around.
I took a look at this post and it seems like I have a slightly different constraint that forces me to not break the geometry up into smaller chunks.
viewtopic.php?f=9&t=8387&p=35942&hilit=optimize+createfixture#p35942
so basically I have long chains that represent the collision of a vector drawn world. some chains can be 2000 verts in length and since the shapes are organic, they can overlap each other.
on an iPad 1, the createFixture call can take up to 0.06 seconds for some of the longer chains. the game currently runs at 60fps so I get a hit of 4 frames while this single load takes place.
ideally I want to get it running on ipod 2nd gen so there is a ton of optimization I need to do.
most of the data is currently defined in c structs and it would be pretty easy to make a static definition at compile time of the fixtures and shapes if it wasn't a class. Is there any way to get around this?
It seems like the time is linear based on the number of verts in the chain so cutting it up doesnt look like it would speed it up at all.
the other option I thought of, was to create a world or body that was not in use, create the fixture in a separate thread, and then move it over to the main world when I need it. I can't really split the game into multiple worlds that each represent a grid in the level. the shapes overlap and it would be a mess if I had to deal with multiple worlds at the same time.
Any other ideas for speeding up the creation of a fixture?
I'm currently using 2.2.1
Thanks
I took a look at this post and it seems like I have a slightly different constraint that forces me to not break the geometry up into smaller chunks.
viewtopic.php?f=9&t=8387&p=35942&hilit=optimize+createfixture#p35942
so basically I have long chains that represent the collision of a vector drawn world. some chains can be 2000 verts in length and since the shapes are organic, they can overlap each other.
on an iPad 1, the createFixture call can take up to 0.06 seconds for some of the longer chains. the game currently runs at 60fps so I get a hit of 4 frames while this single load takes place.
ideally I want to get it running on ipod 2nd gen so there is a ton of optimization I need to do.
most of the data is currently defined in c structs and it would be pretty easy to make a static definition at compile time of the fixtures and shapes if it wasn't a class. Is there any way to get around this?
It seems like the time is linear based on the number of verts in the chain so cutting it up doesnt look like it would speed it up at all.
the other option I thought of, was to create a world or body that was not in use, create the fixture in a separate thread, and then move it over to the main world when I need it. I can't really split the game into multiple worlds that each represent a grid in the level. the shapes overlap and it would be a mess if I had to deal with multiple worlds at the same time.
Any other ideas for speeding up the creation of a fixture?
I'm currently using 2.2.1
Thanks