Thursday, January 3, 2013

Facilities, and crit success at programming!

In Skitter, you begin the game with not much on your ranch. You have your home, your barn for your new pet monster, and an empty lot. As the game progresses, you can buy land expansions which essentially give you more empty lots. On these empty lots, though, you can build facilities. Facilities are where you can train or play with your monster. Each facility has one function, so if you want a variety of training options, you will need to build many.

"Facility" is a sort of weird term, because a "facility" can be many things. For example, the empty lot is itself a facility where you can let your monster run free. This free play-time will allow your monster to train itself by playing, much like children stay healthy through playing outdoors. You can also turn your empty lot into a vegetable garden, another type of facility where your monster or yourself can toil away at the land to produce crops that you can sell for money. You could use your empty lot to build a track where your monster can practice running. This type of facility can really help your monster become faster and learn to love running (or, depending on how you use it, maybe make your monster hate running!)

Of course, those are just a few examples of some early facilities you can build. As you progress through the game, expand the size of your ranch, and make a lot of money, you will be able to upgrade to plantation fields, training gyms, exotic zen gardens, and more!

Using training facilities is easy. Wherever you go, your pet monster will follow you. So just go to the facility on your farm, and you will see your monster wandering around. To interact with your monster in Skitter, all you have to do is tap or click on the monster. If you are at a facility, your monster will start training! It's that simple. Training at a facility will take a large chunk of time out of your day, as it is the main way you interact with your monster. Plus, abusing facilities to try to get a powerful monster can cause your monster to get frustrated or bored and refuse to cooperate. So you have to choose wisely how to utilize facilities and make the most of them.

Anyway, this fun aspect of Skitter was the focus of my coding tonight. I essentially wrote the code that recognizes which facility you are visiting, pulls needed data from the facility database (which I can expand on to add new types of facilities to the game easily), and then makes your monster respond accordingly when you click on it while at the facility. Of course, this had to be a code that would work with any kind of facilities. So it essentially takes a lot of numbers from the facility database and uses them to generate a training sequence...

I guess it's kind of hard to explain exactly what I did, but I will just say that it was hundreds of lines of code across multiple objects and files. I also added the "boredom" system, and created the formulas for calculating boredom, talent and interest skewing, fatigue, stress, and more. Of course, these are subject to change in order to balance the game.

But the key point to explaining all of this is that I programmed this all in one go without testing, and then when I tested it, it all worked! There were no crashes, no glitches, no unexpected behaviors... Everything worked perfectly! Even though I had never "played" the game where a facility was able to exist, I was now able to leave the barn, see my facilities on my farm screen, choose a facility to go to, and click on my Skitter to allow him to play freely for 3 hours, raising his stats properly!

Normally, since I'm a noob programmer, when I code even the tiniest snippet, I test the game. Half the time, even that results in some kind of error or unexpected behavior... and whenever I code something larger, it's almost guaranteed to crash the first time I run the program.

So I'm really happy that I was able to create a lot of complex code and for it to work fine on the first go! Some of the code is probably a little sloppy, but it works, and that's what's most important :)

At this rate, I should have all of the major systems done in a few days, and then it will be on to tackling both the design and programming for the contests, which is going to be where the bulk of the entire time spent in coding will go. I usually code a new "system" (like the text input system, barn system, clock system, whatever) in a day, sometimes multiple systems in a day. But the contest system itself should take a day or two, and then the actual contests themselves will be like programming entire games in themselves.

The actual specifics of how the contests will work are not set in stone, and I will most likely as for input about this as I get to the time when I'll actually be creating them. So I would hope that anyone interest in the project would like to offer suggestions. Of course, the core of the idea is set, but I would like to know some things for some specific directions. So stay tuned :)

No comments:

Post a Comment