5-8-19

Another solution to some of the Actor Behavior issues is working out the scripting system. For some reason, I’m okay with a data solution being to pretty much “hardcode” game object behavior - but that’s cause it’s script… script is data! I’ve already integrated MoonSharp into the project, and it looks quite easy to setup - so another “relatively soon” move should probably be to get some simple scripting working.

What will you script though? Props / Actors could be fully scriptable. A Lua table defines what frames to use in the sprite animation (this begs the question, how do we access sprites already in the project, can we load external sprites?), defines what behaviors to include (built-in + require more script ones by name), and then each behavior’s properties can also be setup for whatever params they require.

Actor Behavior System

One issue that’s been a little complicated to work out with the actor behavior system is when multiple things want to perform the same behavior - so for this, I’m introducing the concept of “Resolvers.”

For example, the biggest one I’m running into is multiple things that wish to be interactable, the ResolverInteract would test if interaction with this actor is possible, if it is, then it distributes the command down its chain.

This likely will go hand-in-hand with the concept of a command dispatcher.