Jump to content
  • Advertisement
Sign in to follow this  
Raeldor

Item List and Info... In Scene Graph/Node or Seperate List?

This topic is 4825 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I need to store a list of game objects that exist in my world and their positions and data such as attributes (health, strength etc.). I currently have a scene graph which holds the meshes and nodes, but should I really have a seperate world inventory so to speak, or should I just subclass a scene graph node and put the information in there? Is the scene graph best left for rendering purposes and have a seperate game object list and game object class that points to the correct rendering node? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Seperate is much better. You might inherit from the same tree structures to orginize them the same way, but the trees themselves should be seperate instances.

Why? Because objects should be seperate from their representation. It makes for a cleaner use of the object by themselves. It makes for an easier time to change/upgrade either the object or its representation without breaking the other half. It eases moving objects to a place where they're not rendered [AI/network server]...

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
Why? Because objects should be seperate from their representation. It makes for a cleaner use of the object by themselves. It makes for an easier time to change/upgrade either the object or its representation without breaking the other half. It eases moving objects to a place where they're not rendered [AI/network server]...


Interesting you mention moving them to somewhere they are not being rendered, as that is another thought I was having. Won't they still need access to a lot of the same information as in the scene graph such as bounding boxes and vertex information to do collision detection if they are on a server?

Share this post


Link to post
Share on other sites
Quote:
Original post by Raeldor
Is the scene graph best left for rendering purposes and have a seperate game object list and game object class that points to the correct rendering node?


This seems to be a common approach, one which i agree is better over the former. You might be interested in reading this:

The GDC 2003 Game Object Structure Roundtable check the Scene Graph section.

Slightly related to:

Game Object Structure: Scene Graphs
Game Object Structure: Scene Graphs Revisited

Take what is said in those articles with a fine grain of salt as the guy writing those articles is just as confused as anyone else.

Share this post


Link to post
Share on other sites
Quote:
Original post by snk_kid
Take what is said in those articles with a fine grain of salt as the guy writing those articles is just as confused as anyone else.


Wow, great site... never seen that one before. You are right about the confusion, but in a way it's strangely reassuring :P. The articles helped a lot though, as did your advice. Thank you.

Share this post


Link to post
Share on other sites
Quote:
Original post by Raeldor
Quote:
Original post by Telastyn
Why? Because objects should be seperate from their representation. It makes for a cleaner use of the object by themselves. It makes for an easier time to change/upgrade either the object or its representation without breaking the other half. It eases moving objects to a place where they're not rendered [AI/network server]...


Interesting you mention moving them to somewhere they are not being rendered, as that is another thought I was having. Won't they still need access to a lot of the same information as in the scene graph such as bounding boxes and vertex information to do collision detection if they are on a server?


[IMO]

Well, ideally, no. Ideally, game objects exist in the game world, which has no concept of vertexes. There you have game world position, size, weight... things that matter to the game. The representation builds off that, with added stuff [camera, images, models]. It's simple hierarchal object design on a massive scale. Making game coordinates equate to rendering coordinates leads to these sort of design issues when you need to run a server or use AI.

[/IMO]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!