Search Unity

TowerDefense Toolkit v1.0 now on AssetStore

Discussion in 'Assets and Asset Store' started by Song_Tan, Jul 13, 2011.

  1. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993


    This TowerDefense Toolkit is designed and made as a code base toolkit for easy construction of TD game of any kind. It supports construction of TD game of any kind without needing of any code extension. It has been updated to version1.3.3. The addition in v1.2 are open-field gameplay mode and a path-finding component. With v1.3 the toolkit is now iOS compatible. Here's a v1.3 demo contains 5 playable levels:

    http://dl.dropbox.com/u/23073684/TD_ToolKit/Demo/TDTKv1.3.1_Demo/WebPlayer.html

    Everything shown in the demo is included in the toolkit (tower prefabs, explosions effects, particle systems...). The toolkit also support another wide range of TD gameplay variety other than the one shown in the demo. Here's a rough list of the of what the toolkit contains:

    iOS compatible (tested on iPhone4)

    Configurable Level
    • Configurable resource, player's life, number/type of build-able tower for every level
    • Configurable number of wave, creep type for each wave, number of creep for each wave, interval for each wave.
    • Configurable path and spawn point (multiple spawn point and path supported).
    • Options of two play mode (fixed path or open-field play)
    • Options of two build mode (towers build on grid or build on designated platform)
    • Options of two deploy mode (drag and drop or point and build)

    GUI
    • Two preset GUI type, scripted OnGUI() function and gameObject-based GUI-elements
    • Tooltip showing tower stat and info in building selection
    • Selectable tower after being built for stat display, upgrade and selling.
    • Range indicator and selection indicator for tower when selected.
    • Hitpoint Overlay for creep/unit to display hitpoint

    SpawnMode Supported:
    • Continous spawn based on time.
    • Continous spawn when a wave is cleared.
    • Round-based where each round (a wave) require user initiation.
    • Option for user to skip a the waiting time for a wave for continuous mode

    Creep/Unit:
    • Configurable hitpoint, speed, resource gain upon unit destroyed
    • Auto determining of waypoints.
    • Compatible to use with custom model with custom animation.
    • Can be assigned a custom effect (ie. explosion) to display upon reaching end of path or destroyed

    Tower:
    • Two build mechanism, build on pre-placed tower platform or build on pre determined grid
    • Configurable damage, range, cooldown, aoe, dot, slow effect, shootobject, targeting, upgradable level, upgradable stat, resell value.
    • Compatible to used with custom model tower base and turret.
    • Support model change upon tower upgrade.
    • 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 appearance such as colour and fade out range.
    • Projectile, missile and beam can be assigned any custom hit effect to display upon hitting the target.

    Example and Effects:
    • This package included a number of example example prefabs to demonstrate how the base script can be used or configure to its' best effect.
    • These example include a number towers, shootobjects, creeps as well as two example scenes with different type of TD game play.
    • The package included a number of effects ready to be used in this or other game.
    • This effects are used in the example scene and the example prefab. They are mostly use as shootObject hit effects or special tower effects

    Minimap:
    • Show creeps/units, tower, creeps' path and camera position and field of view(fov).
    • Configurable position and size of the minimap on the screen.
    • Map scale can be adjusted during runtime. (zoom in/out)
    • Configurable blip appearance (texture) and size for creeps, towers and the paths as well as camera position and fov.
    • Run as a active rotating map with camera or a static map, configurable during runtime.

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

    Audio
    • Audio Manager enable playing of music as well as different audio clip for different event such as new wave spawn, tower built, tower upgrade, level lost... etc.
    • Each unit/creep and shoot object can be assigned individual sound clip for appropriate event

    Update for v1.1
    • added GUI-elements based UI
    • added new tower deployment scheme
    • added scene transition facility
    • revamp code logic flow to be more organised along with lots of optimization
    • added comment on some of the script explaining the vital logic flow
    • added untested code block for touch input

    Update for v1.2
    • added open-field game play mode where creep find the shortest path on the map and player are can actively block the path with towers.
    • comes with a portable A* path-finding component.

    Update for v1.3
    • Optimized and tested on iOS
    • Tower can now deal over time damage


    Please visit http://song-gamedev.blogspot.com/search/label/TDTK for more detailed listing of features. Or feel free to contact me if you have any question.

    Finally here's the link to the asset store: http://u3d.as/content/song-game-dev/tower-defense-toolkit-tdtk-/1Zt

    A stand alone scripting package for the minimap is also available: http://u3d.as/content/song-game-dev/minimap-script-package/220.
    A stand alone path-finding system used in this tool kit is also available: http://forum.unity3d.com/threads/109512-PathFinder-version1.0-now-on-AssetStore

    If for whatever reason you have problem getting the package from the AssetStore, please contact me directly if you like to make a purchase. I'll be giving a discount for anyone who is doing a direct purchase!


    Thanks for reading!
     
    Last edited: Feb 16, 2012
  2. ognjenm

    ognjenm

    Joined:
    May 3, 2011
    Posts:
    97
    I'm using this Toolkit , and it is very advanced!

    This is Demo Game that i'm working on, it is not using all features of toolkit!. :

    http://www.kongregate.com/games/ognjenm/defend-serbia-demo-test


    I'm not good scripter/programmer , but this thing is so easy to work and it have a very detailed documentation. You only need to know click with your mouse and have idea for game :)
    Also songtan is very support guy he will help in any problem. Game can be very stylized because toolkit support music,effects,animations and much more. I never seen such good project like this one for unity.It can be used also for learning scripts are very good commented. I strongly recommend this thing!
     
  3. flim

    flim

    Joined:
    Mar 22, 2008
    Posts:
    326
    Is that mobile platform friendly?
     
  4. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Although untested, the scripts should be ready to be compiled for mobile platform. However the toolkit doesnt have a control scheme (touch-based control) for mobile platform. Everything is mouse and keyboard currently.

    I'm plannning an update to make it more mobile platform friendly.

    Edit: Since it's untested at all, performance is not guaranteed when compiled for mobile platform
     
    Last edited: Aug 10, 2011
  5. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    After some feedback from the unity community and some reconsideration. I've deceided that I would do the decent thing and make the package more affordable. With the hope that it would serve the community better without too high an expense to myself. The toolkit afterall is partially intended as an example project that include examples to show how certain things can be done in unity. In short, I've adjust the price to $65.

    On that note, I've also update the toolkit to version 1.01 with slight improvement to the minimap component. I've made this submission and price adjustment since yesterday. I'm making this annoucement now that I've realised the new version and price has gone live.
     
  6. waywardchicken

    waywardchicken

    Joined:
    Jul 13, 2011
    Posts:
    23
    Thanks for the adjustment, it was the tipping point for me and I picked it up this afternoon. Looking forward to working with it.
     
  7. kheng

    kheng

    Joined:
    Oct 22, 2008
    Posts:
    126
    Can the build on pre-determined grid be put on a sphere? And does the turret recognize to attack flying objects?
     
  8. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    waywardchicken: I hope you enjoy it. Let me know if you have any problem. :)

    Kheng: I dont really understand your first question. The grid based system in the toolkit assume the game area is taking place on a flat terrain if that is what you are asking. For you second question, the towers can be configured to either target only one of the flying/ground units, or both. So effectively three targeting type: targeting air unit, target gound unit, target both air and gound unit.
     
  9. kheng

    kheng

    Joined:
    Oct 22, 2008
    Posts:
    126
    Yea I was hoping it didn't have to be on flat terrain.
     
  10. shaneneville

    shaneneville

    Joined:
    Jan 8, 2011
    Posts:
    7
  11. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Shaneneville:

    Unfortunately There's no pathfinding in the toolkit right now.

    But your question just gave me the idea. I'll probably try to put it in the next update. But I'm afraid that wont happen in very near future as I'm quite busy recently.

    Hope you enjoy the toolkit.
     
  12. bkviper

    bkviper

    Joined:
    Aug 10, 2011
    Posts:
    1
    I just downloaded Unity and starting to get familiar with it.
    I was really interested in building TD game for my Android as a first personal project.
    This toolkit is beyond what I could have expected for a learning tool.
    Only problem is I am dead set on Android development.
    I will be watching this app for future updates with great anticipation.
    The day it supports mobile platforms, you've got another sale for sure.
    Keep up the great work.
     
  13. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thanks viper, I hope you could gain something from it.

    I'm indeed working on the mobile platform support. Hope I could make it available in the near future.
     
  14. dgutierrezpalma

    dgutierrezpalma

    Joined:
    Dec 22, 2009
    Posts:
    404
    One thing that could kill performance in mobile devices is "Instantiating" and "Destroying" GameObjects (for example: bullets and enemies). Instead of that, you should use a pool of reusable GameObjects: whenever you need a new bullet, take it from the pool... when you want to destroy the bullet, disable the GameObject and return the bullet to the pool so it can be reused later. There is some nice implementations out there, but I usually use the Prime31's LINQ Object Recycler: http://prime31.com/unity/docs/

    By the way, another interesting feature for a future version would be the possibility of choosing which kind of enemy will target each tower first (the first enemy, the last one, the slowest, the fastest, the strongest, the weakest...).

    I would also like being able to position the towers wherever I want (as long as it doesn't collide with another tower), like it's done in this game: http://ninjakiwi.com/Espanol/Games/Tower-Defense/Play/Bloons-Tower-Defense-4.html
     
  15. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thanks a lot David, I have since found that out since that particular post of mine. The point is current version is not tested at all on mobile platform. Rest assure the mobile platform compatible version when released, will be fully tested, both in term of performance and control scheme.

    I will give your suggestion some thoughts. Thanks again.
     
  16. Eva Maria

    Eva Maria

    Joined:
    Dec 21, 2010
    Posts:
    85
    Hi Song ... your toolkit looks great. Here is another customer waiting for the mobile enabled version :)
    Any forecast on the release date?
    Cheers
     
  17. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hi Eva, thanks for the interest! I'm still not sure about the release date of the mobile compatible version as of now. It depends on how fast my tester can give me the feeback I need. Hopefully it's no more than a month or two from now.

    Still I plan to have some minor update that would improve the current version in the very near future.
     
  18. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I've noticed that Unity AssetStore has stop transaction using paypal. I'm aware that this might be an issue for of people who uses only paypal (such as myself). Please contact me directly if you like to make a purchase.

    I'll be giving a discount for anyone who is doing a direct purchase!
     
  19. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Updated to version1.1 on AssetStore. Please read the first post for the information.
     
  20. Drewbie

    Drewbie

    Joined:
    Dec 22, 2010
    Posts:
    25
    does the purchase of this allow me to use it for a commercial project?
    would i be able to take your scripts and add to/modify them?
    how much is the code commented?
     
  21. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Drewbie:

    Yes, you are free to use it in whatever purpose as long as you dont resell it as it's. :)
    Yes, you are free to modify the script and use it however you like.
    At this point, the code is not fully commented. But the between the documentation and the existing comment, you should be able to figure out what's what. It's also worth mentioning that work is still being put into the package so I'll put in more comments for future release.
     
  22. Drewbie

    Drewbie

    Joined:
    Dec 22, 2010
    Posts:
    25
    bought the kit.

    imported the package into an empty project to test it out and tweak some things and it wont load at all
    tried to load a sample scene and all it does is pop up about 5 errors when trying to load everything in the scene...

    dunno what is wrong but it looks like half of the objects in the scene dont get loaded, and also there are problems with tags and your game objects not being setup

    im guessing that you did that all manually and when i load an empty project it doesnt do that...
     
  23. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thanks for bringing that issue to my attention.

    Can you please link me the error so I can see what are they?

    I'm aware that sometime when importing into a new empty project some of the tags are not setup automatically, despite the fact that I have all the prefabs tagged (it seem have some tagged prefab in the package is the only way to export the tag information). I did write some note in the documentation (section 1.1/2) about the possible tagging issue that you may need to re-declare the tag yourself before you start playing any scene.

    Sorry for casuing any inconvenience. Let me know if this solve the issue.
     
    Last edited: Sep 11, 2011
  24. Drewbie

    Drewbie

    Joined:
    Dec 22, 2010
    Posts:
    25
    hmm, well im stupid and didnt notice the documentation..

    let me RTFM and i'll get back to you if i still have errors. this might solve all the problems i had...
     
  25. Drewbie

    Drewbie

    Joined:
    Dec 22, 2010
    Posts:
    25
    the tag Path was missing from the initial get go, had to create that myself. thats what was causing my original errors

    i also had to create the 5 layers it recommended in the documentation, that also created problems when I tried to run right from the start
    and as always, in order to load a different level from the start screen i had to add them to build settings (but thats expected...)

    other than that it works fantastically.... awesome job on this kit :)



    I did load a brand new scene and add in the plane and point light and my main camera

    attached the camera.js script to it and hit play and this is the error i get


    UnityEngine.Transform.get_position () <IL 0x00003, 0x00035> is the error the unity console pops up with...

    seems it cant get the position of my camera, which makes no sense because its in the scene and it should be able to pull that easily...

    do you have any idea whats wrong?
     
  26. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thanks for the compliment. Now for the camera...

    If you look carefully in the example scene, the "Camera" object is not really the camera in the scene. the camera (named "Main Camera") in the scene is actually the child object of the "Camera" object. This arrangement is done to simplfy the movement and rotation of the camera in term of coding needed. The parent object is the object which the CameraControl.js should be attached to.

    If you are still not sure of what to do or have problem configure it from fresh. I suggest you use the "Camera" prefab in the the folder "example_asset/scene_prefab". Or you can copy the "Camera" object from the example scene and paste it in the hierarchy tab of you new scene. Of couse dont forget to delete the default "Main Camera" in the new scene.

    Hope this helps.
     
  27. Drewbie

    Drewbie

    Joined:
    Dec 22, 2010
    Posts:
    25
    nice, that works perfectly now.

    i'll start tweaking it to my liking now.

    thanks again
     
  28. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    you are welcome.

    Enjoy the toolkit and thanks for your custom!
     
  29. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Released version 1.2, should be on AssetStore very soon. Check the first post for info or visit here for more information.
     
  30. Deej

    Deej

    Joined:
    Jan 29, 2011
    Posts:
    5
    Hola,

    Bought your kit and it is really slick, gives me inspiration.

    Just playing around with some idea's for this, I was wondering how difficult it would be to add a feature to allow the creeps to target and fire projectiles and such at the towers during the attack waves? Being a complete non-programmer, I' love to see it in an update :)
    Thanks for providing the kit, its is great!
     
  31. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hola Deej,

    Thanks for your support and I'm glad you like it.

    As for your idea, It's not too difficult to be honest, since all the code is somewhere there in the toolkit (just being used for different purpose). I'll seriously consider it. Thanks alot for your input.
     
  32. gioworks

    gioworks

    Joined:
    Oct 12, 2011
    Posts:
    138
    I bought kit and i really like it, i have one question.I made 3rd person hero, wich on mouse click instantiate shockwave but he doesnt do any damage? What i missed, or i need to write some script? Can you write it for me please? Some sample instantiating that work with damage.
     
  33. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hello GIOWorks,

    Thanks for your support and glad you like it.

    If you instantiate a shockwave by default, the damage value is zero. Therefore it wont do any damage. You need to call Initiate(damage:float, slow:float, range:float) function right after you instantiate it. Just pass the damage, slowduration, and shockwave effective range to it and it will work.

    It can go like this:

    Code (csharp):
    1. var instanceShockwave=Instantiate(shockwavePrefab, transform.position, transform.rotation);
    2. instanceShockwave.gameObject.GetComponent.<ShockWave>().Initiate(10, 1, 15);
    for the example code, the shockwave deal 10 damage to all creeps within radius of 15 and slow them down for 1 sec.
     
  34. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Just a quick announcement that version 1.2.3 has been uploaded and now available on AssetStore

    The new version is basically a fix to a problem with open-field gameplay mode. If you havent found out about it, well the new version is going to be better anyway. In short, the creep now find their individual shortest path to their destination.

    For more information, please visit this link.
     
    Last edited: Oct 25, 2011
  35. trileletri

    trileletri

    Joined:
    Nov 10, 2011
    Posts:
    1
    Hi,
    I've recently bought your toolkit and I think it is very helpful, it really shortened development time of our video game.
    However, I noticed a lag spike when there is several enemies in-game and new tower is placed (for open TD games). I suspect it comes from path finding. I think you'll need to implement some kind of optimization. Either by calculating one path and assign that path to all enemies or by queuing path finding in several frames... Something like that...

    I'm also interested in making it work with unity's terrain. Do you have some kind of suggestion for this? What is the best way of implementing this toolkit to work with terrain? I disabled rendering of a plane, assigned waypoints to terrain, now I need to disable mesh rendering that becomes visible when waypoints are connected...

    I'm gonna get some screens soon so you can see my work in development.

    Great kit! Thanks.
     
  36. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hi,

    Thanks for you support.

    First off, you can definitely work with unity terrain. Simply replace the grid plane in the example scene with you terrain. You will need to make sure that the tower deployment height match with the terrain height othwise it might look funny. Finally place some collider and assisng them to layer "Obstacle" (layer 10 by default) to cover up the spot where you dont want any tower to be built. To disable the auto generate path, simply uncheck the "Generate path" option in spawn manager.

    As for the path-finding, there is already a queue system in place and I havent seen any lag in my testing. Never the less, I'll send you a pm with a mod path-finding script so you may be able to play with it a bit.

    Once again thanks.
     
  37. FiveFingers

    FiveFingers

    Joined:
    Oct 15, 2009
    Posts:
    541
    Tdtkit->mobileFriendly() = Me->Buying()
     
  38. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    while(!kit.mobileFirendly()){
    kit.TryMakeMobileFriendly();​
    }
     
  39. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    TDTK version1.3 is now available on AssetStore!

    The notable update is one that had been requested time and again, iOS support. So get your update today!

    Feel free to pm me if you have any question.
     
  40. RandAlThor

    RandAlThor

    Joined:
    Dec 2, 2007
    Posts:
    1,293
    Is it possible to make a game on uneven terrain with your kit?
     
  41. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You can always adjust the waypoints so the creep have vertical movement. As for the tower, it will depend on the game-mode you want. If you want the tower to be build on a pre-defined grid, the grid will always take place on a flat plane. But using build-on-platform mode, you can place the platform at anywhere so the tower can be build on wherever the platforms are placed

    In short, yes it's possible but only under certain game-mode combination. At any rate, you can use uneven terrain for visual effect but the it will have no impact to the core mechanic.
     
  42. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    Excellent work on this package!

    Is this package coded in C# or JavaScript? I'd like to purchase it if it is coded in C#.
     
  43. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hi zhx,

    Unfortunately it's all written in JavaScript.
     
  44. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Just updated the Toolkit to version 1.3.1 and is now available on AssetStore. The changes are as follow:

    • Improved path-smoothing, the creep no longer clip through tower when moving diagonally and will try to cut the shortest path in open-space.
    • Path-validation check before tower building in open-field mode are now added. Player can no longer build on spot where it will effectively block all possible route.
    • Further optimize component interaction
    • Fix bug on iOS where restart and next button doesn't work after level end
    • Slight adjustment to the shader used in iOS scene for more consistent dynamic batching

    Please Feel free to try out the latest demo with all the up to date features.
     
  45. 3Duaun

    3Duaun

    Joined:
    Dec 29, 2009
    Posts:
    600
    the v1.3.1 updates look great!
    wish I could purchase, and would if it was ported to C#, hint hint ;-). Pretty please.

    P.S. I'd port it myself, but then I'd have to port/diff every time you release an update, which would take TONS of time, over the long run. I'd purchase it today if it was in C#
     
  46. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thanks for your interest, zhx.

    I'm really sorry that to say that porting to C# is not something I'm going to do in the near future, or at least in the coming 2 to 3 months. There is a chance I might do it in the future but I really cant guarantee. Sorry again.
     
  47. wheelbarrow

    wheelbarrow

    Joined:
    Sep 12, 2011
    Posts:
    177
    I have just downloaded the package, looking forward to playing with it :) Getting a couple of NullReferenceExceptions on opening an example scene, but nothing serious. I will be sure to let you know if I have any problems. Thanks for a fine effort :)
     
  48. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hi wheelbarrow,

    Thanks for your support. Sorry about the error, can you please let me know what are they, I'll try to fix it up.

    Of course, please dont hesitate to let me know if you come across any problem or need any help. Have fun!

    Song
     
  49. wheelbarrow

    wheelbarrow

    Joined:
    Sep 12, 2011
    Posts:
    177
    The most recent one I have is : NullReferenceException: Object reference not set to an instance of an object Prebuild.Update () (at Assets/TDTK scripts/tower/Prebuild.js:122)

    I pretty much get a null reference for each of your example scenes, but it doesn't seem to affect gameplay, so I ignore 'em. I am having a bit of a problem getting my own tower prefabs to play nice, currently when I place them (PnB, Platforms), the green range indicator remains permanently showing for some reason.

    Cheers.
     
    Last edited: Dec 21, 2011
  50. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hi wheelbarrow, I sent a pm to you.