Commit Graph

24 Commits

Author SHA1 Message Date
Steve Biedermann 3a24531529 feat!: simulate multiple map levels connected by teleports
Test / Clippy and tests (nextest) (push) Failing after 1m2s Details
Windows package / Build Windows package (push) Failing after 53s Details
Worlds now consist of levels: the server's map plus every map reached
through `teleport` triggers (`target` object name, optional `map` file
property relative to the map). All levels are simulated all the time;
replicon only sends clients their character's level, and singleplayer
hides other levels client-side. Interactions, construction, machines and
item drops are confined to the actor's level.

The default map gains stairs in the main hall leading to a new cellar
level and stairs back up.

Exports write every level's map, naming the main map after the server's
map; import validates and replaces all levels and moves characters on
removed levels to the spawn point.

BREAKING CHANGE: save schema version 3 stores entity levels and level
terrain. Exported main maps are named after the server's map (for example
`station.tmx`) instead of `world.tmx`. `Level` is a new replicated
component, changing the network protocol.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 02:13:09 +02:00
Steve Biedermann 823f0f76e6 feat(server)!: export worlds as ready-to-use Tiled projects
`export [DIR]` now writes a project directory containing world.tmx, a
station.tiled-project that loads the bundled extensions, a copy of the
extensions, relative tileset image copies and a README. An existing
project file is kept on re-export. `import` accepts the directory or a
map file; copied tileset images map back to the identical asset paths.

Add the Tiled action "Station: Convert All Project Maps", which converts
painted gameplay tiles in every map of the opened project at once and
leaves the results open for review.

BREAKING CHANGE: the export path is now a directory instead of a .tmx
file, and default export locations changed to <db-stem>.<world>.tiled/,
saves/<world>/ or saves/world/.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 01:01:04 +02:00
Steve Biedermann 232305490d feat(tiled): paint objects with independent brush properties
Test / Clippy and tests (nextest) (push) Failing after 1m33s Details
Windows package / Build Windows package (push) Failing after 41s Details
Add a grid-snapped object brush with configurable per-tile defaults, drag previews, independently editable building properties and one-step stroke undo. Validate placement before changing the map, preserve integer properties and report mouse-callback errors without blocking the editor.

Ship a Tiled project that loads the bundled extensions after the standard trust prompt, ignore local editor sessions and document the painting workflow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 23:36:34 +02:00
Steve Biedermann 3c568dc6f3 chore: format Cargo.toml 2026-10-21 22:59:03 +02:00
Steve Biedermann 402aa12043 fix(tiled): match default layer order and visibility
Place Objects above Ground Items and Triggers, with Floors and Wiring/Plumbing hidden by default. Apply the defaults to exports and newly created conversion layers while preserving existing layer visibility. Verify hidden layers still import gameplay entities.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 22:53:24 +02:00
Steve Biedermann b0fa5b3ec4 feat(xtask): serve watched packages over local HTTP
Add watch-only --serve on 127.0.0.1:9932 with directory listings, streamed downloads and HEAD requests. Serve the selected output directory independently of rebuilds and reject paths outside its root. Document usage and test HTTP responses and option parsing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 22:42:51 +02:00
Steve Biedermann 6af3df0ecc feat(xtask): watch sources and debounce automatic packaging
Wait for a ten-second quiet period before rebuilding and packaging, resetting the timer on each source change. Queue edits during builds or while dist/NOREBUILD exists, exclude generated outputs, and forward pack options. Recompile packaging code for each run and keep watching after build failures.

Document watcher usage and require agents to hold dist/NOREBUILD throughout their work.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 22:30:03 +02:00
Steve Biedermann 29275c38fc fix(tiled): enforce tmx exports and group objects by category
Normalize export filenames to .tmx and return the actual saved path in command replies. Separate floors, structures, ground items and spawn points into named object layers, with a reserved wiring/plumbing layer. Reuse the same categories in the Tiled converter and preserve undo behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 22:20:13 +02:00
Steve Biedermann 8f24528304 feat(world)!: add layered floors and painted-tile conversion
Separate floors from structures for occupancy, rendering, interaction and deconstruction. Convert marked Tiled tiles to stateful gameplay buildings, retain a configurable default terrain tile, and preserve legacy saved terrain without reseeding it.

Bundle a Tiled conversion extension with editable per-object properties, conflict checks and single-step undo. Cover conversion, persistence, collision and gameplay in Rust tests and run the extension tests in CI.

BREAKING CHANGE: network protocol version 6 adds layered building state and default terrain metadata; clients and servers must be upgraded together.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 21:40:20 +02:00
Steve Biedermann fadd159de6 docs: document SS13 feature gaps and development priorities
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 20:57:50 +02:00
Steve Biedermann 4d7d777e86 feat(chat): add native text editing, history and command completion
Use Bevy editable text with word navigation, keyboard and pointer selection, system clipboard integration and IME-aware submission. Add bounded history with draft restoration and permission-aware Tab completion. Cover native keyboard, mouse and clipboard event handling in tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 20:22:32 +02:00
Steve Biedermann 43051c9f5d feat(world)!: add lossless Tiled export and import
Preserve building state, machine contents and progress in editable Tiled properties. Share property decoding between seeds and imports; replace terrain and objects atomically while keeping characters. Persist terrain in schema version 2 and replicate it to existing and joining clients.

BREAKING CHANGE: network protocol version 5 replicates authoritative terrain; older clients and servers cannot connect.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 20:22:13 +02:00
Steve Biedermann 0c9136eaae feat!: move characters freely instead of tile by tile
Test / Clippy and tests (nextest) (push) Failing after 1m59s Details
Windows package / Build Windows package (push) Failing after 59s Details
Characters have a continuous Position simulated on the server with a
square collision box, sliding along walls and corner assist into
openings. GridPos is derived from the position, so interactions,
building and reach stay tile-based. The exact position is saved.

BREAKING CHANGE: protocol version 4 replaces SetMoveDir with SetMovement
and replicates Position.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 23:15:16 +02:00
Steve Biedermann 2d6f52e8a4 feat!: start menu, file-based UI, machine windows and server access control
- Start menu with new game (optionally hosted), load/delete saves and join
  server screens; CLI options skip it.
- Menus and HUD are built from rsn layouts in assets/ui with a shared theme,
  bindings, conditional visibility and tooltips.
- Machine windows place slots and backgrounds from the machine's ui
  definition; slots are filled from and emptied into the inventory.
- Chat with / commands, pause menu, clickable inventory, craft and build
  menus.
- Server passwords, admins, whitelist, bans, kicks and admin commands from
  the terminal or chat; changes are written to the config file. The hosting
  player is always admin.
- Clients keep a player id in client.toml; characters belong to it.

BREAKING CHANGE: protocol version 3 adds the player id and password to
Login, and characters are keyed by player id instead of name, so characters
in existing worlds are not restored.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 22:29:05 +02:00
Steve Biedermann 09ace2607c feat(server): add file and command line config
Add a dedicated server configuration file (`server.toml`) with clap-based
command line overrides. The server now supports runtime config changes via
terminal commands, and config edits are written back to the TOML file while
preserving comments.

Also let host mode feed the shared network startup through the same server
config resource.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 21:41:58 +02:00
Steve Biedermann afd3d3a537 feat(server): store worlds in sqlite or postgres with sqlx
Worlds are identified by a UUID and every table is keyed by it, so many
worlds can share one database. The schema is created and migrated
automatically. Autosaves are written on a background tokio runtime; exit
saves block until done.

Singleplayer saves are one SQLite file per save game in the platform data
directory. The dedicated server takes --database URL (default
sqlite://saves/server.sqlite) and --world NAME|UUID.

BREAKING CHANGE: the rsn save format and the server's --save FILE option
are removed; existing saves are not migrated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 20:47:43 +02:00
Steve Biedermann 3cf0561401 feat: add data-driven machines
Machines give a building input/output slots and their own timed recipes.
The server processes them, replicates their state and saves it with the
world. The furnace becomes a machine and an assembler is added as an
example with a custom window layout. The client window follows with the
new UI.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 20:28:16 +02:00
Steve Biedermann 0d025b824e ci(github): package client and server for Windows, Linux and macOS
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 20:21:07 +02:00
Steve Biedermann 0c3d6c57e1 ci: package Windows builds with cargo xtask pack
The Windows workflows now ship the dedicated server alongside the client
and publish the archive produced by xtask instead of packaging by hand.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 20:08:45 +02:00
Steve Biedermann 0b258a9361 build: add cargo xtask pack for distributable archives
`cargo xtask pack [--target T] [--format zip|tar.gz] [--out-dir DIR] [--debug]`
builds the client and dedicated server and packs them with assets,
README and changelog into dist/station-<version>-<target>.(zip|tar.gz).
Windows targets default to zip, others to tar.gz.

Packaging uses a new `dist` profile (release + strip), which shrinks the
binaries considerably without changing regular release builds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 20:08:45 +02:00
Steve Biedermann a3c55bc8b0 docs: add project notes for agents
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 19:44:13 +02:00
Steve Biedermann 680bb0e034 test: run tests with cargo-nextest in CI
Add a nextest config with a ci profile (JUnit report) and test
workflows for GitHub and Gitea that run clippy and nextest.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 19:44:13 +02:00
Steve Biedermann 9ffca14d8d ci: build the Windows client on GitHub and Gitea
GitHub builds natively on windows-latest; Gitea cross-compiles with MinGW
on a Linux runner. Both upload the client with its assets and publish a
zip for v* tags.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 19:44:13 +02:00
Steve Biedermann a43949be14 feat: add persistent-world station game
Bevy ECS workspace with three crates:
- game_core: rsn data definitions, components, Tiled map loader, protocol
- game_server: authoritative simulation, Rune scripting, persistence,
  dedicated server binary
- game_client: rendering, UI and input; embeds the server for
  singleplayer and hosting

Items, recipes, buildings and skills are defined in assets/data, behavior
in Rune scripts under assets/scripts, and maps are made in Tiled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-18 19:44:13 +02:00