rust-data-driven-game-content
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRust Data Driven Game Content
Rust 数据驱动的游戏内容
Use this skill to move game content out of Rust code and into validated data
files. Keep schemas small, explicit, and aligned with components the game can
actually spawn.
使用此 skill 将游戏内容从 Rust 代码迁移到经过验证的数据文件。
保持 schema 小巧、明确,并与游戏实际能够生成的组件相对应。
Core Workflow
核心工作流
- Identify repeated hard-coded spawn data.
- Design a Serde-friendly schema for entities, effects, spawn levels, and weights.
- Load data at startup or level generation with clear errors.
- Convert templates into component bundles through one spawn boundary.
- Add validation for missing fields, impossible levels, invalid effects, and empty spawn tables.
- Keep balance changes in data and behavior changes in Rust systems.
- 识别重复出现的硬编码生成数据。
- 为实体、特效、生成等级和权重设计适合 Serde 的 schema。
- 在启动或关卡生成时加载数据,并提供清晰的错误信息。
- 通过统一的生成边界将模板转换为组件 Bundle。
- 添加对字段缺失、不可能的等级、无效特效和空生成表的验证。
- 将平衡性调整保留在数据中,并将行为变更保留在 Rust 系统中。
Read Next
延伸阅读
Read for schema design,
RON/Serde notes, spawn weighting, validation, and review checks.
references/data-driven-content-patterns.md阅读 ,了解 schema 设计、
RON/Serde 注意事项、生成权重、验证方式和审查检查项。
references/data-driven-content-patterns.mdSource Notes
来源说明
Guidance is transformed and paraphrased from Hands-On Rust Chapters 13, 14,
and 15 and from the official companion source repository. Current crate context
was checked against Serde and RON docs. Verify the target project's chosen data
format and dependency versions before editing.
本指南根据 Hands-On Rust 第 13、14 和 15 章以及官方配套源码
仓库改写并重新表述。当前 crate 上下文已对照 Serde 和 RON 文档
进行检查。编辑前,请确认目标项目所选的数据格式和依赖版本。