A Great Darkness Looming on the Horizon
Progress
I was able to work on my game a wee bit this weekend. Only a few hours on one of the nights, but hey it's work, and progress was made! I mentioned the desire to complete my camera and control work so that I would have an enclosed playground to play around in. Well, my desires have come to fruition!
I was able to restrict the camera to within the map boundaries pretty easily. It took longer than it should have, because the landscape I was drawing to the screen was not positioned properly, and I took that as a flaw with the camera focusing, but I tracked it down before I spent too much time barking up the wrong tree.
I also managed to restrict the ship's movement to within the map boundaries. I'd originally messed with reversing the ship when it hit the boundary, but I found the resulting bounce-back somewhat undesirable. Ended up setting it up as if it were a wall. The ship will simply stop moving forward at the edges. Nice!
That stuff aside, I was finally able to start digging into the Enemy code... woo! I... actually made some substantial progress in a really short time. I've got a ship that appears on the screen and will try and patrol along predefined paths. More importantly, I've got some serious state and behavior management integrated already. The enemy will decide whether it should be Attacking, Guarding, Patrolling, Hiding, Fleeing, etc. Deeper still, he will decide when he's Patrolling (the only behavior I've addressed so far - want to get it working before proceeding), how he will patrol. Where will he go? How fast will he get there? What will he do when he arrives at each waypoint? Will he turn back when he reaches the end, or circle around back to the beginning? I've made all these variables... well, variables, so that I can make any number of enemies that might patrol differently quite easily.
The Rigamorole
I have several issues facing me immediately and they actually present quite a challenge. For instance, I set up a Queue of actions I want my ship to take... like correct it's angle, change it's speed, etc. The problem I see is, what if I want to change it's angle and accelerate at the same time? A single depth queue could make this quite difficult. Also, if I were to queue up multiple things at once, do I perform the entirety of the queue at once, or do one action, then the next when the first completes? I'll want the enemy to be capable of moving and firing at the same time, for example, so I need to figure out a way to achieve this. How will I prioritize some things over others? Hrm. Yeah, I don't know either. Perhaps some research on AI would shed some light on things. I'll see what I can find. Anyways... immediate goal: get my enemy ship to patrol properly... right now he doesn't change angle and slowly accelerates to the right off the screen forever. Smart guy...
