Skip to content

Repository files navigation

PetitMaker 谷地工坊

English | 简体中文

A browser-based map planner for Petit Planet, with validation against the game's building rules.

Play at petitmaker.cc  Release  License: Apache-2.0

Support on Patreon  Support on Afdian

The PetitMaker editor holding a finished planet, with seven labels: Build modes on the block row at the top left, AI agent on the character below them, Save and share at the top right, Layers panel, Undo and redo, and the 3D view, fit and zoom cluster on the right rail, and Object shelf on the bottom bar full of cabins

The header shows 鱼松的爱心桃花岛, created by project contributor 鱼松. An importable share image is available below.

PetitMaker is a map editor for Petit Planet that runs in your browser. Plan your planet here, then build it in the game. Edits are checked against the implemented rules for terrain, water, placement, edge cuts, bridges, ramps and roads. Game updates and actual building conditions may differ; check your plan in the game before building.

PetitMaker is an independent, unofficial fan project. It is not affiliated with, endorsed by, or sponsored by miHoYo / HoYoverse (COGNOSPHERE PTE. LTD.). Petit Planet and related names, characters, and material are the property of their respective owners. See Affiliation & licensing below.

Two views, one map

Animation cross-fading between the 2D and 3D editing views of one map region: a house in a heart-shaped garden pond, selected in 2D, and the same house still framed as selected after the switch to 3D

One map, both views: the house in the heart garden, selected with a click, and still selected after the switch.

The 2D and 3D editors use the same grid and support the same brushes, shapes, eraser, item placement, edge cutting, region selection, and undo history. Switching views does not change the map or current selection. The 3D view also displays animated water, shadows, and models for placed items; terrain corners edited in 2D appear with the same shape in 3D.

Draw terrain with building-rule checks

Terrain tools work like those in a pixel editor: free brush, line, curve, rectangle, circle, and brush-size control. After each stroke, the editor checks the result. Invalid changes, such as uncontained water or high terrain without enough support, are reverted with an explanation. Item placement is checked before the item is added, and invalid locations show the applicable reason.

Animated editor view: a tree is moved to the edge of a terrace, its preview turns red, and a message states that placement requires flat ground with no elevation change or nearby water; the same attempt repeats in the 3D view, where the step under the tree is visible

A tree cannot be placed at the edge of a step. Both views reject the placement, while the 3D view makes the elevation change easier to see.

Other tools provide more detailed control. The edge-cut tool changes individual terrain corners, while auto-trim applies bevelled or rounded corners as terrain is drawn. The eraser lowers terrain one layer per pass. Items snap to the grid and can be selected, rotated when supported, or moved. Bridges align automatically when both ends are flat and at the same height. The app includes browser-local autosave and a multilingual interface, requires no account, and does not store maps on a project-operated server.

The layer readout opens a panel with three display sizes, including a grid of all layers. Each layer shows its cell count and has separate visibility and lock controls, allowing upper layers to be hidden or completed terrain to be protected from further editing.

Animated editor view: selecting the elevation count at the top right opens a column of layer rows, each with a cell count, visibility control, and lock; selecting an arrow changes it to a grid of all layers with Ground highlighted, then two further selections return it to the compact count

The layer panel switches between a compact readout, a single-column list, and a grid containing every layer.

Three panels of the same three-level mountain: on the left every corner is square, in the middle each outer corner is sliced off at 45 degrees, on the right each outer corner is a quarter-circle; the inner corner of the L stays square in all three

The same terrain with auto-trim set to Off, Bevel, and Round. Auto-trim changes outer corners and leaves inner corners square.

Placeable cabins, facilities, bridges, ramps, trees, flowers, and plants arranged on shelves

The object shelf contains cabins, facilities, bridges, ramps, trees, flowers, and other plants. In-game path surfaces are drawn with a brush.

Import a map from its share image

A PetitMaker share image: a title and one line of description, the planet on a lettered and numbered grid, a column of per-layer thumbnails beside it, a row of four 3D views under it, the PetitGlyph share-code band below that, and a footer carrying the export date and pixel size

This share image contains the complete map data. Download the original image (save the file rather than taking a screenshot), then drop it into the Import window at petitmaker.cc. The editor will restore 鱼松's planet from the header, including its terrain, water, and objects.

The band at the bottom is a PetitGlyph code, which stores the map and its planning annotations in the image. Error correction tolerates some resizing and JPEG or WebP compression. Preserve the original file for reliable sharing; platform processing may make a code unreadable. Import verifies the data before restoring the map. Processing takes place in the browser, and the image is not uploaded.

For a separate backup, export a JSON save. Planning annotations are included by default and can be omitted with their own switch; Notes separately controls the title, description and author. Plain images cannot restore an editable map. Browser storage is separate for the mainland China and international sites, so use exported files to move a map between them.

Turn the plan into an illustration

Before exporting a 2D image, the map can be redrawn as an illustration. Built-in procedural and on-device model styles run locally and require no API key. Online styles use your API key to send a rendered map and style instructions directly to the selected image provider. Images created by a model, whether local or online, include an AI disclosure; procedural styles do not. You can compare several versions with the original before exporting, and the image can still include optional PetitGlyph map data.

Six renderings of one planned map in watercolor, coastal, sakura, autumn, atlas, and night illustration styles

The same map rendered in several styles. Built-in styles run on the device, and model-generated versions are identified as AI-drawn in the exported image.

Generate a map

Animated stages of generation, each captioned in the lower left and wiping left to right into the next: the empty map, terraced hills, lakes and rivers with waterfalls, streets across the planet, bridges and ramps and homes, then trees and flowers

The generator creates terrain, water, roads, bridges and ramps, buildings, and vegetation in six stages.

The generator provides four modes: Planet, Maze, Letter, and Picture. Planet and Maze use a recipe number and follow the same building rules as manual editing; the same app version, mode, settings, base map, and recipe produce the same result. Letter and Picture offer built-in designs. Letter converts text into terrain, water, or a pattern made from a selected item. Picture converts an image into terrain, water, objects, or paths.

Two whole-map views side by side, labelled Planet and Maze: on the left a settled planet of terraced hills, roads and hundreds of placements; on the right the same map filled edge to edge with a maze of one-cell mountain walls around the central plaza

The same recipe number produces different results in different modes: Planet creates a complete layout, while Maze creates connected corridors.

Planet calculates a complete layout before applying it to the map. It creates terraces, major roads that divide the planet into districts, themed areas along those roads, water features, buildings, and connections to each entrance. The Scenery richness setting controls terrain variation, water, and vegetation density.

The same recipe generated three ways: a flat garden town at scenery richness 0, terraces and ponds appearing at 50, and a fully terraced planet with deep greens and stepped water at 100

The same recipe at Scenery richness 0, 50, and 100. Higher values add more elevation changes, water, and vegetation.

Maze uses recursive backtracking to create a connected maze on buildable ground. Its walls are ordinary terrain, so they can be edited, trimmed, and decorated after generation. A generation region can restrict the maze to part of the map. Its entrance and exit can be moved, and Show the way displays the solution route.

Three panels of the same patch of map, labelled Corridor 1, Corridor 2 and Corridor 3: the maze walls thin out and the passages widen from left to right, with the central plaza in each panel for scale

The same recipe with Corridor set to 1, 2, and 3. Wider corridors produce fewer walls.

Use the agent to edit a map

The agent requires your own API key. Where supported, the browser key vault encrypts it on the device; otherwise, the app stores an obfuscated copy in the current browser. The key authenticates provider requests; automatic identification may also validate it with candidate providers whose key formats match. The agent's tools can read and modify the current map, but cannot access browser storage, other page content, or the general network. Provider requests use the selected integration.

A band of provider tiles, each carrying the platform's brand mark and name, followed by a Custom tile for OpenAI-compatible endpoints

Choose a supported provider, or use the Custom option for an OpenAI-compatible service, including a model running on your own machine.

The agent can follow natural-language instructions to create or modify areas such as villages, hill parks, bridges, waterfalls, dry gardens, and terraces.

You can first select a region to restrict the agent's edits to that part of the map.

The agent presents a plan for approval before execution when the selected oversight level requires it. While a task is running, you can add instructions, pause after the current step, or return to an earlier stage and continue with revised requirements. Each stage is a rollback point, and task rollback uses the available undo history. Returning to an earlier stage also undoes later edits.

The agent panel at three points in one task: a four-stage plan awaiting approval, plan execution with two placements in progress, and a completed receipt with a map image, change counts, and a How it was built button

An agent task in three stages: awaiting plan approval, executing the plan, and displaying a receipt that summarizes the changes.

Three oversight levels are available. Strict asks before every map change, Checkpoint asks before plans and large changes, and Autopilot proceeds without step-by-step confirmation. Changes made under any level can be undone.

Agent edits use the same rule checks as manual edits. If an operation is invalid, the editor reports the reason so the agent can revise its approach:

Agent: Placing water along the ridge at F6…

Editor: Reverted. Water: waterfall needs mountain caps on both ends.

Agent: "The waterfall is missing mountain caps on both sides. I will add them before placing the water again."

Under the hood

Layered source-tree diagram. Editors appear at the top, followed by UI and legal, agent with IO and API, kit, canvas, tools, i18n, rules, state, configuration with assets, and core. A highlighted path leads from the editors through rules to core commands, and a side label states that imports point downward.

Four design constraints keep map data and editing results consistent:

  • Every editor uses the same command path. Manual tools, the generator, and the agent all produce commands handled by the same executor (core/commands/command-executor). Rules may reject a command before it runs and validate the completed stroke afterward, reverting invalid changes.
  • A share image imports completely or fails. The PetitGlyph band carries the map through Reed-Solomon error correction, and its SHA-256 covers the canonical map and planning notes. Import decodes, rebuilds, and compares the data. It either returns the complete exported map or reports that the image is too damaged to read. Validation runs locally.
  • Generation is reproducible from its complete inputs. Within the same app version, the recipe, generation kind, and settings drive one seeded generator (mulberry32), with ties broken by index. A share image does not rely on replaying that algorithm: its payload contains the complete canonical map, while an optional recipe note records how the map was generated.
  • Automated tests verify these constraints. npm run test:run covers the rules, codec, and generator. One test imports the share image on this page and fails if it can no longer restore its map.

The full tour: docs/ARCHITECTURE.md (the engine) and docs/THREAT_MODEL.md (build hardening, CSP, the key vault, the agent sandbox).

Quick start

Requires Node.js 24 or newer.

npm install
npm run dev          # Vite dev server
Other commands (test, lint, build)
npm run test:run     # Vitest (all tests)
npm run lint         # TypeScript type-check (tsc --noEmit)
npm run build        # Production build

Contributing

Contributions are welcome. Code contributions are accepted inbound = outbound under Apache-2.0 with a Developer Certificate of Origin sign-off (git commit -s); art and other non-code assets need a separate written permission record first. See CONTRIBUTING.md for the full process.

Affiliation & licensing

PetitMaker is an independent, unofficial fan project, not affiliated with, endorsed by, or sponsored by miHoYo / HoYoverse (COGNOSPHERE PTE. LTD.). Petit Planet and related names, characters, and material are the property of their respective owners.

Code, artwork, branding and third-party material in this repository have separate licenses. Check the applicable permissions before using or redistributing each category:

  1. Code: licensed Apache-2.0 (see LICENSE and NOTICE).
  2. Brand, logo, and original art: the PetitMaker name (and its Chinese name 谷地工坊), logo, and original artwork are All Rights Reserved unless a specific file states otherwise.
  3. Third-party assets and fonts: keep their own licenses. See THIRD_PARTY_NOTICES.md for bundled software and shipped fonts.
  4. User maps: maps and other content you create in the editor belong to you, subject to any third-party material they incorporate. Sharing the screenshots and export images the editor produces of your maps is expressly permitted, even though they embed our art; the details are in ASSET_LICENSES.md.

The full ownership breakdown, provenance disclosure, and IP-request process are in ASSET_LICENSES.md.

Credits

In alphabetical order, not a ranking.

火山野牛王's avatar
火山野牛王
镜喵MirrorCat's avatar
镜喵MirrorCat
Selka's avatar
Selka
鱼松吃点吗's avatar
鱼松吃点吗

Acknowledgements

Thanks to these community members for their support. In alphabetical order, not a ranking.

晶焰EXFire's avatar
晶焰EXFire
星灭散落's avatar
星灭散落
奕言君's avatar
奕言君

Support the project

You can support PetitMaker’s ongoing development on Patreon or Afdian. Thank you for your support.

Legal & policy documents

Document Purpose
LICENSE Apache-2.0 code license
ASSET_LICENSES.md (中文) Four-way ownership scope: code / brand & art / third-party / user maps
THIRD_PARTY_NOTICES.md Bundled software dependencies and shipped fonts
SECURITY.md (中文) Vulnerability reporting policy
docs/THREAT_MODEL.md Developer threat model (build, headers/CSP, key vault, agent sandbox)
CONTRIBUTING.md DCO sign-off, code/asset contribution terms, credit policy
CHANGELOG.md (中文) Release history (Keep a Changelog)

Contact

For general questions, IP requests, or contribution/credit arrangements, email petit.maker@outlook.com. Security issues follow a separate process. See SECURITY.md.


© 2026 PetitMaker contributors · Apache-2.0 · an unofficial fan project, not affiliated with miHoYo / HoYoverse

About

PetitMaker - Map editor for Petit Planet: plan an planet in your browser, build it in the game. 2D+3D views, batch operations, generators, and an AI assistant.

Topics

Resources

Contributing

Security policy

Stars

30 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages