Skip to content

Tree Maps is a Godot Addon which provides useful nodes and functionality to help create graphical maps of tree-like node structures.

License

Notifications You must be signed in to change notification settings

ToxicStarfall/tree-maps-addon

Repository files navigation

Tree Maps - Graphs and Skill Trees

Tree Maps provides useful nodes and functionality to help create graphical maps of tree-like node structures.

image

Releases (more up to date) - Godot Asset Library

About

One day while trying to make a very large technology tree, I found that I was having trouble creating a system which would allow me quickly expand and add lots of different upgrades and paths. To simplify this process I decided to create Tree Maps in order to adress some of the complications behind creating tech/skill trees.

Currently, this remains a very simple addon, however I plan to continue adding features in order to help with creating fully fledged skill and technology trees.

Download & Installation

There are two options to install this addon:
  1. Through the built-in AssetLib tab in Godot.
  2. Downloading manually, unpack it, and put it in your project's "addons" folder.

Option 1 - Download through Godot's AssetLib tab

Note: The addon may still be pending in the Asset Library.
  1. Simply open your Godot project, select the "AssetLib" tab, and search "TreeMap"
  2. Select it and download, then install. Afterwards simply enable it in ProjectSettings's Plugins tab.

Option 2 - Download manually

  1. Go to repository and download a release (tree-maps-addon.zip)
  2. Unpack the zip (make sure you don't duplicate the root folder)
  3. Simply move the addon (tree-maps) to the addons folder of your project's root (create one if your missing it).

Usage

This addon adds two new custom nodes which both inherit from Node2D: TreeMap and TreeMapNode

Starting in 2D view, add a new TreeMap to your scene, positioned at the origin.

Note: Positioning the TreeMap node anywhere else will effect drawing of TreeMapNodes. Will be fixed later.


TreeMap comes with several custom properties in the Inspector. By default, these properties will be passed down to any children TreeMapNodes. These properties will effect how TreeMapNode childs will be displayed and/or interact.

From here, you can now add TreeMapNode as a child of the TreeMap, see Main Tools for the "Add Nodes" tool.

Note: You can add nodes manually, however you will have to refresh the Scene Tree (Reload scene, or Open and Close the scene).

Note: It is highly recommended to have TreeMapNode be children of TreeMap. By continueing without TreeMap, there WILL be errors.


Editing any properties within the "Overrides" section will result in that TreeMapNode having its own property seperate from its parent TreeMap. To reset it to its default inherited property, simply reset the property normally.

Upon selecting a TreeMap or TreeMapNode, you can see in the tool bar at the top will change, showing some new tool buttons. These will allow you to edit your TreeMapNode(s)

tree-maps-tools

Tip: Right click to disable the active main tool.

Note: When activating a tool, the currently selected node is your main node, from which tools will act from. Selecting another node while your tool is active will make that the target node. To select a different node to edit from, simply deactivate the tool, then select your new node and reactivate the tool.

  • Edit Connections: Click to create connection. If there is a existing connection, remove it instead. If there is a existing connection poiting towards the selected node, swap pointing direction.
  • Add Nodes - Creates a new TreeMapNode at mouse click.
  • Remove Nodes - Removes the selected node.

Modifiers

These tools change the way Main Tools behave.
  • Chaining - selects the targeted node after using a tool (if applicable).
  • Lock/Unlock (WIP) - disables editing of the selecetd node(s).

Miscellaneous

  • Reset (WIP) - resets the selected node's properties to the default inherited values.
  • Info (WIP) - Shows helpful info


Examples

Demo video

tree-maps-tools-and-color-demo.mp4
tree-maps-example-2
tree-maps-example-3

What's Next?

Currently there is a somewhat limited amount of customization options available for TreeMap and TreeMapNode.

I still plan to continue adding some more customization features along with more helpful tools. I already have several in mind.

However, if you find that there is a missing feature you want, this is where you can extend the TreeMapNode class and add your own code! If you think it could be a core feature, feel free to create a issue in the repository.

Planned Features

TreeMap
- Min/Max line length - prevent node placement or movement within min/max distance of another node.
- NodeInstance - use your own extended node for the "Add Nodes" tool.

Potential Features

These features are still being decided on. If enough people really want this, I will consider adding.
  • Bezier curves, and Arcs

About

Tree Maps is a Godot Addon which provides useful nodes and functionality to help create graphical maps of tree-like node structures.

Resources

License

Stars

Watchers

Forks

Packages

No packages published