yare.io is a real-time 2-player (1v1) strategy game where you control units with any input method you want.
The default built-in methods are JavaScript/Python or a traditional Mouse/Touch interface, but you can create your own UI and modalities using the modules system.
There is one resource — energy. You extract energy from stars and use it to attack, defend and produce new units. The only thing you can control is the movement of your units and where they transfer the energy.
Player with 0 remaining units loses
2Player with 0 structures (bases, pylon, outpost) under their control loses
Small and weak, but their power lies in numbers.
merge/divide
Combines spirits into one stronger unit
Large and strong, but expensive to produce and small in numbers.
lock/unlock
Can’t move, but increases energize range
Neither too strong, nor too weak, but most difficult to play right.
explode
Damages all enemies in surrounding area
Spirits are the game’s units. They are JavaScript objects with various properties and methods listed below.
spirits[id]
object
The spirits object contains all of the game’s spirits. E.g. spirits[‘jane2’] returns the spirit with id = ‘jane2’
my_spirits[index]
array
my_spirits array contains only your spirits (including dead spirits). E.g. my_spirits[0] is your oldest spirit.
You can also access your own spirits by their id. E.g. jane2.position, but that’s highly impractical in the real game outside of the tutorial.
set_mark()
method.
Transfers (1 × spirit's size) energy unit from itself into target. Max distance of the energy transfer is 200 units.
If target is an enemy spirit or a base, the target takes damage (loses energy) equivalent to (2 × attacking spirit's size)
If target is the same spirit as origin, the spirit will attempt harvesting energy from a star.
If target is a location (e.g. [450, 380]
) the spirit will create an energy fragment at that point.
my_spirits[0].energize(my_spirits[1]);
var enemy = spirits['jane7']; my_spirits[0].energize(enemy); my_spirits[1].energize(enemy);
If a spirit or base has negative energy at the end of a tick, it will die.
Moves spirit to target with a speed of 20 units per tick
my_spirits[0].move([800, 900]);
Teleports a spirit into a new location. Energy cost of the jump is equal to distance/5. Target can not be within a 50 unit distance from any base, outpost or pylon, or 100 unit distance from a star. If target is not a valid location, the jump will land in the nearest valid location from target
Merges a spirit into another friendly spirit. Target needs to be within 10 units radius.
for (i = 0; i < 5; i++){ my_spirits[i].move(my_spirits[6].position); my_spirits[i].merge(my_spirits[6]); }
Divides spirit back into all the spirits that were merged into it.
my_spirits[9].divide()
Spirit locks itself — cannot move anymore, but every tick its range increases by 25 units until it reaches 300 (4 ticks).
Unlocks the spirit, returning its energize range back to 200. The spirit can move again.
Spirit explodes, killing itself and dealing 10 damage to all enemy spirits within 160 radius.
Shows a message above the spirit as a light-weight in-game communication. Useful for some debugging as well.
Updates the mark property of the spirit. That can be useful for e.g. marking which spirit is doing what
All instances of a method are executed together for both players every tick on the server in the same order as the table above.
First, all energize() methods are calculated, then all movements, then all merge() and so on. Except for explode() that happens together with energize().
E.g. if two spirits of the same size and with the same amount of energy are attacking each other, they will die at the same moment.
Base is the birth-place for new spirits, automatically generating new spirits when it has enough energy. If there is an enemy in its sight, the base stops producing new spirits, keeping all energy to defend itself.
Energy needed to generate a new spirit (happens automatically once per tick)
25-150 360–700 90–300The base won’t generate new spirits if there is an enemy in its sight (400 radius). It will keep all incoming energy from friendly spirits (until it reaches its energy_capacity) to defend itself.
If a base is in a neutral state, the player that pours more energy into it in the next tick claims control.
When a non-neutral base's energy would have gone below 0 (i.e. while under attack), the base becomes neutral.
Neutral structure that provides strategic advantage for whoever controls it by automatically shooting at enemy targets within its range.
Outpost deals 2 damage (costing 1 energy, same as a spirit) when it has less then 500 energy and 8 damage (costing 4 energy) when it has over 500 energy.
Neutral structure that provides strategic advantage for whoever controls it by automatically healing all friendly spirits within its range.
Pylon heals all friendly spirits that are inside the annulus area where the smaller circle has radius 200 and the larger one 400 units. The healing rate is 1 energy per tick per spirit.
Who controls the outpost / pylon / neutral base
The player that first sends energy into the neutral structure takes over its control. If both players are energizing neutral structure at the same time, the player who pours more energy in that tick takes control (structure remains neutral if both energize it with the same amount). Energizing a structure controlled by an enemy deals 2 damage — same as attacking a spirit.
Once the structure's energy reaches 0 (either by using up all of its energy to attack/heal or by the enemy damaging it), it becomes neutral again, available for any player to take control over it. Base remains under the player's control until its energy would have gone below 0.
Energy is the only resource in the game. Spirits harvest it from the stars, use it to create new spirits, transfer energy between themselves and attack with it.
Stars are the source of energy. Every tick (1 tick = 500ms), a star generates 2 energy + 2% of its current energy (rounded to a nearest integer). Except for star_nua
that generates 3 energy + 3%.
All “movement” of energy in the game is done via the energize(target) method. See the Spirit methods section.
Energy fragments
Energizing a location (e.g. spirit.energize([450, 500])
) will create an energy fragment at that point. Fragments can then be harvested by any player in the same way as stars (spirit energizing itself). If a spirit can harvest from a star or from a fragment, it will prioritize the fragment.
Author: Vilem Ries