Skip to contentGo to cookie choices
Skip to docs navigation

Bring a Construct 3 game

https://docs.zokogames.com/porting/construct-3

For a Construct 3 game that already ships as an HTML5 export on other web game portals. The work happens in the event sheet: you replace the other portal's object and actions with the ZokoGames addon. No scripting is needed. The full reference is the Construct 3 engine page. The overall route is in bring your game.

1. Export settings#

Install zokogames.c3addon (not the zip) through Menu > View > Addon Manager, restart Construct, and insert the ZokoGames object (Construct 3: install). The addon loads the SDK script itself, so you edit no export file. Then check the export:

Setting On ZokoGames
Export type HTML5 website; zip the folder contents so index.html is at the archive root.
Offline support No. It adds a service worker, which the validator warns about (service_worker).
Use worker Yes is supported.
Minify script Simple or Advanced.
Pre-compression None. Construct requests plain file names; upload the export as it is.
Fullscreen mode A letterbox or scale-outer mode, so the layout fits a frame that changes with fullscreen and rotation.

Details: export settings that matter on the web.

2. Replace the platform events#

Delete the other portal's object and every event that uses it, so no action points at an SDK that is not there. Then rebuild those events with the ZokoGames object. Every asynchronous action takes a Tag; On request completed or On request failed with the same tag fires when it ends (tags, results and errors).

Your game does With the ZokoGames addon
Start the SDK Initialize at the start of the first layout; wait for it before other actions. Is available is false when the SDK is disabled, and the game must still run.
Loading finished Loading stop once the first layout can be played (optionally Loading start and Report loading progress before it). The addon does not send these on its own.
Gameplay start and stop Gameplay start and Gameplay stop.
Midgame (interstitial) or rewarded ad Request ad (midgame or rewarded). Pause on On ad started; resume on On ad finished and on On ad error. Grant a reward only in On ad finished.
Mute On settings changed with Is mute requested.
Cloud save Set saved item, Get saved item (then read SavedItem(key) in On request completed), Remove saved item.
Leaderboard score Submit score for a logged-in player, on a board created in the console. No wrapper builds an encrypted payload; see leaderboards.
Purchases Get catalogue items, Buy item, Consume item, Get player inventory. Purchases are test purchases for now (purchases).
Sign-in prompt Show login prompt; On auth changed and Is logged in.

A complete event sheet is in a working event sheet. The Local Storage object keeps data in IndexedDB on one device; move progress you want kept to the cloud save actions.

The compatibility shim is for JavaScript call sites. Use it only if a script in your project calls another portal's JavaScript SDK directly; event sheets move to the addon.

3. Build size and mobile#

  • Budget: 1,500 files, 250 MB unpacked, about 50 MB initial download (20 MB for mobile), estimated from uncompressed sizes.
  • Compress images (WebP) and audio (Opus or AAC); put large media in a second layout loaded once the first is interactive.
  • Split rarely used layouts and keep sprite sheets small for phones.
  • Start music from a "tap to play" button, not on start of layout. See mobile.

4. Test before you submit#

  1. Preview on localhost. There is no separate simulator: on localhost the SDK runs its own local mode with a three-second ad overlay, a fake player and local saves. If your preview is not on a localhost address, add ?useLocalSdk=true. See Construct 3: test locally.
  2. Try the failures. ?ad_response=unfilled forces ad errors, ?user_response=logged_out tests guests, and a second midgame within three minutes fails with adCooldown.
  3. Upload the zip and open the game's Preview and QA tab in the developer console to run it in the portal frame with ads on (build preview).

Checklist#

  • Addon installed; the other portal's object and events removed.
  • Initialize first; the game plays when Is available is false.
  • Gameplay start and stop at the right moments.
  • Ads resume on On ad finished and On ad error; rewards only on finish.
  • One tag per request in flight.
  • Saves through the cloud save actions; scores on a board created in the console.
  • Offline support off; other portal's logos, links and sitelock removed.
  • Tested on localhost and in Preview and QA.

Next#

Something unclear, wrong or missing on this page? Tell us through support · Test your game in the preview tool