I am trying to create a exp and leveling system like final fantasy 13… I know how to create a basic system with buttons that asked you to add and subtract a value to a skill or health, but I really want something a little more intracate than that… I want to make a leveling system that follows along the lines of the final fantasy crysanthnim, but I want it to be on creeping ivy vines… Unfortunately I have no idea how to go about making this… I am kinda new to scripting but I have a good base concept of c#… I would really appreciate some help.
This is a bit of a very loaded question. By the way, not everyone here knows about FF13 and its skill system, so describing it more would help.
For one, the “creeping ivy vines” you may need to describe more, but that’s more or less the graphics of this whole system. You should first focus on the skill and exp system. Here are some basic questions you should ask yourself first:
- How do I get EXP?
- How much EXP to level up? Does it exponentially increase with each level?
- How do I unlock skills? If it’s each level up gives a certain number of skill points…
- How many skill points does each level up give? Does it change with your level?
aaaand finally, the creeping vine questions/steps: - How should the skill set be layered out/organized? Are there different branches? How often does it branch? How would it look like? A drawing here would help as well
- Once you get the IDEA of the layout - and some skills to populate your layout - try to create a basic system rather than jumping into the creeping ivy vines. Once you get the whole “click here to unlock this, then you can unlock these ones” and so on, then you can finally work on the creeping ivy vines effect…
But first you need to get these 6 “steps” done. I’d suggest to do this incrementally, adding one upon the other- which tends to be how (I at least) add features to my games. Since one thing tends to depend on another - and some things have a much higher priority above others - it helps to do it one step at a time mentally, because that’s how it is in coding (in my experience/opinion).
So, my final suggestion: Do those steps generally in that order. First, you may want to answer them on paper (I actually like to use Notepad or Evernote for note taking, depending on importance and complexity- however, I also have a notebook for classic work ;)). This will help you get the WHOLE idea out in your head. Then you can work on each feature one by one.
At each step, feel free to come back with more specific questions. There quite a few basic EXP tutorials out there, and there may be some (maybe even amazing) assets in the asset store that may help you out.
The best of luck!
If you need any help, remember that we can always help- when there’s more detail. ![]()
He means FF13’s Crystarium system. In it, your character is given a series of different paths, and going to the next spot on the path costs XP points, and unlocks things like extra HP, new skills, etc.
The path is basically linear, with a few optional off-shots that are usually only 1 or 2 nodes long. Each path consists of a number of areas on flat plains, with an occasional advancement (upward) to the next set of nodes. It’s purely a visual thing, except that as you go to higher sets of nodes, it costs more XP to go from node to node.
The majority of the work to implement this system is in the visuals, as the nodes simply add stats to the character in a simple way.
Unless they changed it after the first FF13,wasn’t it more you have 6 different skill types, could level each one up (although you didn’t unlock all of them until later), and you kept going up and up the branch although you could only move to the next “level” of skills if you leveled up to a certain point if I recall correctly. Also, later in the skill “tree” it did branch a bit off from the central ones more for better skills (3 nodes?).
Now, what aspects did you want again?
And good point wccrawford, the hardest part here is not the system itself but rather the visuals. However, it’d help to build that system first, right?
Hi,
i have nearly the same Question.
I want to have a dynamic Research/Tech/Talent Tree in my Game.
For example:
Tech “Y” needs to have Tech “X” at least at Level x
Tech “Y” costs between 100 and 500 Ore, the more Ore, the bigger the chance for a additional Level/Stat/Quality or simple faster Research…
Do somebody have a idea for a Data structure?
Done a little work…
Is there a faster way for UpdateAviable() than looping trouth all?
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Tech
{
//Techts that are known by the Player
public static Dictionary<int, Tech> CurrentKnown = new Dictionary<int, Tech>();
//All Techs
public static Dictionary<int, Tech> Techs = new Dictionary<int, Tech>();
//Techs that can be Learned/Updated by the Player
public static List<Tech> Aviable = new List<Tech>();
//Instance...
public int ID;
public string Name;
public int Level = 0;
public List<int[]> Prerequisites = new List<int[]>();
//For the Tech-Template
public Tech(int id, string name, params int[] prerequisites)
{
ID = id;
Name = name;
for (int i = 0; i < prerequisites.Length; i += 2)
{
this.Prerequisites.Add(new int[] { prerequisites[i], prerequisites[i + 1] });
}
Techs.Add(id, this);
}
//For the player owned instance of the Tech-Template
public Tech(Tech copyFrom)
{
ID = copyFrom.ID;
Name = copyFrom.Name;
Prerequisites = copyFrom.Prerequisites;
}
//Research or Advance
public static bool Research(int id)
{
Tech tech;
//Do we have a Instance and want to Advance or do we need to create a instance from a Template?
if (CurrentKnown.ContainsKey(id))
tech = CurrentKnown[id];
else if (Techs.ContainsKey(id))
tech = new Tech(Techs[id]);
else
return false;
//Look for resources other Stuff later...
//Check if we have all Prerequisites
foreach (int[] i in tech.Prerequisites)
{
int requiredTechId = i[0];
int requiredTechLevel = i[1];
if (!CurrentKnown.ContainsKey(requiredTechId) || CurrentKnown[requiredTechId].Level < requiredTechLevel)
{
return false;
}
}
tech.Level++;
CurrentKnown[id] = tech;
return true;
}
//Rebuild the List of Techs we can create or advance
public static void UpdateAviable()
{
Aviable.Clear();
foreach (Tech tech in Techs.Values)
{
//We already know, so we can advance (simply - for now)
if (CurrentKnown.ContainsKey(tech.ID))
{
Aviable.Add(CurrentKnown[tech.ID]);
}
else
{
bool hasSatisfied = true;
//Look at each posible Tech if it is (not) aviable now...
foreach (int[] i in tech.Prerequisites)
{
int requiredTechId = i[0];
int requiredTechLevel = i[1];
if (!CurrentKnown.ContainsKey(requiredTechId) || CurrentKnown[requiredTechId].Level < requiredTechLevel)
{
hasSatisfied = false;
}
}
if (hasSatisfied)
Aviable.Add(tech);
}
}
}
public override string ToString()
{
return Name + "(" + Level + ")";
}
}
public class TechTree : MonoBehaviour
{
private bool isUpdated;
void Start()
{
new Tech(1, "Laser");
new Tech(2, "Ion");
new Tech(3, "Large Laser", 1, 5, 2, 5); //requires "Laser" (1) @ Level 5 "Ion" (2) @ Level 5
new Tech(4, "Large Ion", 3, 5); //requires "Large Laser" (3) @ Level 5
new Tech(5, "Ultra-Large Ion", 4, 10); //requires "Large Ion" (4) @ Level 10
Tech.UpdateAviable();
}
void OnGUI()
{
GUILayout.Label("\n\n\n\nTechs:");
foreach (Tech tech in Tech.Aviable)
{
GUILayout.BeginHorizontal();
GUILayout.Label(tech.ToString());
if (GUILayout.Button("Research"))
{
Tech.Research(tech.ID);
isUpdated = true;
}
GUILayout.EndHorizontal();
}
if (isUpdated) // If we do this in the foreach we will get a "InvalidOperationException: Collection was modified; enumeration operation may not execute."
{
Tech.UpdateAviable();
isUpdated = false;
}
if (GUILayout.Button("Reset"))
{
Tech.CurrentKnown.Clear();
Tech.UpdateAviable();
}
}
}
Your Tech class shouldn’t manage the list of techs for the player, it should hold information about a given tech; such as the name, what it modifies, what techs it is parented to, what techs are parented to it, a flag designating if it has been unlocked, etc etc.
Your “TechManager” class should essentially build a graph of techs using Tech instances. If everything is hooked up correctly you theoretically only need to know the first tech and then you can traverse the tech graph using that one as the root and display the entire tree.