szdarkhack wrote:Pretty much, yes. The general idea is that if you want to make, say, a plane, you just make a new entity, add the components necessary and add it to the scene. Of course there is nothing stopping you from automating the creation, although since the main point of using a component system is flexibility, i would advice against hardcoding it. Perhaps, for example, you can read what components to attach from a file describing your objects, or something similar.
Ok, good idea but I quite like the automated approach hehe. But I agree, things would be even more flexible with scripting the types.
GyroVorbis wrote:Yeah, that's exactly right.
There's nothing stopping you from having a factory "assemble" a specific type of entity by automatically attaching components for you. That's essentially how saving/loading works. It lends itself extremely well to serialization/deserialization.
Sweet, I choose that way because my entity types are pretty straight forward and I kept things simple.
Speaking of serialisation, I was considering a PAK file format for all the necessary resources needed. But I wasn't sure how it is done; reading in files and then concenate them into one file, or actually loading them into the engine (e.g. Texture("tex.jpg")) and then serialising the state of the object into a binary file?