Future Terminal

Mechanics

Right now, the mechanics for Earth-based players have been kept simple.

You must gather ore using Worker-class units. Then process the ore into metal with OreProcessor buildings. Finally, submit the metal via OrbitalMassDriver to assist space forces.

Buildings

Buildings are critical to help you progress through the technology tree. If you lose all your buildings, it's game over.

Units

Units are an important part of extending your influence. Units are used for economy and military purposes.

Resources

Harvest Ore with workers and return it to your Hub.

Process Ore into Metal.

Use Metal to build basic units like workers and soldiers to expand your economy and military.

Generate Energy to power your units and buildings.

Add Control to increase the number of units you can control.

Gather more advanced resources and use them to build custom modular units to adapt to any situation.

Earth-based players must first demonstrate competency before working with more complex resources.

Control

Your control limit is determined by the number of hubs and other personnel buildings you have.

Vision

Your units and buildings provide vision around them in a moderate area. There may be some delay due to satellite uplink.


Code editor

Here's how you can code

The code editor is a simple JavaScript editor with a few features to help you.


        // Add more code here
      
      

API

Here's what you're coding with

When you're using the client editor, the main object to code against is found at api.

Functions take time to run and so have a cost or delay associated with them. Any function that is a server command might be rejected: your code will continue to run, but the command will not be accepted by the server.

Make sure your code handles this gracefully.

Local commands

These functions run locally and have no costs. But their data might be a little bit out of date.

Function Description
distanceBetweenEntities(a, b) Get the distance between two entities
distanceBetween(x1, y1, x2, y2) Get the distance between two entities within a range
getNearest(entities, x1, y1) Get the nearest entity to a point
getNearestWithinRange(entities, x1, y1, range) Get the nearest entity to a point within a range

Server commands

These functions are sent to the server as requests and have a cost or delay associated with them. They might be rejected.

Function Description
getOres() Get all ores
getUnits() Get all your units
getBuildingsByType(buildingType) Get your buildings by type
getUnitsByType(unitType) Get your units by type
getEnemyUnits() Get enemy units
getEnemyBuildings() Get enemy buildings
move(a, x, y) Try to move a unit to a point
mine(a, ore) Try to mine an ore
load(a, hub) Try to load ore into a building
spawnBuilding(buildingType, x, y) Try to spawn a building
spawnUnit(unitType, x, y) Try to spawn a unit

Local commands - detail

distanceBetweenEntities(a, b)

Returns the distance between two entities as a number.

a is the first entity, b is the second entity

distanceBetween(x1, y1, x2, y2)

Returns the distance between two points as a number.

getNearest(entities, x1, y1)

Returns the nearest entity to a point.

entities is a list of entities

getNearestWithinRange(entities, x1, y1, range)

Returns the nearest entity to a point within a range.

entities is a list of entities. x1, y1, and range are numbers

Server commands - detail

getOres()

Returns a list of Ore objects.

getUnits()

Returns a list of Unit objects that are yours.

getBuildingsByType(buildingType)

Returns a list of Building objects filtered by buildingType that are yours.

buildingType is the value of a BuildingType.

getUnitsByType(unitType)

Returns a list of Unit objects filtered by unitType.

unitType is the value of a UnitType

getEnemyUnits()

Returns a list of Unit objects that are enemies.

getEnemyBuildings()

Returns a list of Building objects that are enemies.

move(a, x, y)

Moves a unit to a point.

mine(a, ore)

Mines an ore.

a is the entity mining. ore is the ore to be mined.

load(a, hub)

Loads ore into a building.

a is the entity loading. ore is the hub to be loaded.

spawnBuilding(buildingType, x, y)

Create a building.

spawnUnit(unitType, x, y)

Create a unit.


BuildingType

Name Value Build limit Description
Hub 1 1 Build other buildings, process ore, and spawn units
House 2 - Increase control limit
Cannon 3 4 Shoot at enemy units and buildings
OreProcessor 4 3 Process ore into metal
OrbitalMassDriver 5 1 Send metal as required
Artillery 6 1 Shoot at enemy units and buildings but far away

UnitType

Name Value Description
Worker 1 Harvest ore
Soldier 2 Attack enemy units and buildings
Archer 3 Attack enemy units and buildings from a distance
Crawler 5 Cheap numerous units that attack enemy units and buildings at close range

Mechs

Each faction ultimately strives to field its customisable mech units, which are the mainstay of any ground-based main battle force.

Simple (Primary) mechs are comprised of a Base, Body, and Primary Armament.

Complex (Secondary) mechs are comprised of a Base, Body, Right arm (primary), Left arm (secondary).

Advanced (Tertiary) modular mechs are comprised of a Base, Body, and composable Segments. Segments may be connectors with various Endpoints. Endpoints can have Armaments attached.

Body

Body types are the core of a mech. They determine the mech's size and shape.

Base

Base types are the foundation of a mech. They determine the mech's movement and power.

Armament

Armament types are the weapons of a mech. They determine the mech's offensive capabilities.

Segment

Segment types are the modular components of a mech. They determine the mech's flexibility and adaptability.

Building a mech

In code:


const simpleMech = buildMech({
  base: "BaseType",
  body: "BodyType",
  armament: "ArmamentType",
});

Base type should be one of the following:

Body type should be one of the following:

Weapons come in three major categories:

Future weapon classes may include e.g., Indirect Fire (Artillery), Support (e.g,. Repair), and Melee (???).

Armament (weapon) type should be one of the following:


Factions

Each faction has unique buildings, units, and tactics

Information about known factions has been removed.


How code runs

Here's how your commands compete

All commands received by the server are queued and run in order, after a little bit of grouping. The server will run as many commands as it can. If you send too many commands, only the first few will run. The rest will be ignored.

In more technical terms, the server runs commands in batches. Each batch is a set of commands that were received within a certain time period. The size of each batch varies according to server performance.


Websocket

For precise control over units and buildings, you can establish a websocket connection.

Probably ignore this for now.

  1. Send connect to the server
  2. Server responds with `PlayerConnected`
  3. Send `PlayerId` with your playerId, password, and colour
  4. Send `GetSync` with your playerId
  5. Send `SpawnBuilding` with building info
  6. Send `SpawnUnit` with unit info
  7. Send `Action` with its info
  8. Send `GetOres` with your playerId

Handle the following events for a complete experience