My AssetStore Link

I've moved - GO TO THE NEW WEBSITE

Unity Store Link - Click to see all the Song's work that has been put on Unity AssetStore




Thursday, 30 June 2011

Tower Defense ToolKit (TDTK)

Got a Brainwave this week thanks to someone who asked me to write some TD code base.  So guess what, I'm currently working on a TDTK. This TDTK is designed and made as a code base toolkit for easy construction of TD game of any kind. It should at least support construction of a standard TD game without needing of any code extension. It also meant to be serve as a tutorial/example project for beginner or maybe intermediate user of Unity3D. 

The toolkit comes with a bundle of scripts that is flexible and configurable to fit a variety of TD gameplay scenario. Part of the coding can be extended to use in RTS. Despite having two working example level (so far, this is still a WIP), there are no 3D art asset in this TD. The user are meant to incorporate their own models. However it does feature some 2D standard asset some example example/prefabs demonstrate how to use a simple 2D texture to the best effect. So there's definitely more than code that is showed in these Toolkit.

Here are a list of the feature currently implemented or supported in the TDTK:
GameControl and GUI
  • Configurable resource, player's life, number/type of buildable tower for every scene
  • Configurable number of wave, creep type for each wave, number of creep for each wave, interval for each wave
  • Selectable tower after being built for stat display, upgrade and selling.
  • Range indicator for for tower when seleceted.
  • Hitpoint Overlay to display hitpoint

SpawnMode Supported:
  • Timed Wave Spawn
  • Timed Wave Spawn with skipped time upon wave cleared
  • Timed Wave Spawn with user Initiated Skipped
  • User Initiated Wave

Creep:
  • Configurable hitpoint, speed, resource gain upon unit destroyed, hp overlay display.
  • Auto determining of waypoints.
  • Compatible to use with custom model with custom animation.

Tower:
  • Two build mechanism, build on specified tower platform or build on pre determined grid.
  • Configurable damage, range, cooldown, aoe, slow effect, shootobject, targeting, upgradable level, upgradable stat, resell value.
  • Auto setup component and parameter depend on model used.

Tower firing object:
  • Projectile: basic projectile type, with configurable speed, projectile curve
  • Missile: a missle type, with configurable speed, curve pattern
  • Beam: a straight laser beam
  • Shockwave: aoe wave type, with configurable expanding speed and radius

Game Environment Setup:
  • Auto setup path object for creep (2D only). Considering adding 3D.
  • Auto setup collider component for tower with custom model

Camera(typical mmo character camera):
  • Pan on horizontal plane using keyboard or mouse at the edge of screen
  • Rotate camera arround pivot.
  • Zoom in/out using mouse scroll.

Quite a list consider I've only worked on it for less than 4 days. Most of the feature are now in place. What's left is polishing and testing and of course, documenting. I'll need to have most of the code commented to hit the brief that this is a more or less a beginner's example project, something I don't normally do. >.<

As a customary practise, here's some screenies:
Screen shot taken from scene with grid based tower deployment
Screen shot taken from scene with platform based tower deployment, notice tower is built on some pre-placed platform.
And a brief playable demo put together using the TDTK. http://dl.dropbox.com/u/23073684/TD_ToolKit/platform_based/WebPlayer.html In this demo, the standard camera control apply, w,a,s,d to pan, left-click and drag to rotate and mouse-scroll to zoom. A scene like this including the tower type, creep type, creep path can be setup with relative ease using the TDTK. Please let me know if you find any bug with the demo.

To be honest, I've actually have this in mind for quite sometime. Most of the code or effects are what I spend hours digging the web though self help material and put together in my self-teaching learning process.  I guess this should be helpful for anyone who wants to learn about unity. I'm planning to put this up in the unity asset store in upon completion.

No comments:

Post a Comment