Allllllllright, so. I'm programming a server/client MUD in C# using a form of the Entity/Component design paradigm. I've made a substantial amount of headway, even reaching the point where I can move about the world and interact with simple objects and other players with no problems or glitches. However, I ran into some issues when I started learning about and implementing a state machine for AI purposes. From what I can tell, the State Machine design in Programming Game AI by Example will not work for an Entity/Component system, at least, one like mine. My basic design is as follows:
All of my components are managed separately by their own respective managers. Each manager is instantiated in a Region object representing a specific area of the game. I do this so that I don't have to load large amounts of data into memory in order for players to interact with the world. Only regions with players are active. Others update the database and are disposed of. All components are in a dictionary keyed to the ID of the Entity that owns it.
My entities are basics classes containing their ID, their Region ID, a List of ComponentMap objects that describe the type of component and ID for each component it contains. (this hasn't really been of any use yet, but I'm loathe to remove it until I'm sure).
Most of my 'system' code lies in my Game class. This class handles the different regions, and has methods for logging in and out, character creation, updating client information, and so on. I basically just pass around the currently focused Region and Entity, and do work.
I'm having a hard time wrapping my head around state machines though, at least in this context. Since my entities don't hold any of their own data, a State Machine can't really do much. I've run into a wall. Any advice on State Machines in an ECS?