So I've got this scripting requirement in the game and in my current project but it's a bit different than your average scripting engine:
* able to execute commands simultaneously
* able to sequence commands in order
* does not require another thread
* does not block the calling thread
* able to take the same time input and reproduce the same results every time
* able to take any time input and produce results quickly
So it seems to me that this is really more of a deterministic state machine. The commands have a known element, time, that is essential to the process and the results. Because it is deterministic, variables are not allowed except at initialization time.
Major advantages:
* reproducibility - most languages require backtracking to return to an earlier state
* time based - the system is well aware of a timeline and the ability to scrub forwards and backwards
* simple - variables only used for initialization
* low resource overhead - multiple scripts can be "running" without a large number of threads
* low processing overhead - execution doesn't waste threads that are blocked waiting for animations to complete
* scripts can be paused, reversed, speed up, slowed down
* scripts can be "ticked" as needed, speeding up as necessary, round robin ticking on multiple scripts, etc.
General architecture:
Script Context - contains information about running scripts, variables, executing commands
Command - base class, getDuration, tick, getChildren, setTime
Batch Command - executes multiple child commands (container of commands)
Sequencer Command - executes child commands in order (container of commands)
Misc Commands:
Loop
Delay
Counter
Fire Event
Start Animation
Stop Animation
Set Animation
Set Texture
Set Position
Set Rotation
Set Scale
Play Sound
Stop Sound
Play Music
Stop Music
Set Shader
Set Shader Variable
...
