Where to generate data in an Entity-Component System?
Posted
by
Mark Mandel
on Game Development
See other posts from Game Development
or by Mark Mandel
Published on 2012-12-18T03:05:09Z
Indexed on
2012/12/18
5:13 UTC
Read the original article
Hit count: 164
architecture
|entity-system
So I'm making a small game where I generate 2D landscape using perlin noise when the game first loads.
I've got it working in a OO way, but want to move over to an ES architecure, and I'm just struggling to work out the right place for the code that does the generation to go?
In OO world, I have a World
object which gets passes a coordinate
value that is used as the seed for the perlin noise, and generates all the points for the land mass when the world is created.
I'm thinking I need a World
component with a coordinate
field on it - that's an easy part.
From there - is it right for a component to generate data when it's first initialised (or is that too OO?)? Or should a System be doing that instead, when the game first starts?
Or... some other solution I'm not aware of?
Thanks in advance for any guidance.
© Game Development or respective owner