itch.io is community of indie game creators and players

Devlogs

Random timing of a simple task (Whitaker)

Party Panic!
A downloadable game for Windows

Hello again!
So, we all know that a good mash game has challenging AI. However, you also do not want that AI to all produce the same results every time!  I was racking my brain trying to figure out the perfect algorithm that would be time based, as opposed to frame dependent, that would provide challenging AI while also giving them a "human feel." I had already set up all my animations and logic in a behavior tree and really did not want to redo the work to get the logic in the AI controller. I tried even having the logic for the timing split off in the AI controller class. That was working fine all the way until I discovered the Timing task in the behavior tree!

With the wait task, I was able to configure a timing between tasks that could have a random deviation. This way I was able to make the AI challenging while feeling fairly random. The Ai would "press" the button wait a set time, with a random deviation, before "releasing the button." Then it would do it all again. This proved to be the same result as I was trying to do from the AI controller class but with SO MUCH LESS work. Who knew it could be so easy!

Download Party Panic!
Leave a comment