neko-mouse-world 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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GGN_2015
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,145 @@
1
+ Metadata-Version: 2.4
2
+ Name: neko-mouse-world
3
+ Version: 0.1.0
4
+ Summary: Panda3D voxel world editor built from reusable .box assets.
5
+ Author: GGN_2015
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: box-editor-view>=0.1.7
10
+ Requires-Dist: panda3d>=1.10.14
11
+ Dynamic: license-file
12
+
13
+ # neko-mouse-world
14
+
15
+ Voxel-based cubic world editor built from reusable `.box` files created with
16
+ `box-editor-view`.
17
+
18
+ ## Showcase
19
+
20
+ The repository includes a generated castle world at `examples/castle_showcase`.
21
+ It demonstrates a large editable scene made from a small set of reusable `.box`
22
+ assets: a stone castle, towers, a bridge, a stream, trees, paths, windows, and
23
+ layered roofs.
24
+
25
+ ![Castle gate with bridge and stream](docs/images/castle_gate.png)
26
+
27
+ ![Castle courtyard and keep](docs/images/castle_courtyard.png)
28
+
29
+ ![Castle aerial view](docs/images/castle_overlook.png)
30
+
31
+ Open the showcase world in single-player mode:
32
+
33
+ ```powershell
34
+ venv\Scripts\python.exe -m neko_mouse_world.server examples\castle_showcase --with-client
35
+ ```
36
+
37
+ The showcase can be regenerated and re-captured with:
38
+
39
+ ```powershell
40
+ venv\Scripts\python.exe tools\generate_castle_showcase.py
41
+ venv\Scripts\python.exe tools\capture_showcase_screenshots.py
42
+ ```
43
+
44
+ ## Run
45
+
46
+ Use the project virtual environment:
47
+
48
+ ```powershell
49
+ venv\Scripts\python.exe -m neko_mouse_world.server path\to\world-folder --host 127.0.0.1 --port 5678
50
+ venv\Scripts\python.exe -m neko_mouse_world.client --host 127.0.0.1 --port 5678
51
+ ```
52
+
53
+ If the client is started without `--host` and `--port`, it opens a modal
54
+ connection dialog first. Fill in the server host and TCP port, then press OK.
55
+
56
+ The world path is a folder. When `info.world` or `boxes/` is missing, the editor
57
+ creates them automatically. If `info.world` exists but is malformed, startup
58
+ prints `FormatError` and exits.
59
+
60
+ For single-player convenience, run the server with a main local client:
61
+
62
+ ```powershell
63
+ venv\Scripts\python.exe -m neko_mouse_world.server path\to\world-folder --with-client
64
+ ```
65
+
66
+ In `--with-client` mode the server runs in the background, launches one client
67
+ connected to itself, and shuts down when that main client exits.
68
+
69
+ The server accepts `--udp-host` and `--udp-port`. The default UDP port is `0`,
70
+ which means the OS chooses a free port. The selected UDP endpoint is negotiated
71
+ over TCP. World/map changes always use TCP. Player positions first try UDP; the
72
+ client sends 5 probe packets and UDP is used only when at least 3 probes succeed.
73
+ If the test fails, player positions automatically fall back to TCP.
74
+
75
+ During startup, the main TCP connection receives the world snapshot and an asset
76
+ manifest. Missing `.box` assets are then downloaded over temporary parallel TCP
77
+ channels that share the same client UUID and startup token. The temporary
78
+ channels close after startup, leaving only the main TCP connection. Configure
79
+ the count with `--startup-asset-channels`; use `1` to effectively disable
80
+ parallel startup asset transfer. If those temporary channels fail, the client
81
+ reconnects and falls back to inline asset transfer on the main TCP connection.
82
+
83
+ The server saves world changes immediately. When the last client disconnects, it
84
+ also removes `.box` files from `boxes/` that are no longer referenced by the
85
+ world.
86
+
87
+ When a client first connects to a server, it shows a loading progress bar while
88
+ preparing reusable `.box` meshes, collision hulls, and world chunks over multiple
89
+ frames. Later reconnect snapshots are synchronized in the background without
90
+ showing the first-load progress overlay again.
91
+
92
+ ## World Format
93
+
94
+ `info.world` is a SQLite database containing the world grid. Each occupied world
95
+ cell stores the content hash of a `.box` file plus an `orientation` value from
96
+ `0..23`. The hash identifies the reusable shape; the orientation only rotates
97
+ that instance. The corresponding file is loaded from:
98
+
99
+ ```text
100
+ boxes/<hash>.box
101
+ ```
102
+
103
+ The hash is the same stable digest printed by:
104
+
105
+ ```powershell
106
+ venv\Scripts\python.exe -m box_editor_view --hash some.box
107
+ ```
108
+
109
+ If `info.world` references a missing `.box` file, that world cell is removed on
110
+ load and the repaired world file is saved.
111
+
112
+ `.box` color alpha follows `box-editor-view`: alpha `0` is not empty. It is
113
+ rendered as an opaque RGB cube and acts as an RGB-colored point light source.
114
+ The client keeps realtime point lighting capped to nearby/in-view light cubes;
115
+ far or off-screen light cubes still render as opaque RGB cubes. Alpha `1..254`
116
+ is transparent, and alpha `255` is opaque.
117
+
118
+ ## Controls
119
+
120
+ - Mouse look after the mouse is captured.
121
+ - `WASD`: move.
122
+ - `F`: switch walk and fly modes.
123
+ - Walk mode `Space`: jump 1.1 world units.
124
+ - Fly mode `Space` / `Shift`: move up / down.
125
+ - Right click: place the selected `.box`.
126
+ - Left click: delete the targeted world box.
127
+ - `Z`: restore the last world box you deleted.
128
+ - Middle click: select the targeted world box type.
129
+ - `E`: edit the targeted world box in `box-editor-view`.
130
+ - Numpad `4` / `6`: rotate the targeted box around the player's view-up axis.
131
+ - Numpad `8` / `2`: rotate the targeted box around the player's view direction axis.
132
+ - `F2` or `Ctrl+S`: show save status; multiplayer worlds are saved by the server.
133
+ - `F5`: switch first-person / third-person view.
134
+ - `C`: look at the world-box centroid, or the origin when the world is empty.
135
+ - `H`: show help.
136
+ - `Esc`: release the mouse and show exit choices.
137
+
138
+ Placing, deleting, selecting, editing, and hover highlighting only work within
139
+ 10 world units of the player.
140
+
141
+ World boxes collide using the convex hull of their `.box` voxel vertices, not a
142
+ full cube. In walk mode the player can step up onto obstacles up to 0.5 world
143
+ units high and follows convex slope surfaces.
144
+
145
+ The default placed object is the gray `N=0` single-cube `.box`.
@@ -0,0 +1,133 @@
1
+ # neko-mouse-world
2
+
3
+ Voxel-based cubic world editor built from reusable `.box` files created with
4
+ `box-editor-view`.
5
+
6
+ ## Showcase
7
+
8
+ The repository includes a generated castle world at `examples/castle_showcase`.
9
+ It demonstrates a large editable scene made from a small set of reusable `.box`
10
+ assets: a stone castle, towers, a bridge, a stream, trees, paths, windows, and
11
+ layered roofs.
12
+
13
+ ![Castle gate with bridge and stream](docs/images/castle_gate.png)
14
+
15
+ ![Castle courtyard and keep](docs/images/castle_courtyard.png)
16
+
17
+ ![Castle aerial view](docs/images/castle_overlook.png)
18
+
19
+ Open the showcase world in single-player mode:
20
+
21
+ ```powershell
22
+ venv\Scripts\python.exe -m neko_mouse_world.server examples\castle_showcase --with-client
23
+ ```
24
+
25
+ The showcase can be regenerated and re-captured with:
26
+
27
+ ```powershell
28
+ venv\Scripts\python.exe tools\generate_castle_showcase.py
29
+ venv\Scripts\python.exe tools\capture_showcase_screenshots.py
30
+ ```
31
+
32
+ ## Run
33
+
34
+ Use the project virtual environment:
35
+
36
+ ```powershell
37
+ venv\Scripts\python.exe -m neko_mouse_world.server path\to\world-folder --host 127.0.0.1 --port 5678
38
+ venv\Scripts\python.exe -m neko_mouse_world.client --host 127.0.0.1 --port 5678
39
+ ```
40
+
41
+ If the client is started without `--host` and `--port`, it opens a modal
42
+ connection dialog first. Fill in the server host and TCP port, then press OK.
43
+
44
+ The world path is a folder. When `info.world` or `boxes/` is missing, the editor
45
+ creates them automatically. If `info.world` exists but is malformed, startup
46
+ prints `FormatError` and exits.
47
+
48
+ For single-player convenience, run the server with a main local client:
49
+
50
+ ```powershell
51
+ venv\Scripts\python.exe -m neko_mouse_world.server path\to\world-folder --with-client
52
+ ```
53
+
54
+ In `--with-client` mode the server runs in the background, launches one client
55
+ connected to itself, and shuts down when that main client exits.
56
+
57
+ The server accepts `--udp-host` and `--udp-port`. The default UDP port is `0`,
58
+ which means the OS chooses a free port. The selected UDP endpoint is negotiated
59
+ over TCP. World/map changes always use TCP. Player positions first try UDP; the
60
+ client sends 5 probe packets and UDP is used only when at least 3 probes succeed.
61
+ If the test fails, player positions automatically fall back to TCP.
62
+
63
+ During startup, the main TCP connection receives the world snapshot and an asset
64
+ manifest. Missing `.box` assets are then downloaded over temporary parallel TCP
65
+ channels that share the same client UUID and startup token. The temporary
66
+ channels close after startup, leaving only the main TCP connection. Configure
67
+ the count with `--startup-asset-channels`; use `1` to effectively disable
68
+ parallel startup asset transfer. If those temporary channels fail, the client
69
+ reconnects and falls back to inline asset transfer on the main TCP connection.
70
+
71
+ The server saves world changes immediately. When the last client disconnects, it
72
+ also removes `.box` files from `boxes/` that are no longer referenced by the
73
+ world.
74
+
75
+ When a client first connects to a server, it shows a loading progress bar while
76
+ preparing reusable `.box` meshes, collision hulls, and world chunks over multiple
77
+ frames. Later reconnect snapshots are synchronized in the background without
78
+ showing the first-load progress overlay again.
79
+
80
+ ## World Format
81
+
82
+ `info.world` is a SQLite database containing the world grid. Each occupied world
83
+ cell stores the content hash of a `.box` file plus an `orientation` value from
84
+ `0..23`. The hash identifies the reusable shape; the orientation only rotates
85
+ that instance. The corresponding file is loaded from:
86
+
87
+ ```text
88
+ boxes/<hash>.box
89
+ ```
90
+
91
+ The hash is the same stable digest printed by:
92
+
93
+ ```powershell
94
+ venv\Scripts\python.exe -m box_editor_view --hash some.box
95
+ ```
96
+
97
+ If `info.world` references a missing `.box` file, that world cell is removed on
98
+ load and the repaired world file is saved.
99
+
100
+ `.box` color alpha follows `box-editor-view`: alpha `0` is not empty. It is
101
+ rendered as an opaque RGB cube and acts as an RGB-colored point light source.
102
+ The client keeps realtime point lighting capped to nearby/in-view light cubes;
103
+ far or off-screen light cubes still render as opaque RGB cubes. Alpha `1..254`
104
+ is transparent, and alpha `255` is opaque.
105
+
106
+ ## Controls
107
+
108
+ - Mouse look after the mouse is captured.
109
+ - `WASD`: move.
110
+ - `F`: switch walk and fly modes.
111
+ - Walk mode `Space`: jump 1.1 world units.
112
+ - Fly mode `Space` / `Shift`: move up / down.
113
+ - Right click: place the selected `.box`.
114
+ - Left click: delete the targeted world box.
115
+ - `Z`: restore the last world box you deleted.
116
+ - Middle click: select the targeted world box type.
117
+ - `E`: edit the targeted world box in `box-editor-view`.
118
+ - Numpad `4` / `6`: rotate the targeted box around the player's view-up axis.
119
+ - Numpad `8` / `2`: rotate the targeted box around the player's view direction axis.
120
+ - `F2` or `Ctrl+S`: show save status; multiplayer worlds are saved by the server.
121
+ - `F5`: switch first-person / third-person view.
122
+ - `C`: look at the world-box centroid, or the origin when the world is empty.
123
+ - `H`: show help.
124
+ - `Esc`: release the mouse and show exit choices.
125
+
126
+ Placing, deleting, selecting, editing, and hover highlighting only work within
127
+ 10 world units of the player.
128
+
129
+ World boxes collide using the convex hull of their `.box` voxel vertices, not a
130
+ full cube. In walk mode the player can step up onto obstacles up to 0.5 world
131
+ units high and follows convex slope surfaces.
132
+
133
+ The default placed object is the gray `N=0` single-cube `.box`.
@@ -0,0 +1,23 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "neko-mouse-world"
7
+ version = "0.1.0"
8
+ description = "Panda3D voxel world editor built from reusable .box assets."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ authors = [{ name = "GGN_2015" }]
12
+ dependencies = [
13
+ "box-editor-view>=0.1.7",
14
+ "panda3d>=1.10.14",
15
+ ]
16
+
17
+ [project.scripts]
18
+ neko-mouse-world = "neko_mouse_world.client:main"
19
+ neko-mouse-world-client = "neko_mouse_world.client:main"
20
+ neko-mouse-world-server = "neko_mouse_world.server:main"
21
+
22
+ [tool.setuptools.packages.find]
23
+ where = ["src"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,5 @@
1
+ """Neko Mouse World editor package."""
2
+
3
+ __all__ = ["__version__"]
4
+
5
+ __version__ = "0.1.0"
@@ -0,0 +1,23 @@
1
+ from __future__ import annotations
2
+
3
+ import sys
4
+
5
+
6
+ def main(argv: list[str] | None = None) -> int:
7
+ args = list(sys.argv[1:] if argv is None else argv)
8
+ if args and args[0] == "server":
9
+ from .server import main as server_main
10
+
11
+ return server_main(args[1:])
12
+ if args and args[0] == "client":
13
+ from .client import main as client_main
14
+
15
+ return client_main(args[1:])
16
+
17
+ from .client import main as client_main
18
+
19
+ return client_main(args)
20
+
21
+
22
+ if __name__ == "__main__":
23
+ raise SystemExit(main())