> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-zh/jiao-cheng-yu-shi-li/published-games/cozy-farm.md).

# 温馨农场

一款社交农场游戏，具有定时作物生长阶段、肥料加成，以及由一个实体层级构建的重复农场。

![舒适农场预览](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-4fe880edfa421efe4b731844dfbc165974debcbb%2FcozyFarm-preview.webp?alt=media)

一款社交农场游戏，专注于种植作物、扩建农场并结识其他玩家。

* [在 Decentraland 上游玩](https://decentraland.org/jump?realm=cozyfarm.dcl.eth)

## 项目信息

**维护者：** Decentraland DAO

[查看源代码](https://github.com/dcl-regenesislabs/cozy-farm)

**许可证：** 此目录中未标明许可证。重用前，请查阅上游代码库并咨询维护者，确认适用条款。

## 探索代码

这些链接指向特定的源代码快照，因此随着上游持续开发，这些说明仍然有用。它们是学习参考资料，并非安全评估。

### 将经过的时间转化为作物生长阶段

`growthSystem` 根据种植时间戳计算进度，调整教程作物和施肥后的生长时长，并且仅在阶段变化时替换模型。

**项目背景：** 结合 `PlotState`, `CROP_DATA`以及 `game/actions` 中的模型辅助函数一起查看，了解模拟状态如何驱动视觉反馈。

**源代码参考：**

* [`growthSystem`](https://github.com/dcl-regenesislabs/cozy-farm/blob/440805a68d4d93a665c42cf17830735804b54a71/src/systems/growthSystem.ts#L62-L142)

### 从一个实体层级结构创建多个农场

`cloneEntityTree` 递归重新创建模板的子项、保留局部变换、复制选定的渲染组件，并按名称记录每个克隆。这展示了重复区域如何共享同一套创作布局。

**项目背景：** 此辅助函数需要场景的子项映射，并且只复制明确列出的组件，因此新增组件类型时需要有针对性地处理。

**源代码参考：**

* [`cloneEntityTree`](https://github.com/dcl-regenesislabs/cozy-farm/blob/440805a68d4d93a665c42cf17830735804b54a71/src/systems/farmInstances.ts#L127-L168)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decentraland.org/creator/content-creator-zh/jiao-cheng-yu-shi-li/published-games/cozy-farm.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
