The upcoming MotorJ automata system or the fabulous Pigeon Behaviour Simulator - 09/09/2009, 02:23
Yesterday/today I uploaded a video of a new thing for MotorJ I've been working on these last 2 days: an automata system.
The objective of this system is to make it easier to add behaviour to NPCs in MotorJ-based developments. My main inspiration for this system is the Wind Waker version of Stalfos. I remember thinking: "Wow, not only is this boss incredibly detailed but it is also extremely hilarious! I want do something like this!". That boss does so many different things depending on which weapon it is being attacked with, and they are all so much fun (except of course when it flings the club at link and doesn't miss). That was a long time ago..
I finally got around to do it, and after thinking and tinkering a lot with the idea, I decided something like this:
- It must free the developer from as much boilerplate code as possible
- It must be relatively elegant and allow for adding states without having to adjust the existing ones as much as possible
- It has to be efficient
While code-wise it is not that impressive, it does help to keep the program a bit more tidy, and the programmer does not have to fuss with iteration and state switches other than calling Update() . It also seems to run pretty nicely (I tried with 200 pigeon entities simultaneously with acceptable CPU consumption, < 5%).
The sudden inspiration to actually start coding was watching children play with pigeons one sunny afternoon while waiting for the bus. I thought simulating pigeons would be simple, yet sufficiently complex to realise shortcomings and improvement areas.
So here's the video of the simulation, partially implemented:
I expect the system to hit the MotorJ repo (along with some bugfixes and documentation updates) in less than a week.