Power Tree Design Suggestion #357

Open
opened 2026-09-21 16:14:09 +00:00 by DiscordBot · 9 comments
Owner

So, as I was working on Palladium Power Designer, I came up with an example JSON format to better represent the power trees, giving more control to addon developers. This is a rundown of how it is structured and it's field.

Before I start, some vocab.
Node means an ability that is visible inside of the power tree.
Connection is a line connecting one node to another.

New file type called Power Tree lives in data/<mod_id>/palladium/power_tree/exmple.json

It has the following fields:

  • "power": The Identifier for the power this tree corresponds to
  • "grid_size": A value to control how big the overall tree area is. Ex: 50 is a 50x50 grid. Allows players to zoom in/out and pan within this entire space.
  • "auto_connect": Boolean value deciding if nodes connect automatically based on original power.json. (Almost always true unless you want full control)
  • "styles": Similar to CSS, this property allows devs to create "styles" as presets that can be later assigned to individual nodes or connections. (see second message for details)
  • "nodes": A section to define information about node positions and what style they use. This would replace the need for gui_position Ex:
"nodes": {
  "laser_eyes": {
    "pos": [0, 0],
    "style": "root"
  }
}
  • "waypoints": Here is where you define and name points where the lines will travel. They can either be single points, or full paths. For example, below, we define a waypoint at (-0.5, -0.5) called "split_left". We can then reference that below inside the "connections" section control where the connection gets drawn. You can also define a complete polyline (multiple curves) as seen in "swing_path":
"waypoints": {
  "split_left": [-0.5, -0.5],
  "swing_path": [
    [0.2, 1.8],
    [0.4, 2]
  ]
}
  • "connections": This property is where you define the line draws. See the third message after this for explanation
  • "regions": Definable sub regions to visually group powers. Explanation below.

Reported by Bandit (@letbandithelp) via Discord — open thread

So, as I was working on Palladium Power Designer, I came up with an example JSON format to better represent the power trees, giving more control to addon developers. This is a rundown of how it is structured and it's field. Before I start, some vocab. ```Node``` means an ability that is visible inside of the power tree. ```Connection``` is a line connecting one node to another. New file type called ```Power Tree``` lives in ```data/<mod_id>/palladium/power_tree/exmple.json``` It has the following fields: - "power": The Identifier for the power this tree corresponds to - "grid_size": A value to control how big the overall tree area is. Ex: 50 is a 50x50 grid. Allows players to zoom in/out and pan within this entire space. - "auto_connect": Boolean value deciding if nodes connect automatically based on original power.json. (Almost always true unless you want full control) - "styles": Similar to CSS, this property allows devs to create "styles" as presets that can be later assigned to individual nodes or connections. (see second message for details) - "nodes": A section to define information about node positions and what style they use. This would replace the need for ```gui_position``` Ex: ``` "nodes": { "laser_eyes": { "pos": [0, 0], "style": "root" } } ``` - "waypoints": Here is where you define and name points where the lines will travel. They can either be single points, or full paths. For example, below, we define a waypoint at (-0.5, -0.5) called "split_left". We can then reference that below inside the "connections" section control where the connection gets drawn. You can also define a complete polyline (multiple curves) as seen in "swing_path": ``` "waypoints": { "split_left": [-0.5, -0.5], "swing_path": [ [0.2, 1.8], [0.4, 2] ] } ``` - "connections": This property is where you define the line draws. See the third message after this for explanation - "regions": Definable sub regions to visually group powers. Explanation below. --- <sub>Reported by Bandit (@letbandithelp) via Discord — [open thread](https://discord.com/channels/116908382878695430/1551627606762463372)</sub>
Author
Owner

More Info about Styles

It has two sub properties, node and connection. Here is an example of a valid styles property:

"styles": {
    "node": {
      "default": {
        "size": 26,
        "background": "yha:textures/gui/tree/node.png"
      },
      "root": {
        "size": 40,
        "background": {
          "locked": "yha:textures/gui/tree/node_root_locked.png",
          "available": "yha:textures/gui/tree/node_root.png",
          "unlocked": "yha:textures/gui/tree/node_root.png"
        }
      },
      "major": {
        "size": 32,
        "icon_scale": 1.15
      }
    },
    "connection": {
      "default": {
        "color": {
          "locked": "#5A5A5A",
          "available": "#8A6A4A",
          "unlocked": "#3D2B1F"
        },
        "width": 2,
        "path": "straight"
      },
      "accent": {
        "color": "#6B3FA0",
        "width": 3,
        "dash": [6, 4]
      }
    }
  }

Above, we have defined 3 styles for nodes, and 2 for connections.

For Nodes, we have properties such as:

  • "size": Defines the size of the node (no longer only one size)
  • "background": Allows for a custom background sprite instead of the default palladium square. Also has properties for locked, available, and unlocked to give devs even more control.
  • "icon_scale": Allows the ability to change the sizing of the ability icon.

For Connections, we have the properties:

  • "color": Define the locked, unlocked, or available render colors of the line.
  • "width": how thick it is
  • "dash": Make it a dashed line by defining frequency of line breaks.

All these styles can then be applied to nodes/connections on an individual basis as you see above/below


Bandit (@letbandithelp) via Discord — jump to message

# More Info about Styles It has two sub properties, `node` and `connection`. Here is an example of a valid styles property: ``` "styles": { "node": { "default": { "size": 26, "background": "yha:textures/gui/tree/node.png" }, "root": { "size": 40, "background": { "locked": "yha:textures/gui/tree/node_root_locked.png", "available": "yha:textures/gui/tree/node_root.png", "unlocked": "yha:textures/gui/tree/node_root.png" } }, "major": { "size": 32, "icon_scale": 1.15 } }, "connection": { "default": { "color": { "locked": "#5A5A5A", "available": "#8A6A4A", "unlocked": "#3D2B1F" }, "width": 2, "path": "straight" }, "accent": { "color": "#6B3FA0", "width": 3, "dash": [6, 4] } } } ``` Above, we have defined 3 styles for nodes, and 2 for connections. For Nodes, we have properties such as: - "size": Defines the size of the node (no longer only one size) - "background": Allows for a custom background sprite instead of the default palladium square. Also has properties for `locked`, `available`, and `unlocked` to give devs even more control. - "icon_scale": Allows the ability to change the sizing of the ability icon. For Connections, we have the properties: - "color": Define the locked, unlocked, or available render colors of the line. - "width": how thick it is - "dash": Make it a dashed line by defining frequency of line breaks. All these styles can then be applied to nodes/connections on an individual basis as you see above/below --- <sub>Bandit (@letbandithelp) via Discord — [jump to message](https://discord.com/channels/116908382878695430/1551627606762463372/1551627827365814293)</sub>
Author
Owner

i like the design, I'll consider it
one thing: I'd probably put it into assets, not sure yet


lucas (@idkmaybelucas) via Discord — jump to message

i like the design, I'll consider it one thing: I'd probably put it into assets, not sure yet --- <sub>lucas (@idkmaybelucas) via Discord — [jump to message](https://discord.com/channels/116908382878695430/1551627606762463372/1551629442332500029)</sub>
Author
Owner

More info about Connections

As I said above, connections hold information about the actual lines. Each connection has the following potential properties:

  • "from": The Identifier for an ability id from which the line begins
  • "to": The Identifier for an ability id of where the line will end
  • "path": A path type preset for how the line will be drawn. Default is "straight", but other options are things like "orthogonal"
  • "from_side": The side the outgoing line will connect when starting. (top, bottom, left, right)
  • "to_side": Where the line will connect at the to node (top, bottom, left, right)
  • "via": Define which waypoints will be used by saying their name.
  • "style": Where you can assign a defined style

Example:

{
  "from": "bw_tree_whip_zip_2",
  "to": "bw_swing",
  "via": "swing_path",
  "style": "accent"
}

Bandit (@letbandithelp) via Discord — jump to message

# More info about Connections As I said above, connections hold information about the actual lines. Each connection has the following potential properties: - "from": The Identifier for an ability id from which the line begins - "to": The Identifier for an ability id of where the line will end - "path": A path type preset for how the line will be drawn. Default is "straight", but other options are things like "orthogonal" - "from_side": The side the outgoing line will connect when starting. (top, bottom, left, right) - "to_side": Where the line will connect at the to node (top, bottom, left, right) - "via": Define which waypoints will be used by saying their name. - "style": Where you can assign a defined style Example: ``` { "from": "bw_tree_whip_zip_2", "to": "bw_swing", "via": "swing_path", "style": "accent" } ``` --- <sub>Bandit (@letbandithelp) via Discord — [jump to message](https://discord.com/channels/116908382878695430/1551627606762463372/1551629804695191633)</sub>
Author
Owner

More info about Regions

Regions are like sub sections of the tree. Mostly a visual thing if people wanted to setup sections with different abiltities. Definitely an additional/not 100% needed thing.

Example Definition:

"regions": [
    {
      "pos": [-2.8, -2.6],
      "size": [2.0, 2.2],
      "label": "Movement Upgrades",
      "color": "#22000000",
      "background": "yha:textures/gui/tree/region.png"
    }
  ]

If you have ever used a node based programming language, like in Unreal Engine 5, a similar idea to how you can group things in a big "Comment Block" to keep it organized.


Bandit (@letbandithelp) via Discord — jump to message

# More info about Regions Regions are like sub sections of the tree. Mostly a visual thing if people wanted to setup sections with different abiltities. Definitely an additional/not 100% needed thing. Example Definition: ``` "regions": [ { "pos": [-2.8, -2.6], "size": [2.0, 2.2], "label": "Movement Upgrades", "color": "#22000000", "background": "yha:textures/gui/tree/region.png" } ] ``` If you have ever used a node based programming language, like in Unreal Engine 5, a similar idea to how you can group things in a big "Comment Block" to keep it organized. --- <sub>Bandit (@letbandithelp) via Discord — [jump to message](https://discord.com/channels/116908382878695430/1551627606762463372/1551630605408538746)</sub>
Author
Owner

one of the reason I wanted to put it in data was because it's technically data driven here, as all the drawing is done once you open the tree. Also, it just made more sense to me that /reload would apply to it. (Not sure if /reload does assets as well)


Bandit (@letbandithelp) via Discord — jump to message

one of the reason I wanted to put it in data was because it's technically data driven here, as all the drawing is done once you open the tree. Also, it just made more sense to me that /reload would apply to it. (Not sure if /reload does assets as well) --- <sub>Bandit (@letbandithelp) via Discord — [jump to message](https://discord.com/channels/116908382878695430/1551627606762463372/1551631388804124693)</sub>
Author
Owner

it's client-side stuff tho

rendering related


lucas (@idkmaybelucas) via Discord — jump to message

it's client-side stuff tho rendering related --- <sub>lucas (@idkmaybelucas) via Discord — [jump to message](https://discord.com/channels/116908382878695430/1551627606762463372/1551632250117034014)</sub>
Author
Owner

ah true


Bandit (@letbandithelp) via Discord — jump to message

ah true --- <sub>Bandit (@letbandithelp) via Discord — [jump to message](https://discord.com/channels/116908382878695430/1551627606762463372/1551632300280909957)</sub>
Author
Owner

but on the other hand, it would be useful for server data packs to define the trees without a resource pack

I'll think about it


lucas (@idkmaybelucas) via Discord — jump to message

but on the other hand, it would be useful for server data packs to define the trees without a resource pack I'll think about it --- <sub>lucas (@idkmaybelucas) via Discord — [jump to message](https://discord.com/channels/116908382878695430/1551627606762463372/1551632362213875713)</sub>
Author
Owner

alright. if you want help implementing any of it, I have started some of the features. I stopped cause I assumed you would just wanna do it your self lol


Bandit (@letbandithelp) via Discord — jump to message

alright. if you want help implementing any of it, I have started some of the features. I stopped cause I assumed you would just wanna do it your self lol --- <sub>Bandit (@letbandithelp) via Discord — [jump to message](https://discord.com/channels/116908382878695430/1551627606762463372/1551632570691620905)</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ThreeTAG/Palladium#357
No description provided.