skilltree-lab 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- skilltree_lab/__init__.py +0 -0
- skilltree_lab/cli.py +82 -0
- skilltree_lab/data/LICENSE.d3-celestial +12 -0
- skilltree_lab/data/NOTICE +14 -0
- skilltree_lab/data/asterisms.lines.json +1 -0
- skilltree_lab/data/snt.lines.json +1 -0
- skilltree_lab/editor.html +418 -0
- skilltree_lab/editor.py +311 -0
- skilltree_lab/figures.py +201 -0
- skilltree_lab/shapes.py +1053 -0
- skilltree_lab/svg.py +61 -0
- skilltree_lab-0.1.0.dist-info/METADATA +266 -0
- skilltree_lab-0.1.0.dist-info/RECORD +18 -0
- skilltree_lab-0.1.0.dist-info/WHEEL +4 -0
- skilltree_lab-0.1.0.dist-info/entry_points.txt +2 -0
- skilltree_lab-0.1.0.dist-info/licenses/LICENSE +21 -0
- skilltree_lab-0.1.0.dist-info/licenses/skilltree_lab/data/LICENSE.d3-celestial +12 -0
- skilltree_lab-0.1.0.dist-info/licenses/skilltree_lab/data/NOTICE +14 -0
skilltree_lab/svg.py
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""A preview picture of a tree: nodes coloured by tier, the start in white."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import math
|
|
5
|
+
|
|
6
|
+
from .shapes import LOOKS, Tree
|
|
7
|
+
|
|
8
|
+
UNIT, PAD, R = 48, 40, 9
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def colour(n, t: Tree, top: int) -> str:
|
|
12
|
+
"""The start in white; light blue near it, deep blue far out."""
|
|
13
|
+
if n.id in t.starts:
|
|
14
|
+
return "#e8e8ec"
|
|
15
|
+
if n.tier < 0: # loose: no way to a start yet
|
|
16
|
+
return "#77777f"
|
|
17
|
+
k = n.tier / top
|
|
18
|
+
return f"rgb({int(140 - 100 * k)},{int(200 - 90 * k)},255)"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def mark(look: str, ratio, x: float, y: float, fill: str, tip: str) -> str:
|
|
22
|
+
"""The node's mark, its longer side R across from the middle."""
|
|
23
|
+
sx, sy = R * ratio[0] / max(ratio), R * ratio[1] / max(ratio)
|
|
24
|
+
sides = LOOKS.get(look, 0) if look in LOOKS else int(look)
|
|
25
|
+
if not sides:
|
|
26
|
+
return f'<ellipse cx="{x:.1f}" cy="{y:.1f}" rx="{sx:.1f}" ry="{sy:.1f}" fill="{fill}"><title>{tip}</title></ellipse>'
|
|
27
|
+
turn = -math.pi / 2 + (math.pi / sides if sides % 2 == 0 and look != "diamond" else 0) # a corner up, or a flat top
|
|
28
|
+
k = 1 / math.cos(math.pi / sides) if sides % 2 == 0 and look != "diamond" else 1 # flat sides reach R, as a circle does
|
|
29
|
+
pts = " ".join(f"{x + sx * k * math.cos(turn + 2 * math.pi * i / sides):.1f},"
|
|
30
|
+
f"{y + sy * k * math.sin(turn + 2 * math.pi * i / sides):.1f}" for i in range(sides))
|
|
31
|
+
return f'<polygon points="{pts}" fill="{fill}"><title>{tip}</title></polygon>'
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def render(t: Tree) -> str:
|
|
35
|
+
xs = [n.x for n in t.nodes]
|
|
36
|
+
ys = [n.y for n in t.nodes]
|
|
37
|
+
x0, y0 = min(xs), min(ys)
|
|
38
|
+
w = (max(xs) - x0) * UNIT + 2 * PAD
|
|
39
|
+
h = (max(ys) - y0) * UNIT + 2 * PAD
|
|
40
|
+
top = max(n.tier for n in t.nodes) or 1
|
|
41
|
+
pos = {n.id: ((n.x - x0) * UNIT + PAD, (n.y - y0) * UNIT + PAD) for n in t.nodes}
|
|
42
|
+
out = [f'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 {w:.0f} {h:.0f}" '
|
|
43
|
+
f'width="{w:.0f}" height="{h:.0f}"><rect width="100%" height="100%" fill="#0c0c0e"/>']
|
|
44
|
+
for a, b in t.edges:
|
|
45
|
+
(ax, ay), (bx, by) = pos[a], pos[b]
|
|
46
|
+
out.append(f'<line x1="{ax:.1f}" y1="{ay:.1f}" x2="{bx:.1f}" y2="{by:.1f}" '
|
|
47
|
+
f'stroke="#55555f" stroke-width="3"/>')
|
|
48
|
+
extra: dict[int, list[str]] = {} # nodes a join reaches, and from where
|
|
49
|
+
seen: set[int] = set()
|
|
50
|
+
for a, b in t.edges:
|
|
51
|
+
if b in seen:
|
|
52
|
+
extra.setdefault(b, []).append(t.nodes[a].label)
|
|
53
|
+
seen.add(b)
|
|
54
|
+
for n in t.nodes:
|
|
55
|
+
x, y = pos[n.id]
|
|
56
|
+
out.append(mark(n.look, n.ratio, x, y, colour(n, t, top), f"#{n.id} tier {n.tier}"))
|
|
57
|
+
text = n.label + (f" (+{', '.join(extra[n.id])})" if n.id in extra and len(extra[n.id]) < 3 else "")
|
|
58
|
+
out.append(f'<text x="{x + R + 2:.1f}" y="{y - R:.1f}" font-size="11" font-family="sans-serif" '
|
|
59
|
+
f'fill="#c8c8d0">{text}</text>')
|
|
60
|
+
out.append("</svg>")
|
|
61
|
+
return "\n".join(out)
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: skilltree-lab
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Lay out skill-tree skeletons from a shape and a few numbers, then fix them by hand in a browser editor
|
|
5
|
+
Project-URL: Homepage, https://github.com/remnantlab/skilltree-lab
|
|
6
|
+
Project-URL: Issues, https://github.com/remnantlab/skilltree-lab/issues
|
|
7
|
+
Project-URL: Changelog, https://github.com/remnantlab/skilltree-lab/blob/main/CHANGELOG.md
|
|
8
|
+
Author: remnantlab
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: skilltree_lab/data/LICENSE.d3-celestial
|
|
12
|
+
License-File: skilltree_lab/data/NOTICE
|
|
13
|
+
Keywords: constellation,game development,procedural generation,skill tree,talent tree
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Games/Entertainment
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pillow; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest; extra == 'dev'
|
|
26
|
+
Provides-Extra: trace
|
|
27
|
+
Requires-Dist: pillow; extra == 'trace'
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
|
|
30
|
+
# skilltree-lab
|
|
31
|
+
|
|
32
|
+
<p align="center"><picture><source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/logo-dark.png"><img src="https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/logo.png" alt="skilltree-lab" width="320"></picture></p>
|
|
33
|
+
|
|
34
|
+
**English** · [한국어](https://github.com/remnantlab/skilltree-lab/blob/main/README.ko.md) · [日本語](https://github.com/remnantlab/skilltree-lab/blob/main/README.ja.md) · [简体中文](https://github.com/remnantlab/skilltree-lab/blob/main/README.zh-CN.md)
|
|
35
|
+
|
|
36
|
+
> **Work in progress.** skilltree-lab is not finished yet: settings, file formats and the editor may still change between versions.
|
|
37
|
+
|
|
38
|
+
Lay out skill trees from a shape and a few numbers. **Every number is a setting**:
|
|
39
|
+
how many tiers, how many ways one node splits, how many arms, how far apart
|
|
40
|
+
nodes stand. The same seed always gives the same tree.
|
|
41
|
+
|
|
42
|
+
Six shapes:
|
|
43
|
+
|
|
44
|
+
| Shape | Looks like |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `ring` | a hub, arms fanning out like wedges, bridges in the gaps between arms |
|
|
47
|
+
| `branch` | a root splitting downwards, tier by tier |
|
|
48
|
+
| `grid` | skills on a sparse grid, prerequisites mostly straight down, several starts (Diablo II, WoW talents) |
|
|
49
|
+
| `zigzag` | chains swinging left and right, side by side, never joined |
|
|
50
|
+
| `spine` | a straight trunk with side branches that can fork again |
|
|
51
|
+
| `constellation` | star figures scattered over the sky, each with its own first star (Grim Dawn) |
|
|
52
|
+
|
|
53
|
+
| ring | branch | grid |
|
|
54
|
+
|---|---|---|
|
|
55
|
+
|  |  |  |
|
|
56
|
+
| **zigzag** | **spine** | **constellation** |
|
|
57
|
+
|  |  |  |
|
|
58
|
+
|
|
59
|
+
It makes a skeleton, not a finished tree: generate one, then move, add, link and take away nodes by hand in
|
|
60
|
+
`skilltree edit` until it reads right. Skill names, effects and balance are yours to fill in.
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
pip install skilltree-lab
|
|
64
|
+
skilltree gen examples/ring.toml -o out/ring # out/ring/tree.json, out/ring/tree.svg
|
|
65
|
+
skilltree edit examples/branch.toml # drag nodes; Add, Connect, Delete; Save writes the hand fixes into the file
|
|
66
|
+
skilltree shapes
|
|
67
|
+
skilltree figures # the 88 constellations figure = can name
|
|
68
|
+
skilltree trace drawing.png # trial: a drawn figure as TOML (pip install skilltree-lab[trace])
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
`tree.json` holds every node (`id`, `x`, `y`, `tier`, `label`, `shape`, `ratio`, `cost`, `needs`, `need_all`)
|
|
72
|
+
and edge, for any engine to read. `needs` lists the nodes with a line into it; by default one of them is enough
|
|
73
|
+
to take it, all of them when `need_all` is true. `tree.svg` is a preview. A node's tier is how many steps it is from
|
|
74
|
+
the nearest start (`starts` in the JSON). A misspelt setting is an error, not silently ignored.
|
|
75
|
+
|
|
76
|
+
## In a game engine
|
|
77
|
+
|
|
78
|
+
`tree.json` is plain JSON, so any engine can read it. Two small examples draw a tree from it:
|
|
79
|
+
[`examples/godot/skill_tree.gd`](https://github.com/remnantlab/skilltree-lab/blob/main/examples/godot/skill_tree.gd) (Godot 4, on a Node2D) and
|
|
80
|
+
[`examples/unity/SkillTreeView.cs`](https://github.com/remnantlab/skilltree-lab/blob/main/examples/unity/SkillTreeView.cs) (Unity, with LineRenderer).
|
|
81
|
+
Each places a node at `x`, `y` times a cell size, draws its mark from `shape` and `ratio`, and a line
|
|
82
|
+
from every node in `needs`. Icons, names and unlocking are left to your game.
|
|
83
|
+
|
|
84
|
+
## Settings
|
|
85
|
+
|
|
86
|
+
A count can be fixed (`3`) or a range (`[1, 3]`), picked from by the seed. `arms` takes a number or the
|
|
87
|
+
last letter (`"p"` means a to p), at most 16. A per-arm count takes letters: `length = {a = 12, c = 20}`;
|
|
88
|
+
arms not named keep the default.
|
|
89
|
+
Distances are in node widths.
|
|
90
|
+
|
|
91
|
+
### Every shape
|
|
92
|
+
|
|
93
|
+
| Setting | Default | Meaning |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| `shape` | `"ring"` | `branch`, `grid`, `zigzag`, `spine`, `constellation` or `ring` |
|
|
96
|
+
| `seed` | `0` | same seed, same tree |
|
|
97
|
+
|
|
98
|
+
### Join lines (every shape but `zigzag` and `ring`)
|
|
99
|
+
|
|
100
|
+
A join gives a node a second prerequisite: a nearby node one tier above it. Joins are off unless asked for.
|
|
101
|
+
A join never crosses a line, never comes from the far side, never sits next to another join, and never
|
|
102
|
+
links two arms (the lines out of a start, or separate starts), so arms, star figures and roots stay apart.
|
|
103
|
+
|
|
104
|
+
| Setting | Default | Meaning |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| `merge` | `false` | `true` (same as `0.3`), `false`, or the chance each node gets a join |
|
|
107
|
+
| `merge_from` | `2` | the upper end of a join is at least this tier (the start is tier 0) |
|
|
108
|
+
| `merge_reach` | `2.0` | longest join, in typical line lengths |
|
|
109
|
+
| `joins` | `[]` | joins by hand, by label: `[["a3", "b2"]]`; a crossing line gives a warning |
|
|
110
|
+
| `no_joins` | `[]` | joins to take away, by label: `[["a2", "a5"]]`; a node's own line cannot go |
|
|
111
|
+
| `grow` | `[]` | nodes added by hand: `[{at = "b5", nodes = 2, side = "left"}]`; side is `out` (default), `left` or `right` as seen when the line runs down; new nodes count on in that arm (`b13`, `b14`) |
|
|
112
|
+
| `move` | `{}` | nudge nodes by label: `{a3 = [0.5, -0.2]}`, in node widths, y down |
|
|
113
|
+
| `shift` | `{}` | nudge a node with everything hanging off it: `{b2 = [1, 0]}` |
|
|
114
|
+
| `place` | `{}` | put a node at a spot: `{c1 = [4, 2]}` |
|
|
115
|
+
| `add` | `{}` | a new node by label with no line yet: `{n1 = [3, 2]}`; link it with `joins` (its first line is its own, grey, not a join) |
|
|
116
|
+
| `remove` | `[]` | take away nodes with their lines: `["b4"]`; the others keep their labels; a start cannot go |
|
|
117
|
+
| `cut` | `[]` | take away any line: `[["a7", "a11"]]` |
|
|
118
|
+
| `node_shape` | `"circle"` | the mark every node gets: `circle`, `square`, `triangle`, `diamond`, `pentagon`, `hexagon`, `octagon`, or a number of sides (`7`) |
|
|
119
|
+
| `node_ratio` | `[1, 1]` | the mark's width to height: a square with `[2, 1]` is a wide rectangle, a circle an oval |
|
|
120
|
+
| `cost` | `1` | points to take a node: one number, or a list by tier (`[1, 1, 2, 3]`, the last goes on) |
|
|
121
|
+
| `node_costs` | `{}` | a cost for some nodes by label: `{a5 = 4}` |
|
|
122
|
+
| `need_all` | `[]` | nodes that want every line into them taken first: `["bc1"]` |
|
|
123
|
+
| `node_shapes` | `{}` | a mark for some nodes by label: `{"0" = "hexagon", a3 = "square", b5 = {shape = "diamond", ratio = [1, 2]}}`. Both go into `tree.json` as `shape` and `ratio` |
|
|
124
|
+
| `meet` | `[]` | one node two others lead to: `[["c5", "b12"]]`; it takes both letters (`bc1`), so two arms may meet here on purpose |
|
|
125
|
+
| `made_with` | | written by `skilltree edit` on save: a fingerprint of the settings that decide the labels; leave it alone |
|
|
126
|
+
|
|
127
|
+
Every node has a label, shown in the preview and in `tree.json`. With one start, the start is `0` and
|
|
128
|
+
each line out of it is a letter; with several starts, each start is a letter and is itself `a0`, `b0`...
|
|
129
|
+
Within a letter, nodes count `a1`, `a2`, `a3`... outward. A node a join reaches reads `a3 (+b2)`.
|
|
130
|
+
Generate a shape, then fix what looks off by hand, in `skilltree edit` or by writing the settings above.
|
|
131
|
+
In the editor:
|
|
132
|
+
|
|
133
|
+
- drag a node: only it moves and its lines follow; Shift-drag: it moves with everything hanging off it (`shift`)
|
|
134
|
+
- click a node: a panel for its shape and ratio (`node_shapes`)
|
|
135
|
+
- Add, then an empty spot: a new node; Connect, then two nodes: a line (a node's first line is its own, grey; any
|
|
136
|
+
more are joins, orange), the same two again take it away; Delete, then a node or a line
|
|
137
|
+
- the wheel zooms, dragging empty space pans, Fit shows it all; Undo, Reset and Save (Ctrl+Z, Ctrl+S)
|
|
138
|
+
- warnings show as you go: a node on another, lines crossing, a line over a node, trees overlapping, and a node left
|
|
139
|
+
without a way to a start, which turns grey and gets tier -1 in tree.json
|
|
140
|
+
|
|
141
|
+
Labels come from the shape alone, so hand fixes never rename a node, but a new seed or a changed count does. Saving
|
|
142
|
+
from the editor writes `made_with`, a fingerprint of the settings that decide the labels; change the seed, counts
|
|
143
|
+
or shape afterwards and `skilltree gen` warns that the hand fixes may now point at other nodes.
|
|
144
|
+
|
|
145
|
+
### ring
|
|
146
|
+
|
|
147
|
+
| Setting | Default | Meaning |
|
|
148
|
+
|---|---|---|
|
|
149
|
+
| `arms` | `5` | arms out of the hub; a letter (`"e"`) or a range (`[4, 6]`) works too |
|
|
150
|
+
| `arm_tiers` | `[3, 6, 6, 9, 9, 9]` | nodes across an arm, tier by tier; a range in a tier (`[6, 9]`) is picked per arm by the seed |
|
|
151
|
+
| `bridge_tiers` | `[1, 1, 2, 3]` | nodes across a bridge, tier by tier (`[]`: no bridges); ranges are picked per bridge |
|
|
152
|
+
| `bridge_from` | `2` | the arm tier a bridge starts beside; a range (`[2, 4]`) is picked per bridge |
|
|
153
|
+
| `bridges` | `true` | a bridge in every gap (`true`), none (`false`), or each gap by this chance (`0.6`) |
|
|
154
|
+
| `bridge_ties` | `1` | bridge rows, from the first, that also reach both arms: `3` ties a bridge to the arms in three places; a range is picked per bridge |
|
|
155
|
+
| `arm_spread` | `0.55` | share of its slice an arm takes; the rest is the bridge's gap |
|
|
156
|
+
| `bridge_width` | `0.8` | share of the gap a bridge may fill |
|
|
157
|
+
| `first_radius` | `1.5` | distance from the hub to the first tier |
|
|
158
|
+
| `tier_gap` | `1.0` | least distance between tiers (a crowded tier moves further out) |
|
|
159
|
+
| `node_gap` | `1.0` | distance between nodes across a tier |
|
|
160
|
+
| `radii` | | every arm tier's distance by hand, e.g. `[1.5, 4, 6, 8]` |
|
|
161
|
+
|
|
162
|
+
### branch
|
|
163
|
+
|
|
164
|
+
| Setting | Default | Meaning |
|
|
165
|
+
|---|---|---|
|
|
166
|
+
| `tiers` | `4` | tiers below the root, or per arm: `{a = 6, b = 3}` |
|
|
167
|
+
| `arms` | | lines out of the root (sets the first tier of `children`) |
|
|
168
|
+
| `fan` | `0` | `0`: straight down; else degrees the tree spreads around the root (`360`: all round) |
|
|
169
|
+
| `children` | `[1, 3]` | how many ways one node splits; one value for all tiers, or one per tier: `[[3], [2, 3], [1, 2]]` (the last repeats) |
|
|
170
|
+
| `max_width` | `8` | most nodes one tier of one arm may hold |
|
|
171
|
+
| `widths` | | nodes in each row by hand, e.g. `[2, 3, 4, 3, 2]`; replaces `tiers` and `children` |
|
|
172
|
+
| `capstone` | `false` | one last node every node of the last row leads to; `true`, `false` or a chance such as `0.15`; not with `fan` |
|
|
173
|
+
| `spacing_x` | `1.0` | distance between neighbouring leaves; every node sits over its own children |
|
|
174
|
+
| `spacing_y` | `1.0` | distance between tiers |
|
|
175
|
+
|
|
176
|
+
### grid
|
|
177
|
+
|
|
178
|
+
| Setting | Default | Meaning |
|
|
179
|
+
|---|---|---|
|
|
180
|
+
| `columns` | `3` | columns |
|
|
181
|
+
| `rows` | `6` | rows |
|
|
182
|
+
| `per_row` | `[1, 2]` | skills in each row; emptier columns are picked first |
|
|
183
|
+
| `skip` | `1` | most empty rows a line straight down may jump |
|
|
184
|
+
| `capstone` | `false` | one last node every skill of the last row leads to; `true`, `false` or a chance |
|
|
185
|
+
| `spacing_x` | `1.5` | distance between columns |
|
|
186
|
+
| `spacing_y` | `1.0` | distance between rows |
|
|
187
|
+
|
|
188
|
+
A skill with nothing above it is a start: open from the beginning.
|
|
189
|
+
|
|
190
|
+
### zigzag
|
|
191
|
+
|
|
192
|
+
| Setting | Default | Meaning |
|
|
193
|
+
|---|---|---|
|
|
194
|
+
| `length` | `8` | nodes in each chain: a range gives each its own length, `{a = 12}` sets one arm |
|
|
195
|
+
| `arms` | `1` | chains out of the start node, side by side or fanned (`fan`) |
|
|
196
|
+
| `swing` | `[0.4, 1.0]` | how far each step swings left or right, picked per step |
|
|
197
|
+
| `lane_gap` | `2 × largest swing + 1.2` | distance between lanes |
|
|
198
|
+
| `step` | `[0.8, 1.2]` | distance down to the next node, picked per step |
|
|
199
|
+
| `fan` | `0` | `0`: arms side by side, all going down; else degrees the arms spread around the start (`360`: all round) |
|
|
200
|
+
| `twigs` | `0` | chance a bend grows a small cluster on its outer side |
|
|
201
|
+
| `twig_leaves` | `[2, 3]` | nodes fanning out at the end of a twig |
|
|
202
|
+
| `twig_stem` | `[0, 1]` | nodes between the bend and that fan |
|
|
203
|
+
|
|
204
|
+
### spine
|
|
205
|
+
|
|
206
|
+
| Setting | Default | Meaning |
|
|
207
|
+
|---|---|---|
|
|
208
|
+
| `length` | `8` | nodes in the trunk |
|
|
209
|
+
| `branches` | `3` | trunk nodes that grow branches |
|
|
210
|
+
| `per_node` | `1` | branches on one trunk node |
|
|
211
|
+
| `branch_length` | `[1, 3]` | nodes from a branch's base to its tip |
|
|
212
|
+
| `branch_children` | `1` | how many ways a branch node splits (1: a plain line) |
|
|
213
|
+
| `sides` | `"both"` | `"left"`, `"right"` or `"both"` |
|
|
214
|
+
| `step` | `1.0` | distance between trunk nodes |
|
|
215
|
+
| `branch_step` | `1.0` | sideways distance per branch node |
|
|
216
|
+
| `branch_row` | `0.7` | vertical room one branch tip takes |
|
|
217
|
+
| `capstone` | `false` | one last node below the trunk; `true`, `false` or a chance |
|
|
218
|
+
|
|
219
|
+
### constellation
|
|
220
|
+
|
|
221
|
+
Star figures scattered over the sky, each from its own first star, like devotion constellations.
|
|
222
|
+
|
|
223
|
+
| Setting | Default | Meaning |
|
|
224
|
+
|---|---|---|
|
|
225
|
+
| `arms` | `5` | figures (with `fan`, each hangs off the start node) |
|
|
226
|
+
| `stars` | `[4, 7]` | stars in one figure, or per arm: `{a = 9}` |
|
|
227
|
+
| `fork` | `0.3` | chance a star starts a short side chain |
|
|
228
|
+
| `bend` | `60` | most degrees a chain turns at one star |
|
|
229
|
+
| `room` | `5.0` | sky each figure gets |
|
|
230
|
+
| `fan` | `0` | `0`: figures scattered, each its own start; else one start in the middle with at most 2 figures, one star gap away, spread over this many degrees |
|
|
231
|
+
| `figure` | | a constellation (Sky & Telescope / IAU chart lines) by its IAU abbreviation (`"ori"`, `"uma"`), `"random"`, a drawn one `{stars = [[x, y], ...], lines = [[0, 1], ...], start = 0}`, or a list of these; replaces `arms` and `stars`. A figure keeps exactly its own lines (no joins): it starts at the first line tip drawn, numbers run along the lines in the order they were drawn (for a drawn figure, the order `lines` lists them), and a part drawn apart (Serpens) gets its own start. An asterism by name (`"big_dipper"`, `"summer_triangle"`; `skilltree figures` lists them), or any strokes of a figure, `{name = "ori", strokes = [1, 4]}` (`skilltree figures ori` lists them) |
|
|
232
|
+
| `star_gap` | `1.0` | distance between linked stars |
|
|
233
|
+
|
|
234
|
+
## Several trees in one file
|
|
235
|
+
|
|
236
|
+
Give each tree a `[[tree]]` block with a `name` and where it stands, `at = [x, y]` (default `[0, 0]`), and its own
|
|
237
|
+
shape and settings. Labels then carry the tree's name (`fire.a3`); hand fixes inside a block use the tree's own
|
|
238
|
+
labels (`a3`). `links = [["fire.b3", "ice.a2"]]`, before the first block, draws lines between trees; inside one
|
|
239
|
+
tree use its `joins`. In tree.json the second label of a link needs the first, except that a start never
|
|
240
|
+
needs anything: a link into a start runs out of it. `skilltree edit` opens every tree at once: Connect across two trees writes `links`, and
|
|
241
|
+
Move tree drags a whole tree. Add tree puts a new tree (a name and a shape, default settings) where you
|
|
242
|
+
click; Import brings in the trees of another file, one tree or many, to the right of what is open; Remove tree takes a
|
|
243
|
+
whole tree away with its links; click a tree's name in the side panel to rename it. A file of one tree that gets a second is saved as blocks, the first named after the
|
|
244
|
+
file. See `examples/trees.toml`.
|
|
245
|
+
|
|
246
|
+

|
|
247
|
+
|
|
248
|
+
New nodes from the editor's Add are named `n1`, `n2`… and numbered outward along their lines, nearest the start
|
|
249
|
+
first; drawing them in another order renumbers them, so `n3-n1-n2` out from the start becomes `n1-n2-n3`.
|
|
250
|
+
|
|
251
|
+
## Drawn figures from a picture (trial)
|
|
252
|
+
|
|
253
|
+
`skilltree trace drawing.png` reads round stars joined by thinner lines, light on dark or dark on light,
|
|
254
|
+
and prints a `[figure]` block to paste into a config. Stars are what survives shaving `--erode` pixels
|
|
255
|
+
(default 5) off every edge, so lines must be thinner than that and stars wider. Check the result: a
|
|
256
|
+
line that bends or a star touching another is easily misread.
|
|
257
|
+
|
|
258
|
+
## License
|
|
259
|
+
|
|
260
|
+
MIT, except the two figure files in `skilltree_lab/data/`, which stay CC BY-SA (see
|
|
261
|
+
`skilltree_lab/data/NOTICE`): `snt.lines.json` holds Sky & Telescope's figures, the ones on the IAU's
|
|
262
|
+
constellation charts (the IAU itself defines only names and boundaries, not lines), from Stellarium's
|
|
263
|
+
`western_SnT` sky culture; `asterisms.lines.json` holds Stellarium's western asterisms. Star positions
|
|
264
|
+
come from [d3-celestial](https://github.com/ofrohn/d3-celestial) (BSD-3-Clause,
|
|
265
|
+
`skilltree_lab/data/LICENSE.d3-celestial`). `tools/build_figures.py` rebuilds both files. Tight stars are
|
|
266
|
+
nudged apart so no two nodes overlap.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
skilltree_lab/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
skilltree_lab/cli.py,sha256=jHbu2w2E60eOZJUvFGIj6lWtZ4YSrhM0OQcUoBd4bNs,3541
|
|
3
|
+
skilltree_lab/editor.html,sha256=aj51mUvxmL2z7SB6gronXzty9vzYJxAz-eDtZQAO9FY,19992
|
|
4
|
+
skilltree_lab/editor.py,sha256=byEgy0DPpRV77-3lOD597ZBSz7tukf9MmydI6YOhtOQ,15002
|
|
5
|
+
skilltree_lab/figures.py,sha256=yM8sx5SMXTGz_990mz3HY-TPTbHQsFlNqIlZ2nHoHhk,9363
|
|
6
|
+
skilltree_lab/shapes.py,sha256=4DbgR4RUFQWcGhNp-KWSEV8-ssxWZr-njFK49XGOZmQ,51592
|
|
7
|
+
skilltree_lab/svg.py,sha256=v321ko5awHDxT9iNZ2n2cPBBygWy85u89YyOygd-Ioo,2890
|
|
8
|
+
skilltree_lab/data/LICENSE.d3-celestial,sha256=qMeSOQAa1L6iQ9F5a4UITh_DkwnFxaZjkwobRjICVMY,1480
|
|
9
|
+
skilltree_lab/data/NOTICE,sha256=eTwaO8Mw17XujFvnHV60csIPevuKfRG_vksygoQ3Qso,957
|
|
10
|
+
skilltree_lab/data/asterisms.lines.json,sha256=onOdUQHCnRg6godVqffSC4dpmxO8ArocMp14QxrF2O8,16666
|
|
11
|
+
skilltree_lab/data/snt.lines.json,sha256=nMcpOoNi5_crw8nvBOG6D8rPByoFu2nvcqbuG9gHLgI,29129
|
|
12
|
+
skilltree_lab-0.1.0.dist-info/METADATA,sha256=mVCflvnMa_Bt-R9eS7i0YRUClYuPsunPCtwqulbK8X8,17466
|
|
13
|
+
skilltree_lab-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
14
|
+
skilltree_lab-0.1.0.dist-info/entry_points.txt,sha256=vLDQ1EPjS92RsrqoHTWkwFdTZ3hxqDitYZRv4i9g4AQ,53
|
|
15
|
+
skilltree_lab-0.1.0.dist-info/licenses/LICENSE,sha256=Q3ayDRBsl4vect86CZ_NvGTlwjtct6DUcot1VeRz5Co,1067
|
|
16
|
+
skilltree_lab-0.1.0.dist-info/licenses/skilltree_lab/data/LICENSE.d3-celestial,sha256=qMeSOQAa1L6iQ9F5a4UITh_DkwnFxaZjkwobRjICVMY,1480
|
|
17
|
+
skilltree_lab-0.1.0.dist-info/licenses/skilltree_lab/data/NOTICE,sha256=eTwaO8Mw17XujFvnHV60csIPevuKfRG_vksygoQ3Qso,957
|
|
18
|
+
skilltree_lab-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 remnantlab
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Copyright (c) 2015, Olaf Frohn
|
|
2
|
+
All rights reserved.
|
|
3
|
+
|
|
4
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
5
|
+
|
|
6
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7
|
+
|
|
8
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
9
|
+
|
|
10
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
11
|
+
|
|
12
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
snt.lines.json - constellation figures by Sky & Telescope (Alan MacRobert), the figures on the IAU
|
|
2
|
+
constellation charts, from Stellarium's "western_SnT" sky culture
|
|
3
|
+
(https://github.com/Stellarium/stellarium-skycultures/tree/master/western_SnT; authors Paul Krizak and
|
|
4
|
+
Jonathan E. Piskor, rework by the Stellarium Team). Licence: CC BY-SA 2.0
|
|
5
|
+
(https://creativecommons.org/licenses/by-sa/2.0/).
|
|
6
|
+
|
|
7
|
+
asterisms.lines.json - asterisms from Stellarium's "western" sky culture
|
|
8
|
+
(https://github.com/Stellarium/stellarium-skycultures/tree/master/western; Stellarium Team).
|
|
9
|
+
Licence: CC BY-SA (https://creativecommons.org/licenses/by-sa/4.0/).
|
|
10
|
+
|
|
11
|
+
Changes: the star numbers (Hipparcos) were replaced by star positions taken from d3-celestial
|
|
12
|
+
(https://github.com/ofrohn/d3-celestial, BSD-3-Clause, see LICENSE.d3-celestial), and the lines were
|
|
13
|
+
written as GeoJSON by tools/build_figures.py. These two files stay under their CC BY-SA licences;
|
|
14
|
+
the rest of skilltree-lab is MIT.
|