Skip to content

Latest commit

 

History

History
61 lines (52 loc) · 2.18 KB

TODO.md

File metadata and controls

61 lines (52 loc) · 2.18 KB

Falling Sand

TODO

  • Falling Sand Sim
    • Oc
  • Lighting
    • Terraria style lighting
    • Light Raytracing

Noita comparison

  • 1 tile is one color
  • Virtual Resolution: 424 x 242 (4.5 pixels per tile)
  • Region (Biome) Chunk size: 512 x 512 (8 x 8 sim chunks)
  • Simulation Chunk size: 64 x 64
  • World size: 35840 x 73728 (70 x 144 Chunks)
  • 12 Region chunks loaded for 3,145,728 "active" tiles (768 sim chunks)
Game Noita Rust 4 Rust 3
Passes 4 4 9
Chunks per Pass 196 196 85.
Unit size 1 4x4 3x3
Work units 196 49 196

Other Simulation stuff

Optimizations

  • Only update dirty chunks, generate dirty rects
  • Use z-order hash for Chunk storage
  • Z-order chunk index (and revamp grid coords)
  • Slotmap (maybe dense) for chunk storage

Game Update Order

Client update order
1. Recieve network packets
2. Change 
2. Wait for STEP packet (already received chunk packets at this point)
Stage Server Host Client
/ Always send movement packets
1. Receive new players Receive new players Receive network packets
2. Insert chunks to region Insert chunks to region Apply (un?)load chunks
3. Apply global events Apply global events Apply global events
4. Freeze packets and send tick Freeze packets/own input and send tick Wait for tick packet (with movement info)
5. Tick game Tick game Tick game
6. Preload and send global events, chunks etc. (Send tick rsp finished)
7. Render Frame Render Frame
8. (Wait for tick rsp if lockstep mode) (Wait for tick rsp if lockstep mode)
  1. Tick tiles
  2. Tick Entities
  3. Apply entity dx/dy, change chunks