# Resource Management

<figure><img src="https://1963719226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8pr5EgDZn2rnTUJE8XB%2Fuploads%2Fdt2wIKSpPOhxwgW1Wevo%2FRM%20banner%2Blogo.PNG?alt=media&#x26;token=d57f7e86-ef67-43d2-a7a9-e4cf1bec72bb" alt=""><figcaption></figcaption></figure>

Resource management as a core game loop could be a relaxing simulation game, such as Stardew Valley. but it could also be a secondary loop in other game types to make them more realistic or interesting, such as an action adventure game where you must cook your own meals to heal.

There are many game types where resource management logic is used, such as:

* Farming simulators
* Tower defense
* Cooking
* Economic management

## Characteristics

***Plan for Growth!***

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>GAIN &#x26; USE RESOURCES</strong></td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f333">🌳</span> Harvest, collect, earn<br><span data-gb-custom-inline data-tag="emoji" data-code="1fa99">🪙</span> Buy/sell/exchange<br><span data-gb-custom-inline data-tag="emoji" data-code="2692">⚒️</span> Craft/build</td></tr><tr><td><strong>UNLOCK EFFICIENCIES</strong></td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f199">🆙</span> Upgrade builds or plans<br><span data-gb-custom-inline data-tag="emoji" data-code="1f513">🔓</span> Unlock new options</td></tr><tr><td><strong>FLEXIBILITY</strong></td><td><span data-gb-custom-inline data-tag="emoji" data-code="1f465">👥</span> Single or multiplayer<br><span data-gb-custom-inline data-tag="emoji" data-code="1f4a0">💠</span> Full game or a game's secondary gameplay loop</td></tr></tbody></table>

#### Keys of Success

* **Everyone Can Play -** Simple actions to mine/farm and collect items, choose how to use them with  options in dialogue
* **Play for Long -** Short term goals to reach long term growth and efficiency
* **Play with Friends -** Multiplayer or singleplayer

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>NEED TO HAVE</strong></td><td><ul><li>Game currency</li><li>Variable per resource used (avoid exceeding recommended limit)</li><li>Utility per resource (trade, sell, craft)</li></ul></td></tr><tr><td><strong>NICE TO HAVE</strong></td><td><ul><li>Automation options later in game (higher cost to motivate longer play)</li></ul></td></tr></tbody></table>

## Game Loops

Below is a general game loop diagram for this genre. Your game's loops may vary.

<figure><img src="https://1963719226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8pr5EgDZn2rnTUJE8XB%2Fuploads%2FNrz0DEJFWuTjTPtXCWh1%2Fimage.png?alt=media&#x26;token=836ff10c-7a26-460d-9799-7b97a08ec415" alt="" width="563"><figcaption></figcaption></figure>

## Learn to Create It

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>GAME MAKER TEMPLATES</strong></td><td><img src="https://lh7-us.googleusercontent.com/9ltJ32B5P9l_keHpvNK-vrGnkQKSZnk1HVKM5kkJi4i6370oSqz5bVKZ-PyIPtmeGrHdvL7dkbQlkxIykrpPAFIoreve4m6Ab9O7KxpNkvyzbqVifoS-uFA1rmIUARH194dallkY-77bDBd2obNaMm6Stg=s2048" alt=""><br><img src="https://1963719226-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FV8pr5EgDZn2rnTUJE8XB%2Fuploads%2FqZvgYBMRgPtjhgpT2pAb%2FGM%20Resource%20Managment%20template%20thumb.png?alt=media&#x26;token=f39f4e43-a1e4-4464-a910-575b561f8903" alt=""></td></tr><tr><td><strong>LOGIC TO EXPLORE</strong></td><td><ul><li>Currency</li><li>Inventory/crafting</li><li>Counting and comparing to purchase</li><li>Simple or scalable logic<br>- Shop preset in Crafty Challenge<br>- Buying/selling method in Resource Management using message arguments</li></ul></td></tr></tbody></table>

### Make it More Interesting

Consider ways to add to or change the core structure of this game type to challenge and motivate players differently.

<table data-view="cards"><thead><tr><th></th><th></th></tr></thead><tbody><tr><td><strong>MAIN OBJECTIVE</strong></td><td><p>➿ Secondary loop in another game type</p><p>🏆 Achievements</p></td></tr><tr><td><strong>RAMP OF DIFFICULTY</strong></td><td><p>🥪 More resources/recipes</p><p>🎲 Random effects on resource generation (rain, fire, etc.)</p></td></tr><tr><td><strong>CORE DECISIONS</strong></td><td><p>🔁 Trade with players</p><p>👥 Team vs personal use</p><p>🦸 Reputation system</p></td></tr></tbody></table>

> **PRACTICE: Modify the Crafty Challenge or Resource Management templates to increase the fun:**
>
> * Achievements
> * Randomness
> * Global vs. local variables for teams vs personal use (collaboration, competition, independence)

### Useful Logic

* [**Game Rules Shop Preset**](https://docs.sandbox.game/jp/creators/game-maker/creative-guide/game-rule-guide/shop)
* [**Collectable**](https://docs.sandbox.game/jp/creators/game-maker/document/components/collectable)
* [**Messages with arguments**](https://docs.sandbox.game/jp/creators/document/using-assets-and-objects/messagesmessji#custom-messages-with-arguments-1)
* (Object) [**Presets**](https://docs.sandbox.game/jp/creators/game-maker/document/build-menus/side-bar/preset)
* [**Key Input**](https://docs.sandbox.game/jp/creators/document/game-rules/rule-types#key-input-1) rule

## Tutorial Videos (English)

Open the Resource Managment template in Game Maker to find logic included in the content below.

{% embed url="<https://youtube.com/live/XxP0z413PKk>" %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sandbox.game/jp/creators/game-maker/creative-guide/experience-guide/resource-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
