game.json
Only id, title, version and api are needed. npx earthgames check reports invalid fields in plain words.
{
"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" }
}| Field | Takes | Left out | What it is |
|---|---|---|---|
id | 3 to 40 lowercase letters, digits or dashes | required | The game's name in links (/games/<id>). It is yours once you have submitted it, and it cannot change. |
title | text, up to 60 characters | required | The name players see. |
summary | text, up to 200 characters | empty (a warning) | One or two sentences players read before they join. |
version | three numbers, like 1.0.0 | 0.1.0 | Raise it each time you submit. Players keep the approved version until the new one is approved. |
api | 1 | required | The 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.maxPlayers | 1 to 32 | 8 | How many players one running game holds. |
instance.minPlayers | 1 to maxPlayers | 1 | How many players the game is meant for at least. Shown to players; the game still starts with fewer. |
area | exactly 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.blood | true or false | false | Whether 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.pvp | true or false | false | Whether players can hurt each other. |
content.notice | text, up to 200 characters | empty | Anything else players should know before they enter, in your own words. |
world.traffic | 0 to 2 | 0 | Everyday traffic inside your game: 0 is none, 1 is as in the shared world. |
world.pedestrians | 0 to 2 | 0 | Everyday people on the streets inside your game, on the same scale. |
player.modes | a list from "walk", "drive", "fly", "boat", "bike" | every mode | How players may get around in your game. |
player.rejoinS | 0 to 600 (seconds) | 0 | How 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. |
actions | a list of up to 12: { "id", "label", "key" } | none | Your 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
| Id | Name | Damage | Range | Rate | Mag | Max |
|---|---|---|---|---|---|---|
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.
| Behavior | What it does |
|---|---|
idle | Stands where it is. |
wander | Walks around near where it started. |
chase | Goes after the nearest player it can see (or its target) and attacks when in reach. |
flee | Runs away from players. |
guard | Stays at its post (home) and goes for players who come within sight. |
patrol | Walks its route, point after point, and around again. |
goto | Walks to its target; you hear onNpc with ev "reached". |
Kind defaults
Speeds are meters per second; sight and leash (maximum chase distance) are meters.
Spawner defaults
Defaults for a rule-based spawner with no at; placed spawners start with minFromPlayersM: 0.
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.
| Id | What it is |
|---|---|
ui.click | UI click |
ui.open | UI open |
ui.chat | Chat message |
ui.mention | Chat mention or whisper |
ui.waypoint | Waypoint set |
ui.call | Vehicle called |
ui.garage.ping | Garage signal ping |
ui.rare | Rare find sting |
ui.error | UI error |
ui.job_offer | Job board opened |
ui.job_accept | Job accepted |
ui.job_load | Cargo loaded |
ui.job_deliver | Delivery complete |
ui.job_fail | Job 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 inkinds. - 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.
server.js256 KBgame.json16 KBThings in the world
Per running game.
world.placesNear64What players are sent
Toasts, HUD cards, windows, prompts, menus, effects and sounds, per player.
scores.add100,000Players and running games
Translations
Text marked with eg.t and the lang folder (the guide: "Translating your game").
lang folder80lang folder512 KBeg.t20, each up to 200 charactersSaves
What eg.saves keeps.
