Game Development Community

Shnazz Tower Defense

by Steven Meek · in Torque Game Builder · 02/10/2008 (8:57 pm) · 7 replies

Howdy All,

I've been working on a Tower Defense game as a personal project of mine for the past month or 2.

I'm using Torque Game Builder 1.6 and its been great!

Any who, check out the video youtube.com/watch?v=rpkd8HeKMLg and the website www.shnazztd.com for updates.

I'll hope to get a version out soon for the public, but I need to get an online score submission setup going first.

Check it out!

#1
02/10/2008 (10:22 pm)
Do you have a proper pathing system set up, or do they just hug the walls?
#2
02/11/2008 (5:19 am)
I'm just using t2dpath with some spawn and death objects. I decided against any tricky pathing system due to the simplicity of the mazes.

In the future I want to implement a AI pathing system so I can make a level where towers make the maze.
#3
02/17/2008 (10:54 am)
Hey great work

I am currently working on a Tower Defense myself and was wondering how you did a few things. How did you get the towers to attack the monsters, and spawning the monsters onto the path. I'm having some issues with attacking a pathed object. Any help would be great.
#4
02/17/2008 (11:35 am)
Howdy thanks for checking it out.

It was really simple actually. All towers and enemies created are added to a SimSet and removed once killed or whatever.....

Each frame I calculate ONE of the towers to select the enemy to shoot. So that tower loops through all enemies in the enemy simset and calculates t2dVectorDistance and compares it against the tower range.... thus selecting a target and then damaging it.... There's more to it, such as skip towers who just shot, target selection mode for that tower, etc.... But thats the idea

Originally I experimented with setting up a circle collision area with each tower to use torque to calculate when an enemy goes within the towers radius... I found this to be slow and very confusing to implement.

Spawning monsters on a path is actually the one annoying thing about this all. Essentially the enemy is create in code, assigned it's datablock then position is set to the "SpawnObject" which is an off camera t2dSceneObject set in the location to spawn the enemies per map.... Once the enemies are created for the level a I run a schedule to set them to the path object and add them to the enemy sim set. I hard coded the start node and end node to put them on so when creating a map you have to make sure it matches up......


The down falls of using a t2dPath object is you can't really make a good Slow tower, I can really only make enemies stop dead instead of slowing their path speed.
#5
02/18/2008 (7:07 am)
Ok guys I've uploaded version 1.0 enjoy!
#6
03/01/2008 (3:49 am)
Brilliant,

Was a bit similar to something i had planned, but never got started, spent about 2 hours playing this today, what have you got planned next for it?
#7
03/30/2008 (6:37 pm)
Ahh, lots of stuff. Sound and music for starters, more of a design on the towers. Some bug fixes of course.

But the big thing I'm working on for the next version is Tower mazing, where you create the maze with your towers.

Thanks for playing of course!