Search Unity

TurnBased-Toolkit (TBTK)

Discussion in 'Assets and Asset Store' started by Song_Tan, Aug 11, 2013.

  1. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    TBTK_FrontPage.png

    From the developer of TowerDefenseToolkit, TurnBased-ToolKit (TBTK) is a an easy to use and flexible Unity game engine coding framework designed for construction of turn-based tactic game. The aim of the toolkit is to allow as many variant of turn based game as possible. It's designed with integration of custom asset in mind. The toolkit is written with non-coder in mind so no coding skill is required to use it

    The various level setup in following demo should gives a glimpse of what TBTK is capable of. Please note that due to the multiple game rules combination that are supported by the toolkit, the levels in this demo are only some of the setup available. There are other possible setup.


    The demo are constructed using Unity default and standard asset, as well as custom assets made specifically for this toolkit. All asset seen in the demo (with the exception of skybox) are all included in the package. Each scene in the demo are available as example scene in the package.

    Notable features of TBTK:
    • Emphasise freedom of design, tons of customization option to accommodate wide variety of design.
    • Flexible grid system support both hex and square tile, can be edited manually or generated procedurally before or during runtime.
    • Flexible game logic that support customization on many aspect of the game rules, turn/round logic, unit movement/attack rule, etc.
    • Experiment with various game enchacing system like Fog-of-War, cover system.
    • Customize each unit with a huge range of stats and powerful customizable unit's ability system.
    • Ability system to add strategic depth. You can add/edit abilities for each side on the grid
    • Built in perk system, build a simple shop or a full fledged tech-tree. Each perk can be customized to provide different bonus/effect.
    • Built in AI that support multiple faction on a grid. Hotseat multiplayer is supported too.
    • Streamlined editor that make you life easier handling vast amount of customization.
    • Mobile Compatible.
    • Full C# source code included.
    It's simply too long to list all of the features. If you have any question to like to know about certain things, please don't hesitate to contact me. Here are some link that you might be interested, check them out. :)




    Following are screenshots taken from the default TBTK demo. All assets with the exception of skybox are included by default package unless stated otherwise.

    TBTK_Hex.png

    TBTK_Square.png

    TBTK_Hex_Ability.png

    TBTK_ModularUnits.png


    Thanks for reading!!

     
    Last edited: Feb 22, 2019
    juba08 likes this.
  2. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Looking good man. Nice job :)

    I can see your inspiration of xcom even in the UI :p, so covering will be indeed a good addition as you've mentioned in your TODO.

    Price?

    --EDIT--
    Nevermind about price. Just saw it on your website ;-)
     
  3. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    How does it go scaling up, most Hex Based games have much much larger maps.
     
  4. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thank You!

    Did I reveal the price on my website? I think you must have mistaken it with TowerDefenseTookit (TDTK). it's $55 by the way.

    It's definitely not well optimized enough for something like civilization at this point. It is intended for small scale turn based battle scene such as one in King's Bounty or Heroes of Might and Magic. From the limited testing I ran so far, It run reasonably well for a grid size of 40x40. which is quite sizable in term of what it's intended for in the first place.
     
  5. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    very nice!
     
  6. nuverian

    nuverian

    Joined:
    Oct 3, 2011
    Posts:
    2,087
    Yep, I've been mistaken :). Thanks for info
     
  7. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Yup 40x40 is pretty good, any issue with path calculation (assuming there is terrain movement costs and shortest path calculation) for long paths at this size?
     
  8. TheRealFuzz

    TheRealFuzz

    Joined:
    Jul 17, 2012
    Posts:
    308
    It looks great but the web player won't work for me. Think you could upload a video when you have the time?

    Also, I can't see that you have said that it has multiplayer so I assume it doesn't but are you thinking about it? I'd pay extra for multiplayer.
     
    Last edited: Aug 12, 2013
  9. Play_Edu

    Play_Edu

    Joined:
    Jun 10, 2012
    Posts:
    722
  10. Player2D

    Player2D

    Joined:
    Feb 2, 2013
    Posts:
    50
    interesting project. waiting for release.
     
  11. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    There's no terrain movement costs at this point but I'll certain explore the possibility down the lane. As for the path calculation, There's no performance issue whatsoever as far as I can tell. I used the algorithm for something much bigger (like 200x200) in realtime so it should be good enough. I dont see any potential complication either if terrain movement cost is added as part of the processing.

    I'm working on it. Hopefully I'll manage to make a decent one by the time the package is live on AssetStore

    You are right, there's no multiplayer at this point. Honest reason, I'm not familiar with network coding at all. I'll probably look into it some point in the future. Unless there is an unexpected turn, I'd say it wont be available soon.
     
    Last edited: Aug 12, 2013
  12. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    I'm thinking more when you select a unit and show all available destination squares. Lets say you have a unit with a movement allowance of 20 on a map 40x40. You also have terrain costs and enemies that can block your movement (preventing a naive caching approach). I don't expect desktop will struggle with that, but on a mobile device I'd be surprised if that can be calculated in a few milliseconds without some pretty clever pre-calculations and caching techniques.

    Important to me as I'm primarily interested in mobile devices (I guess you never said mobiles were supported... are they?)
     
  13. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    No, I never tested it on mobile so far. I imagine there might be some issue that need resolved. At least in term of input. Not so sure about path-finding efficiency, some testing is definitely needed. But I would say showing the available destination squares is quite easy, the search simply involve getting all the square within the movement allowance. The tricky bit would be finding the shortest path to the selected destination.

    Having say all that, I think it wont work 100% on mobile yet, and probably not for the reason you mentioned. I'm kind of on the fence to add support for mobile tbh. If there's an interest, I'm more than happey to try to make it work.
     
  14. JohnnyA

    JohnnyA

    Joined:
    Apr 9, 2010
    Posts:
    5,041
    Getting a bit deep but once you add terrain cost the available movement squares are not just those within the allowance. Assuming you also have movable enemies which you can't move through you can't (naively) pre-caclulate the paths. In other words you need to follow the cheapest path to each hex, because you can't base the rest of the path calculation on a non-optimal path choice (i.e. it might be cheaper to take a path from A to B through 4 hexes as opposed to through 2 hexes due to the terrain cost, so you can't assume a path is optimal until you have traversed other paths which might get you there cheaper). It's similar to a shortest path problem... but for EVERY hex within range. Djikstras is the standard solution to this problem (A* typically doesn't help much when you need every path).

    Anyways a mobile a solution is likely to be popular IMO.
     
  15. yung

    yung

    Joined:
    Nov 22, 2010
    Posts:
    274
    Looking cool! Definitely on my watch list of assets to buy! Is the hex grid locked in? Is there possibilities for Square grids? Any possibilities of height
    taken into account?

    Cheers
     
  16. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    You are right and thanks for the advice! it just shows that I havent give much thought to the subject.

    What do you mean by locked in? I do have plans to add support for square grids, however given amount of addition/work that I plan to do, I cant really promise it will be ready anytime soon. Height is not being factored into the grid right now. You can just set the height of the grid on y-axis but you can have varied height across the grid.
     
  17. yung

    yung

    Joined:
    Nov 22, 2010
    Posts:
    274
    My mistake, what I meant was the grid just hex grid only, but its good to see you planned to add square grids. Variable height across the grid is good!
    Keep up the good work!
     
  18. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    I'm very interested in mobile support.
     
  19. kalamona

    kalamona

    Joined:
    Aug 16, 2011
    Posts:
    727
    I'm very interested in general :)
     
  20. huxley

    huxley

    Joined:
    Apr 27, 2009
    Posts:
    334
    Having bought the tower defense toolkit that Songtan made, I can attest to his abilities to code for mobile performance. This is a great new kit and I hope that he will also convert this for mobile use in the future. I will certainly be a buyer.
     
  21. Toad

    Toad

    Joined:
    Aug 14, 2010
    Posts:
    298
    This looks great. I'm interested in mobile support too please.
     
  22. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thanks all for the interest, especially huxley for the vote of confidence. I'll try adding support and optimization for mobile when it's possible. But please dont make a purchase based on this statement, not until I have actually done it anyway. :)

    Once again, thanks a lot.
     
  23. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
  24. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    Now that the asset is out, can we get a link to the documentation? I'd love to better understand the functionality of the asset.
     
  25. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Argh, I've been beaten at announcing my own package. >.< But yes people, it's finally out on AssetStore.

    I'll try to put a video up as soon as I can. Please keep in mind that this package is still being developed so there are still some bugs and rough edges. I'll get them fix as I go. Expect an update soon.

    Your feedback, comment and review are much appreciated!


    @pneil, I'll send you a copy of the documentation later. I'm away at work so I dont have access to it now.
     
    Last edited: Aug 15, 2013
  26. Player2D

    Player2D

    Joined:
    Feb 2, 2013
    Posts:
    50
    hi songtan
    please add support for mobile platforms
     
  27. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I'll certainly try. Mobile support is currently on things to do list now. :)
     
  28. E1iTe

    E1iTe

    Joined:
    Aug 7, 2012
    Posts:
    47
    Great Asset! +1 to Square grid support
     
  29. TokyoDan

    TokyoDan

    Joined:
    Jun 16, 2012
    Posts:
    1,080
    I'm thinking of purchasing your Turn-based Toolkit so I'd like a copy of the Turn-based Toolkit documentation too please.

    Regards,
    Dan

    tokyodan1 [at] gmail [dot] com
     
    Last edited: Aug 16, 2013
  30. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    @E1iTe, thanks.

    @TokyoDan, Sent!
     
  31. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    A quick video overview, it should give an overall idea of what the frame work can do

    [video=youtube_share;gU0GhvlNCGo]http://youtu.be/gU0GhvlNCGo​
     
  32. Player2D

    Player2D

    Joined:
    Feb 2, 2013
    Posts:
    50
    it looks good!
     
  33. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Thank you!
     
  34. TheRealFuzz

    TheRealFuzz

    Joined:
    Jul 17, 2012
    Posts:
    308
    I think I might buy this on pay day this week :)
     
  35. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I thank you in advance, good sir!
     
  36. E1iTe

    E1iTe

    Joined:
    Aug 7, 2012
    Posts:
    47
    @SongTan How do I adjust the camera boundary?
     
  37. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    There's a set of value on CameraControl, minPosX, maxPosX, minPosZ, maxPosZ. Those are the values that define the camera boundary. If you have the showGizmo in CameraControl enabled, you can see the area being drawn out in as a green square in the SceneView.
     
  38. E1iTe

    E1iTe

    Joined:
    Aug 7, 2012
    Posts:
    47
    Thanks @songtan, I think I found a bug... when I have 6 abilities assigned to a unit it seems like the first time i select a unit it shows the 6th ability (by ID number) in the 6th slot after I end my turn or select another character It seems to correct it self. Thanks for a GREAT Toolkit!! It really saved me A LOT of dev time so far.
     
    Last edited: Aug 19, 2013
  39. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    There's a bug that I've found with the abilities UI. That's probably what causing it. I have alreayd fixed it for the next update, which I hope to release at the end of this week. At any rate, if it happen again please let me know the details so I can check it out.

    Spoiler: mobile support will be included in the next update!
     
  40. Player2D

    Player2D

    Joined:
    Feb 2, 2013
    Posts:
    50
    this is very good news
     
  41. E1iTe

    E1iTe

    Joined:
    Aug 7, 2012
    Posts:
    47
    Great News! Any timeline on Square Grids? I'll pay extra to get that feature bumped up!! also feature request: A way to make ranged attack minimum and maximum like say between 3 tiles and 6 tiles away?
     
  42. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I honestly cant say when. I imagine I wont get to that for at least 2-3 weeks. It involve quite a lot of work to be honest. Basically it requires me to duplicate the majority of the framework to handle square grid instead of hex grid.

    That shouldnt be too hard. Good idea too. I can probably try to get it done before the next update.
     
  43. pneill

    pneill

    Joined:
    Jan 21, 2007
    Posts:
    207
    How easy is it to mod the AI? Does the AI have an API that I can write my own methods on top of?
     
  44. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    Very sorry for the slow respond, unity has failed to send me any notification for any pm or thread respond, again...

    To answer your question. There isn't a dedicated set of API for writing custom AI yet. But suffice to say you dont need to dig into the very low level stuff. There are various API that you can use to govern the AI logic. Currently, a master script is used to run the AI. The script basically call a bunch of high level functions to determine and execute the movement of AI unit. A snippet of the code looks like this:

    Code (csharp):
    1.  
    2.     //execute move/attack for a single unit
    3.     IEnumerator _MoveUnit(UnitTB unit){
    4.         //make sure no event is taking place
    5.         while(GameControlTB.actionInProgress) yield return null;
    6.  
    7.         //if unit is not stunned, else skipped it
    8.         if(!unit.IsStunned()){
    9.             UnitTB target=UnitControl.GetNearestHostileUnit(unit);
    10.             int dist=HexGridManager.Distance(unit.occupiedTile, target.occupiedTile);
    11.            
    12.             //if target is in attack range
    13.             if(dist<=unit.GetAttackRangeMax()){
    14.                 //attack the target
    15.                 unit.Attack(target);
    16.             }
    17.             else{
    18.                 //move towards target, attack any hostile that comes into range along the path
    19.                 unit.MoveAttack(target.occupiedTile);
    20.             }
    21.         }
    22.     }
    23.  
    I hope this gives you some idea of what you can do in term of implementing your own AI
     
    Last edited: Aug 22, 2013
  45. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I'm pleased to announce that the new update is now live on AssetStore! In a nutshell, mobile support is added. Following is the change log if you are interested:

    Version Change – v1.0.1
    addition/change
    • optimization for mobile device
    • added touch input support for mobile device.
    • added support for camera control via touch
    • more comment and clean up has been added to the code
    • change the way attack animation delay works, delay duration can now be specified manually
    • point reward will no longer shown up when game end in non-persistant data mode
    bug fixes
    • fix UI bug where ability tooltip not display correctly
    • fix bug where AI unit wont pick up collectible
    • fix bug where miss chance is mis-calculated and limited at 5%
    • fix bug where AP bonus on tile doesnt apply to unit


    A shameless request: please go on AssetStore to rate the package if you already own this. Your honest review will help the development of the toolkit in the long run! A million thanks in advance!
     
    Last edited: Aug 23, 2013
  46. E1iTe

    E1iTe

    Joined:
    Aug 7, 2012
    Posts:
    47
    Thanks! Question: Any easy way to attack in a straight line? ex.) attack all enemies up to 5 tiles away in a straight line with a beam attack.
     
  47. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    I thought of that at some point but I didnt implement it as it doesnt fit quite well with the existing system. Like you said, easy way. But unfrotunately it's not that easy, at least back when I'm trying to build the whole system. I'll give it a revisit and see if I can put it in. By the way the minimum range requirement you requested has been added.
     
  48. BB80

    BB80

    Joined:
    Aug 24, 2013
    Posts:
    5
    Hi, I noticed you have to choose the exact hex you want the unit to move, so for example if your range is 5 hexes and you move only 1 hex your movement for the turn is done? In most games you can still move a unit 4 more hexes if you want after the first move, is this working as intended? Also the unit placement is bugged somehow and the AI freezes if you use one of the specials, i have not bought this yet i am going off the webplayer demo. Anyway still looks like a good starting point for a game, but it would be nice to be able to move/shoot until your AP is used up not just 1 time no matter how much the AP cost.
     
  49. Song_Tan

    Song_Tan

    Joined:
    Apr 9, 2011
    Posts:
    2,993
    It's working as intended. I was trying to go for the system as seen in King's Bounty, where you can just move and attack once and commit to it. But I'll try to add an option to use the movement system you mentioned.

    I realize the code is not entirely bug free at this point. Can you elaborate in what way the unit placement is bugged? I'll get it fixed.
     
  50. BB80

    BB80

    Joined:
    Aug 24, 2013
    Posts:
    5
    If the first hex you click is not one that you can place a unit you can no longer place units, only way to place them at that point would be autoplace. You can also "cheat" by moving and shooting units after you place them before you start the battle, this gives you 2 turns in a row :) I was unable to duplicate the AI freezing today when i played it, so.. not so sure it even happened. I think i will buy this asset I will let you know if the AI freezes again.