Skip to content

Release: 7 features, 2 fixes, 1 chore → Main#9750

Merged
h0lybyte merged 11 commits intomainfrom
dev
Apr 7, 2026
Merged

Release: 7 features, 2 fixes, 1 chore → Main#9750
h0lybyte merged 11 commits intomainfrom
dev

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented Apr 6, 2026

Release: Dev → Main

11 atomic commits ready for main

Features

Bug Fixes

Chores

  • chore(api): preparing release of v1.0.100 (3b72ada)

Other Changes

  • chore|build: isometric client. (fe800f1)

This PR is automatically maintained by CI — KBVE Studio

h0lybyte added 3 commits April 6, 2026 19:52
* feat(isometric): integrate bevy_db for local persistence

Wire bevy_db into the isometric game for client-side data caching:

- BevyDbPlugin registered first in plugin group (redb on desktop, IndexedDB on WASM)
- PersistPlugin handles save/load lifecycle:
  - Startup: kicks off async loads for cached player state, collected tiles, last position
  - Update: receives load results and applies to ECS resources
  - Save player state every 5s (throttled, fire-and-forget)
  - Save collected tiles on change (server ObjectRemoved/Respawned events)

Data persisted:
  - player.state: health/mana/energy/vitals (restored on reload)
  - player.last_position: spawn point recovery
  - world.collected_tiles: which objects have been harvested

All I/O is off-thread via bevy_tasker — game thread never blocks on DB operations.

* feat(isometric): persist inventory + server time sync via bevy_db

Extend PersistPlugin to cache additional game state:

- Inventory: saved on every change, restored on startup (full slot contents)
- Server time sync: creature_seed, game_hour, wind data cached when server
  sends TimeSyncMessage — restored on startup if no live server connection
  (enables deterministic creature spawns before reconnect completes)
- ServerTime struct now derives Serialize/Deserialize for persistence

On startup, all 5 loads fire in parallel (player state, position, inventory,
collected tiles, server time) — each polled independently via DbRequest.
Three fixes for the firecracker infrastructure:

1. Rootfs init job: fix kernel URL (v1.10 S3 assets removed, use v1.11),
   add Alpine repo/keys config for chroot installs, replace heredoc with
   printf to avoid YAML block scalar issues, remove resize2fs (not in
   e2fsprogs base package), use command+args form.

2. NetworkPolicy: add egress rule for rootfs-init pods allowing DNS + HTTPS
   so the init job can download packages and kernel. The default-deny policy
   was blocking all egress including for the init job.

3. KEDA ScaledObject: set minReplicaCount=1 so firecracker-ctl stays alive
   24/7. Cron trigger now scales to 2 during peak hours (06:00-22:00 UTC).
   Removed CPU trigger since metrics-server is not installed.
Every creature now gets a unique CreatureId(Ulid) assigned by the server
at spawn. ULIDs encode creation timestamp in the upper 48 bits. On
recycle, a new ULID is assigned (new creature instance).

Phase 1: creature_id added to CreatureSnapshot alongside existing
pool_index for backward compat. Client stores received ULID on matched
entities. Phase 2 will switch to ULID-first matching.

Changes:
- ulid dep added to bevy_kbve_net
- CreatureId component in types.rs with new/from_u128/as_u128/timestamp_ms
- Server spawn inserts CreatureId::new() (sprite + ambient)
- simulate.rs regenerates ULID on creature recycle
- CreatureSnapshot.creature_id field (u128 wire format)
- Server broadcast populates creature_id from query
- Client net_events stores CreatureId on matched entities via Commands
h0lybyte added 2 commits April 6, 2026 21:09
#9751)

Switch client sync to match creatures by CreatureId (ULID) first via
O(1) HashMap lookup, falling back to (npc_ref, pool_index) for entities
that haven't received a ULID yet. CreatureIdIndex resource rebuilt each
frame from all entities with CreatureId.

Also adds creatures feature to client bevy_kbve_net dependency so
CreatureId type is accessible.
…#9752)

The VM was booting but had no mechanism to receive user code, causing
every execution to timeout. Fix by:

1. firecracker-ctl: write user code (from env.CODE) to a raw block file,
   attach as second drive (/dev/vdb), pass entrypoint via boot_args
   (fc_entrypoint= parameter). Clean up code file after VM exits.

2. rootfs init script: parse fc_entrypoint from /proc/cmdline, read code
   from /dev/vdb (strip null padding), write to /tmp/code, exec with
   the specified entrypoint.

3. Bump rootfs init job to v4 so ArgoCD rebuilds images with new init.
@github-actions
Copy link
Copy Markdown
Contributor Author

github-actions Bot commented Apr 7, 2026

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 1 package(s) with unknown licenses.
See the Details below.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 3b72ada.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

License Issues

packages/rust/bevy/bevy_kbve_net/Cargo.toml

PackageVersionLicenseIssue Type
ulid>= 1.0.0, < 2.0.0NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
cargo/ulid >= 1.0.0, < 2.0.0 UnknownUnknown

Scanned Files

  • packages/rust/bevy/bevy_kbve_net/Cargo.toml

Terrain chunk height maps are now persisted to bevy_db and restored on
subsequent loads, skipping noise computation entirely for cached chunks.

- TerrainMap gains insert_cached_chunk() and chunk_heights() for cache I/O
- ChunkData::from_cached_heights() bypasses noise generation
- PersistPlugin adds 3 terrain cache systems:
  - load_cached_terrain_chunks: dispatches async cache reads before generation
  - receive_cached_terrain_chunks: injects cached heights into TerrainMap
  - cache_new_terrain_chunks: fire-and-forget writes on chunk generation
- TerrainCacheState tracks saved/pending/resolved chunks per session
- Also enables "creatures" feature on bevy_kbve_net (required by ULID PR)
@github-actions github-actions Bot changed the title Release: 2 features, 1 fix → Main Release: 5 features, 1 fix → Main Apr 7, 2026
h0lybyte added 2 commits April 6, 2026 22:42
…hing (Phase 3) (#9754)

Breaking protocol change — creatures are now identified solely by
CreatureId (ULID) across all network messages:

- CreatureSnapshot: removed index field, creature_id is primary key
- CreatureAttackRequest: creature_id replaces creature_index
- CreatureStateEvent: creature_id replaces creature_index
- CreatureCaptureRequest/Captured: creature_id replaces creature_index
- CapturedCreatures: HashSet<u128> instead of HashSet<(ProtoNpcId, u32)>
- Client sync: ULID-only matching, fallback assigns unmatched entities
- Server broadcast: no longer sends pool index
Extend persistence layer with navigation data caching:

WaypointGraph:
- Serde derives added to WaypointGraph, Waypoint, ZoneTag
- Cached on every rebuild (when nav_systems produces a new graph)
- Loaded at startup — skips centrality computation + waypoint extraction
- Key: nav.waypoint_graph

PatrolRoutes:
- CachedPatrolRoute DTO converts &'static str in DwellAction to String
  for serde round-tripping, with anim_lookup table for restoration
- Cached per-creature on creation (Added<PatrolRoute> query)
- Key: nav.{type_key}:{slot_seed}

Also adds Serialize/Deserialize to PatrolMode (influence.rs)
@github-actions github-actions Bot changed the title Release: 5 features, 1 fix → Main Release: 7 features, 1 fix → Main Apr 7, 2026
h0lybyte added 2 commits April 6, 2026 22:51
Replace hardcoded PI/TAU with std::f32::consts, add Default impls,
derive Default for CreatureRegistry, allow type_complexity on Bevy
system queries, fix redundant static lifetimes, remove useless .into()
conversions, and suppress dead_code on intentionally-kept mapping fns.
@github-actions github-actions Bot changed the title Release: 7 features, 1 fix → Main Release: 7 features, 2 fixes → Main Apr 7, 2026
@github-actions github-actions Bot changed the title Release: 7 features, 2 fixes → Main Release: 7 features, 2 fixes, 1 chore → Main Apr 7, 2026
@h0lybyte h0lybyte merged commit 4051fce into main Apr 7, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this from Review to Done in KBVE Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant