EARTH GAMESVroege toegang
Home›Developers›game.json and limits
SPECIFICATION & LIBRARY40 MODELS · 5 WEAPONS

game.json, the library and the limits

Generated directly from the modules that validate manifests and enforce live runtime budgets, so every ID and number here is live.

game.json

Only id, title, version and api are needed. npx earthgames check reports invalid fields in plain words.

game.json (starter)
json
{
  "id": "flag-hunt",
  "title": "Flag Hunt",
  "summary": "Find the flag 60 m north of wherever you spawn.",
  "version": "0.1.0",
  "api": 1,
  "instance": { "kind": "match", "maxPlayers": 8 },
  "area": { "anywhere": true },
  "content": { "violence": "none" }
}
FieldTakesLeft outWhat it is
id3 to 40 lowercase letters, digits or dashesrequiredThe game's name in links (/games/<id>). It is yours once you have submitted it, and it cannot change.
titletext, up to 60 charactersrequiredThe name players see.
summarytext, up to 200 charactersempty (a warning)One or two sentences players read before they join.
versionthree numbers, like 1.0.00.1.0Raise it each time you submit. Players keep the approved version until the new one is approved.
api1requiredThe API version the game was written for. Additions to the API never change it.
instance.kind"match" or "persistent""match"A match is played and over. A persistent world keeps what it saves and can be opened again with the same invite code.
instance.maxPlayers1 to 328How many players one running game holds.
instance.minPlayers1 to maxPlayers1How many players the game is meant for at least. Shown to players; the game still starts with fewer.
areaexactly one of { "anywhere": true }, { "bbox": [west, south, east, north] }, { "regions": [...] }, { "built": true }, { "corridor": ... }{ "anywhere": true }Where the game can be played. Leave it out unless the game really needs one place: a game that plays anywhere can be started by anyone, where they are.
content.violence"none", "mild" or "strong""none"How violent the game is. Players see it before they enter.
content.bloodtrue or falsefalseWhether the game has blood. Blood is drawn only when this is true, and only for signed-in players of 17 or older who turned it on in their own settings. Guests never see it. Needs a violence level other than "none".
content.horror"none", "mild" or "strong""none"How frightening the game is.
content.language"none", "mild" or "strong""none"How rough the game's own text is.
content.pvptrue or falsefalseWhether players can hurt each other.
content.noticetext, up to 200 charactersemptyAnything else players should know before they enter, in your own words.
world.traffic0 to 20Everyday traffic inside your game: 0 is none, 1 is as in the shared world.
world.pedestrians0 to 20Everyday people on the streets inside your game, on the same scale.
player.modesa list from "walk", "drive", "fly", "boat", "bike"every modeHow players may get around in your game.
player.rejoinS0 to 600 (seconds)0How long a player's place is held when their connection drops. You hear onPlayerAway, then onPlayerJoin with rejoined: true, or onPlayerLeave when time runs out.
actionsa list of up to 12: { "id", "label", "key" }noneYour own keys. key is "panel" (the game's main key, J) or one of the keys listed under Library below. A press fires onUi with { from: "action", id }.

Zone and marker styles

Pass style to eg.entities.add. Click any swatch to copy its style ID. Any unknown string uses default.

Weapons

IdNameDamageRangeRateMagMax
fists Fists
20
1.7 m
2.5/s — —
bat Bat
50
2.1 m
1.6/s — —
pistol Pistol
34
60 m
4/s 12 120
smg SMG
18
45 m
11/s 30 240
shotgun Shotgun
12 × 8
25 m
1.1/s 6 48

Everyone always carries fists. Gun damage falls off with distance. Any other lowercase string id works as a custom inventory item.

Characters

Behaviors

Set brain on a character kind, a spawner, eg.npcs.spawn, or eg.npcs.setBrain.

BehaviorWhat it does
idleStands where it is.
wanderWalks around near where it started.
chaseGoes after the nearest player it can see (or its target) and attacks when in reach.
fleeRuns away from players.
guardStays at its post (home) and goes for players who come within sight.
patrolWalks its route, point after point, and around again.
gotoWalks to its target; you hear onNpc with ev "reached".

Kind defaults

Speeds are meters per second; sight and leash (maximum chase distance) are meters.

scale: 1speed: 1.4runSpeed: 4.5health: 100sight: 40leash: 90brain: "idle"aggro: true

Spawner defaults

Defaults for a rule-based spawner with no at; placed spawners start with minFromPlayersM: 0.

radius: 8count: 6capNear: 12capTotal: 60perSecond: 2respawnS: 0minFromPlayersM: 40maxFromPlayersM: 160

Models

Pass model on a kind (click to copy). Left out, every spawned character gets a distinct everyday look.

Sounds

Call eg.audio.cue(player, id) (click an ID to copy). Unknown IDs fall back to the waypoint chime.

IdWhat it is
ui.clickUI click
ui.openUI open
ui.chatChat message
ui.mentionChat mention or whisper
ui.waypointWaypoint set
ui.callVehicle called
ui.garage.pingGarage signal ping
ui.rareRare find sting
ui.errorUI error
ui.job_offerJob board opened
ui.job_acceptJob accepted
ui.job_loadCargo loaded
ui.job_deliverDelivery complete
ui.job_failJob failed

Keys and other lists

Keys for custom manifest actions: "panel" (the game's main key, J) plus:

  • Ways of getting around: walk, drive, fly, boat, bike.
  • Team colors: red, blue, green, yellow, purple, orange.
  • Place kinds for eg.world.placesNear: depot, fuel, shop, office, hospital, police, street. The last three appear only when requested in kinds.
  • Weather presets for eg.world.setWeather: clear, cloudy, overcast, rain, storm, snow, fog.
  • Handling profiles for eg.vehicles.setHandling: arcade, sport, real.
  • Tire compounds for eg.vehicles.setTire: slick, allweather, gravel.
  • Window block types for eg.ui.window: heading, text, divider, stats, bar, list, table, callout, badges, actions.
  • Form field types for eg.ui.form: text, number, select, checkbox, slider.
  • {dist:1234} in HUD text: a distance in meters, shown in the player's own units.
  • {km:2.5} in HUD text: a trip length.
  • {time:95} in HUD text: seconds as a clock: 1:35.

Limits

Limits are live budgets so one game cannot degrade the server. The in-game dev panel shows real-time usage. If an approved game needs higher caps, ask the team.

Your script

The rules script reacts to events; it does not run all the time. These keep one game from slowing the others.

Size of server.js256 KB
Size of game.json16 KB
Memory for one running game32 MB
Time to load the script250 ms
Time for one handler call8 ms. 3 time-outs in a row stop the script and end the game with a notice.
Platform calls in one handler call2000
One value passed in or out (a save, a menu, a HUD card)64 KB
Events waiting for the script500. More than that are dropped; the dev panel says how many.
A timer that repeatsat most ten times a second

Things in the world

Per running game.

Zones and markers500
Characters alive at once400
Kinds of character64
Spawners64
Teams8
Race courses of your own20
Places from one world.placesNear64

What players are sent

Toasts, HUD cards, windows, prompts, menus, effects and sounds, per player.

Messages15 a second, with bursts of up to 40
Size of one message16 KB
A line of text (a toast, a label)200 characters
Open windows per player3
Blocks per window30
Fields / choices per prompt8 fields / 12 choices
Points in one scores.add100,000

Players and running games

Players in one running game32
Games one player may start12 an hour
An empty match closes after60 seconds
An empty persistent world is saved and closed after10 minutes

Translations

Text marked with eg.t and the lang folder (the guide: "Translating your game").

Texts to translate in one game2000
One text, and one translation1000 characters
Languages in the lang folder80
Size of the lang folder512 KB
Values in one eg.t20, each up to 200 characters

Saves

What eg.saves keeps.

A saved world200 keys, 256 KB in all
Kept for one player in your game50 keys, 16 KB in all
One value64 KB
Saved worlds one player may own10, and 3 of one game (a guest: 1)
A world nobody opens is removed after90 days (a guest's: 7 days)

Combat and inventories

Health a player may haveup to 10,000 (100 unless you say)
Different items one player carries40
Of one item9,999

Making and publishing

Drafts on one account10
Published games on one account20
Versions waiting for reviewone per game: a newer submission replaces it
Games made in the Make a game app10, each with up to 60 placed things and 12 rule cards