Values your game fetches when it starts, changed on the dashboard (the project's Remote config)
without shipping a build. The same types as Unity's - string, bool, int, long, float,
json - plus image and video. No sign-in needed: anybody with the project id can fetch.
GET /config?environment=production&userId=...
POST /config
{ "environment": "production", "userId": "install-or-player-id", "attributes": { "platform": "Android", "app": { "version": "1.2.0" }, "user": { "level": 12 } } }
environment is optional; without it you get the project's default one. An unknown one is a 404.
attributes is whatever your rules match on, and only POST carries it. userId decides who falls
inside a rule rolled out to a share of players; a signed-in player's session token, when sent, is
used instead of it.
{
"environment": "production",
"configs": {
"speed": 1.25,
"motd": "Hello",
"shop": { "items": [1, 2] },
"banner": { "url": "https://www.dasmaffin.com/api/mgds/v1/projects/.../config/media/...", "contentType": "image/png",
"compression": "none", "bytes": 48213, "fileName": "banner.png", "width": 1280, "height": 400, "seconds": null }
},
"types": { "speed": "float", "motd": "string", "shop": "json", "banner": "image" },
"rules": [ { "id": "...", "name": "Android" } ]
}
rules lists the rules that changed something for this player. Nothing set up yet is an empty
configs, not an error.
Pictures and videos
A picture is PNG, JPEG, WebP or GIF; a video MP4 or WebM. Each comes as an object: fetch url (no
sign-in, and cache it for good: an address never changes what it holds). compression says how the
bytes are packed:
compression |
What you download | What to do |
|---|---|---|
none |
The file itself, as contentType |
Use it |
gzip |
The file, gzipped, as application/octet-stream |
Unpack it (GZipStream), then it is contentType |
Unity loads PNG and JPEG with ImageConversion.LoadImage; WebP needs a decoder. VideoPlayer
plays MP4 (H.264) everywhere and WebM (VP8) on most platforms.
All compressing happens in the dashboard, in your browser, before anything is uploaded: pictures can be re-encoded as PNG, JPEG or WebP at a quality and a smaller size, videos re-recorded as WebM or MP4 at a size and bitrate (it plays the video through once to do it), and either gzipped on top, with the resulting size shown before you upload. At most 200 MB once compressed. Files are kept on our file server.
Environments and rules
Each environment has its own settings: production exists from the start, and you add others
(development, staging). One is the default.
A rule gives some players other values for some keys. It has a condition over the attributes, a rollout (the share of matching players, by user id; under 100% skips a game that sends no id), a priority (0 to 1000, lower wins where two rules set the same key), optional start and end times, and an on/off switch. Conditions:
app.version == "1.2.0" && user.level >= 10
platform in ["Android", "iOS"]
!user.isTester
"beta" in user.groups
(user.level > 50 || user.vip) && platform != "WebGL"
Names are paths into attributes; one the game did not send is null. Compare with
== != < <= > >= (numbers with numbers, text with text), join with && || !, group with brackets,
and in looks inside a list or a piece of text. A condition that does not read is refused when it
is saved.