Commit Graph
188 Commits
Author SHA1 Message Date
popertots 1f5dfe5182 Task fix attempt 2026-03-23 19:31:30 +00:00
popertots 3632836016 fix 2026-03-22 22:30:15 +00:00
popertots bf81f42ced fix 2026-03-22 22:10:00 +00:00
popertots 57764fbcbb fix 2026-03-22 22:05:08 +00:00
popertots c448ef4bff fix 2026-03-22 22:01:11 +00:00
popertots 760f6602cf fix 2026-03-22 16:51:20 +00:00
popertots ffb0e79cf3 fix 2026-03-22 16:45:46 +00:00
popertots 738f595f67 debug 2026-03-22 16:38:54 +00:00
popertots e7a43457a3 fix 2026-03-22 16:05:38 +00:00
popertots bceec18a7a log sprite 2026-03-22 16:05:33 +00:00
popertots c46e23af06 fix 2026-03-22 15:23:44 +00:00
popertots 3b9b2d9c88 fix 2026-03-22 15:07:05 +00:00
popertots 5a830f46f9 demo part 2 2026-03-22 14:57:59 +00:00
popertots 54eabe85e2 fix 2026-03-22 14:34:59 +00:00
popertots 57e377c093 fix 2026-03-22 13:01:10 +00:00
popertots 2eaf0196a5 demo 1 2026-03-22 12:56:52 +00:00
popertots 360ffc7526 value tweaks 2026-03-22 12:06:33 +00:00
popertots 26a861e1a5 value tweaks 2026-03-22 12:00:17 +00:00
popertots cb5b18008d fix 2026-03-22 11:50:53 +00:00
popertots 2f456f80b8 Gaussian idle 2026-03-22 11:29:50 +00:00
popertots b2dc0cb864 fix 2026-03-22 11:02:36 +00:00
popertots 749913a028 fix? 2026-03-22 01:58:34 +00:00
popertots adc236dc3d fix 2026-03-22 01:52:20 +00:00
popertots 9afcb0f612 more debug 2026-03-22 01:32:22 +00:00
popertots 64a69d6a40 Debug 2026-03-22 01:24:08 +00:00
popertots deb3f741b0 rng fix 2026-03-22 01:00:42 +00:00
popertots 71653350d8 fix 2026-03-22 00:52:06 +00:00
popertots cafe376841 Plugin cleanup 2026-03-22 00:43:03 +00:00
popertots d61baaf1ba Task Infrastructure — Task Enum, Queue, Events, Executor 2026-03-22 00:35:22 +00:00
popertots 458068fb87 run_if 2026-03-22 00:03:57 +00:00
popertots ff149117ca remove Digger from dorf 2026-03-21 23:56:03 +00:00
popertots 029e4162d8 fixes 2026-03-21 23:48:49 +00:00
popertots c776b91a44 haulage system WIP 2026-03-21 23:39:58 +00:00
popertots dcdfb375f0 Fix 2026-03-21 21:51:29 +00:00
popertots f52c8ab18c inventory: early return before HashSet alloc, restore doc comments 2026-03-21 21:44:06 +00:00
popertots b7b7af5560 inventory: linter fixes - saturating_add, SmallVec<4>, new_default, drop PIG_SLOTS 2026-03-21 21:39:52 +00:00
popertots 2f9360c8bc inv update 2026-03-21 21:27:26 +00:00
popertots 40b5d8ce95 Fix forrestry 2026-03-21 19:20:57 +00:00
popertots 1ddcb538df tree felling optimisations 2026-03-21 19:14:14 +00:00
popertots 4fc4843ed7 fix 2026-03-21 19:10:04 +00:00
popertots 03c3e5d6d7 first pass at tree interaction 2026-03-21 18:57:15 +00:00
popertots cabe944f1b use constants better 2026-03-21 17:51:05 +00:00
popertots f96c71b61b docs: update README architecture diagram with magic_numbers locations 2026-03-21 17:31:57 +00:00
popertots 7fe33d4b2d refactor: split magic_numbers into per-module files
Extracted all doc-commented magic numbers into module-local magic_numbers.rs
files, co-located with the module that owns them. No logic changes.

- entities/shared_systems/magic_numbers: pathfinding + dig constants
- world/generation/terrain/magic_numbers: terrain + cave constants
- world/generation/forestry/magic_numbers: tree constants
- world/tiles/magic_numbers: A*, benchmark, memory constants
- entities/item/magic_numbers: item sprite z-offset
- Removed src/magic_numbers.rs (central file deleted)

Constants imported as `crate::{module}::magic_numbers::*` from each
consumer. src/constants.rs retains only structural constants (PIXEL_RATIO,
TILE_SIZE, SEED, pathfinding tier thresholds).
2026-03-21 17:31:39 +00:00
popertots 776d3caefc fix: dig_rng sequential multiply-add mixing
Switch from add-then-XOR pattern to proper sequential multiply-add
avalanche. Each coordinate feeds into the next multiply, preventing
correlation between adjacent tiles when rare drops are introduced.
2026-03-21 17:10:52 +00:00
popertots 2622144cdf fixed typo 2026-03-21 17:09:32 +00:00
popertots 5b563bad67 perf: SmallVec inline storage, TOML drop tables, seeded deterministic RNG
- SmallVec<[DropEntry; 2]> replaces Vec in DropTable: zero heap allocation for
  all current tiles (0 or 1 entries), spills to heap only at 3+
- DropEntry fields packed to u8 (chance_pct, min_count, max_count): ~12 bytes ->
  4 bytes; derives Copy so no extra clones
- Replaced SystemTime pseudo-RNG with dig_rng(pos): PCG-style hash of world SEED
  + tile position. Deterministic per world, same dig = same roll every time
- TOML-driven drop tables: assets/drop_tables.toml (grass=5%/1-2, rock=10%/1,
  dirt/air=none). TOML parsed at startup into DropTableRegistry resource
- OnceLock global map for async terrain generation tasks to access drop tables
  without Bevy resource borrowing
- terrain.rs: DropTableRegistry::global_get("tile") replaces hardcoded drop_table_for
2026-03-21 16:06:41 +00:00
popertots f03651e0cf docs: update README for generic digging, drop tables, revised architecture
- Add generic digging + drop tables to implemented list
- Rabbit digging: now using Digger component, not debug code
- Building and construction: updated to reflect generic system in place
- Architecture: added digging to shared_systems, drop_table to tiles
2026-03-21 15:41:20 +00:00
popertots ce3746366c refactor: extract generic digging system, drop tables, remove debug code
- New src/entities/item/drop_table.rs: DropEntry (chance, min/max count,
  pseudo-RNG roll) + DropTable wrapper. grass=5% coin 1-2, rock=10% coin 1,
  dirt/air=none.
- New src/entities/shared_systems/digging.rs: Digger component + dig_system.
  Any entity with Digger digs the tile below on its interval. Replaces
  rabbit_dig_system/rabbit_fall_debug_system/RabbitDigTimer/RabbitFallDebug.
- New TileMap::dig_floor: remove_floor + insert air. Used by dig_system.
- FloorTileData: added drop_table field. Lost Copy derive (Vec field).
  Updated all 6 terrain.rs call sites with per-tile drop tables.
- Pig: removed PigDropTimer + pig_drop_system. Drops were debug placeholder.
  TODO added for future loot-on-death/butcher system.
- Rabbit: removed all debug components/systems. Now uses Digger::new(5.0).
- main.rs: removed rabbit_dig_system/rabbit_fall_debug_system/pig_drop_system,
  added shared_systems::digging::dig_system.
2026-03-21 15:40:34 +00:00
popertots 1a170ea9a9 docs: update README with collision, tile events, rabbit dig, visibility notes
- Add Stage 2 collision section documenting convoy / head-on / E/S yield / W/N right-of-way
- Add TileChangedEvent + path invalidation section
- Add Rabbit digging to implemented list
- Add visibility raycast note (absent tiles in loaded chunks = air)
- Remove stale warning count from build instructions
2026-03-21 15:23:11 +00:00