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 are critical to help you progress through the technology tree. If you lose all your buildings, it's game over.
Units are an important part of extending your influence. Units are used for economy and military purposes.
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.
Your control limit is determined by the number of hubs and other personnel buildings you have.
Your units and buildings provide vision around them in a moderate area. There may be some delay due to satellite uplink.
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
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.
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 |
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 |
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
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.
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 |
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 |
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 types are the core of a mech. They determine the mech's size and shape.
Base types are the foundation of a mech. They determine the mech's movement and power.
Armament types are the weapons of a mech. They determine the mech's offensive capabilities.
Segment types are the modular components of a mech. They determine the mech's flexibility and adaptability.
In code:
const simpleMech = buildMech({
base: "BaseType",
body: "BodyType",
armament: "ArmamentType",
});
Base type should be one of the following:
Bipedal (Scout Legs)
Reverse-Jointed (Strider Legs)
Treads (Siege Treads)
Quad (Fortress Legs)
Body type should be one of the following:
Light (Recon, Specter Frame)
Medium (Combat, Vanguard Chassis)
Heavy (Assault, Titan Hull)
Superheavy (Fortress, Bastion Core)
Weapons come in three major categories:
Projectile (Kinetic)
Missile (Explosive)
Laser (Energy)
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:
Kinetic - Light - Machine Guns
Kinetic - Light - Shotguns
Kinetic - Medium - Autocannons
Kinetic - Medium - Railguns
Kinetic - Heavy - Gauss Cannons
Energy - Light - Laser Pointers
Energy - Medium - Plasma Rifles
Energy - Medium - Beam Lasers
Energy - Heavy - Particle Cannons
Explosive - Light - Grenade Launchers
Explosive - Medium - Missile Racks
Explosive - Heavy - Artillery Cannons
Explosive - Heavy - Rocket Pods
Support - Light - EMP Launchers
Support - Medium - Smoke Launchers
Support - Heavy - Repair Tools
Each faction has unique buildings, units, and tactics
Information about known factions has been removed.
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.
For precise control over units and buildings, you can establish a websocket connection.
Handle the following events for a complete experience