跳到正文
网页珍奇柜Web Curio

落沙游戏

Sandspiel,Max Bittker,2019 年

正在布展…

原作直展:这是 Max Bittker 的原始作品,按 MIT(打包依赖见 728.*.LICENSE.txt;Inconsolata 字体为 OFL) 许可证收录(版本 24a63c6)。收录作者发布在 gh-pages 的构建(Rust→WASM 落沙模拟原样保留),删去了广告、Google Analytics、Sentry 和外部统计,并修正了子路径下会自动暂停的问题。选右侧元素在画布上拖动撒沙、水、火、植物;上传/浏览社区作品依赖 Firebase,在这里不可用。 许可证全文 · 收录说明

它是怎么做的

  1. 第 1 步Rust → WASM 实现每种元素的元胞自动机规则
  2. 第 2 步单元格数组直接作为纹理上传给 WebGL 着色
  3. 第 3 步独立的 GPU 流体模拟(风)读写单元格,影响粒子运动
  4. 第 4 步片元着色器为每种元素加噪声与色彩抖动,形成手绘质感

复刻配方

一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。

Represent the world as a 2D grid of cells, each with a species id and a couple of bytes of state, and update it with per-species rules (sand falls and slides diagonally, water spreads sideways, fire consumes wood). Implement the update loop in a compiled language or tight JS with typed arrays, alternating scan direction to avoid bias. Upload the cell buffer as a texture every frame and color it in a fragment shader using species palettes plus hash noise. Optionally run a separate low-resolution GPU fluid sim whose velocity pushes cells around for wind.

档案

能不能拿来用

原作以 MIT 许可开源:可以阅读源码学习,按许可证条款使用;在自己的项目里引用时保留原作者署名。

性能开销

视觉强度

实现难度

尺度为策展判断(1 到 5),用于比较和推荐。

核实记录:Site loads (200); repo has MIT licence.