Conversation
* 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
#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.
Contributor
Author
Dependency ReviewThe following issues were found:
Snapshot WarningsEnsure 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 Issuespackages/rust/bevy/bevy_kbve_net/Cargo.toml
OpenSSF Scorecard
Scanned Files
|
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)
…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)
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release: Dev → Main
11 atomic commits ready for main
Features
c344496)af93bf1)a01cc30)bc308f3)8a9c1d0)e259e6d)eb8cdf7)Bug Fixes
7639699)b2532d3)Chores
3b72ada)Other Changes
fe800f1)This PR is automatically maintained by CI — KBVE Studio