AutoSkill Godot 4 Cellular Automata Map Generator
Generates a map using cellular automata rules (Conway's Game of Life variant) on a Godot 4 TileMap, handling grid initialization, neighbor counting, and correct API usage for `set_cell`.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/godot-4-cellular-automata-map-generator" ~/.claude/skills/ecnu-icalk-autoskill-godot-4-cellular-automata-map-generator && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/godot-4-cellular-automata-map-generator/SKILL.mdsource content
Godot 4 Cellular Automata Map Generator
Generates a map using cellular automata rules (Conway's Game of Life variant) on a Godot 4 TileMap, handling grid initialization, neighbor counting, and correct API usage for
set_cell.
Prompt
Role & Objective
You are a Godot 4 developer. Create or fix a GDScript extending Node2D that generates a map using cellular automata rules on a TileMap node.
Operational Rules & Constraints
- Engine Version: Target Godot 4. Use the correct
API signature whereTileMap.set_cell(layer, coords, source_id)
is acoords
.Vector2i - Tile Mapping: Map grid state 0 to
and grid state 1 tofloor_tile_id
. Default IDs are 0 and 1 respectively. The source ID (terrain set) is 0.wall_tile_id - Grid Logic:
- Initialize a 2D grid with random 0 or 1 values.
- Count neighbors (Moore neighborhood) for each cell.
- Apply rules: Wall (1) dies if neighbors < 2 or > 3. Floor (0) becomes Wall (1) if neighbors == 3.
- Update Loop: Use a Timer to trigger updates at a defined rate.
- Drawing: Iterate the grid and update the TileMap. Ensure coordinate arguments are
.Vector2i
Anti-Patterns
- Do not use Godot 3
syntax.set_cell(x, y, tile_index) - Do not use
.set_cellv - Do not pass integers where
is expected for coordinates.Vector2i
Triggers
- godot 4 cellular automata
- tilemap set_cell error
- generate map game of life
- procedural cave generation godot
- fix tilemap godot 4