XNA Creators Club Online
Page 1 of 1 (2 items)
Sort Posts: Previous Next

What is the best way to create a object Manager.

Last post 10/28/2009 11:53 PM by Ben Andersen. 1 replies.
  • 10/28/2009 10:54 PM

    What is the best way to create a object Manager.

    After I did some research on object managers and XNA I saw that someone was setting up a system where objects were essentially components and then wrapping a object manager around them. I don't really understand the reason for this approach entirely.  The main reason for having a object manager to my understanding is so that all objects are stored and updated in one place.  So it makes some sense to me to them components because componets are updated by XNA right?

    However what dosent make sense to me about this apprach is that you would have trouble searching through all objects and performing things such as collision with them inside of a central location. Secondly it would also easier to sort through the objects to be rendered and place in them the renders list of objects by renderstate. 

    Lastly if anyone has anyother good tutorial sites on object managers for XNA that pretty general I would appreciate the link thanks and have a nice day you guys.
  • 10/28/2009 11:53 PM In reply to

    Re: What is the best way to create a object Manager.

    Answer
    Reply Quote
    A lot of people have a class they define called "component" which is a simpler more flexible entity than the XNA GameComponent. Really hardly anyone uses GameComponents anymore, they are a kind of left over from when Microsoft ware trying to make XNA handle all the SceneGraph and Screen management itself rather than have the programmer develop his own system.

    You should really make your own. Not only will it be better trimmed down to fit your needs, but you can also make it more flexible as a result of it's simplicity if that's your goal.

    There are several different "Game Engine" tutorials out there that demonstrate such systems for managing multiple objects. Most of them have a root engine that updates and draws Screen objects in some order according to some criteria. While the Screens update and draw their Component objects when it is drawn and updated (respectively). Further some engine allow for Components to own Components which they manage and the chain goes on from there. The Component class is extended six ways from Sunday to represent everything from sprites to particle systems, to shader effects to AI entities, to space trees (octree/quadtree). really everything the player interacts with directly or indirectly within a screen is an extension of a component.

    here are a couple game engine tutorial series I ran into just skimming google
    http://www.innovativegames.net/blog/category/game-engine-tutorial/
    http://roecode.wordpress.com/xna-gameengine-development-series/

    I am aware that those are by the same guy, but it appears of all people making game skeletons in XNA this guy is the only one who is telling people how hw does it.
Page 1 of 1 (2 items) Previous Next