Jump to content
  • Advertisement
Sign in to follow this  
Sappharos

Components / Spatial Graph

This topic is 2585 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

These are issues that stumped me a while ago - they were the final straw for me to abandon the project I was working on. I'm looking at it again now with a fresher brain. :)

When implementing a component-based entity system along with spatial subdivision, is a whole seperate spatial graph required for each component subsystem, or are there other approaches? Won't this result in such a decrease in performance as to make each spatial graph useless anyway? And is it okay for the components to be very fine-grained? My current system is about as fine as you can get, as I really dislike the idea of having any entities containing unused variables.

Thanks,

Matthew Rule

Share this post


Link to post
Share on other sites
Advertisement

These are issues that stumped me a while ago - they were the final straw for me to abandon the project I was working on. I'm looking at it again now with a fresher brain. :)

When implementing a component-based entity system along with spatial subdivision, is a whole seperate spatial graph required for each component subsystem, or are there other approaches? Won't this result in such a decrease in performance as to make each spatial graph useless anyway? And is it okay for the components to be very fine-grained? My current system is about as fine as you can get, as I really dislike the idea of having any entities containing unused variables.

Thanks,

Matthew Rule


I'm still working towards a component based design, so YMMV, but I opted to have a single spatial component, per object, which is handled by a spatial subsystem. what has really tripped me up so far is how something common to many components, like position, should be handled. So far my idea has been that components hold no data of their own, only functions. the data is stored in kv map of belonging to the entity as generic data. this way the entity has no original data(or unused data) only what has been added to it's map via it's components. I've not reached the light at the end of the tunnel, but this has definitely been my most reusable attempt so far.

Share this post


Link to post
Share on other sites

I'm still working towards a component based design, so YMMV, but I opted to have a single spatial component, per object, which is handled by a spatial subsystem. what has really tripped me up so far is how something common to many components, like position, should be handled. So far my idea has been that components hold no data of their own, only functions. the data is stored in kv map of belonging to the entity as generic data. this way the entity has no original data(or unused data) only what has been added to it's map via it's components. I've not reached the light at the end of the tunnel, but this has definitely been my most reusable attempt so far.


Well this is certainly an interesting approach. It seems like the polar opposite to mine because my components hold no functions, only data (virtually all component processing is handled by the subsystems). I'm currently wondering whether it would be feasible or practical for each subsystem to hold its own [s]scene[/s] spatial graph. Perhaps this would only be necessary for certain subsystems.

Share this post


Link to post
Share on other sites

[quote name='Burnt_Fyr' timestamp='1320948686' post='4882675']
I'm still working towards a component based design, so YMMV, but I opted to have a single spatial component, per object, which is handled by a spatial subsystem. what has really tripped me up so far is how something common to many components, like position, should be handled. So far my idea has been that components hold no data of their own, only functions. the data is stored in kv map of belonging to the entity as generic data. this way the entity has no original data(or unused data) only what has been added to it's map via it's components. I've not reached the light at the end of the tunnel, but this has definitely been my most reusable attempt so far.


Well this is certainly an interesting approach. It seems like the polar opposite to mine because my components hold no functions, only data (virtually all component processing is handled by the subsystems). I'm currently wondering whether it would be feasible or practical for each subsystem to hold its own scene graph. Perhaps this would only be necessary for certain subsystems.
[/quote]

You are going to likely find that some subsystems will have their own "view" of the virtual world. The render engine cares about the scene graph so that objects are rendered properly. The physics system will likely use an organization pattern that best fits determining collisions and callbacks to notify the affected entities. You will likely have some spatial subsystem where either transform components or some representation of a transform component is represented in an organized tree/structure so that when say entity A wants to yell or determine nearby enemies, it can query that subsystem, get that information and take an action appropriately such as aggro onto a nearby player that just walked by :P.

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!