Search Unity

TowerDefense ToolKit 4

Discussion in 'Assets and Asset Store' started by Song_Tan, Apr 18, 2012.

  1. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Absolutely, you can configure the creeps to attack towers. Some of the creeps in the demo do that. But you have to get to later waves before they are spawned.
     
  2. detomato

    detomato

    Joined:
    Aug 16, 2013
    Posts:
    54
    sorry, but what do you mean by 'But you have to get to later waves before they are spawned.'?
     
  3. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Sorry I was meant to say that in the demo, the creeps that attack the towers only appear in wave 3+. I cant quite remember which wave. But rest assure you can have creeps that attack tower.
     
  4. detomato

    detomato

    Joined:
    Aug 16, 2013
    Posts:
    54
    Oh okay.. thanks for the quick reply. Will look into it.

    Thanks again.
     
  5. seidgaparov

    seidgaparov

    Joined:
    Jul 18, 2013
    Posts:
    18
    Pls help me! :)
    I want to do some changes:
    Support Tower instead of buff after Buffcooldown time, should create unit, which goes in creep spawn place with StayNAttack mode. and attack creeps

    how it will look in code?

    This is unit creation code?:
    Code (csharp):
    1.     static public GameObject Spawn(GameObject obj, Vector3 pos, Quaternion rot){
    2.         GameObject spawnObj;
    3.        
    4.         int ID=CheckIfObjectExist(obj);
    5.        
    6.         if(ID==-1){
    7.             Debug.Log("Object "+obj+" doesnt exsit in ObjectPoolManager List.");
    8.             return (GameObject)Instantiate(obj, pos, rot);
    9.         }
    10.         else{
    11.             spawnObj=poolList[ID].Spawn(obj, pos, rot);
    12.         }
    13.        
    14.         #if UNITY_EDITOR
    15.             spawnObj.transform.parent=null;
    16.             //if(opm.hideObjInHierarchy) spawnObj.transform.parent=null;
    17.         #endif
    18.        
    19.         return spawnObj;
    20.     }
    Could u write this simple function:
    Code (csharp):
    1.  
    2.     public GameObject CreateUnit(int Playerid, GameObject UnitType, Vector3 pos){
    3.         GameObject unit;
    4.  
    5.         ...some code here...
    6.        
    7.         return unit;
    8.     }
    9.  
     
    Last edited: Mar 11, 2014
  6. senc01a

    senc01a

    Joined:
    Dec 26, 2012
    Posts:
    5
    Dear Songtan,
    We are loving the TDTK toolkit and are making a great game with it.
    We have recently decided to use NGUI and as far as we understand, TDTK does support it, at least up to certain extent.
    Is there some kind of instructions or tutorial of how to get it up and running in the latest version of TDTK and NGUI?
    We are coding quite a lot on top of TDTK, so don't be afraid of mentioning issues that require additional coding.

    Thank you so much in advance.
     
  7. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @seidgaparov, I'm a bit confused. I dont quite understand what kind of unit that you want to spawn. A standard creep that can be attacked by tower? or tower friendly unit that attack the creep? If it's the later, I'm afraid it's not possible at this point. The toolkit doesnt support moving unit that attack creeps. Can you please describe in detail to me what exactly do you need?

    @senc01a, As far as I know TDTK should work right out of the box with latest NGUI. There's a default working NGUI UI that comes with the kit. It is build using NGUI3.0.6 so it should be compatible with the latest. You can refer to it's implementation as to how you do your own UI, or simply modify it to match your vision. Basically the scripts of TDTK provide you with a set of API to perform certain key interaction, like spawn new wave, build/sell/upgrade towers, etc. So most of the coding required for the UI are to get the UI element displaying the way you want them to be.
     
  8. ChunkoGames

    ChunkoGames

    Joined:
    Jul 15, 2013
    Posts:
    20
    Thanks for the help. I'll post any further questions on the TBTK thread.
     
  9. seidgaparov

    seidgaparov

    Joined:
    Jul 18, 2013
    Posts:
    18
    Thanks for answering.
    Let think of this point(just for example): in game 2 players
    UnitCreep should have 1 more int value, called Playerid
    AI (Playerid=0) and player (Playerid=1)
    UnitCreep(Playerid=0) should attack everything with Playerid=1
    So after tower buff cooldown, we should spawn UnitCreep(with player's Playerid) and give him order to move to point, and attack (stayandattack) everything in his way with Playerid=0
     
  10. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You can use SpawnIndependentUnit() in SpawnManager.cs for a start. You will need to modify the function of course. The function will spawn a new unit, get the UnitCreep component instance and assign the path. So what you need to add is assign the playerID along with path. Note that you dont just pass the position you want the creep to spawn in, you need to pass the path which you want the unit to take. Hope this help.
     
  11. seidgaparov

    seidgaparov

    Joined:
    Jul 18, 2013
    Posts:
    18
    OK
    and where i can modify script where AI choose target? (to add Playerid dependency)
     
  12. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    That is all being done in UnitCreepAttack.cs. The function you are looking for is ScanForTarget().
     
  13. WizardGameDev

    WizardGameDev

    Joined:
    Jul 25, 2012
    Posts:
    62
    I tried searching but it was difficult with the forum tools to get a certain answer...

    Can I use a mecanim characters for my creeps? I already have like 15 creeps fully rigged with idle, walk and attack animations. What kind of work am I looking at to get them incorporated into the toolkit? From what I've been able to find there isn't any real built in mechanisms... but if I could just get a general high level overview of what scripts and objects I would need to most look at that would go a long way and save a ton of time. I'm also using Daikon Forge for my GUI which adds another layer of complexity to my integration.

    So I guess that brings me to my ultimate question... I'm primarily wanting to use the tower defense mechanism as like a mini-game within a larger system. Is it possible to break out the grids, spawns, and tower components... then just wire them into a more limited GUI that I would more tailor to represent the tower defense aspect of the game?
     
  14. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I'm sorry to say that mecanim is not supported. But I imagine you can easily replace the default animation code. They are all in UnitCreep.cs. It's a bit scattered but just do a search for keywords - 'ani', 'animation', 'play' and you will find them. I would help more but to be honest I am a bit behind the curve and doesnt know much about mecanim.

    As for GUI, you can refer to the default UI scripts located in TDTK/Scripts/C#/UI, particularly UI.cs. You can find all, if not most the TDTK functions you will need from there. You can try the NGUI counter part too if you are familiar with NGUI. If you have trouble working something out, please let me know.

    I dont quite understand your final question. In what way you want to break out the components? And what do you mean by wire to a more limited GUI?
     
  15. detomato

    detomato

    Joined:
    Aug 16, 2013
    Posts:
    54
    hi songtan,
    Just a few quick question.
    - How do I setup the 'Targeting Area' to straight line properly? I cant seem to get it to work.
    - Is it possible to have range for damage, like 15-20, which now is fix number. Same goes to 'money' gain when creep is killed. If that is possible, can we get the number of 'money' gain when the the creep died shown on top of the creep, like dota style.
     
  16. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Straight line targeting is what it meant literally, it just do a simple straight ray-cast. So obviously it's quite senstitive. If your creep have a small collider, or the path is not aligned with the tower height, it will not be pick up by the raycast. Upon looking at the code, I find the implementation is rather flaw. I'll try to fix that. At the mean time, I would suggest you to use Directional-Cone targeting. Set the targetingFOV to something like 10 degree and you should have a rather similar effect.

    That can be done rather easily. Mind you it's easy in the sense of it's straight-forward, but it still require the code to be changed at quite a number of place. The question is, do you want to do the modification yourself or you rather wait a bit for the next update?

    I'll see what I can do. Are you using NGUI or the default Unity UI?
     
  17. detomato

    detomato

    Joined:
    Aug 16, 2013
    Posts:
    54
    If its not too much to ask for, probly you can just supply the scripts over here so others can benefit from it too.


    Am using NGUI.

    I'm still playing with the example scene, and I noticed theres a second of lag whenever the turret detecting the creeps. It happen in Play mode not sure if it occur after compiling.

    edit: Is there anyway to view the grid on the Scene viewport?
    And since Im planing to do PvZ kind of game, its only natural to use 'StraightLine' mode, but still unable to detect the Creeps. Is there anything that I need to pay attention to? When using the DirectionalCone, it will misses the creep when its near, or sometimes overshoot to the other lane. And also, is there anyway to prevent the creeps stacking together, this happen when they were attacking the tower.
    edit2: is there a tutorial to properly setting up for Melee attack for creep?

    Thanks.
     
    Last edited: Mar 17, 2014
  18. seidgaparov

    seidgaparov

    Joined:
    Jul 18, 2013
    Posts:
    18
    humm... couldn't find function SpawnIndependentUnit()
    could u pls send code of this function?
     
  19. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    There's no need to post the scripts here for user to download manually. What I will do is to include the changes in the next update so all TDTK user will be benefiting from it. Obviously if they haven't ask for the feature they probably dont need it or at least dont need it urgently so it can wait. I will happily send you an advance copy should you want.

    Have to say I havent notice that. No one has mentioned about this as well. Does it happen in a scene with minimum graphic rendering?

    You can either let the auto grid adjusting to do the work for you and check for the result in runtime (in both SceneView and GameView), or disable the 'AutoAdjustTexture' flag on BuildManager and align the grid yourself, by adjusting the texture offset and tilting of the grid material.

    Assuming you are pointing the tower in the right direction. The issue could be height of the cast or the spreading of the creep over the path (if you have dynamicWP set to relatively high). I would suggest you to make the y-axis position of the tower as close as possible to the y-axis position of the creep. Also it would help if your creep has a large collider.

    There's no tutorial for that. But setting up a melee attack creep is as simple as select the attack type to melee. However you might want to set the attack mode to "stop and attack" for obvious reason other wise the creep wouldnt move towards the target if it's not in range.




    It's in line895 of SpawnManager.cs. Are you using the latest version of TDTK? Btw here the function:
    Code (csharp):
    1.  
    2.     public static void SpawnIndependentUnit(GameObject unitObj, PathTD path){
    3.         if(spawnManager==null){
    4.             Debug.Log("error, no instance of SpawnManager is found");
    5.             return;
    6.         }
    7.        
    8.         Vector3 pos=path.waypoints[0].position;
    9.         Quaternion rot=path.waypoints[0].rotation;
    10.        
    11.         GameObject obj=ObjectPoolManager.Spawn(unitObj, pos, rot);
    12.         UnitCreep unit=obj.GetComponent<UnitCreep>();
    13.        
    14.         unit.Init(path, spawnManager.totalSpawnCount, -1);
    15.         unit.pathLooping=spawnManager.pathLooing;
    16.        
    17.         spawnManager.totalSpawnCount+=1;
    18.     }
    19.  
    Keep in mind this function is not used in the core framework and not tested properly. You might have some unexpected error.
     
    Last edited: Mar 17, 2014
  20. seidgaparov

    seidgaparov

    Joined:
    Jul 18, 2013
    Posts:
    18
    Thanks, found it
    1)How i can add every 50 sec spawn event to my tower? (Tower that after building complete, should start 50s loop timer and spawn unit)
    2)How i can play animations of my models in .mb (Maya)
    *Model was imported->it had animations->i drag'n'drop it on scene, added UnitTower.cs->drag'n'drop it in "towers-current prefabs"->added it in Tower manager->in TowerEditor added Turret fire animation
    *It didn't work =(
     
    Last edited: Mar 17, 2014
  21. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You can use a coroutine that loop every 50sec, like so:
    Code (csharp):
    1.     IEnumerator TimedCoroutine(){
    2.         while(!building  stunned){
    3.             //do something
    4.             yield return new WaitForSeconds(50);
    5.         }
    6.     }
    you will need to call this function from InitTower();



    I'm sorry but I'm afraid this is beyond me as I dont use maya. Perhaps you can ask around or google it and see what's the asset work-flow for Maya.
     
  22. CJindustries

    CJindustries

    Joined:
    Mar 17, 2014
    Posts:
    1
    Hi i am a new developer and for my first game i wanted to make a tower defense game, however i do not want to use the cannons and space ships. Is there any way that i can just change the tower models so that the towers could be things like a person with a rife or bow that shoot bullets or arrows? and can i change the enemy into a person also?
     
  23. detomato

    detomato

    Joined:
    Aug 16, 2013
    Posts:
    54
    It would be great if you could email me the scripts or could send me a link via PM


    Yeah, but not 100% sure if its happen during raycasting or the creeps are spawning. Will do more observation later.

    Will try the later option, coz only will be able to see it in Runtime is a bit troublesome.


    I already set the dynamicWp to 0, which the creep is walking in a straight line.When you says the y-axis of the tower, does it mean the axis of the parents or the axis of the 'shooting point' game object? I already set up the collider of the creeps to be higher than the tower and am pretty sure the width is big enough too.

    Probly I did something wrong, the melee attack setting wont work for me, already using stop and attack. But I could set it to Range Attack and set the range to be small enough.

    Thanks for the reply.
     
  24. detomato

    detomato

    Joined:
    Aug 16, 2013
    Posts:
    54
    It actually quite easy to do that. If you follow the tutorial, you will get to set it up in no time. You can use any object to replace the towers and creeps. If you are not a 3d artist, you can as well get the models that might suit your need from the Asset store. But If you mean if TDTK comes with other models sample, well it doesnt, its a toolkit not a 3d models package. Those models that you saw from the demo is included tho.
     
  25. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    It's like how detomato has explained. you can use any model you want for the creeps, towers, anything. The only key thing is the scripts. In fact I have another demo in the first post that uses another set of demo which is set in a fantasy setting with medieval towers and skeleton creeps. link here. You can also find the tutorial mentioned by detomato here.


    @Detomato, I've sent you the modification you required. Straight-line targeting has been improved. Let me know if it works, or not. Thanks for helping in answer CJindustries question.
     
  26. detomato

    detomato

    Joined:
    Aug 16, 2013
    Posts:
    54
    Thanks songtan, appreciate it. Btw, probably you should include your tutorial link in your first post, its easier for people to navigate through without going back to the Asset store. If its already there, then I might have missed it.
     
  27. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Yes I did. You missed it. :)

    Well it's my fault I didn't highlight it enough. Got that fixed now thanks to you.
     
  28. TensonHanzo

    TensonHanzo

    Joined:
    Sep 16, 2012
    Posts:
    13
    Hello again, been awhile since I last posted so trying to catch up on 50+ pages. Sorry if this has already been asked/answered.
    Has tower animation been added to the toolkit or is it easy to implement? Like having a tower play an idle animation when creeps are out of range and then returning to the idle animation once the creeps have been killed or exit range? I can get the scene setup with my own custom prefabs ok, but would be nice if I can add some 'life' to them.
     
  29. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    There are animation support for tower, but it's for shoot and build only. However it's not too difficult to add idle animation. You simply need to do this condition check if(built !stunned target==null). If true, play the idle animation, else stop the animation. You can do this in Update() of the tower instance. I trust you know the code to setup and get the animation playing?
     
  30. TensonHanzo

    TensonHanzo

    Joined:
    Sep 16, 2012
    Posts:
    13
    Ok thanks, I'll see if I can figure that out.
     
  31. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Please let me know if you are having problem. As long as you are not using mechanim, I should be able to help. :)
     
  32. TensonHanzo

    TensonHanzo

    Joined:
    Sep 16, 2012
    Posts:
    13
    I just have a simple idle (non-mecanim) animation of a tower looking back and forth. Haven't had any luck yet with getting it to play in runtime however. I'm still learning C# so this might be above my pay grade lol.
     
  33. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    The code is actually very simple. You should have something like this:
    Code (csharp):
    1.  
    2.     public Animation idleAnimation; //the animation component
    3.     public AnimationClip idleClip;      //the animation clip
    4.    
    5.     void Update(){
    6.         if(built  !stunned  target==null)
    7.             if(!idleAnimation.IsPlaying(idleClip.name)){
    8.                 idleAnimation.Play(idleClip.name);
    9.             }
    10.         }
    11.         else{
    12.             if(idleAnimation.IsPlaying(idleClip.name)){
    13.                 idleAnimation.Stop();
    14.             }
    15.         }
    16.     }
    17.  
    The catch here is to get the animation component right. You may want to make sure when you the animation works when adding the animation component to the tower object. Then simply assign the that particular animation component to the script. Otherwise the code might work but the animation wont be playing.
     
  34. Brensdumb

    Brensdumb

    Joined:
    Mar 13, 2013
    Posts:
    11
    Hey songtan, I was transferring my project containing TDTK to my friend across Google Drive. I have paid for the full version, and my friend uses my account as well. When he received the project, he was prompted with this message from Google Drive: "/Assets/TDTK/UI_NGUI_Free.unitypackage: The requested file contains a virus." Is this a serious issue, or is it a glitch in Google Drive? Sincerely, Brensdumb
     
  35. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @songtan

    we are setting up a demo using the toolkit, and are running into some issues w/the example scenes. Currently during gameplay we will get this error

    NullReferenceException: Object reference not set to an instance of an object
    UnitTower+<TurretRoutine>c__Iterator52.MoveNext () (at Assets/TDTK/TDTK (Base)/Scripts/C#/UnitTower.cs:1111)


    Quite frequently. Somehow the object is getting nulled out before moveNext is running and can't seem to figure out whats causing it. have you seen this?
     
  36. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @Brensdumb, I'm not sure why that happen. From what I can tell if the source comes straight from AssetStore, there shouldn't be a virus. To be safe, I would suggest you to download directly from AssetStore. Please note that the eula in the Unity AssetStore state that the assets on the store are on a per seat license, so you shouldnt be transfering them across different machine.


    @bpritchard, I dont have such issue, but from what I can tell the error seems to be your firing animation is taking too long that by the time the shootObject fires the target has already been destroyed or move out of range. I didnt forsee this issue when doing the code, my bad. If you cant wait a day or two I will include the fix to the next update, which I'm about to upload to AssetStore. At any rate, I've pm you a possible fix.
     
  37. bpritchard

    bpritchard

    Joined:
    Jan 29, 2009
    Posts:
    444
    @songtan, thx for the speedy response. I just sat down at home and am getting latest on the project here.. soon as i do i'll give your code snippet a whirl and let you know.
     
  38. guang_zhao

    guang_zhao

    Joined:
    Mar 28, 2014
    Posts:
    2
    Why the "Turret Fire Animation" in my game can not play? how Control Turret Fire Animation? Thanks.
     
  39. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    If you are using legacy animation system (please note that mecanim animation is not supported), I assume you must have assign the wrong animation component. If you havent gone through this video, please do. It will explain to you the basic of the animation system. The video is a bit out of date, so instead of drag and drop the animation object like how it's show in the video, you can select it directly via the editor.

    Also, you might not want to change the name of the animated gameObject, or any of its child gameObject as that would break the animation as well.
     
  40. Song_Tan

    Song_Tan

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

    Just a quick note that a new update has just gone live on AssetStore. Not a big update considering the last one happen only 3 weeks back. Apart from the usual bug fixes from the feedback, here are the changes/additions in this update:
    • add support for damage (when creep is attacked) and resource gained (when creep is killed) overlay
    • add min-max damage range to towers, as opposed to just 1 fix value
    • add min-max resource gain for killing creep, as opposed to just 1 fix value
    • improve scanning mechanic of straight-line targeting so it's more robust
     
  41. guang_zhao

    guang_zhao

    Joined:
    Mar 28, 2014
    Posts:
    2
    According to your method I have done some experiments,the result is right,If I have problems I will ask you again,thanks very much.(I come from China, so my English is a little rusty)
     
  42. Mike_011972

    Mike_011972

    Joined:
    Jun 8, 2009
    Posts:
    97
    Hello,
    I'm trying to do a city street level with slightly raised pavements -___- (as a maze style level so the creeps will walk around obsticles), but I can't work out a way to get the creeps to walk on the pavement if the road becomes blocked (I might be missing something really simple here).
    For the path, I've split the road up into segments (platforms), so the creeps will dodge around obsticles on the road, but I would also like to get the creeps to also use the pavements if the road is blocked. I can't just add the pavement platforms to the path list as the creeps would go up the road platform and then the pavement platform.
    I've also tried using 3D models as collision objects, but that didn't work either and I can't think of another way around it. If I can't come up witha work around, I'll just have to have a flat road-pavement model, but that looks a bit dull.
    Any one got an ideas?
    Enjoying the kit so far.
    Thanks,
    Mike.
     
  43. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I'm not really sure what you mean by obstacle. I'm going to assume if a tower is built in the path? Anyway, if you want the creep to do that, you will need a maze level. Basically instead of moving on a linear waypoint (empty gameObject), there will be a platform which the creep will try to traverse thru. You need to super-imposed the platform on the road and pavement (or the other way round). So if a tower is built and the road is blocked, the creeps will try to find another way round. Try to refer to the example scene (ExMazeMultiPath ExMazeTerrain). Those two scene have the platforms partially blocked to match the shape of the environment.

    You can add obstacle but those needs a collider to work. An 3D model (mesh) without any collider will not work mechanically even tho it shows up on screen.

    Please let me know if you need further help.
     
  44. Mike_011972

    Mike_011972

    Joined:
    Jun 8, 2009
    Posts:
    97
    Thanks for the quick reply songtan. I'll try it tonight after work (sorry for rush text late for work).
    Yeah, I'm using a maze level with a 3D model over top of it as you said (route is an U shape), but because the road and side pavements are at a slightly different height
    Pav Road Pav
    -----______------
    I cant setup a single platform that covers the whole of that road and pavement section as the towers and creeps would either float on the road or walk under the the pavement a bit and if I do split the platform up into 3 different parts (pavement, road, pavement) for each section, I can't add it to the path route correctly as it would zig zag (the route is split up into a few platforms as the shape of the level is a U shape).
    Anyway, I'll take a look at the example level and see if that fits.
    Thanks again for feedback.
     
  45. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Hm... U shape road is not a problem. You can cover the whole size of the 'U' with a very big platform, then use a invisible collider to block off the middle bit. Just like the example.

    I'm afraid the height difference tho is an actual limitation of the toolkit. Platform doesnt support tile with varying height.
     
  46. Mike_011972

    Mike_011972

    Joined:
    Jun 8, 2009
    Posts:
    97
    Hi Songtan,
    Sorry for bugging you, but I really want to get this right.
    I’ve ended up making the road and pavement the same level, doesn’t look as good, but I can give the feeling of depth with textures, so can live with that.
    If I just do a single, large platform and block out the areas the creeps can’t move, they just hug the wall (which looks crappy).
    If I just create a waypoint system; that also doesn’t work for my idea (from a gameplay point of view), as I want a swarm of people running around, not a conga line.
    $MultiPlatform.jpg
    If I cut the platform up in to sections (marked out in picture), this gives me the kind of flow for the creeps I want as the creeps seem to go for the center point of each platform (so they stay mainly on the road, but will dodge around towers if needed). The downside to this is that it seems, that the center point of the entering edges of the platforms are protected and you can’t build on them(the red crosses on the picture).

    So basically, what I’m after is a kind of hybrid maze / path effect where the creeps can move around slightly, but still follow a general path, which the multiple paths seem to do, except that I can’t build on the entering center edges.
    Any ideas to solve it? If not, I'll have to totally rethink my game ideas (and I was thinking this would be the easy bit:D).

    Thanks,
    Mike.
     
  47. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I see your problem there, thanks to the image.

    I really like to give you a possible solution using what that is available on TDTK but I'm afraid I dont have one that is better than what you have tried. The best one would be the have multiple platform and connect them via the center like how it's in the picture. But the downside is you cant block the connecting tile and the creep wont move from one platform to another from what seems to be connecting tile.

    The easiest way (relatively) to achieve what you need would be to have movement cost incoporated into the existing path-finding system. With that you can use one single platform. To prevent creep from hugging the wall when opting for the shortest path, you can set the movement cost on the side to be higher so they would go for the middle of the road. Of course that means you will have to do some modification to the path-finding system.
     
    Last edited: Apr 28, 2014
  48. Mike_011972

    Mike_011972

    Joined:
    Jun 8, 2009
    Posts:
    97
    Thanks for your quick reply and help on this Songtan. I'll keep messing around with this and try to get something close to what I'm after, but the code modification is way out of my abilities at the moment.
    Half the fun of game design is working around your limits, so 'll get something going.
    Thanks again,
    Mike.
     
  49. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Very well, have fun and all the best. Please dont hesitate to let me know if you are stuck on something.
     
  50. numnim

    numnim

    Joined:
    Mar 12, 2014
    Posts:
    2
    Can this toolkit make 2d tower defense game ?