skilltree-lab 0.1.0__tar.gz

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.
Files changed (42) hide show
  1. skilltree_lab-0.1.0/.github/workflows/ci.yml +27 -0
  2. skilltree_lab-0.1.0/.github/workflows/release.yml +40 -0
  3. skilltree_lab-0.1.0/.gitignore +5 -0
  4. skilltree_lab-0.1.0/CHANGELOG.md +23 -0
  5. skilltree_lab-0.1.0/LICENSE +21 -0
  6. skilltree_lab-0.1.0/PKG-INFO +266 -0
  7. skilltree_lab-0.1.0/README.ja.md +239 -0
  8. skilltree_lab-0.1.0/README.ko.md +233 -0
  9. skilltree_lab-0.1.0/README.md +237 -0
  10. skilltree_lab-0.1.0/README.zh-CN.md +235 -0
  11. skilltree_lab-0.1.0/docs/branch.svg +50 -0
  12. skilltree_lab-0.1.0/docs/constellation.svg +112 -0
  13. skilltree_lab-0.1.0/docs/grid.svg +26 -0
  14. skilltree_lab-0.1.0/docs/logo-dark.png +0 -0
  15. skilltree_lab-0.1.0/docs/logo.png +0 -0
  16. skilltree_lab-0.1.0/docs/ring.svg +744 -0
  17. skilltree_lab-0.1.0/docs/spine.svg +93 -0
  18. skilltree_lab-0.1.0/docs/trees.svg +76 -0
  19. skilltree_lab-0.1.0/docs/zigzag.svg +52 -0
  20. skilltree_lab-0.1.0/examples/branch.toml +5 -0
  21. skilltree_lab-0.1.0/examples/constellation.toml +7 -0
  22. skilltree_lab-0.1.0/examples/godot/skill_tree.gd +54 -0
  23. skilltree_lab-0.1.0/examples/grid.toml +6 -0
  24. skilltree_lab-0.1.0/examples/ring.toml +5 -0
  25. skilltree_lab-0.1.0/examples/spine.toml +9 -0
  26. skilltree_lab-0.1.0/examples/trees.toml +16 -0
  27. skilltree_lab-0.1.0/examples/unity/SkillTreeView.cs +82 -0
  28. skilltree_lab-0.1.0/examples/zigzag.toml +4 -0
  29. skilltree_lab-0.1.0/pyproject.toml +36 -0
  30. skilltree_lab-0.1.0/skilltree_lab/__init__.py +0 -0
  31. skilltree_lab-0.1.0/skilltree_lab/cli.py +82 -0
  32. skilltree_lab-0.1.0/skilltree_lab/data/LICENSE.d3-celestial +12 -0
  33. skilltree_lab-0.1.0/skilltree_lab/data/NOTICE +14 -0
  34. skilltree_lab-0.1.0/skilltree_lab/data/asterisms.lines.json +1 -0
  35. skilltree_lab-0.1.0/skilltree_lab/data/snt.lines.json +1 -0
  36. skilltree_lab-0.1.0/skilltree_lab/editor.html +418 -0
  37. skilltree_lab-0.1.0/skilltree_lab/editor.py +311 -0
  38. skilltree_lab-0.1.0/skilltree_lab/figures.py +201 -0
  39. skilltree_lab-0.1.0/skilltree_lab/shapes.py +1053 -0
  40. skilltree_lab-0.1.0/skilltree_lab/svg.py +61 -0
  41. skilltree_lab-0.1.0/tests/test_shapes.py +607 -0
  42. skilltree_lab-0.1.0/tools/build_figures.py +62 -0
@@ -0,0 +1,27 @@
1
+ name: ci
2
+ on: [push, pull_request]
3
+
4
+ jobs:
5
+ test:
6
+ strategy:
7
+ fail-fast: false
8
+ matrix:
9
+ os: [ubuntu-latest, macos-latest, windows-latest]
10
+ python: ["3.11", "3.13"]
11
+ runs-on: ${{ matrix.os }}
12
+ defaults:
13
+ run:
14
+ shell: bash
15
+ steps:
16
+ - uses: actions/checkout@v5
17
+ - uses: actions/setup-python@v6
18
+ with:
19
+ python-version: ${{ matrix.python }}
20
+ - run: pip install -e ".[dev]"
21
+ - run: pytest -v
22
+ - run: skilltree gen examples/trees.toml -o out/trees
23
+ - name: The wheel carries the editor page and the figure data
24
+ run: |
25
+ pip install build
26
+ python -m build --wheel
27
+ python -c "import zipfile,glob; n=zipfile.ZipFile(glob.glob('dist/*.whl')[0]).namelist(); need={'skilltree_lab/editor.html','skilltree_lab/data/snt.lines.json','skilltree_lab/data/NOTICE'}; assert need <= set(n), need - set(n); assert any(x.endswith('licenses/LICENSE') for x in n), n"
@@ -0,0 +1,40 @@
1
+ name: release
2
+ # A version tag (v0.1.0) publishes that version to PyPI and makes a GitHub release.
3
+ # Run it by hand (Actions → release → Run workflow) to publish what main holds.
4
+ on:
5
+ push:
6
+ tags: ["v*.*.*"]
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ pypi:
11
+ runs-on: ubuntu-latest
12
+ environment: pypi
13
+ permissions:
14
+ id-token: write # PyPI Trusted Publishing: no token stored anywhere
15
+ steps:
16
+ - uses: actions/checkout@v5
17
+ - uses: actions/setup-python@v6
18
+ with:
19
+ python-version: "3.13"
20
+ - name: Build
21
+ run: |
22
+ pip install build
23
+ python -m build
24
+ - name: The tag matches the version
25
+ if: github.ref_type == 'tag'
26
+ run: |
27
+ v=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
28
+ test "v$v" = "$GITHUB_REF_NAME" || { echo "tag $GITHUB_REF_NAME but pyproject says $v"; exit 1; }
29
+ - uses: pypa/gh-action-pypi-publish@release/v1
30
+
31
+ github-release:
32
+ needs: pypi
33
+ if: github.ref_type == 'tag'
34
+ runs-on: ubuntu-latest
35
+ permissions:
36
+ contents: write
37
+ steps:
38
+ - run: gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --title "$GITHUB_REF_NAME" --generate-notes
39
+ env:
40
+ GH_TOKEN: ${{ github.token }}
@@ -0,0 +1,5 @@
1
+ __pycache__/
2
+ *.egg-info/
3
+ .venv/
4
+ out/
5
+ uv.lock
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0
4
+
5
+ First release.
6
+
7
+ - Six shapes: `branch`, `grid`, `zigzag`, `spine`, `constellation` (88 IAU constellations with
8
+ Sky & Telescope lines, 71 asterisms, or figures you draw) and `ring`.
9
+ - Every number is a setting; a misspelt setting is an error. The same seed gives the same tree.
10
+ - Every node has a fixed label (`0`, `a1`, `b3`...). Hand fixes by label: `move`, `shift`, `place`, `grow`,
11
+ `meet`, `joins`, `no_joins`, `add`, `remove`, `cut`, `node_shapes`.
12
+ - Switchable join lines (`merge`); node marks of any regular polygon with a width-to-height ratio.
13
+ - `tree.json` for any engine: positions, tiers, labels, marks, `cost`, `needs`, `need_all`.
14
+ - Several trees in one file (`[[tree]]` blocks with `name` and `at`) joined by `links`.
15
+ - `skilltree edit`: a browser editor on this machine. Drag (Shift: with what hangs off it), add, connect and
16
+ delete nodes and lines, a node panel for marks, add, import, move, rename and remove trees, zoom and pan,
17
+ warnings as you go. Saving writes the hand fixes into the file with `made_with`, so a later change of seed
18
+ or counts is caught.
19
+ - `skilltree trace` (trial): read a drawn figure from a picture.
20
+ - `ring` is the main shape and the default when `shape` is left out. Its counts take ranges picked by the
21
+ seed; bridges come by chance (`bridges`), from any arm tier (`bridge_from`), tied to both arms in one place
22
+ or several (`bridge_ties`).
23
+ - Godot and Unity examples that draw `tree.json`.
@@ -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,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
+ | ![ring](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/ring.svg) | ![branch](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/branch.svg) | ![grid](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/grid.svg) |
56
+ | **zigzag** | **spine** | **constellation** |
57
+ | ![zigzag](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/zigzag.svg) | ![spine](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/spine.svg) | ![constellation](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/constellation.svg) |
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
+ ![trees](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/trees.svg)
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,239 @@
1
+ # skilltree-lab
2
+
3
+ <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>
4
+
5
+ [English](https://github.com/remnantlab/skilltree-lab/blob/main/README.md) · [한국어](https://github.com/remnantlab/skilltree-lab/blob/main/README.ko.md) · **日本語** · [简体中文](https://github.com/remnantlab/skilltree-lab/blob/main/README.zh-CN.md)
6
+
7
+ > **開発中です。** skilltree-lab はまだ完成していません。設定、ファイル形式、エディタはバージョンごとに変わることがあります。
8
+
9
+ 形といくつかの数値からスキルツリーを配置します。**すべての数値は設定で変えられます**。
10
+ 段の数、1つのノードが何本に分かれるか、腕の数、ノードの間隔まで決められます。
11
+ 同じシードからは、いつも同じツリーが生まれます。
12
+
13
+ 形は6種類です。
14
+
15
+ | 形 | 見た目 |
16
+ |---|---|
17
+ | `ring` | 中心から腕が扇形に広がり、腕の間のすき間に橋が架かります |
18
+ | `branch` | 根から段ごとに分かれて下へ伸びる木 |
19
+ | `grid` | まばらな格子に並ぶスキル。前提はほぼ真上から下りてきて、開始ノードが複数あります (Diablo II、WoW のタレント) |
20
+ | `zigzag` | 左右に振れながら並んで下りる鎖。鎖同士はつなぎません |
21
+ | `spine` | まっすぐな幹に枝が付き、枝はさらに分かれることもあります |
22
+ | `constellation` | 空に散らばる星座。星座ごとに最初の星があります (Grim Dawn) |
23
+
24
+ | ring | branch | grid |
25
+ |---|---|---|
26
+ | ![ring](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/ring.svg) | ![branch](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/branch.svg) | ![grid](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/grid.svg) |
27
+ | **zigzag** | **spine** | **constellation** |
28
+ | ![zigzag](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/zigzag.svg) | ![spine](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/spine.svg) | ![constellation](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/constellation.svg) |
29
+
30
+ 完成したツリーではなく、骨組みを作る道具です。生成したあと `skilltree edit` でノードを動かし、足し、
31
+ つなぎ、消して、手で仕上げてください。スキルの名前、効果、バランスはご自身で埋めます。
32
+
33
+ ```
34
+ pip install skilltree-lab
35
+ skilltree gen examples/ring.toml -o out/ring # out/ring/tree.json, out/ring/tree.svg
36
+ skilltree edit examples/branch.toml # ノードをドラッグ。Add、Connect、Delete。Save で手直しをファイルに書きます
37
+ skilltree shapes
38
+ skilltree figures # figure = で選べる88の星座
39
+ skilltree trace drawing.png # 試験機能: 描いた星座を TOML に (pip install skilltree-lab[trace])
40
+ ```
41
+
42
+ `tree.json` にはすべてのノード (`id`、`x`、`y`、`tier`、`label`、`shape`、`ratio`、`cost`、`needs`、`need_all`)
43
+ と線が入っていて、どのエンジンからでも読めます。`needs` はそのノードへ線が入ってくるノードの一覧で、
44
+ 既定ではそのうち1つを取れば十分です。`need_all` が true ならすべて必要です。`tree.svg` はプレビュー画像です。
45
+ ノードの段 (tier) は、いちばん近い開始ノード (JSON の `starts`) から何歩離れているかです。
46
+ 設定名を書き間違えると、黙って無視せずにエラーになります。
47
+
48
+ ## ゲームエンジンで
49
+
50
+ `tree.json` はただの JSON なので、どのエンジンでも読めます。これからツリーを描く小さな例が2つあります:
51
+ [`examples/godot/skill_tree.gd`](https://github.com/remnantlab/skilltree-lab/blob/main/examples/godot/skill_tree.gd) (Godot 4、Node2D に付けます) と
52
+ [`examples/unity/SkillTreeView.cs`](https://github.com/remnantlab/skilltree-lab/blob/main/examples/unity/SkillTreeView.cs) (Unity、LineRenderer を使います)。
53
+ ノードを `x`、`y` にセルの大きさを掛けた位置に置き、`shape` と `ratio` で図形を描き、`needs` のノードごとに
54
+ 線を引きます。アイコン、名前、習得の規則はゲーム側で付けてください。
55
+
56
+ ## 設定
57
+
58
+ 数は固定 (`3`) でも範囲 (`[1, 3]`) でもよく、範囲ならシードで選ばれます。`arms` は数か最後の文字で
59
+ 指定します (`"p"` なら a から p まで)。最大16です。腕ごとの数は文字で書きます: `length = {a = 12, c = 20}`。
60
+ 書かなかった腕は既定値のままです。距離の単位はノード1つ分の幅です。
61
+
62
+ ### すべての形
63
+
64
+ | 設定 | 既定 | 意味 |
65
+ |---|---|---|
66
+ | `shape` | `"ring"` | `branch`、`grid`、`zigzag`、`spine`、`constellation`、`ring` のどれか |
67
+ | `seed` | `0` | 同じシードなら同じツリー |
68
+
69
+ ### 合流線 (`zigzag` と `ring` 以外のすべての形)
70
+
71
+ 合流は、ノードに2つ目の前提を与えます。近くにある1段上のノードです。頼まない限り合流はありません。
72
+ 合流は線と交差せず、遠い側からは来ず、別の合流の隣には置かれず、2本の腕 (開始ノードから出る線、
73
+ または別々の開始ノード) をつなぎません。そのため腕、星座、根は離れたままです。
74
+
75
+ | 設定 | 既定 | 意味 |
76
+ |---|---|---|
77
+ | `merge` | `false` | `true` (`0.3` と同じ)、`false`、またはノードごとに合流が付く確率 |
78
+ | `merge_from` | `2` | 合流の上の端はこの段以上 (開始ノードが段 0) |
79
+ | `merge_reach` | `2.0` | いちばん長い合流。ふつうの線の長さが単位 |
80
+ | `joins` | `[]` | 番号で手で入れる合流: `[["a3", "b2"]]`。線と交差すると警告します |
81
+ | `no_joins` | `[]` | 番号で外す合流: `[["a2", "a5"]]`。ノード自身の線は外せません |
82
+ | `grow` | `[]` | 手で足すノード: `[{at = "b5", nodes = 2, side = "left"}]`。side は `out` (既定)、`left`、`right` で、線が下へ伸びるときの向きです。新しいノードはその腕の続き番号になります (`b13`、`b14`) |
83
+ | `move` | `{}` | 番号でノードを少し動かします: `{a3 = [0.5, -0.2]}`。ノード幅が単位で、y は下向き |
84
+ | `shift` | `{}` | ノードを、そこにぶら下がるノードごと動かします: `{b2 = [1, 0]}` |
85
+ | `place` | `{}` | ノードを決めた場所に置きます: `{c1 = [4, 2]}` |
86
+ | `add` | `{}` | 線のない新しいノードを番号で置きます: `{n1 = [3, 2]}`。`joins` でつなぐと、その最初の線は合流 (オレンジ) ではなく自分の線 (灰色) です |
87
+ | `remove` | `[]` | ノードを線ごと消します: `["b4"]`。ほかのノードの番号は変わりません。開始ノードは消せません |
88
+ | `cut` | `[]` | どの線でも消します: `[["a7", "a11"]]` |
89
+ | `node_shape` | `"circle"` | すべてのノードの図形: `circle`、`square`、`triangle`、`diamond`、`pentagon`、`hexagon`、`octagon`、または辺の数 (`7`) |
90
+ | `node_ratio` | `[1, 1]` | 図形の幅と高さの比。`square` に `[2, 1]` なら横長の長方形、円なら楕円 |
91
+ | `cost` | `1` | ノードを取るのに要るポイント。数1つ、または段ごとの一覧 (`[1, 1, 2, 3]`、最後の値が続きます) |
92
+ | `node_costs` | `{}` | 番号で一部のノードのポイント: `{a5 = 4}` |
93
+ | `need_all` | `[]` | 入ってくる線をすべて取らないと開かないノード: `["bc1"]` |
94
+ | `node_shapes` | `{}` | 番号で一部のノードの図形: `{"0" = "hexagon", a3 = "square", b5 = {shape = "diamond", ratio = [1, 2]}}`。どちらも `tree.json` に `shape` と `ratio` として入ります |
95
+ | `meet` | `[]` | 2つのノードが向かう1つのノード: `[["c5", "b12"]]`。両方の文字を取り (`bc1`)、2本の腕がここで意図して出会います |
96
+ | `made_with` | | `skilltree edit` が保存時に書く値で、番号を決める設定の指紋です。触らないでください |
97
+
98
+ すべてのノードに番号があり、プレビューと `tree.json` に出ます。開始ノードが1つなら開始ノードは `0` で、
99
+ そこから出る線ごとに文字が付きます。開始ノードが複数なら、開始ノードごとに文字が付き、開始ノード自身は
100
+ `a0`、`b0`… です。文字の中では外へ向かって `a1`、`a2`、`a3`… と数えます。合流が届くノードは
101
+ `a3 (+b2)` と表示されます。形を生成したら、おかしなところを `skilltree edit` か上の設定で手直しします。
102
+ エディタでは:
103
+
104
+ - ノードをドラッグすると、そのノードだけが動き、線が付いてきます。Shift を押してドラッグすると、ぶら下がるノードごと動きます (`shift`)
105
+ - ノードをクリックすると、図形と比を選ぶパネルが開きます (`node_shapes`)
106
+ - Add のあと空いた場所をクリックで新しいノード。Connect のあと2つのノードで線 (ノードの最初の線は自分の線で灰色、
107
+ それ以降は合流でオレンジ)。同じ2つをもう一度選ぶと消えます。Delete のあとノードか線で消えます
108
+ - ホイールで拡大・縮小、空いた場所のドラッグで移動、Fit で全体表示。Undo、Reset、Save (Ctrl+Z、Ctrl+S)
109
+ - 警告はすぐに出ます: ノードの重なり、線の交差、ノードの上を通る線、ツリーの重なり、そして開始ノードまで
110
+ つながらないノード (灰色になり、tree.json で tier が -1)
111
+
112
+ 番号は形だけで決まるので、手直ししてもノードの番号は変わりません。ただしシードや数を変えると変わります。
113
+ エディタから保存すると、番号を決める設定の指紋 `made_with` が書かれます。そのあとシード、数、形を変えると、
114
+ 手直しが別のノードを指しているかもしれないと `skilltree gen` が警告します。
115
+
116
+ ### ring
117
+
118
+ | 設定 | 既定 | 意味 |
119
+ |---|---|---|
120
+ | `arms` | `5` | 中心から出る腕。文字 (`"e"`) や範囲 (`[4, 6]`) も使えます |
121
+ | `arm_tiers` | `[3, 6, 6, 9, 9, 9]` | 腕の横方向のノード数を段ごとに。段に範囲 (`[6, 9]`) を書くと腕ごとにシードで選ばれます |
122
+ | `bridge_tiers` | `[1, 1, 2, 3]` | 橋の横方向のノード数を段ごとに (`[]`: 橋なし)。範囲は橋ごとに選ばれます |
123
+ | `bridge_from` | `2` | 橋が始まる腕の段。範囲 (`[2, 4]`) なら橋ごとに選ばれます |
124
+ | `bridges` | `true` | すべてのすき間に橋 (`true`)、橋なし (`false`)、またはすき間ごとに橋ができる確率 (`0.6`) |
125
+ | `bridge_ties` | `1` | 最初の行から何行までが両側の腕につながるか。`3` なら橋は腕と3か所でつながります。範囲なら橋ごとに選ばれます |
126
+ | `arm_spread` | `0.55` | 自分の扇のうち腕が使う割合。残りが橋のすき間です |
127
+ | `bridge_width` | `0.8` | すき間のうち橋が使える割合 |
128
+ | `first_radius` | `1.5` | 中心から最初の段までの距離 |
129
+ | `tier_gap` | `1.0` | 段の最小の間隔 (混んだ段はさらに外へ) |
130
+ | `node_gap` | `1.0` | 同じ段のノードの間隔 |
131
+ | `radii` | | 腕の各段の距離を手で: 例 `[1.5, 4, 6, 8]` |
132
+
133
+ ### branch
134
+
135
+ | 設定 | 既定 | 意味 |
136
+ |---|---|---|
137
+ | `tiers` | `4` | 根の下の段数、または腕ごと: `{a = 6, b = 3}` |
138
+ | `arms` | | 根から出る線 (`children` の最初の段を決めます) |
139
+ | `fan` | `0` | `0`: まっすぐ下。それ以外は根の周りに広がる角度 (`360`: 一周) |
140
+ | `children` | `[1, 3]` | 1つのノードが分かれる数。全段に1つの値、または段ごと: `[[3], [2, 3], [1, 2]]` (最後が繰り返されます) |
141
+ | `max_width` | `8` | 1本の腕の1段に入る最大のノード数 |
142
+ | `widths` | | 各行のノード数を手で: 例 `[2, 3, 4, 3, 2]`。`tiers` と `children` の代わりになります |
143
+ | `capstone` | `false` | 最後の行のすべてのノードが向かう最後のノード。`true`、`false`、または `0.15` のような確率。`fan` とは併用できません |
144
+ | `spacing_x` | `1.0` | 隣り合う葉の間隔。どのノードも自分の子の真上にあります |
145
+ | `spacing_y` | `1.0` | 段の間隔 |
146
+
147
+ ### grid
148
+
149
+ | 設定 | 既定 | 意味 |
150
+ |---|---|---|
151
+ | `columns` | `3` | 列 |
152
+ | `rows` | `6` | 行 |
153
+ | `per_row` | `[1, 2]` | 各行のスキル数。空いている列から先に選ばれます |
154
+ | `skip` | `1` | まっすぐ下りる線が飛び越せる空の行の最大数 |
155
+ | `capstone` | `false` | 最後の行のすべてのスキルが向かう最後のノード。`true`、`false`、または確率 |
156
+ | `spacing_x` | `1.5` | 列の間隔 |
157
+ | `spacing_y` | `1.0` | 行の間隔 |
158
+
159
+ 上に何もないスキルは開始ノードで、最初から開いています。
160
+
161
+ ### zigzag
162
+
163
+ | 設定 | 既定 | 意味 |
164
+ |---|---|---|
165
+ | `length` | `8` | 各鎖のノード数。範囲なら鎖ごとに長さが変わり、`{a = 12}` で1本の腕を決めます |
166
+ | `arms` | `1` | 開始ノードから出る鎖。並べるか扇形に広げます (`fan`) |
167
+ | `swing` | `[0.4, 1.0]` | 1歩ごとに左右へ振れる幅。1歩ごとに選ばれます |
168
+ | `lane_gap` | `2 × 最大の振れ幅 + 1.2` | 鎖の間隔 |
169
+ | `step` | `[0.8, 1.2]` | 次のノードまで下がる距離。1歩ごとに選ばれます |
170
+ | `fan` | `0` | `0`: 腕を並べてすべて下へ。それ以外は開始ノードの周りに広がる角度 (`360`: 一周) |
171
+ | `twigs` | `0` | 曲がり角の外側に小さな房が付く確率 |
172
+ | `twig_leaves` | `[2, 3]` | 小枝の先で扇形に広がるノード |
173
+ | `twig_stem` | `[0, 1]` | 曲がり角とその扇の間のノード |
174
+
175
+ ### spine
176
+
177
+ | 設定 | 既定 | 意味 |
178
+ |---|---|---|
179
+ | `length` | `8` | 幹のノード数 |
180
+ | `branches` | `3` | 枝が出る幹のノード数 |
181
+ | `per_node` | `1` | 1つの幹ノードの枝の数 |
182
+ | `branch_length` | `[1, 3]` | 枝の付け根から先までのノード数 |
183
+ | `branch_children` | `1` | 枝のノードが分かれる数 (1: ただの線) |
184
+ | `sides` | `"both"` | `"left"`、`"right"`、`"both"` |
185
+ | `step` | `1.0` | 幹のノードの間隔 |
186
+ | `branch_step` | `1.0` | 枝のノード1つごとの横の距離 |
187
+ | `branch_row` | `0.7` | 枝の先1つが取る縦の幅 |
188
+ | `capstone` | `false` | 幹の下の最後のノード。`true`、`false`、または確率 |
189
+
190
+ ### constellation
191
+
192
+ 空に散らばる星座で、それぞれ最初の星から始まります。献身 (devotion) の星座のような形です。
193
+
194
+ | 設定 | 既定 | 意味 |
195
+ |---|---|---|
196
+ | `arms` | `5` | 星座の数 (`fan` があれば、どれも開始ノードからぶら下がります) |
197
+ | `stars` | `[4, 7]` | 1つの星座の星の数、または腕ごと: `{a = 9}` |
198
+ | `fork` | `0.3` | 星から短い枝分かれが始まる確率 |
199
+ | `bend` | `60` | 1つの星で鎖が曲がる最大の角度 |
200
+ | `room` | `5.0` | 星座1つが使う空の広さ |
201
+ | `fan` | `0` | `0`: 星座がばらばらで、それぞれ自分の開始ノード。それ以外は中央に開始ノードが1つあり、星座は最大2つ、星1つ分離れて、この角度に広がります |
202
+ | `figure` | | 星座 (Sky & Telescope / IAU 星図の線) の IAU 略号 (`"ori"`、`"uma"`)、`"random"`、自分で描いたもの `{stars = [[x, y], ...], lines = [[0, 1], ...], start = 0}`、またはそれらの一覧。`arms` と `stars` の代わりになります。星座は自分の線だけを保ちます (合流なし)。最初に引いた線の端から始まり、番号は線を引いた順に付きます (描いた星座は `lines` に書いた順)。離れて描かれた部分 (へび座) は自分の開始ノードを持ちます。星群を名前で (`"big_dipper"`、`"summer_triangle"`。`skilltree figures` で一覧)、または星座の画を選んで `{name = "ori", strokes = [1, 4]}` (`skilltree figures ori` で一覧) |
203
+ | `star_gap` | `1.0` | つながった星の間隔 |
204
+
205
+ ## 1つのファイルに複数のツリー
206
+
207
+ ツリーごとに `[[tree]]` ブロックを置き、`name` と置く場所 `at = [x, y]` (既定 `[0, 0]`)、そのツリーの形と
208
+ 設定を書きます。番号の前にツリーの名前が付きます (`fire.a3`)。ブロックの中の手直しは、そのツリーの番号
209
+ (`a3`) をそのまま使います。最初のブロックの前に `links = [["fire.b3", "ice.a2"]]` と書くとツリー同士を
210
+ 線でつなぎ、1つのツリーの中では `joins` を使います。tree.json では link の2番目のノードが1番目を必要と
211
+ しますが、開始ノードは何も必要としないので、開始ノードへ入る link は開始ノードから出る線になります。
212
+ `skilltree edit` はすべてのツリーを一度に開きます。別のツリーの2つのノードを Connect でつなぐと `links` に
213
+ 入り、Move tree でツリーを丸ごと動かします。Add tree はクリックした場所に新しいツリー (名前と形を選び、
214
+ 設定は既定値) を置き、Import はほかのファイルのツリー (1つでも複数でも) を開いているものの右に取り込み、
215
+ Remove tree はツリーを link ごと消します。横の一覧でツリーの名前をクリックすると名前を変えられます。
216
+ ツリーが1つのファイルに2つ目が加わると、ブロックの形で保存され、最初のツリーの名前はファイル名になります。
217
+ `examples/trees.toml` をご覧ください。
218
+
219
+ ![trees](https://raw.githubusercontent.com/remnantlab/skilltree-lab/main/docs/trees.svg)
220
+
221
+ エディタの Add で作った新しいノードは `n1`、`n2`… と名付けられ、開始ノードに近いものから線に沿って番号が
222
+ 付きます。別の順で描いても番号を付け直すので、開始ノードから `n3-n1-n2` とつながれば `n1-n2-n3` になります。
223
+
224
+ ## 絵から星座を読む (試験機能)
225
+
226
+ `skilltree trace drawing.png` は、細い線でつながった丸い星を読み取ります (暗い地に明るい絵でも、明るい地に
227
+ 暗い絵でも)。そして設定に貼り付ける `[figure]` ブロックを出力します。星は、すべての縁から `--erode`
228
+ ピクセル (既定 5) を削っても残るものです。ですから線はそれより細く、星はそれより太くなければなりません。
229
+ 結果を確かめてください。曲がった線や、ほかの星に触れている星は読み違えやすいです。
230
+
231
+ ## ライセンス
232
+
233
+ MIT です。ただし `skilltree_lab/data/` の2つの星座ファイルは CC BY-SA のままです
234
+ (`skilltree_lab/data/NOTICE` を参照)。`snt.lines.json` は IAU の星座図に載っている Sky & Telescope の
235
+ 星座線で (IAU 自体が定めるのは名前と境界だけで、線は定めていません)、Stellarium の `western_SnT` から
236
+ 取っています。`asterisms.lines.json` は Stellarium の西洋の星群です。星の位置は
237
+ [d3-celestial](https://github.com/ofrohn/d3-celestial) (BSD-3-Clause、`skilltree_lab/data/LICENSE.d3-celestial`)
238
+ から取っています。`tools/build_figures.py` で両方のファイルを作り直せます。近すぎる星は、ノードが重ならない
239
+ ように少し離してあります。