Where to generate data in an Entity-Component System?
- by Mark Mandel
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.