ALGOWARS Documentation Hub

The comprehensive guide to the AlgoWars protocol. Learn to command your units, optimize your algorithms, and dominate the grid.

Introduction

Welcome to the AlgoWars scripting documentation.

AlgoWars provides a sandboxed, secure environment for you to test your algorithmic thinking. You will write unit logic using a standard JavaScript/TypeScript subset.

No Game Dev Experience Required

You don't need to know Unity, Unreal, or complex rendering pipelines. You just write the onTick() function, and our server handles the rest.

While advanced optimization and complex state machines are possible for veteran developers, beginners can start with simple if/else logic and still be competitive.

Language

JS / TS
Standard Syntax

Environment

Sandboxed
Secure Execution

Tick Rate

10 Hz
100ms / Turn

Complexity

O(n)
Scalable Logic

Getting Started

To begin your first operation, navigate to the AlgoWars section from the main menu. You will be presented with a customized IDE and a visual representation of the battlefield.

The Interface

  • Editor Pane: The left side of the screen where you write your logic.
  • Simulation Grid: The right side visualization of the battlefield.
  • Console: Displays logs, errors, and system messages from your units.

Tip: You can pause the simulation at any time to debug your code. Changes to your scripts are applied immediately upon saving/recompiling.

Core Mechanics

The battlefield is represented as a 2D grid. Coordinates are 0-indexed, starting from the top-left (0,0).

The Grid

Each tile on the grid can contain:

  • Empty Space: Traversable by all ground units.
  • Obstacles: Walls, debris, or buildings that block movement and line of sight.
  • Resources: Data Nodes or Energy Cells that can be harvested.
  • Units: Friendly or hostile bots.

Turn Execution

Although the game appears real-time, it runs on a "tick" system. Each tick represents 100ms of game time. Your `update()` function is called once per tick for every unit you control.

Unit Database

Different chassis are available for deployment, each with unique stats and capabilities.

ClassHealthSpeedRangeCostDescription
Scout100Fast250High mobility recon unit. Weak armor.
Tank400Slow4150Heavy armor main battle tank.
Sniper80Med8120Long range engagement specialist.
Tower1000Static6200Defensive structure. Cannot move.

Scripting API

All units expose a global API that you can access within your scripts. The `this` context refers to the current unit instance.

Movement & Actions

Basic Movement
// Move the unit in a cardinal direction
this.move("UP" | "DOWN" | "LEFT" | "RIGHT");

// Example: Move towards distinct coordinates
if (this.x < target.x) {
    this.move("RIGHT");
}
Combat
// Fire main weapon at target coordinates
// Returns true if fired (check cooldowns)
this.attack(x, y);

// Example: Attack nearest enemy
const enemy = this.scan().find(e => e.team !== this.team);
if (enemy) {
    this.attack(enemy.x, enemy.y);
}

Sensing

Radar
// Returns an array of objects within sensor range
const entities = this.scan();

// Entity Interface
interface Entity {
    id: string;
    type: "UNIT" | "WALL" | "RESOURCE";
    x: number;
    y: number;
    team?: string;
    hp?: number;
}

Archives (Lore)

"The Great Disconnect of 2099 left the world's infrastructure fragmented. Now, Corporate City-States fight proxy wars using automated drone armies. You are a Cipher—a mercenary tactician selling your algorithms to the highest bidder."

Neon Syndicate

A collective of hacker-activists seeking to liberate data from corporate silos. They favor speed, stealth, and electronic warfare units.

OmniCorp

The ruling hegemony controlling 80% of the world's energy grid. Their units are heavily armored, expensive, and devastating.

© 2026 AlgoWars. System Active.