Research trees are used to learn new abilities, upgrade abilities or status values, create items and more.
Research trees are combatant-based, i.e. each combatant has their own research trees to use and learn/purchase new things.
While you can also learn abilities with ability development, give status value bonuses using status development or create items and equipment using the crafting recipes, research trees allows having all that in a single, unified system. Furthermore, research of individual content can be progressed over time – e.g. instead of immediately learning a new ability, it can take a defined amount of time (e.g. 30 minutes) until the ability is learned.
The player can view, start and stop/cancel research using menu screens with a Research (List View) or Research (Tree View) menu part.
Research Types #
Research types are used to organize research trees by separating them into different types.
You’ll mainly use them to filter research trees in the editor and in-game menus (menu screens). Research types can be sub-types of other research types for a more detailed organization.
Research types are set up in Combatants > Research Types.
Research Trees #
A research tree contains different research items, each item represents a single thing that can be researched (e.g. learning an ability). Combatants have to learn a research tree to be able to research it’s items.
Research trees are set up in Combatants > Research Trees.
Base Settings #
Set up some basic settings of the research tree.
Research Limit #
The number of research items that can be researched at the same time can optionally be limited. This only limits items using a research duration.
The research limit can be defined for research items of the research tree or as a global limit (i.e. for all research trees of a combatant).
A research tree’s research limit is set to 3 as a global limit (i.e. for all research trees of the combatant).
There are already 2 research items being researched in other research trees, i.e. you can currently only research 1 research item in this tree.
A research tree’s research limit is set to 1 (not global limit).
Only 1 research item can be researched at the same time, other research trees are ignored for this count.
Schematics #
Researching can optionally start a schematic when starting, canceling or finishing research of a research item.
UI #
Define UI related settings.
Portraits #
Optionally define portraits for the research tree. The portraits can be displayed in tooltips or menu screens.
Information Overrides #
Research trees can override the default notifications and console texts.
Research Items #
You can add as many research items to a research tree as you want. There are different types of research items available:
- Ability
Learns an ability to the user.
If the research tree comes from a class, the ability can optionally be learned by the class (i.e. only available if the class is used). - Item
Adds an item, equipment, currency, crafting recipe, AI behaviour or AI ruleset to the inventory of the user. - None
Nothing will be researched (e.g. can be used for requirements or starting schematics). - Quest
Adds a quest to the player’s quest list. - Status Value
Gives a status value upgrade to the user.
If the research tree comes from a class, the status value upgrade can optionally be added to the class (i.e. only available if the class is used).
You can add custom research item types by deriving from the BaseResearchItem class.
Research Times #
The number of times a research item can be researched can optionally be limited. E.g. you can limit creating a weapon to 3 times or giving a status value bonus to be available only once.
Learning an ability is automatically limited to 1 time, since abilities can only be learned once.
Research Duration #
The research duration defines how long it takes to finish research of a research item. The duraction can be set to:
- None
The research is finished immediately. - Manual
The research progresses manually using schematics. - Time
The research takes a defined amount of time (in seconds).
A research item learns a new ability to the combatant using Time and a duration of 1800 seconds (i.e. 30 minutes).
The new ability will be learned automatically after 30 minutes passed since starting research, excluding pause times. Pausing the game’s time progression (e.g. by pausing the game or using game pausing menu screens) will halt the research time from progressing.
A research item creates a new weapon using Manual and a duration of 3. The game has a custom day system using the event system.
The event system is used to progress research by 1 each time a day passes. The weapon is created after 3 days.
Research items using a research duration (Manual or Time) can optionally allow being canceled. Canceling research can be done in menu screens using a Research menu part.
Canceling research can optionally refund the costs and keep the already finished progress of the research.
Schematics #
Research items can override the research tree’s schematics and use their own schematics when starting, canceling or finishing research.
Override Content #
Certain research item types (e.g. items) can override the content information of the researched thing (e.g. changing the research item’s name from the researched content).
Portraits #
Research items can have their own portraits, they can be displayed by tooltips and menu screens.
Research Costs #
Researching a research item can optionally cost something:
- Status Value
Changes a defined status value of the user.
Supports all types of status values. - Item
Removes a defined quantity of an item, equipment, currency, crafting recipe, AI behaviour or AI ruleset from the user’s inventory.
The chance setting determines if the item will be removed, e.g. setting the chance to 0 will require the item, but not remove it from the inventory.
A research item creates a weapon and requires 3 iron ore and an anvil.
The 3 iron ores will be consumed in the process (chance set to 100), the anvil is just a requirement and will remain in the inventory (chance set to 0).
Research Conditions #
If a research item is available for research can depend on defined conditions, e.g. status conditions of the user, quest states or variable conditions. Since status conditions also allow checking for research trees and research items, you can use this to create procedural research.
There are quick-setup buttons available in the editor to easily set up conditions to require the previous research item being completed or researched.
A research tree has a None type research item named Weaponry, which needs to be researched to allow other research items of the tree to be researched.
The other research items need a status condition, checking if the research item Weaponry has been completed.
Finish Variable Changes #
Finishing research of a research item can optionally change variables. These variable changes will happen each time research of the research item was finished.
The Local variable origin uses the user’s variables. Learn more about variables in the Makinom documentation.
Research State #
In-game, a research item can have one of the following states:
- Unresearched
The research item hasn’t yet been researched. - In Research
The research item is currently in research. - Researched
The research item has been researched (at least once). - Complete
The research item has been fully researched (i.e. reached the limit).
Status conditions can check for these states.
Adding Research Trees #
The research trees are bound to individual combatants and can be added/removed using schematics, the combatant’s settings (Attacks & Abilities) and the settings of classes available to the combatant. When adding research trees to a combatant, you can optionally have multiple instances of the same research tree on a combatant.
A research tree has multiple research items that create various potions, each potion can only be created 1 time.
To create more than 1 potion of a kind, the research tree needs to be added to the combatant multiple times.
A research tree has a research item that creates a short sword, which takes 30 minutes to complete.
Adding the research tree multiple times allows creating multiple short swords at the same time.
Research UI #
Research trees/items can be displayed to the player in different ways using menu screens and HUDs.
Menu screens can display the research trees in 2 ways – either as a list of research items (Research (List View) menu part) or as a tree structure (Research (Tree View) menu part). The tree structure will use Research Tree UI to display the research trees.
Research Item UI #
Displaying a research item in menu screens or HUDs can use a UI setup of the research item. The actual setup depends on the used UI module, e.g. the Unity UI module will use a prefab for this.
You can set up different UI setups by using UI keys. The default UI setup (without key) will be used if no matching key is found. This allows you to have differently styled displays in parts of the UI. E.g. a HUD showing the player’s currently in-research items with a value bar showing the duration, while a menu screen shows a more detailed setup (see the UI system documentation for details on using HUD content in buttons).
The default setup for all research items can be found in the Makinom editor in UI > UI Settings in the ORK UI Settings > HUD Settings > Default Research Item UI.
Research types can override the default setup for all research items of research trees using that research type (primary type only). Research trees can override the default setup and their research type’s setup for all their research items. Individual research items can also override the default setup and the setup of the research typ/tree they belong to.
Research Tree UI #
Displaying a research tree in a Research (Tree View) menu screen part use a UI setup defined in the research tree. Additionally, when displaying the research trees Merged, the menu screen part will use the menu user combatant’s Research Tree UI.
The actual setup depends on the used UI module, e.g. the Unity UI module will use a prefab for this. Generally, research tree UI can be set up either for a single tree or a multi tree display.
Single Tree Display #
In a single tree setup, the individual research items are only identified by their index in the tree. This allows sharing the same research tree UI setup for multiple research trees, but can’t be used to display merged trees to display all research trees of a combatant.
It’s recommended to use this setup only in case you have research trees that have the exact same structure (including research item based conditions).
Using the Unity UI module, the UI Research Tree (Single) component is used for this kind of setup.
Multi Tree Display #
In a multi tree setup, the individual research items are identified by their research tree and research item index in the tree. This allows having different research trees in the same UI setup and can be used to display a single tree and merged trees of a combatant.
If you’re using this kind of setup for an individual research tree, it can only be used if that tree is set up in the UI setup.
Using the Unity UI module, the UI Research Tree (Multi) component is used for this kind of setup.
Unity UI: Quick Setup Guide #
Set up a Research Tree UI for a research tree using the Unity UI module following this guide.
We’ll first create 2 prefabs that will be used by the tree strucutre to create the buttons and lines between them.
Research Item Button Prefab #
The research tree UI will use a prefab to create buttons for the individual research items.
Use the scene hierarchy context menu to create a useable setup: ORK Framework > Research UI > Research Item Button with HUD
This creates a button with HUD components to display the content of the research item (icon and name). You can further style and add additional content as you want.
Create a prefab out of the Research Item Button game object that was created.
Research Line Prefab #
The research tree UI will use a prefab to create lines between research items based on their conditions (e.g. one research item depending on another being researched).
Use the scene hierarchy context menu to create a useable setup: ORK Framework > Research UI > Research Line (UI Line Renderer)
This creates a game object with a UI Line Renderer (a Makinom UI component) and a UI Research Line component that manages the colors of the line based on the research state of the research item the line targets. The research tree UI creating the tree strucutre will set the line’s start/end points automatically.
Create a prefab out of the Research Line game object that was created.
Research Tree UI Prefab #
We’ve got our prefabs set up, we can now create the tree structure. I’m using the Multi variant, but you can also use a Single variant.
Use the scene hierarchy context menu to create a useable setup: ORK Framework > Research UI > Research Tree (Multi)
The UI Research Tree component allows us to create the tree structure for defined research trees (multi variant allows adding multiple setups).
- Research Tree
Select the research tree you want to create. - Button Prefab
Select the prefab you created for the research item buttons. - Button Parent
The created buttons will be placed on the selected game object.
In our newly created setup, this uses a child object of the tree game object. - Line Prefab
Select the prefab you created for the research lines. - Line Parent
The created lines will be placed on the selected game object.
In our newly created setup, this uses a (different) child object of the tree game object. - Spacing
Defines the horizontal (X) and vertical (Y) distance between research item buttons. - Grow Direction
Defines in which direction the gree will be built.
E.g. Up Center will add research items upward and keep the tree centered.
Click on the Generate Tree button to create the tree structure.
If the Keep Setup setting is enabled, generating the tree again will only add new content, not already added buttons. This is useful if you make changes to your tree – when already existing items are changed, it’s best to remove their button/line game objects and regenerate them.
After generating the tree structure, you can further customize the display, move buttons around, adjust the lines (e.g. adding additional line points, using curved lines, etc.).
Make sure to also adjust the Research Tree game object’s size (width/height) and the structure’s placement to have the whole tree visible within it’s bounds. The game object also has a Layout Element component attached to make sure it’s not resized by the UI box it’s displayed in. Keep in mind to also adjust the preferred width/height here.
Create a prefab out of the Research Tree game object that was created.
Research Tree Setup #
Open the Makinom editor, navigate to Combatants > Research Tree and select the research tree you want to use the prefab on.
The research tree UI is set up in the tree’s UI Settings > Research Tree UI.
- UI Prefab
Select the research tree prefab you created.