Sunday, July 24, 2016

Game Actors Or Input Components?

Game Actors Or Input Components?

Hi everyone,

 

I've recently in the last year been working on my own practice ECS-based engine and have been making good progress, although limited to very simple game implementations like Pong!  Actually enjoying sticking with it believe it or not; my mega-fantasy game can wait a bit longer :-).  Now I'm getting into more and more detailed (and more confusing) implementation issues, I'll probably be pestering this board more and more for your insight.

 

Basically, I'm now stuck on how to properly implement how to control the player character and also AI characters.  A few issues or possible resolutions have come to light. 

 

1.  Since I'm using an ECS architecture, then why not simply add an Input Controller Component for the player characters and an AI Controller Component for the AI characters;  The Input Components get handled by the input system (which read from the keyboard and game controllers) and then send commands/messages/events to other components to make the player move or do stuff.  On the other hand, in most games only one Entity (i.e. the player) will have an Input Component so is this overkill?

 

2. I've seen in some places (most notably in Unreal Engine) about Actors or GameActors.  Although it's rarely stated explicitly, I'm assuming an Actor in this context is an Entity that can be controlled (either player or AI)?  The reason for my confusion is in Unreal, it almost seems like an Actor is the same as an Entity, just a different name (although maybe I am wrong about this).  Or is there a fundamental difference? (Does Unreal have both Actors and Entities?)  In that case, are Actors in a pure ECS-model simply Entities with either an input or AI component?

 

3. The third final source of confusion is that there is the 'Actor Model' of programming which I have some understanding about.  Is it just an unfortunate coincidence that they have the same name, or do they share something in common?  Some people have talked about implementing an Actor System with ECS just to confuse me more.

 

Apologies if this has been answered before.  I did look on the forums but could not find any answer that was satisfying.  Thanks for your help in advance.


No comments:

Post a Comment