Scene Management ?

MindCalamity

14-01-2012 17:31:29

Hello guys, I have a state manager (similar to spacegaier's) in my game engine, and I've separated the game engine components into systems, so I want to make my game levels manageable, and initializing the physics render system (Critter) requires a scene manager and a physics scene. I've read in the code that I can have up to 32 of them, now is it recommended that I add a physics scene to my application state ?

I have no idea how to make switching between states physics-friendly...

I think that using 1 physics scene and when switching between states emptying it, and re-creating stuff again, but that would make pause/resume impossible.

Any suggestions are welcome.

OK, so I basically figured out that you can have 32 scenes max. at one point (allocated), but I haven't found a way to switch between scenes, does this mean that I have to delete/create critter every time I start a new level ?

saejox

15-01-2012 03:15:04

i never delete critter::scene, ogre::scene or nxogre::world and clear/save/load/pause/resume all the time. i only create one scene start of the game (not level).
it really depends how you implement your game objects.

to store physics data, you need to store position/rotation/angular vel/linear vel and it's type (CC, rigidbody etc...) to recreate it.
as far as i know there is no easy way to store physics world and restoring just by calling some method.

i read your post like 10 times, but did not understand it much :( i personally never need more than 1 scene, i wouldn't even know what to do with more than one.

if you look for a serialization library i strongly suggest boost::serialization.

MindCalamity

15-01-2012 03:25:59

Well perhaps I wasn't clear enough, sorry I'm still kinda confusing myself over how to make physics work on an inter-level basis (I'm going to rethink this entire thing altogether tomorrow), I basically ripped-off the state manager of the advanced ogre framework, I'll see if I can actually manage to make it work properly with my engine.

I think I may have a fatal flaw somewhere in the design of my engine...

Thanks for your reply, saejox. If anyone has an opinion on the topic of scene/level management with physics, please, do share it.