AI (artificial intelligence) is another big topic. My game is modular everything, so that necessitated a modular AI. Sometimes, I like to do clean-room development.
AI and Clean room architecture vs Research
I want a good AI, and most AI out there is junk. I went to an AI seminar once with some industry veterans and experts at the University of Alberta, and they mostly (that I remember) talked about how poor AI was in the game industry. I still read about how it’s often just tacked on without much thought.
Also, computational intelligence and cognitive psychology are also hobbies of mine, and I have a few unique angles I’m pursuing.
So, early in development, I made my own AI architecture. I got it working and it’s not bad. I knew I had one pain point, which was scheduling of AI reevaluation. It turned out to be a good decision to defer this until after I learned about coroutines (from Unity3D.)
Clean room development is fun, and I love starting with a clean slate.
At some point, though, I just want a good solution, now. I want to ship yesterday, so I want solutions the day before yesterday. I want to watch a 20 minute slideshow from someone who knows what they’re doing, and then I want to grab some open source code or write my own and hit the ground running.
Recently, I addressed the pain point of AI scheduling while simultaneously revisiting my AI architecture.
I discovered behaviour trees (on AiGameDev.com). Cool stuff! Simple, elegant & legit. Not getting into the complicated stuff yet — easily understandable. I found an open source implementation (TreeSharp), but since it’s such a simple concept, it wasn’t too hard to roll my own, ….and revolutionize behavior trees in the process. Ok, maybe not a revolution, but I did make polling optional (using scheduled coroutines), instead preferring event driven behaviors, scoring, and evalutation, which I thought was cool. (Hopefully I can release this code as open source. If you’re interested, let me know.)
It is a great way to learn, to start with no knowledge on a topic, and try to make something good. You end up getting a few things right, and a few things wrong, and it makes you appreciate yourself, as well as the legit solutions that are already researched and out there.
Fortunately, my first stab at AI fits pretty well into behavior trees, and cleans it up while letting me keep my fuzzy and modular logic.