ECS seems to do best when you can operate on multiple entities, but if I have an entity that has unique/specific behavior should that still adhere to ECS architecture? It just seems a little excessive to have components and systems for single entity types. The only solution I can think of for this is to have a behavior component which references a script and then a system can call its functions such as onStart, onUpdate, etc technically this makes it not pure ECS, but it’s not a huge deal.
1 Like
Can you get into a bit more detail about what this entity represents?
Sure, I’m making a tower defense game so an entity could be either a tower or enemy. Most tower entities will have components for doing damage, but I might have a utility tower that just generates money at the start of each wave and doesn’t attack I could also have a tower that generates money, but instead of every wave it might be over time. So I have these two entities that sort of have this unique behavior.
1 Like
You make a tower attack component, and a currency generator component. Anything with the tower attack component attacks entities that have enemy component. Anything with the currency generator component, adds X currency whenever round is ended