Open rusu24edward opened 2 years ago
I need to work on the design. I came up with this idea because I wanted to implement the example where the agent only dies when it is attacked by two agents at once. However, I can implement that using the agent's health instead of making a separate actor or completely changing the attack actor design.
This commit shows the actors becoming responsible for updating the state themselves instead of giving the update responsibility to the State handler. For example, attack processes health changes and removes the agent if it dies; move actually moves the agent; etc. This restricts the game dynamics. Action processing should return the result of the action, such as new position, or list of agents that were attacked; then the state can deal with that accordingly. The lines here are blurred for movement, which is pretty straightforward, but they become more distinct for attacking. For example, suppose we have an agent that must be attacked by two enemy agents at the same time in order for those attacks to be successful. Right now, I would have to make a completely new actor to do this, but most of that actor's actual processing will be the same; only the result logic will be different. Instead, the actor should just say which agents were attacked. We could then store that information and process it after all the attacks are done.
In Epic #337