Developer Documentation
OnlineGameWorlds hosts Unity WebGL games and automatically powers them with XP & leveling, achievements, cloud saves, daily challenges, and personalised recommendations β with zero extra code required for most features.
1. Automatic Features
Every published game gets the following platform features at no extra effort from you:
| Feature | Description |
|---|---|
| XP & Leveling | Players earn XP by playing your game. Progress is tracked on their profile automatically. |
| Achievements | Platform achievements unlock based on player behaviour β no setup required. |
| Daily Challenges | Rotating daily tasks include playing games on the platform. Your game counts automatically. |
| Recommendations | Your game is recommended to players with matching interests and play history. |
| Recently Played | Players can resume your game directly from their profile and the homepage. |
| Trending Badge | If your game trends, it receives a HOT badge on its card automatically. |
| Cloud Saves | Players can save and load game state across devices. Optional integration β see Β§2. |
| Reviews & Ratings | Players can rate and review your game. Shown on the game page. |
2. Cloud Save Integration
The platform injects a window.OGW bridge into every game page. Your Unity build calls it through a .jslib plugin. Anonymous players are silently skipped β the bridge no-ops when no one is logged in.
Step 1 β Create CloudSaveBridge.jslib
Place this file inside your Unity project's Assets/Plugins folder:
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 || "");
});
}
}
});Step 2 β Create CloudSave.cs
Attach this MonoBehaviour to a persistent GameObject in your scene:
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);
// Call this to save β e.g. on level complete or menu open
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
}
// Call this on game start to restore player progress
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
}
// Platform calls this with the loaded JSON string
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; }Slots: Up to 10 slots (0β9) are available per game per player. Save data is a JSON string with a maximum size of 64 KB per slot. Use
PlayerPrefs as the in-editor fallback β it mirrors the cloud slot behaviour locally.3. Technical Requirements
Unity Version
Unity 2021.3 LTS or newer. Build target must be WebGL.
Compression
Brotli or Gzip. Do not use the "Decompression Fallback" option β the platform handles decompression.
Memory
Heap size β€ 512 MB. Exception support: set to None for smaller builds.
Download Size
Target β€ 40 MB total. Players on mobile connections will drop off above this.
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.
Content Policy
No explicit adult content. Violence must be cartoon or stylised. No real-money gambling mechanics.
4. Submit Your Game
Ready to submit?
Use the submission portal to upload your build, thumbnail, and icon β and track your review status in real time.
1
Prepare your build
Export your Unity WebGL build and verify it runs locally without errors. Compress the entire build folder as a ZIP file.
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 format.
3
Submit via the portal
Fill in your game details, upload your build ZIP and images, and hit Submit. Your submission is tracked in your profile dashboard.
4
Review
Our team tests the game within 3β5 business days. Status updates (Viewed β Approved / Rejected) appear in your dashboard automatically.
5
Go live
Once approved, your game is published and all platform features (XP, achievements, cloud saves, trending badge) activate automatically.
5. Support
Have questions about integration or want to submit your game? Get in touch and we'll respond within 24 hours.