godot-platform-web

Expert blueprint for web/browser platforms (HTML5 export) covering WebGL/WebGPU rendering, custom loading screens, JavaScriptBridge integration, LocalStorage saves, and size optimization. Use when exporting to web or implementing browser-specific features. Keywords web, HTML5, WebGL, WebGPU, JavaScriptBridge, localStorage, canvas, browser API.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "godot-platform-web" with this command: npx skills add thedivergentai/gd-agentic-skills/thedivergentai-gd-agentic-skills-godot-platform-web

Platform: Web

Browser API integration, LocalStorage persistence, and size optimization define web deployment.

Available Scripts

web_bridge_sync.gd

Expert JavaScriptBridge helpers for browser API integration (persistence, analytics).

NEVER Do in Web Development

  • NEVER use FileAccess for savesFileAccess.open("user://save.dat") on web? Browser sandbox blocks filesystem. Use JavaScriptBridge + localStorage.
  • NEVER forget loading screen — 20MB wasm download with default load screen = user closes tab. MUST customize index.html with progress bar + brand assets.
  • NEVER use threadsThread.new() on web? Not supported. Use await for async OR split work across frames with await get_tree().process_frame.
  • NEVER ignore HTTPS requirement — Geolocation, microphone, webcam APIs REQUIRE HTTPS. Local http:// = APIs blocked. Use localhost OR HTTPS.
  • NEVER exceed 50MB build size — 100MB WebAssembly = user rage-quits during load. Compress textures (ETC2/ASTC), exclude unused assets.
  • NEVER hardcode window sizeget_viewport().size = Vector2(1920, 1080) on web? Breaks mobile browsers. Use get_window().size_changed + responsive UI.

<!-- index.html custom loading -->
<div id="loading-screen">
    <div class="progress-bar">
        <div id="progress" style="width: 0%"></div>
    </div>
    <p id="status-text">Loading...</p>
</div>

<script>
const engine = new Engine(CONFIG);
engine.startGame({
    onProgress: function(current, total) {
        const percent = Math.floor((current / total) * 100);
        document.getElementById('progress').style.width = percent + '%';
        document.getElementById('status-text').innerText = `Loading ${percent}%`;
    }
}).then(() => {
    document.getElementById('loading-screen').style.display = 'none';
});
</script>

Browser Integration

# Check if running in browser
if OS.has_feature("web"):
    # Web-specific code
    JavaScriptBridge.eval("console.log('Running in browser')")

LocalStorage Save

func save_to_browser() -> void:
    if not OS.has_feature("web"):
        return
    
    var data := JSON.stringify(get_save_data())
    JavaScriptBridge.eval("localStorage.setItem('savegame', '%s')" % data)

func load_from_browser() -> Dictionary:
    if not OS.has_feature("web"):
        return {}
    
    var data_str := JavaScriptBridge.eval("localStorage.getItem('savegame')")
    if data_str:
        return JSON.parse_string(data_str)
    return {}

Size Optimization

# Minimize build size
[rendering]
textures/vram_compression/import_s3tc_bptc=false
textures/vram_compression/import_etc2_astc=true

# Exclude unnecessary exports
[export_preset]
exclude_filter="*.md,*.txt,docs/*"

Performance

  • Target 60 FPS on mid-range browsers
  • Limit godot-particles - WebGL has lower limits
  • Reduce draw calls
  • Avoid large textures

Best Practices

  1. Loading Screen - Users expect feedback
  2. File Size - Keep under 50MB
  3. Mobile Web - Test on phones
  4. HTTPS - Required for many APIs

Reference

  • Related: godot-export-builds, godot-platform-mobile

Related

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

godot-master

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

godot-shaders-basics

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

godot-ui-theming

No summary provided by upstream source.

Repository SourceNeeds Review
Automation

godot-particles

No summary provided by upstream source.

Repository SourceNeeds Review