A world is partitioned in two different ways. Scenes are separate pieces of a world, joined only by portals: the island's top and its labyrinth are two scenes. Regions are pieces of one scene's content that need be active only when they might be seen: the cottage, the marina and lighthouse, the riding ground. A visitor goes from scene to scene through a portal, in a single step; a visitor walks from region to region without noticing a boundary. Both exist for the same reason: a world can be far larger than any one machine holds, and the visitor should never wait.
Words used on this page:
- Scene
- A truly separate piece of a world, with its own coordinate system, rules and rendering. Scenes share nothing but the portals between them.
- Region
- A part of one scene whose contents may be absent from a visitor's machine, with a stand-in drawn in their place. Any part can be one.
- Stand-in
- What a region looks like from far away: one simple thing to draw in place of all its parts. Its proposed form is the distant form.
- Wake, sleep
- A region wakes when its parts are brought in and made active, and sleeps when they are let go.
- Occluder
- Something that hides what is behind it from view: a city wall, a mountain, a cave's bend.
- Zoning
- Splitting a game world into zones loaded one at a time, as some online games do, usually with a pause and a loading screen at each crossing.
The world above its scenes
The world is the top part (Parts). Under this proposal its children are its scenes, and so is anything shared across scenes:
- the world's rules, those that hold in every scene;
- state that must survive moving between scenes: a lever pulled in the labyrinth opens a gate on the island;
- what a visitor carries from scene to scene within the world (what crosses into another world is on Portals).
The world never needs to be loaded whole. A visitor's machine holds one scene, and the regions of it awake round the visitor. The server may hold more.
Scenes
- A scene is truly discrete. It has its own coordinate system, its own rules, its own rendering, its own everything: its own sky or none, its own light, its own exposure.
- Scenes have nothing in common except the portals between them. Nothing in one scene's frames places it relative to another (Frames).
- A scene need not be loaded while the visitor is in another.
- Crossing is instant. As the visitor nears a portal, the browser prepares and caches the scene beyond it, so that going through is immediate: no pause, no loading screen. This is zoning as some games do it, without the pause (Loading; Portals: being ready).
Regions
A region is one scene's content, active only when it might be seen. A world could be divided into six regions: the cottage, the marina and lighthouse, horse riding, race cars and so on. The visitor walks between them.
- The designer arranges the scene so that not all of it need be active: buffer zones between regions, careful occlusion, a wall round a city so the city is not seen until the visitor is inside the gates.
- Approaching a region, the browser prepares it, draws part of it, then more as the visitor goes deeper.
Any part can be a region
A region is a general mechanism, not a kind of part of its own: a part whose contents may be absent, with a stand-in for when they are.
- Regions nest arbitrarily deep: a city, a district inside it, a house's interior inside that.
- The model is the open world of games. Over a mountain pass and down the other side, the visitor has moved to another region; into a cave or a dungeon, the same.
- The aim is that regions are built into the world transparently, with the tools helping the designer make every shift look seamless.
- A dungeon may be a region or a scene. Walked into continuously, it is a region; entered through a portal, a scene. The designer chooses.
Stand-ins: a whole hierarchy seen from afar
From a distance, a region is one simple thing to draw: the walled city with a few obvious landmarks and none of the detail inside. Up close, the stand-in hands over to the detailed parts, and the composite view goes away.
Today's level of detail (simpler versions of one mesh drawn further away) works one mesh at a time. A stand-in works on a whole hierarchy of parts. A proposal for how a stand-in is described, the distant form, is on Construction: distant forms.
How you write it
Nothing here has a chosen spelling. As an illustration only, with scene and region written as what a part is:
part island // the world: the top part // illustration
field leverPulled: bool = false, mutable: true, lives: server // shared by both scenes // illustration
part surface: scene // the island's top // illustration
part cottage, at: (-16, land.height((-16, 0, 330)), 330)
...
part marina: region // illustration
...
part labyrinth: scene // its own coordinate system // illustration
part arrivals
part gate, at: (0, 0, 291) // a published arrival (portals.html) // illustration
part maze: region // illustration
...
A lever in the labyrinth would write island.leverPulled; a gate on the island's top would follow it with a subscription (Subscriptions). The labyrinth's numbers are its own coordinates: (0, 0, 291) means nothing on the island's top.
What it means
Waking a region
Each region states where it might be seen from, as an area round it (Physics: areas). A tool generates that area from the scene's occluders (the wall, the mountain pass), and the designer adjusts it. When an eye enters the area, the region wakes:
- first its distant form;
- then its parts, deeper as the eye goes deeper.
The content states where the region can be seen from, which is the designer's intent. The browser chooses when and how much to load (Loading). Whether "an eye" includes a portal's window and a far-seeing stone, as well as each visitor's own camera, is open (Cameras and views).
A sleeping region
A region asleep still has things worth seeing from afar: the lighthouse beam turning, the city's windows lighting at dusk. Its distant form may carry those few live values (a light, an animator) while the region's own logic sleeps. What keeps running while a region sleeps is stated by the region:
- nothing: the region stands still until woken;
- a summary: a few values kept going, enough for its distant form and for waking in a believable state;
- everything, on the server: the region runs in full on the server while visitors' machines hold only its distant form.
What the content states, and what it does not
Content states how the world is partitioned (which parts are scenes, which are regions), where a region can be seen from, and how ready a portal's destination must be. It never states when to fetch, how much to hold or what to drop: those are the browser's, by distance, approach and budget, as every resource decision is (Parts: what a part cannot do).
A region asleep is still in the tree
A region's path names it whether or not its contents are on a given machine: island.surface.marina is the marina's identity while the visitor is at the cottage. Being absent is execution state, as a rider's being carried is; it does not change the tree (Parts: a path is identity, not location). What logic may do with a part in a sleeping region is open.
How it connects
- Parts: the world as the top part; any part a region.
- Frames: each scene has its own coordinate system.
- Loading: preparing a scene, waking a region, caching.
- Portals: the only joins between scenes, and between worlds.
- Physics: areas: the seen-from area that wakes a region.
- Construction: distant forms: what a region looks like from afar.
- Sky and weather: a scene's own sky and settings.
- Distribution: what the server holds while a visitor's machine holds one scene.
Open questions
- Spelling. How a part is declared a scene or a region; whether a region needs a word at all, or is any part that has a stand-in or a seen-from area.
- A scene's own clock. A scene has "its own everything". The pages speak of "scene time" for the world's one clock; whether each scene has its own day, or all share the world's, is not stated (Sky and weather).
- One word, several meanings. "Region" is also a region of a shape (Recipes), a named region of a product such as a scalp (Fitted and grown), and, elsewhere, the labyrinth as a place with its own settings (Sky and weather, Cameras). One word for all, or a new word for some.
- Logic that reaches into a sleeping region or another scene. A rule that reads a field in the labyrinth, or a part in a region no visitor's machine holds: whether it runs only on the server, is refused, or must go through world state shared at the top.
- What a sleeping summary is, and how a region states one; and what state a region wakes in after a long sleep, for a visitor arriving late (Distribution: late arrival).
- What a visitor carries between scenes, as world state keyed by being, against what a person carries between worlds, which is outside the content (Outside the content).
- Areas across regions: an area whose volume spans two regions, one awake and one asleep (Physics).
- Scenes, or one space (a design question): the island's code keeps the labyrinth in the island's own coordinates, 300 m down and told apart by height, and lands a being offset from the pane, where this page has scenes with coordinates of their own, arrival points, and per-place settings (light, exposure, far distance, sky). Which model, and where a place's settings live.