Skip to content

Developer Documentation

OnlineGameWorlds hosts free browser games built in ANY engine that exports to WebGL or HTML5 — Unity, Godot, Construct 3, GameMaker, Phaser, PlayCanvas, Cocos, Defold, GDevelop and more. Every published game is automatically powered by XP & leveling, achievements, cloud saves, daily challenges and personalised recommendations — most features need zero extra code.

1. Supported Engines

If your engine can export a WebGL or HTML5 build that runs JavaScript in the browser, it works here. The most common choices:

EngineExport targetHow it calls the platform
UnityWebGL build targetC# ↔ JS via .jslib
Godot 4HTML5 / Web exportJavaScriptBridge
Construct 3HTML5 exportJavaScript / Browser object
GameMakerHTML5 export (not GX.Games)JavaScript extension
PhaserNative HTML5/JSDirect JavaScript
PlayCanvasNative WebGL/JSDirect JavaScript
Cocos CreatorWeb-Mobile / Web exportDirect JavaScript
DefoldHTML5 exporthtml5.run()
GDevelopWeb (HTML5) exportJavaScript event
Three.js / plain HTML5Native JSDirect JavaScript
Not listed? Any engine that produces an HTML5/WebGL build and can execute JavaScript integrates the exact same way — see the Integration section below.

2. Automatic Features

Every published game gets these platform features with no extra effort from you:

FeatureDescription
XP & LevelingPlayers earn XP by playing your game. Progress is tracked on their profile automatically.
AchievementsPlatform achievements unlock based on player behaviour — no setup required.
Daily ChallengesRotating daily tasks include playing games on the platform. Your game counts automatically.
RecommendationsYour game is recommended to players with matching interests and play history.
Recently PlayedPlayers resume your game directly from their profile and the homepage.
Trending BadgeIf your game trends, it gets a HOT badge on its card automatically.
Cloud SavesPlayers save and load progress across devices. Optional integration — see Integration.
Reviews & RatingsPlayers rate and review your game, shown on its game page.

3. Integration

The platform injects a small, universal browser API into every game page. Any engine that can run JavaScript can call it — cloud saves and ads are optional add-ons on top of the automatic features.

The universal API

These globals are available on your game page:

window.OGW.saveState(slot, data)Save a JSON string to a slot (0-9), up to 64 KB. No-ops when the player is logged out.
window.OGW.loadState(slot)Load a slot's JSON string (or null). Returns a Promise.
window.ShowInterstitialAd(type, cb)Show a full-screen interstitial ad. The game auto-pauses and resumes.
window.ShowRewardedAd(type, cb)Show a rewarded ad. Listen for the result event to grant the reward.
"ogw-ad-result" eventFires when an ad finishes: detail.result is "rewarded", "closed" or "failed".

JavaScript-native engines

Phaser, PlayCanvas, Cocos Creator, Three.js, Kaboom and plain HTML5 run JavaScript directly — just call the API:

Cloud save

// Cloud save — works in ANY engine that runs JavaScript.
// Slots 0-9, save data is a JSON string up to 64 KB. No-ops for logged-out players.
window.OGW?.saveState(0, JSON.stringify({ score: 1234, level: 5 }));

// Load (returns a Promise)
const json = await window.OGW?.loadState(0);
if (json) {
  const data = JSON.parse(json);
  // …restore player progress
}

Ads

// Interstitial ad — fire and forget (game auto-pauses + resumes)
window.ShowInterstitialAd?.("next", "noop");

// Rewarded ad — request it, then listen for the result event
window.addEventListener("ogw-ad-result", (e) => {
  if (e.detail.result === "rewarded") {
    // Player watched the full ad — grant the reward here
  }
  // e.detail.result can also be "closed" (skipped) or "failed"
});
window.ShowRewardedAd?.("coins", "noop");

Unity (C#)

Unity reaches JavaScript through a .jslib plugin. Place the bridge in Assets/Plugins and the C# helper in Assets/Scripts.

Assets/Plugins/CloudSaveBridge.jslib

mergeInto(LibraryManager.library, {
  OGW_SaveState: function(slot, dataPtr) {
    var data = UTF8ToString(dataPtr);
    if (window.OGW) window.OGW.saveState(slot, data);
  },
  OGW_LoadState: function(slot, callbackObjPtr, callbackMethodPtr) {
    var obj    = UTF8ToString(callbackObjPtr);
    var method = UTF8ToString(callbackMethodPtr);
    if (window.OGW) {
      window.OGW.loadState(slot).then(function(data) {
        SendMessage(obj, method, data || "");
      });
    }
  }
});

Assets/Scripts/CloudSave.cs

using System.Runtime.InteropServices;
using UnityEngine;

public class CloudSave : MonoBehaviour
{
    [DllImport("__Internal")] static extern void OGW_SaveState(int slot, string data);
    [DllImport("__Internal")] static extern void OGW_LoadState(int slot, string obj, string method);

    public void Save(int slot = 0)
    {
        var payload = JsonUtility.ToJson(new SaveData { score = 1234, level = 5 });
#if UNITY_WEBGL && !UNITY_EDITOR
        OGW_SaveState(slot, payload);
#else
        PlayerPrefs.SetString($"save_{slot}", payload);   // editor fallback
#endif
    }

    public void Load(int slot = 0)
    {
#if UNITY_WEBGL && !UNITY_EDITOR
        OGW_LoadState(slot, gameObject.name, nameof(OnLoaded));
#else
        OnLoaded(PlayerPrefs.GetString($"save_{slot}", ""));
#endif
    }

    void OnLoaded(string json)
    {
        if (string.IsNullOrEmpty(json)) return;
        var state = JsonUtility.FromJson<SaveData>(json);
        Debug.Log($"Loaded — score: {state.score}, level: {state.level}");
    }
}

[System.Serializable]
public class SaveData { public int score; public int level; }

For ads, download the ready-made Unity ad scripts (interstitial + rewarded managers) and follow the setup steps — the game pauses, mutes and resumes automatically.

Godot 4

Use JavaScriptBridge from a Web (HTML5) export to call the same API and bridge the ad-result event back into GDScript:

# Godot 4 — Web (HTML5) export. Bridge to the platform with JavaScriptBridge.
var _ad_cb  # keep a reference so the callback isn't garbage-collected

func _ready():
    if not OS.has_feature("web"):
        return

    # Cloud save (fire-and-forget). saveState expects a JSON string.
    var payload := JSON.stringify({ "score": 1234, "level": 5 })
    JavaScriptBridge.eval("window.OGW && window.OGW.saveState(0, %s)" % JSON.stringify(payload))

    # Receive ad results. A JavaScriptBridge callback takes ONE Array argument
    # (the JS "arguments" converted to a Godot Array).
    _ad_cb = JavaScriptBridge.create_callback(_on_ad_result)
    var window = JavaScriptBridge.get_interface("window")
    window.ogwAdResult = _ad_cb
    JavaScriptBridge.eval("window.addEventListener('ogw-ad-result', function(e){ window.ogwAdResult(e.detail.result); })")

func show_rewarded():
    JavaScriptBridge.eval("window.ShowRewardedAd && window.ShowRewardedAd('coins','noop')")

func _on_ad_result(args):
    if args[0] == "rewarded":
        pass # grant the reward

Construct 3

Use a JavaScript block, or the Browser object's "Execute JavaScript" action:

// Construct 3 — in a JavaScript block, or Browser object → "Execute JavaScript".
// Cloud save
window.OGW && window.OGW.saveState(0, JSON.stringify({ score: 1234 }));

// Load
const json = window.OGW ? await window.OGW.loadState(0) : null;

// Ads
window.addEventListener("ogw-ad-result", (e) => {
  if (e.detail.result === "rewarded") { /* grant reward */ }
});
window.ShowInterstitialAd && window.ShowInterstitialAd("next", "noop");
window.ShowRewardedAd && window.ShowRewardedAd("coins", "noop");

Defold

From an HTML5 build, call the API with html5.run() (runs JavaScript via eval and returns the result as a string):

-- Defold — HTML5 build. Call the platform API with html5.run().
if html5 then
    -- Cloud save
    html5.run('window.OGW && window.OGW.saveState(0, JSON.stringify({score:1234}))')

    -- Ads
    html5.run("window.ShowInterstitialAd && window.ShowInterstitialAd('next','noop')")
    html5.run("window.addEventListener('ogw-ad-result', function(e){ if(e.detail.result==='rewarded'){ /* reward */ } })")
    html5.run("window.ShowRewardedAd && window.ShowRewardedAd('coins','noop')")
end

GameMaker (HTML5)

GameMaker can't run JavaScript inline, so wrap the platform calls in a JavaScript extension (HTML5 export target only — GX.Games does not support JS extensions), then call the generated functions from GML. Use a gmcallback_ function to receive ad results:

// 1) JavaScript extension file (HTML5 target only — GX.Games does not allow JS extensions).
//    Add these to a GameMaker Extension, then double-click each function in the IDE to
//    create a matching GML function (same name + argument count).
function OGW_Save(slot, data)       { if (window.OGW) window.OGW.saveState(slot, data); }
function OGW_ShowInterstitial(type) { if (window.ShowInterstitialAd) window.ShowInterstitialAd(type, "noop"); }
function OGW_ShowRewarded(type)     { if (window.ShowRewardedAd) window.ShowRewardedAd(type, "noop"); }
// Forward ad results to a GML function named gmcallback_ogw_ad_result:
window.addEventListener("ogw-ad-result", function (e) {
  if (typeof gmcallback_ogw_ad_result === "function") gmcallback_ogw_ad_result(e.detail.result);
});

// 2) GML — call the generated extension functions
OGW_Save(0, json_stringify({ score: 1234, level: 5 }));
OGW_ShowRewarded("coins");

// Receive the ad result (JavaScript calls this global GML function)
function gmcallback_ogw_ad_result(result) {
    if (result == "rewarded") {
        // grant the reward
    }
}

GDevelop

Add a JavaScript code event — you have full window access, so call the API directly:

// GDevelop — inside a "JavaScript code" event (you get `runtimeScene` + full window access).
// Cloud save
if (window.OGW) window.OGW.saveState(0, JSON.stringify({ score: 1234, level: 5 }));

// Load (async): resolve, then store into a scene variable
if (window.OGW) window.OGW.loadState(0).then(function (json) {
  if (json) runtimeScene.getVariables().get("save").setString(json);
});

// Ads
window.addEventListener("ogw-ad-result", function (e) {
  if (e.detail.result === "rewarded") { /* grant reward */ }
});
if (window.ShowRewardedAd) window.ShowRewardedAd("coins", "noop");

Any other engine

Any engine with an HTML5/WebGL export has a way to run JavaScript. Call the exact same window.OGW / window.ShowInterstitialAd / window.ShowRewardedAd API and listen for the ogw-ad-result event — the JavaScript example at the top of this section works everywhere.

Up to 10 save slots (0-9) per game per player; each holds a JSON string up to 64 KB. Logged-out players are skipped silently, so it is always safe to call.

4. Technical Requirements

Build target
A WebGL or HTML5 build that runs in a modern browser. Any engine that produces one is supported.
Compression
Brotli or Gzip. In Unity, do NOT enable "Decompression Fallback" — the platform serves the correct headers.
Download size
Target ≤ 40 MB total. Players on mobile connections drop off above this.
Memory
Keep memory modest (Unity heap ≤ 512 MB). Smaller builds load faster and reach more devices.
Thumbnail
16:9 ratio, minimum 512 × 288 px, WebP or PNG. Dark or transparent background preferred.
Icon
1:1 ratio, minimum 256 × 256 px, WebP or PNG.
Input
Support mouse/keyboard and touch — most players are on mobile.
Content policy
No explicit adult content. Violence must be cartoon or stylised. No real-money gambling.

5. Submit Your Game

Ready to submit?
Sign in to your account, open your Profile, and click Submit Game to fill in the submission form.
1
Export your game
Produce a WebGL/HTML5 build from your engine and confirm it runs locally with no errors. Compress the whole build folder as a ZIP.
2
Prepare your assets
Create a 16:9 thumbnail (min 512×288 px) and a 1:1 icon (min 256×256 px) in WebP or PNG.
3
Add platform features (optional)
Wire up cloud saves and ads using the Integration snippet for your engine. This is optional — XP, achievements, trending and more work automatically.
4
Submit via your profile
Sign in, go to your Profile page, and click Submit Game. Fill in your game details and links and upload your assets. You'll get a confirmation once we receive it.
5
Review
Our team tests your game within 3-5 business days. Status (Submitted → In Review → Approved / Rejected) is tracked live in your profile dashboard.
6
Go live
Once approved, your game is published and every platform feature (XP, achievements, cloud saves, trending badge) activates automatically.

6. Support

Questions about integration or submitting your game? Get in touch and we'll respond within 24 hours.