naughty.games
Play All games
Live Cams
Home Browse Random Live Saved
Left on Read 2 is out. New accounts get 100 free credits until Dec 6. See how →
Home / Guides

How to export your Godot game for the web

Open Project > Export, add a Web preset, and leave Thread Support and Progressive Web App unchecked, both defaults since Godot 4.3. Threaded exports need SharedArrayBuffer, which requires cross-origin isolation headers most hosts including naughty.games do not send, and Progressive Web App installs a service worker, which naughty.games blocks on hosted builds. Export Project generates index.html, a .pck, a .wasm and a .js file; serve them over http to test, then zip them with index.html at the top and upload.

Last checked 2026-10-04

Add in-game ads to your Godot game: copy this prompt

Paste it into Claude Code, Cursor, Copilot or any coding agent. It adds the SDK to your project and tests it.

Preview the prompt
Goal: integrate the naughty.games in-game ads SDK (lifecycle and ad breaks only) into this Godot 4 (web export) project.

Setup:
1. Download https://naughty.games/sdk/wrappers/godot/naughty_games_sdk.gd into the project and add it as an autoload named NaughtyGamesSdk (Project > Project Settings > Globals > Autoload).
2. In Project > Export > Web, paste this into HTML > Head Include:
   <script src="https://naughty.games/sdk/v1.js"></script>
3. Wait for init with: if not NaughtyGamesSdk.is_ready: await NaughtyGamesSdk.initialized (the signal fires once; awaiting it after it fired hangs).
4. Call NaughtyGamesSdk.game_loading_finished(), await NaughtyGamesSdk.commercial_break() and await NaughtyGamesSdk.rewarded_break() (returns bool). The autoload pauses the scene tree and mutes the Master bus during ads, restores the state it found afterwards, and emits paused, resumed, muted and unmuted signals.

API (global NgSdk, added by the script tag; the engine wrappers call these for you):
- NgSdk.init(): Promise of { env, signedIn, locale }. Call it first. env is naughty, local (test mode) or inert; signedIn is whether the player is signed in to naughty.games.
- NgSdk.gameLoadingFinished(): the game finished loading.
- NgSdk.gameplayStart() / NgSdk.gameplayStop(): active play starts or stops (menu, pause screen, game over).
- NgSdk.commercialBreak(): Promise of nothing. Shows an ad if one is due.
- NgSdk.rewardedBreak(): Promise of true or false. true only when the player watched the ad to the end.
- NgSdk.on('pause' | 'resume' | 'mute' | 'unmute', fn): fired around every ad.

Rules:
- The SDK only works in games hosted on naughty.games (an uploaded zip build). A game embedded from itch.io or another site runs in a third-party frame, so the SDK stays inert there and shows no ads.
- Every call settles, and the game must carry on once it does. A commercial break may finish at once (no ad, or too soon), so never wait for an ad to appear.
- Grant a reward only when rewardedBreak() resolves true. Not on the button tap, not when the promise settles.
- On pause and mute, stop the game loop and silence audio; restore both on resume and unmute. Keep the handlers quick, they can arrive back to back.
- Place commercial breaks at natural pauses (between levels, after game over), never mid-action or mid-dialogue, and not at startup.
- Put rewarded breaks behind a button the player chooses to tap, and say what the reward is first. Never block progress behind one: on false the player keeps playing.

Verify:
- Run the game from localhost, or add ?ngsdk=test to its address. A test ad covers the game with Complete and Skip buttons. Check both paths: Complete must grant the reward, Skip must not, and the game must continue after each. Left alone, the test ad closes itself after 5 seconds and a rewarded break resolves false: only Complete grants.
- Zip the build with index.html at the top level and upload it. The Build tab in the naughty.games developer console shows "SDK detected" when an HTML file in the build loads https://naughty.games/sdk/v1.js with a script tag, or an uncompressed .js file names that URL in its code.

Ask me before changing any gameplay. If anything is unclear, read the full guide at https://naughty.games/guides/in-game-ads-sdk before guessing.

What you need

  • Godot 4.7, the current stable release, with the Web export template installed (Editor > Manage Export Templates).
  • A GDScript project. Godot 4's web export currently does not support C# projects at all, so a C# game needs Godot 3 or a native export instead.
  • No special setup for age gating: your build plays inside an iframe on naughty.games, behind the site's own age gate.

Godot 4 can only target WebGL 2.0 on the web, through its Compatibility rendering method; Forward+ and Mobile are not available in a browser. Most current desktop and Android browsers support WebGL 2.0 fine, but Safari has had more issues with it than Chromium-based browsers or Firefox, so it is worth testing your build in more than one browser before you publish, not just the one you develop in.

Export for the web

  1. Open Project > Export, click Add... and choose Web to create an export preset.
  2. Leave Thread Support unchecked. This has been the default since Godot 4.3, and it is also the setting the Godot docs call out as the most compatible with hosts like itch.io, Poki and CrazyGames.
  3. Leave Progressive Web App > Enable unchecked too. See the box below for why.
  4. Set the export path to a new folder and name the output file index.html, since that is the name a plain web server loads by default.
  5. Click Export Project. Godot writes index.html, a .pck file (your game's data), a .wasm file (the engine itself), a .js start-up file, and a .png boot splash image into that folder.

Why single-threaded, and why no Progressive Web App

A threaded Godot web export uses SharedArrayBuffer, which only works on a page that is cross-origin isolated. That requires the server to send both a Cross-Origin-Opener-Policy: same-origin header and a Cross-Origin-Embedder-Policy: require-corp header on every response. naughty.games does not send both of those together, and neither do most general-purpose hosts, so a threaded build simply will not start there. Godot's own docs describe single-threaded export, the default since 4.3, as the fix for exactly this problem, with the added benefit of working better on macOS and iOS too.

Godot's Progressive Web App option offers a workaround for hosts that cannot set those headers: it installs a service worker that simulates cross-origin isolation and also caches the game for offline play. naughty.games does not allow hosted builds to register service workers at all, so this workaround will not work here and should stay off.

Test it locally

Opening index.html directly from your file system will not work. The browser blocks the requests Godot's loader makes for the .wasm and .pck files when the page is loaded over file://, so the game gets stuck loading or never appears.

Serve the export folder over HTTP instead. From inside the folder, run:

python -m http.server 8000

Then open http://localhost:8000 and play through the build before uploading it anywhere.

Zip it for upload

  • Zip the contents of the export folder, not the folder itself, so index.html ends up at the top level of the zip.
  • Stay under 250 MB unpacked and 2,000 files. A Godot web export is usually just the five files listed above, so this rarely becomes an issue unless your game streams a lot of video.
  • Do not manually gzip or brotli the .pck or .wasm file before uploading. naughty.games serves whichever exact filename you upload, and Godot's generated index.html and .js request the plain file names (for example game.pck), so a renamed game.pck.gz simply will not be found. Upload the files exactly as Godot exported them.

Common problems

  1. Blank page or stuck on loading. You opened the export over file://. Serve it from a local server, or upload it and preview it on naughty.games directly.
  2. The game refuses to start and the browser console mentions SharedArrayBuffer. Thread Support was left on during export. Re-export with it off.
  3. Progress does not save between visits. Godot's user:// file system persists through the browser's IndexedDB. Check the player is not in a private/incognito window and is not blocking third-party storage for the naughty.games iframe.
  4. A C# project will not export to Web. Godot 4's web export only supports GDScript; a C# project needs a different export target.
  5. No sound until the player clicks or taps. Browsers block autoplaying audio until a user gesture. This is expected, not a bug in your game.
  6. The game seems to freeze when a player switches tabs. Godot pauses _process() and _physics_process() while a browser tab is inactive. This is a browser limitation, not something to fix in your project.

Add in-game ads (optional)

A build hosted on naughty.games can show ads between levels and rewarded ads ("watch an ad for a bonus") through the naughty.games SDK. For Godot 4, add naughty_games_sdk.gd as an autoload and paste the SDK's script tag into the Web export's HTML > Head Include. The in-game ads guide covers the setup, a test mode that runs on localhost, and how the revenue share works.

Publish it

Once the export runs cleanly from a local server, zip it with index.html at the top level (up to 250 MB unpacked and 2,000 files) and upload it to naughty.games, or send us an https URL if you would rather embed it. Review is usually about 2 working days, listing is free and non-exclusive, and any Patreon, Ko-fi, Steam or itch links inside the game earn you 100% of what they bring in. Head to /submit when you are ready.

Questions

Which Godot version does this guide use?
Godot 4.7, the current stable release. Single-threaded web export has been the default and recommended path since Godot 4.3.
Can I use multithreading in my web export?
Not usefully on naughty.games. Threaded exports need Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers, and naughty.games, like most hosts, does not send both, so a threaded build will refuse to start.
Should I turn on Progressive Web App for offline play?
No. It installs a service worker, and naughty.games blocks service workers on hosted builds, so leave it unchecked.
Can I pre-compress my .pck or .wasm files before uploading?
No, leave them as Godot exported them. naughty.games serves whatever filename you upload, and your index.html requests the plain file names, so a renamed game.pck.gz would not be found.
Does Godot 4 support exporting C# projects to the web?
No. Godot 4 web export currently only supports GDScript projects; C# is not supported on the web platform.

Sources

  • Godot docs: Exporting for the Web
  • Godot docs: Exporting projects

Free hosting, real players on phone and desktop, and a stats console.

Publish your Godot game on naughty.games

More guides

  • Where to publish your adult game

    itch.io, Steam, Patreon, SubscribeStar, Nutaku, DLsite and naughty.games compared for adult games: content rules, fees, browser play and the 2025 delistings.

  • How to make money from your adult game

    Patreon, SubscribeStar, Ko-fi, Steam, itch.io, DLsite and Nutaku for adult games: fees, payouts and rules as of September 2026, plus what drives pledges.

  • Payment processors and adult games: what each platform allows

    Adult content rules and payouts on Patreon, SubscribeStar, Ko-fi, itch.io, Steam and DLsite, and where the 2025 payment processor crackdown stands in 2026.

  • How to add in-game ads to your HTML5 game with the naughty.games SDK

    Add the naughty.games SDK to a hosted HTML5, Unity, Godot, Ren'Py, Construct 3 or GameMaker game: commercial breaks, rewarded ads, test mode and revenue share.

  • How to put your Ren'Py game in the browser

    How to export a Ren'Py visual novel for the web, test it on a local server, zip it correctly, and publish it so players can play in the browser.

  • How to export your Unity game to WebGL for the browser

    How to build a Unity WebGL player, set compression correctly, test it locally, zip it, and publish it so players can play in the browser.

  • How to deploy your RPG Maker game to the browser

    How to deploy an RPG Maker MV or MZ project for Web Browsers, avoid case-sensitive file errors, test it locally, and publish it to play in the browser.

Browse

  • Play online
  • Live cams
  • All games
  • Tags
  • Platforms
  • Best of
  • Privacy
  • Terms
  • Terms of sale
  • DMCA
  • 2257
  • DSA
  • Advertise
  • No ads
  • For developers
  • Guides
  • Data reports
  • Contact
© 2026 naughty.games Adult content. 18+.

Adult content ahead

naughty.games contains adult-oriented game listings. By entering, you confirm you are at least 18 years old and that adult content is legal in your jurisdiction.

What do you want to see?

You can change this anytime

Nothing selected = show me everything