Wednesday, May 29, 2013

Building Libraries

So in my spare time, I like to play around with small components of various games and try to write them into small libraries. The nice thing about doing it this way is that it has no ties to a specific game. So the last few weeks I've been playing with a few different libraries.

First up, Behavior Trees. I was on AIGameDev.com and they have a few posts covering Behavior Trees rather than using Finite State Machines. So I looked at their code and built up a small library with some test cases to play around with their concept. I ran into a snag in that once it successfully made it through the behavior tree, you had to rebuild the tree, or hack the code to reset it. So after some more digging around I found snippits of other behavior trees and was able to make a small library with various nodes and put together a small demo in Unity3d showing a block moving to other blocks to "eat" them when it got hungry.

After that I started up the previous blog post and decided to begin looking at small scripts to handle cameras for most Strategy games (top down, scrolls when the mouse is near the edge, zoom with scroll wheel) and I've decided to make a permanent home for my musings. So far it only does some simple camera movement.

Today I'm looking into how to use Unity3D to make a radar system. I want to build it to behave both like an MMO with the player in the center, and like an RTS, with a camera frustum outline and the entire map displayed so you can click and zoom to that location.

As with everything I work on, I hope to build these into tutorials so that others can benefit from my musings as well.

No comments: