Skip to main content

Panda3D voxel world editor built from reusable .box assets.

Project description

neko-mouse-world

Voxel-based cubic world editor built from reusable .box files created with box-editor-view.

Showcase

The repository includes a generated castle world at examples/castle_showcase. It demonstrates a large editable scene made from a small set of reusable .box assets: a stone castle, towers, a bridge, a stream, trees, paths, windows, and layered roofs.

Castle gate with bridge and stream

Castle courtyard and keep

Castle aerial view

Open the showcase world in single-player mode:

venv\Scripts\python.exe -m neko_mouse_world.server examples\castle_showcase --with-client

The showcase can be regenerated and re-captured with:

venv\Scripts\python.exe tools\generate_castle_showcase.py
venv\Scripts\python.exe tools\capture_showcase_screenshots.py

Run

Use the project virtual environment:

venv\Scripts\python.exe -m neko_mouse_world.server path\to\world-folder --host 127.0.0.1 --port 5678
venv\Scripts\python.exe -m neko_mouse_world.client --host 127.0.0.1 --port 5678

If the client is started without --host and --port, it opens a modal connection dialog first. Fill in the server host and TCP port, then press OK.

The world path is a folder. When info.world or boxes/ is missing, the editor creates them automatically. If info.world exists but is malformed, startup prints FormatError and exits.

For single-player convenience, run the server with a main local client:

venv\Scripts\python.exe -m neko_mouse_world.server path\to\world-folder --with-client

In --with-client mode the server runs in the background, launches one client connected to itself, and shuts down when that main client exits.

The server accepts --udp-host and --udp-port. The default UDP port is 0, which means the OS chooses a free port. The selected UDP endpoint is negotiated over TCP. World/map changes always use TCP. Player positions first try UDP; the client sends 5 probe packets and UDP is used only when at least 3 probes succeed. If the test fails, player positions automatically fall back to TCP.

During startup, the main TCP connection receives the world snapshot and an asset manifest. Missing .box assets are then downloaded over temporary parallel TCP channels that share the same client UUID and startup token. The temporary channels close after startup, leaving only the main TCP connection. Configure the count with --startup-asset-channels; use 1 to effectively disable parallel startup asset transfer. If those temporary channels fail, the client reconnects and falls back to inline asset transfer on the main TCP connection.

The server saves world changes immediately. When the last client disconnects, it also removes .box files from boxes/ that are no longer referenced by the world.

When a client first connects to a server, it shows a loading progress bar while preparing reusable .box meshes, collision hulls, and world chunks over multiple frames. Later reconnect snapshots are synchronized in the background without showing the first-load progress overlay again.

World Format

info.world is a SQLite database containing the world grid. Each occupied world cell stores the content hash of a .box file plus an orientation value from 0..23. The hash identifies the reusable shape; the orientation only rotates that instance. The corresponding file is loaded from:

boxes/<hash>.box

The hash is the same stable digest printed by:

venv\Scripts\python.exe -m box_editor_view --hash some.box

If info.world references a missing .box file, that world cell is removed on load and the repaired world file is saved.

.box color alpha follows box-editor-view: alpha 0 is not empty. It is rendered as an opaque RGB cube and acts as an RGB-colored point light source. The client keeps realtime point lighting capped to nearby/in-view light cubes; far or off-screen light cubes still render as opaque RGB cubes. Alpha 1..254 is transparent, and alpha 255 is opaque.

Controls

  • Mouse look after the mouse is captured.
  • WASD: move.
  • F: switch walk and fly modes.
  • Walk mode Space: jump 1.1 world units.
  • Fly mode Space / Shift: move up / down.
  • Right click: place the selected .box.
  • Left click: delete the targeted world box.
  • Z: restore the last world box you deleted.
  • Middle click: select the targeted world box type and orientation.
  • E: edit the targeted world box in box-editor-view.
  • Numpad 4 / 6: rotate the targeted box around the player's view-up axis.
  • Numpad 8 / 2: rotate the targeted box around the player's view direction axis.
  • F2 or Ctrl+S: show save status; multiplayer worlds are saved by the server.
  • F5: switch first-person / third-person view.
  • C: look at the world-box centroid, or the origin when the world is empty.
  • ~: open the server command console.
  • H: show help.
  • Esc: release the mouse and show exit choices.

Placing, deleting, selecting, editing, and hover highlighting only work within 10 world units of the player.

World boxes collide using the convex hull of their .box voxel vertices, not a full cube. In walk mode the player can step up onto obstacles up to 0.5 world units high and follows convex slope surfaces.

The default placed object is the gray N=0 single-cube .box.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neko_mouse_world-0.1.3.tar.gz (52.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neko_mouse_world-0.1.3-py3-none-any.whl (54.4 kB view details)

Uploaded Python 3

File details

Details for the file neko_mouse_world-0.1.3.tar.gz.

File metadata

  • Download URL: neko_mouse_world-0.1.3.tar.gz
  • Upload date:
  • Size: 52.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for neko_mouse_world-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d8095cd1d103550445dcc4a2784a830b102bd8392156b74e1265447f95d61d5c
MD5 7550652d1fa4f5a677dad628b46228f9
BLAKE2b-256 ef9e0e73294c5aab459eea630b4201c3ad51429f96fa73697b403b7fb7f27857

See more details on using hashes here.

File details

Details for the file neko_mouse_world-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: neko_mouse_world-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 54.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.15 Windows/10

File hashes

Hashes for neko_mouse_world-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 638bd5306a8009b201773fb230e3b8bc4db978900e7f5e332e82707af4d5e1aa
MD5 5ec515c7c8e1181ee7fe07ca1dfee4fc
BLAKE2b-256 bd75ce7150cee4518bb06951d466e4c02d6a6651b0867c8cdbccc5a28a9727ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page