Saturday, July 28, 2012

Infiltrator Part 30 - Shredders + SFML 2

This particular feature addition stretched out over a long period of time for many reasons. All of which are completely unimportant. The shredder AI is almost 100% up and kicking and that's what matters.

These guys not only proved very difficult to fight for my testing team, but a challenge that kept me on my toes myself as well. The biggest hurl was the core design of the behavior. The actual programming came pretty quickly once I had everything designed. It's based on a simple four-mode program:

The first mode, seek mode, simply finds a path to the player and moves along it. The second mode, charge mode, turns toward the player with almost perfect accuracy and charges full speed with constant fire from it's chainguns. In dogfight mode, the third, it will strafe around toward the player's back, try to keep optimal fighting distance, and fire in short bursts at the player. There is a fourth mode also, but it is simply a waiting mode that does nothing.

Currently, I have each mode tethered to a debug key so that I can control them for testing purposes. I still need to add rules for when to switch to which mode, but that will be a rather trite issue compared to what I just got myself into. See, I have been developing in a 1024x768 windowed video mode. The ability to switch to fullscreen is an essential feature, and one that I decided to quickly implement. Needless to say, things are a bit more complicated than that.

The version of SFML I've been using(1.6) is apparently ill equipped to run fullscreen games. This finally convinced me to have another go at porting Infiltrator to SFML version 2.0. I had previously sunk a lot of hours into a similar endeavor that ended in failure, but things have been going much better this time. I started Friday and have been spending every moment of my spare time coding. Even writing this post requires a small break from this work. It's a blast really, and one that I must get back to. There are a thousand things to talk about related to Infiltrator, but they will have to wait.


No comments:

Post a Comment