Game Development Community

dev|Pro Game Development Curriculum

Docoto Defense October Update

by Deozaan · 10/31/2007 (12:18 am) · 3 comments

TGE was proving to be too complex for me to make much progress, so I decided to go back to TGB. My background is mostly in Flash/Actionscript so the 2D stuff makes a lot of sense to me.

Anyway, since I made that decision I've been coding away at the project. It's been some slow progress, me being a full-time student (and strangely it seems my wife's schooling takes up more of my time than my own) and having a part time job. The day I decided to go back to TGB I coded up something to get a turret to follow and shoot at a target. I wrote in my developer blog about the decision to move back to TGB and what I'd done with turret tracking.

Here's a video of the initial targeting in action: Small (~8MB) or Large (~22MB).

I was so excited just to get something done with the game after facing so many setbacks, and just trying out some prototypes to see if certain things would work, that I didn't think it through very well. When I actually sat down and thought about how I wanted these things to interact with each other, I realized the way I'd gone about having the tower pick it's target and follow it around was not done properly.

So I sketched out some relationships on a piece of paper and then tried to figure out how to use UML software, which didn't work very well, so I ended up just using a standard image editor to draw this up:

docoto.dcisv.com/blog/wp-content/uploads/2007/10/docoto-turret-tracking-flowchart.jpg
Using the behavior system in TGB 1.5.x is nice because it lets me add this functionality to any object in the game. With that in mind I've been trying to generalize some of the functionality and make it very expandable and flexible.

Here's the dev blog entry which details the flowchart and shows a new video (~1.5MB) of the rewritten code in action.

Then finally, after testing the code more fully I realized even more changes needed to be made to give it the functionality that I wanted, so I heavily modified it and I think now I've got it working at a very satisfactory level and I can move on to something else.

There isn't a lot about it to show off visually, but I feel the inner workings of the code are very robust and will allow for some fun and interesting strategies in the game.

- Deozaan

#1
10/31/2007 (12:30 pm)
That is VERY cool. I like how you give the turret several choices (near, far, amount of health, etc.). Very interesting work. Let us know how things end up.

Behaviors are REALLY nice.
#2
04/24/2009 (12:16 pm)
Awesome!!
#3
04/28/2009 (6:22 pm)
Johnny:

You asked in my June Update thread how I got the turret to track the bubble when it entered in a certain range.

I did this all about a year and a half ago so I don't remember exactly how I did everything. I was new to TGB and didn't really know what I was doing. I think I did it all or most of it in behaviors.

This is my getTargetList.cs (a behavior).

And this is my GetTargetFromList.cs (another behavior, which I never finished).

I also modified or used vanilla "stock" behaviors such as FaceObjectBehavior and TimerShoots.

Finally, I'm not sure if all this code is completely compatible with the latest version of TGB.

I hope this helps a bit.