Chris' Tutorials
Docs/Grid Placement

Grid Placement v6.0

Web Export

Resource loading, setup checks, and troubleshooting for exporting to the web.

StatusDraft
Versionv6.0
UpdatedDevelopment docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.

This guide covers the Grid Placement-specific parts of web export.

Version note: This guide is for Grid Placement 6.0.0 on Godot 4.5.0 through 4.7. Grid Placement is a GDScript addon; no .NET/Mono setup is required for the plugin path described here.


Main Web Export Rule

Save runtime resources as external .tres files whenever possible.

Avoid relying on embedded SubResource(...) entries for important placement resources. Web exports are less forgiving when nested resources or typed resource arrays fail to deserialize the same way they did in the editor.

Good candidates for external .tres files:

  • GridPlacementBundle
  • GridPlacementSettings
  • placement rules
  • collision rule settings/messages
  • fail visual settings
  • placement profiles
  • terrain palettes/entries
  • ScenePlacementEntry resources

External Resource Example

Avoid this pattern for important runtime rule resources:

# Avoid: embedded subresource
[sub_resource type="Resource" id="Resource_abc"]
script = ExtResource("collisions_script")

[resource]
placement_rules = [SubResource("Resource_abc")]

Prefer this pattern:

# Prefer: external rule resource
[ext_resource type="Resource" path="res://rules/my_collision_rule.tres" id="1_rule"]

[resource]
placement_rules = [ExtResource("1_rule")]

This makes the dependency obvious and easier to include in exports.


Export Filter

Make sure the web export includes the plugin, templates, scenes, rules, config, and any custom resource folders your placement setup uses.

Common paths to include:

  • res://addons/grid_placement/
  • res://templates/ or your copied grid_placement_templates path
  • your res://config/ folder
  • your res://rules/ folder
  • your placeable scenes/resources folder
  • your terrain palette/resources folder

If you use a restrictive export filter, missing .tres or .tscn files are a common cause of web-only failures.


Pre-Export Checklist

  • The plugin is enabled before exporting.
  • Default input actions exist in the project Input Map.
  • GridPlacementBundle is included in the export.
  • GridPlacementBundle.settings points to an external GridPlacementSettings resource.
  • Base rules in PlacementSettings.placement_rules are external .tres files.
  • Placeable entries reference real .tscn files.
  • Placement profiles and local rules are included in the export.
  • Collision rule settings/messages are serialized or safely initialized.
  • Indicator scenes serialize collide_with_areas / collide_with_bodies as needed.
  • Collision masks match your project's physics layers.
  • UI controls use correct Mouse Filter settings so they do not block placement input unexpectedly.

Rule and Indicator Checks

Rules load but every placement succeeds

Check:

  • The rule resource is actually included in the export.
  • The placement_rules array is not empty at runtime.
  • The placeable scene has collision shapes if tile-based rules need indicators.
  • CollisionsCheckRule looks at the same layer the target objects are on.
  • Indicator scenes have the collision flags needed for your target object type.

Indicators do not appear

Check:

  • The indicator scene/template is included in the export.
  • The placeable scene has a collision footprint.
  • The rule setup did not report missing target_map, owner, logger, or settings.
  • Browser console/network output does not show missing resources.

Terrain preview does not appear

Check:

  • A TerrainPreview node exists in the same injected scene scope.
  • The selected terrain can be resolved against the target map's TileSet.
  • The terrain palette/entry resources are included in the export.
  • The target TileMapLayer is assigned through PlacementLevelContext.target_map.

Array Syntax

Plain arrays are easiest to inspect and are usually the safest format for resource lists:

placement_rules = [ExtResource("1_rule")]

If a typed resource array behaves differently in a web build than in the editor, try saving the resource with plain array syntax or recreating the resource in the editor so Godot rewrites it cleanly.


Testing Before Release

Do not wait until the store build to test web export.

Recommended process:

  1. Export a minimal web build with one placeable and one rule.
  2. Test object placement.
  3. Test manipulation if your game uses it.
  4. Test terrain painting if your game uses it.
  5. Open browser console/network output and look for missing resources.
  6. Only then add the full UI/catalog/content set.

For repo-level validation, run the relevant Godot/GdUnit tests from the repo root with the Godot project path set to godot.

godot --headless --path godot -s addons/gdUnit4/bin/GdUnitCmdTool.gd runtest -a res://test/grid_placement

Troubleshooting Quick Reference

Symptom First things to check
Works in editor, fails on web Missing exported resources or embedded subresources.
Rules missing placement_rules resources not included/exported.
Every tile is green Collision masks/layers or missing collision shapes.
No terrain preview Missing TerrainPreview, missing terrain resources, or missing target map.
Clicks do nothing Input actions missing or UI controls consuming mouse input.
Browser console shows 404/missing resource Export filter did not include the needed folder/file.

Related Guides


Source

docs/v6-0/guides/web-export.md

Plugin docs root:gdscript/plugins/grid_placement_dev/docs