Search Unity

Hack Slash - Framework [Beta released]

Discussion in 'Made With Unity' started by kantaki, May 4, 2012.

  1. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254







    Tutorial 01: Setup

    Tutorial 02: Project Goal + Information about uLink

    Tutorial 03: BaseClass Overview

    First example spell (demonstration)

    Tutorial 04: Create your first spell

    Tutorial 05: Basic networking tutorial

    Tutorial 06: Sending a RPC






    Hack Slash - Framework now available
    www.kanta3d.com

    www.kanta3d.com/forum/



    ----------------------------------------------------------------------------------------------------------------------------------------------------------
    Changelog:

    Build 0.4 from 05.05.2012 (pre release)

    OnNotEnoughMana, OnSpellIsCasting ,OnSpellOnCooldown ,OnSpellGobalOnCooldown are now only called 1 time per second, and you have full control over the calling rate.


    Build 0.3 from 05.03.2012 (pre release)

    - Added Callbacks :
    OnNotEnoughMana
    OnSpellIsCasting
    OnSpellOnCooldown
    OnSpellGobalOnCooldown

    -Added GlobalCooldown



    Build 0.2 from 05.01.2012 (pre release)
    - redesigned spell system
    - fixed several bugs
    - added cast time
    - added two example spells


    Build 0.1 from 04.22.2012 (pre release)

    - It will work on any system (ios android windows etc)
    - Works with the basic version of Unity

    - Camera: RTS / fixed camera (diablo)
    - Movment : You character will follow the mouse if the left mouse button is pressed.
    - Attack: If the left mouse is pressed (on an enemy), your character will perfom a normal attack (range only atm)

    - Spell-System
    => Three damages sources are implemented:
    1. Magic Damage
    2. Phyical Damage
    3 Pure Damage

    Spells are able to scale with attackpower / spellpower. You are able to code spells like you would normally do and they still work in a network game.

    Two example spells are implemented:
    - Bouncing Shot:
    Bounces though enemies and inflicts phyical damage.
    -Firebolt:
    Explodes after x range or if it hits an object it will explode and aplly AOE damage to all enemies and inflicts magical damage.


    - Spellbar:
    - You have four different spellstates. Q W E R
    => If you press Q your are in Spellstate 1 , If you press W you are in Spellstate 2 and so on...
    The rightmousebutton will cast the spell.


    - Character System
    :

    Baseclass for players , npcs or enemies.
    =>
    Player class has functionaltiy for classes like Mage , Warrior , Rogue etc.
    It includes:
    Autoattack, Movement, Casting, leveling,upgrading,dieing and so on.

    Basenemy:
    - can give experience.
    (No movment or AI is implemented yet)

    Damagesystem:

    - You can choose between 3 examples armortypes:
    LightArmor, MediumArmor, HeavyArmor.

    Lightarmor will reduce magicdamage by 90% and physical damage by 10%
    MediumArmor will reduce magical / phyicaldamage by 30%
    HeabyArmor will reduce physical damage by 90% and magical damage by 10%

    Rough Talentsystem:
    - You can create "TalentNodes" to create entire talent trees.
    (visual implemention will come soon)

    Looting:
    - Enemies are able to "spawn" loot which automaticly moves to the nearest player.
    - To loot wil contain random items.


    - Basic GUI (with NGUI free version):
    You have a healthbar, manabar an expbar.
    You also have a character stats screen which is toggable with the key "C".
    => Level, Class, attackpower,spellpower etc.
    No Visual inventory yet, but it is already impelemented!(non visual )

    Chat:
    -You can chat with everyone


    -Multyplayer support with uLink, uLobby, uZone, uStream, uGameDB

    - Authoritative Server
    - different approches with interpolation extrapolation (in development)
    => waiting for a response from muchdifferent.com

    ----------------------------------------------------------------------------------------------------------------------------------------------------------

    What I have planed ?


    - working on the pre release make it stable.
    - implementing A* and AI behavior
    - QuestSystem with random objectives

    - Many example spells, Example Coop Game
    => Team up with 4 players, 4 different classes and fight against random generated enemy waves.
    The enemy waves will grow in strength. You are able to level, skill and loot items.

    - GameDB => Account login, Save Characters , Friendlist, host servers etc
    - Visual Spell Scripting, Visual Talent Scripting
    - Map (minimap etc)

    Tutorials:
    - I will start creating many many tutorials after the pre release is stable.
    Topics that i will explain:

    Networking => interpolation , extrapolation , lag compensating etc
    Project goal: I explain you my project design
    I will explain every single line of code to you

    You can request tutorials

    Custom code

    Feel free to request custom code like Spells => Frostbolt which slows enemies in a certain range and applies frostdamage.
    I will implement these custom spells for free ! However these spells will be available for everyone.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------
    What this Framework is not
    It is not a oneclick solution.
    It uses C# and object orientated programming.
    => If you want to extend or customize functionality , you have to code it by yourself.

    That means you should know how to script ( at least a little bit)
    This project is great for learning.

    You can use Javascript => HOWEVER all classes will be written in c#, but if you want to create your own Warrior class, you are able to write it in javascript.


    ----------------------------------------------------------------------------------------------------------------------------------------------------------
    Only buy if you do not expect a finished product yet
    ----------------------------------------------------------------------------------------------------------------------------------------------------------



    uLink
    http://muchdifferent.com/?page=game-unitypark

    NGUI
    http://forum.unity3d.com/threads/114833-NGUI-(Next-Gen-UI)-demo-amp-final-feedback-request


    DEPENDENCIES :


    http://www.mediafire.com/?r58c8ln4crclazj

    http://www.tasharen.com/get.php?file=NGUI

    http://download.muchdifferent.com/ulink/uLinkSetup.exe

    http://download.muchdifferent.com/ucollab/uCollab.unitypackage

    Know Issues:

    uCollab (workflow -> editor synchronization) is only available for pc and not for mac.
     
    Last edited: Jun 15, 2012
  2. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    I will record many tutorial videos to get you started, but first things first.

    We will create many example spells together. Tell me what you wanna see in a tutorial and we will create it together!


    You are a designer and want to team up with me ? -> write me a pm
     
    Last edited: May 5, 2012
  3. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    What's next :

    - activating interpolation

    - implementing a real inventory + useable / equipable items

    - npc's + quest system
     
  4. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    This package is looking nice already. Glad to see that it uses uLink. Will it work with a third person camera with WOW type movement and control?
     
  5. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    sure it will. but its not included as a example yet and you would have to make client side prediction for a mmo. I will cover all this in later tutorials.

    atm i make a writeup for the setup and i will record the "getting started" video again because my editor was already configured.
     
    Last edited: May 4, 2012
  6. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    Great kit. Just got it and looking over it. Its very easy to install too.
     
  7. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    Awesome, I will purchase it. Thanks.
     
  8. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    You have many great features and the base functions for things like spells and other content.
    The install was very easy. I would suggest anyone who wants it to get it now at this price.

    What Would be great would be editors for developers to input content without know programming.

    The editors would set specific values and names for specific content.

    Editors needed would be:
    Spells or talent tree's. With the ability to assign them to a specific class.
    NPC's. With the ability to assign them to a specific quest, shop conversation ect..
    Quests
    Items including loot tables.
    Shops


    As you add more features keep in mind that the developers may need to add masive amount of game specific content.

    Space Dwarves
    Good Luck
    God Bless
     
  9. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    what i wanted to add. If you have any questions or problems feel free to contact me or leave a post in this thread,
    I'm working on a forum
    => Will be available tomorrow
    www.kanta3d.com/foum

    Thanks for the feedback,

    Everything is already in production :)
     
    Last edited: May 4, 2012
  10. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    Project Goal + Information about uLink

     
  11. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    You can find the forum here :

    http://kanta3d.com/forum/


    ps: You need to request some spells, or i will invent my own spell for tomorrow (spell tutorial)
     
    Last edited: May 5, 2012
  12. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    Last edited: May 5, 2012
  13. meeydoo

    meeydoo

    Joined:
    Apr 8, 2012
    Posts:
    28
    its really awesome ! When do you release the spell tutorial ?
     
  14. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    Because I was not allowed to sell it at the asset store. This gives me many sidecosts (found a company) So I thought i could increase the price a little bit ;)

    Before I start with the spell tutorial I want to give you a brief overview of my baseclasses. I will upload them very soon.
     
  15. Distant_Temples

    Distant_Temples

    Joined:
    Apr 14, 2012
    Posts:
    131
    I would think a " Morph " spell would be cool. I'm thinking in the context of this kit you could have it change one of the unsavory cubes into an aimlessly wondering sphere for a settable period of time. Maybe at that point a "Fear " spell would be fairly similar to achieve.

    Being able to use the morph spell on yourself could be neat. kinda like a transform ability.

    A hunter spell that I like is to be able to set a trap. I think it would be something that could have a good number of options for what the trap does. Different amount of damage, effects to movement, abilities and how they interact with each other. like when a player is frozen by an ice trap, any damage will free the player from the trap. or not :)

    I have move but will have to finish a task at hand first. Will post more later.
     
  16. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    I see.

    One more question: How easy to replace ulink to other network solution (say to Photon, smartfox, unity networking, etc.) without breaking down the kit?
     
  17. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    great spell ideas !
    But i will probably start with a fairly simple spell first.

    I will release an update today with some bugfixes.
     
  18. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    It is possible. But to be honest, this would take too long, so if you don't want to use uLink you should probably don't buy this kit.

    remeber i'm not only using uLink, I will use the entire suit like uZone, uStream etc.
     
  19. rockysam888

    rockysam888

    Joined:
    Jul 28, 2009
    Posts:
    650
    Thanks. I will consider this ulink is suitable for me. :D
     
  20. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    If you have questions about uLink ask them in my forum
    www.kanta3d.com/forum
    or directly at
    www.muchdifferent.com

    -------------------------------------------------------------------------------------------------------
    update released: 0.4
    Just redownload the project and import it.

    changelog => see first post



    I made a general video about the baseclasses. Its just an intodruction , it's okay if you couldn't understand some parts.
    In the next tutorial we will cover the spell creation.

     
    Last edited: May 5, 2012
  21. Carlos-Pacheco

    Carlos-Pacheco

    Joined:
    May 5, 2012
    Posts:
    1
    Awesome kit, I bought it already and is very easy to use it. Great job!.

    I have some spell ideas like;
    Stealth/Invisible- your enemies cant see you (maybe a speel for make all team invisible).
    Clone- make a fake clone of you
    Camouflage/Spy- make you look like a other team player

    Best Regards,
    Carlos Pacheco
     
  22. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    thats also great ! thanks
     
  23. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    A few spells:
    Lock pick or decription for future type games.
    Mezzmerize type spell. Make a npc a pet for a short time.
    A aura of damage around the caster like the summoned birds in diablo or the cyclone.
     
  24. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    Demonstration -> First example spell


    Here the code. This spell is also included in the next update.
    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using System.Collections.Generic;
    4.  
    5. public class Doomsday : Projectile
    6. {
    7.     [SerializeField]
    8.     protected float aoeRange;
    9.     [SerializeField]
    10.     protected float explosionRate;
    11.     [SerializeField]
    12.     GameObject explosion;
    13.  
    14.     public override void Initialize (BaseChar bc, Spell spell)
    15.     {
    16.         bc.ApplyCoolDown (coolDown, spell);
    17.         bc.DrainMana (manaCost);   
    18.         endDamage = (bc.attackPower * pDmultiplier) + (bc.spellPower * mDmultiplier) + baseDamage;
    19.         DestroyAfterRangeReached (missleRange);
    20.         ShootForward ();   
    21.         if (explosion) {
    22.             InvokeRepeating ("AoeExplostion", 0f, explosionRate);
    23.         } else {
    24.             Debug.LogError ("No Explosion set");
    25.         }
    26.     }
    27.    
    28.     protected void AoeExplostion ()
    29.     {
    30.    
    31.         Info info = new Info ();
    32.         info.damage = endDamage;
    33.         info.damageType = damageType;
    34.         List<GameObject> nearEnemies = GetObjectByTagInRange ("Enemy", aoeRange, transform);
    35.        
    36.         foreach (GameObject o in nearEnemies) {
    37.             uLink.Network.Instantiate (uLink.NetworkPlayer.server, explosion, o.transform.position, Quaternion.identity, 0);
    38.             Damage (o, "Enemy", info);
    39.         }
    40.     }
    41.    
    42.    
    43.    
    44. }
     
    Last edited: May 5, 2012
  25. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    Tutorial 04 Create your first spell
     
  26. hjalmarsn

    hjalmarsn

    Joined:
    Apr 21, 2012
    Posts:
    11
    I have a question, created a new terrain for the player to walk on but i cant make the player cube walk on it, do I have to implement it in some special way for it to work to walk on? Sorry for the noob question :)

    Awesome kit!

    Update: Nvm, found out how to do it :)

    What are you working on for the next update?
     
  27. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    Sure no problem. remeber everything in the example is just an example.
    If you want to move on a different terrain, you have to set the terrain to Tag "Ground".

    Atm implementing the interpolation, -> to make the movement look smooth.
    And i'm creating an inventory + equipable items.
     
  28. meeydoo

    meeydoo

    Joined:
    Apr 8, 2012
    Posts:
    28
    When will you include the A* pathfinding ?
     
  29. hjalmarsn

    hjalmarsn

    Joined:
    Apr 21, 2012
    Posts:
    11
  30. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    This will take some time, i can't give you an exact date yet.
    its licensed under GNU -> not allowed in commercial projects.

    And I like to code things on my own :)
     
  31. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    short update:

    - Inventory: (60 % done)

    drag drop
    swap items
    add and remove items
    Highlightning
    Resoltuion independed
    My own GUI system -> Planes with textures.
    => High perfomance -> works on all devices
    You can add bags of different sizes at runtime.
     
    Last edited: May 11, 2012
  32. meeydoo

    meeydoo

    Joined:
    Apr 8, 2012
    Posts:
    28
    looks great
     
  33. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
  34. hjalmarsn

    hjalmarsn

    Joined:
    Apr 21, 2012
    Posts:
    11
    So, I was wondering, I'm using player animations in the scripts and I've managed to call animation.CrossFade("run"); from the file PlayerController.cs, but what if i want an enemy to move? I tried to call animation.CrossFade("gethit"); from the ApplyDamage() function in the BaseChar.cs file but nothing happens... Do i need to point to an abject with the animation and if so: what object? :)

    Thank you! It's a great framework! :)
     
  35. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    Okay ,
    i didn't implement pathfinding yet.I need to code my own pathfinding solution because navmesh is only available for pro users. This means enemies can not move at the moment.

    For the applydamage function

    For example :

    Code (csharp):
    1. BaseChar player , BaseChar enemy
    to apply damage to the enemy you need a reference of this enemy for example
    Code (csharp):
    1.  
    2. Info info = new Info();
    3. info.damage = 200f;
    4. enemy.ApplyDamage(info);
    but you dont need to do this. It's easier to use a spell to do this.

    Look at the spell examples that i have included.
    Code (csharp):
    1. protected void Damage (GameObject t, string tag, Info info)
    Its always easier for me if you show me some code. If this doesn't answer your question , please just post a code snippet.

    thanks ;)
     
    Last edited: May 13, 2012
  36. hjalmarsn

    hjalmarsn

    Joined:
    Apr 21, 2012
    Posts:
    11
    Thanks for your answer, but I'm not trying to make them move or anything, I just want to play a predefined animation. Like this:

    Code (csharp):
    1. public virtual void GetExperience (float exp)
    2.     {
    3.         if (experience + exp >= expToLevelUp) {
    4.             expToLevelUp *= expMultiplier;
    5.             experience = 0;
    6.             level++;
    7.             UpgradeStats ();
    8.             currentHealth = maxHealth;
    9.             animation.CrossFade("dance");
    10.         } else {
    11.             experience += exp;
    12.        
    For example, but the character does not dance, am I referencing the character right? :) Should I explain in more detail?
     
  37. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    Well first of all there is one crucial mistake , but this is probably my fault because I didnt had the time to record as many tutorials as i wanted.

    Never change the source code. What if i release an update? it would override all of your work. thats not what you want.

    always extend from the classes for example

    Code (csharp):
    1.  
    2.  
    3. public class MyTestClass : BaseChar
    4. {
    5. public override void GetExperience(float exp)
    6. {
    7. // do somthing
    8. }
    9.  
    10.  
    11. // or in your case
    12. protected override UpgradeStats()
    13. {
    14. animation.CrossFade("dance");
    15. }
    16. }
    But back to your problem. Your code seems correct.
    Are you sure that your animation works correctly ?
     
  38. hjalmarsn

    hjalmarsn

    Joined:
    Apr 21, 2012
    Posts:
    11
    Well, here's my new class

    The animations in the function update() works, the skeleton runs when i press the W-key, but it doesn't play the "die" animation when it's hit... Does this work for you? Can't get any animation to work in the override functions :S

    Code (csharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class BaseLavenderEnemy : BaseEnemy {
    5.    
    6.     // Use this for initialization
    7.     void Start ()
    8.     {
    9.         currentHealth = 100;
    10.         armor = 5;
    11.         giveExperience = 250f;
    12.         expRange = 1000f;
    13.         armorType = ArmorType.HeavyArmor;
    14.         attackPower = 200f;
    15.         spellPower = 10f;
    16.         sightRange = 100f;
    17.         currentMana = 100f;
    18.         maxMana = 100f;
    19.         animation.wrapMode = WrapMode.Loop;
    20.         animation["attack"].layer = 1;
    21.         animation.Stop();
    22.     }
    23.    
    24.     void Update () {
    25.    // Based on the key that is pressed,
    26.    // play the walk animation or the idle animation
    27.    if (Mathf.Abs(Input.GetAxis("Vertical")) > 0.1)
    28.       animation.CrossFade("run");
    29.    else
    30.       animation.CrossFade("idle");
    31.  
    32.    // Shoot
    33.    //if (Input.GetButtonDown("Fire1"))
    34.       //animation.CrossFade("attack");
    35.     }
    36.    
    37.     public override void ApplyDamage (Info info)
    38.     {
    39.         animation.CrossFade("die");
    40.         Debug.LogError("Jag tog stryk!");
    41.         base.ApplyDamage (info);
    42.     }
    43. }
    44.  
     
  39. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    well i think i know your error. even if i'm not too familiar with animation.

    You call run or idle in the update with crossfade

    I'm pretty sure this will always "override" your 'die' animation.(Maybe they are using the same bones ?)


    I will recreate your problem tomorrow

    you could also send me your project and i will fix it.
     
    Last edited: May 13, 2012
  40. hjalmarsn

    hjalmarsn

    Joined:
    Apr 21, 2012
    Posts:
    11
    Thanks for the quick reply! I found this, don't know if it's a bug or what it is...
    When i do a basic attack (shooting a Missile/left-clicking on an enemy) the animation plays, BUT if i shoot a spell with the right mouse button, the animation does not play... I'll look into this to see if it's something with my code or a bug :)

    I'll write soon!
     
  41. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    this is weird because missle is a spell too. if you need further assistance feel free to contact me at any given time.
     
  42. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    How's the new update going? I cant wait to see the inventory in this kit.
     
  43. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    sorry i was sick.

    maybe it will come today ::)
     
  44. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    Sorry to hear. Hope its all done with.
     
  45. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    sorry , I'm verry busy atm, I have two exams next week.

    short update :

    I will integrate A* by Aren Grandberg http://www.arongranberg.com/unity/a-pathfinding/ as a temporary pathfinding solution. I want to conzentrate more on essential gameplay mechanics
     
  46. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    short roadmap:

    i finish my exams on Thursday.
    This means i will quickly implement the inventory system on Thursday. The optimized networking + networking tutorials will follow shortly .
     
  47. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    Great!!! Been waiting biting my fingers to the bone.... Ha ha. Good luck on your exams.
     
  48. hike1

    hike1

    Joined:
    Sep 6, 2009
    Posts:
    401
    Web player crashes even if I wait several minutes.
     
  49. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    Which webplayer version do you use ?
     
  50. kantaki

    kantaki

    Joined:
    May 15, 2011
    Posts:
    254
    okay , I'm nearly done with the inventory port. I will upload it during the day.