A little further. Your frontier. A browser space-strategy game built with FriendSDK, RainbowKit, React, Canvas 2D and an authoritative Node server. Your Rare Friend is the main character: gather resources, construct tetromino rooms, recruit helpers, fight rival stations and capture four shared monoliths.
Play Farfield. For the 960×640 submission viewport, use submission mode; the normal URL keeps the responsive full-window layout. The public beta runs on dedicated AWS resources; see the deployment record for operations and limitations.
The game preloads its assets and opens a fixed, full-screen title menu with an animated station backdrop. The page does not scroll; match setup appears only after choosing a mode. AI count, difficulty and control placement use themed custom selectors with keyboard and touch support. Connect an eligible Rare Friends wallet on Robinhood mainnet (4663). You do not need to pick a Friend immediately: pressing Play uses your first eligible Friend. Change commander opens a full-screen, unframed sprite roster with search and responsive pagination. Inspection shows the Friend type, generation, canonical idle/walk animation, explicit selection and Back. The SDK freshly verifies ownership and hardwired generation ≥1 before play.
- Online PvP: free automatic 1 vs 1 matchmaking. Choose Find free match; play begins when an opponent joins.
- Friends & AI: enter directly into your full-screen sector. Up to four commanders total, any mix of humans and up to three AI. Set initial AI count/difficulty on the landing; use Menu → Match & invitations inside the game to share the 10-character invitation code and add/remove Easy, Normal or Hard bots. Friends select Join friends from the title menu and enter that code. The host begins once everyone is present. Each commander owns a separate station; no mid-match joining.
Custom matches are free. Start with your Friend, a command core, zero workers, 65 alloy, 45 energy and 40 food. A compact resource strip and two-button Build / Workers dock float above the full-screen map. Set Menu → Controls position to Bottom (default), Left or Right; this choice persists between matches. Build and worker drawers animate open without pausing play or resizing the map; the SDK preview toolbar is hidden during play, and wallet controls remain available in Menu → Wallet & connection.
Choose Install game on the title screen. Chrome/Edge offer their native install prompt when available. On iPhone or iPad, use Share → Add to Home Screen (enable Open as Web App if shown). On macOS Safari, use File → Add to Dock. Launch from that icon for a standalone game window. The install option hides in the installed app.
An internet connection is still required for wallets and matches. An offline launch shows a reconnect screen; it does not simulate a local match. Installation may use separate browser storage, so reconnect your wallet if prompted. Preferences can use local storage; restricted storage leaves the game usable without saving those preferences. Updates never force-reload an active match. See PWA implementation and checks.
| Action | Control |
|---|---|
| Build | B / Build → choose a block with 1–7 or I/O/T/L/J/S/Z → choose a building with 1–8 → click/tap once to place. Backspace returns to block selection; R rotates; Escape clears placement. |
| Touch placement | The preview appears as soon as you choose a building. Drag any preview tile to position the whole piece; release to keep adjusting, then tap Build. Empty-space drags pan the camera; pinch zooms without placing. |
| Cancel / dismantle | Click your blueprint or building. Cancel unfinished work for 100% of alloy; dismantle completed buildings for 75%. Dismantling removes the tiles. Your units walk clear automatically before removal; a bridge that would disconnect your station must be replaced with another route before removal. Dependent orphaned blueprints also cancel with a full refund. |
| Work | Click an owned building. Your Friend walks there and operates it. |
| Recruit | W / Workers → Recruit worker (6 alloy + 8 food, 6 seconds), then job +/− controls. Queue up to five; cancel a queued worker for a full refund. Guards can follow the Friend or defend their current position. |
| Move | Click completed flooring or use arrow keys. Friends and workers cannot cross void or unfinished blueprints. Connected enemy and neutral flooring is walkable. |
| Explore | Drag to pan; pinch, scroll or +/− to zoom. ◎ centers your core; Menu → Find my Friend follows the commander. |
| Fight | Click a visible enemy unit or building. Your Friend walks into range and attacks. Following guards support building sieges. |
| Objectives | The four public monolith indicators locate objectives. Click a monolith on the level to approach and capture. |
| Settings / exit | Menu → sound, reduced motion, wallet, help or confirmed forfeit. Custom hosts may pause; online matches cannot. |
On phones and tablets, shortcut hints stay hidden during touch play. Using a hardware keyboard outside text fields reveals them; touching the game hides them again. Landscape ability and camera controls sit at the bottom safe-area corners; narrow portrait screens keep space for the central action dock.
- Everyone builds in one 81 × 81 sector. Each match seeds four random monolith locations with a separate landing platform around each. Two–four commanders use fixed corner slots, with opposite corners in two-player matches. Starting supplies are equal and players are shuffled among seats. Layouts have rotationally balanced objectives with equal distances from every corner. Bases start with only a core and no resource deposits. Objective locations remain fixed once play begins.
- Enemy bases have no map markers. The server filters unseen tiles and units. Discovered floor remains as last-known terrain; new construction outside sight remains hidden and moving enemies vanish outside current vision. Discovery never exposes a rival's complete live state or resource totals.
- Choose any of seven tetromino shapes. Blueprints attach to connected flooring or another queued blueprint, without overlap. Builders and the Friend finish reachable prerequisites in order. Maximum 180 commissioned modules per player.
- The core has two worker beds; Quarters add four each, with no separate 24-worker cap. Each specialist room has two slots. The Friend supplies two work power; workers supply one after reaching their workplace. Idle builders repair a damaged core using alloy.
- Alloy/second =
0.30 × mining power + 0.15 × core salvage power. Energy/second =0.45 × engineering power − building upkeep. Food/second =0.8 × farming power − 0.13 × living workers; the Friend needs no food. One farmer supports about six workers; two staffed Garden slots support about twelve. Unstaffed production buildings generate zero; the Friend can operate them personally, and core salvage requires the Friend actively working there. Production caps at 300; refunds can overflow storage without being discarded. - Recruitment is a serial six-second queue, capped at five pending workers. Payment and a bed are reserved immediately. Canceling refunds all 6 alloy and 8 food. Lost housing holds arrivals until a bed opens; a destroyed workplace returns its recruit to general building duty.
- At zero food, worker mining, construction, combat and worker-staffed turret damage gradually fall to 50% over 30 seconds. They recover over 30 seconds with food. Food shortage does not penalize Friend abilities/work, farms, research, healing or reactors; electricity is still required for building operations. The food counter shows the net rate; Workers shows production, upkeep and queued recruitment.
- Blueprint progress/second =
0.16 × construction power. No worker or Friend present means no progress.
Compact icon actions (with hover help and accessible names) stay in a shallow action strip beside the Build/Workers buttons; on narrow screens swipe the strip sideways for more actions. Two icon toggles beside Shield/EMP control the Friend (single figure) and free workers (group). Crossed swords mean Aggressive; a leaf means Peaceful. Click once to switch. Aggressive sends unassigned builders to fight nearby visible enemies over completed flooring; Peaceful returns them to general construction or idle. Assigned specialists and turret staff stay at their posts in either mode. Guards explicitly ordered to follow or hold are mobile combat units. Ordinary workers deal 3 DPS; guards deal 7. Workers begin peaceful, the Friend aggressive. New workers inherit the group's setting. Direct Friend movement/attack orders take priority; staffed turrets continue defending in either mode.
Buildings cost alloy only to construct. Every completed module, including idle buildings and passages, consumes electricity. Blueprints, wreckage and dismantling modules consume none. The core uses 0.02 energy/s. Energy also powers Friend abilities.
At zero energy, production, recruitment, turrets, healing and research bonuses shut off immediately. Reactors, movement, manual construction/repair and core salvage keep working; beds and paths remain available. Assign engineers or send the Friend to a reactor to restore power. Upkeep remains the station’s full demand during an outage, so generation must cover its load. The HUD shows net energy/s; Workers shows gross generation and building demand.
| Building | Alloy | Energy/s upkeep | Purpose |
|---|---|---|---|
| Passage | 4 | 0.01 | Extend walkable flooring |
| Reactor | 12 | 0.03 | Power for buildings and abilities |
| Garden | 10 | 0.10 | Food production |
| Foundry | 14 | 0.12 | Alloy production |
| Quarters | 14 | 0.08 | Four additional worker beds |
| Defense | 16 | 0.20 | Staffed turret: 5-tile range, fixed 8 damage/second |
| Research | 18 | 0.14 | +25% on-site decoding speed per science work power, capped at +100%; no remote captures |
| Infirmary | 16 | 0.12 | One medic: 8 HP/s; two: 16 HP/s within four tiles |
| Ability | Control | Energy | Effect | Cooldown |
|---|---|---|---|---|
| Shield | Q / Shield button | 20 | 65% damage reduction for 6 seconds | 18 seconds |
| EMP | E / EMP button | 15 | Disable visible enemy turrets within 6 tiles for 6 seconds | 15 seconds |
Failed or out-of-range casts cost nothing. Red projectiles are hostile; friendly fire is green/gold. Turret range rings show danger, blue rings and a timer mark disabled turrets, and the Friend's shield and HP are visible on the map. Research accelerates a Friend physically decoding a monolith; it does not grant combat damage or capture remotely.
The Friend has 120 HP and deals 12 damage/second to units and 18 to selected buildings; workers have 60 HP and guards deal 7 damage/second within 2.2 tiles. Incoming unit damage resolves simultaneously. Enemy destruction pays no refund; destroyed buildings leave walkable wreckage. Select your own wreckage to clear it without a refund, or rebuild over its exact empty footprint at the normal alloy cost. Clearance and rebuilding cannot disconnect completed station paths. The core uses the displayed 100 hull as its health. Destroying it eliminates its commander. Core repairs cost 0.5 alloy/second per repair work power and restore 1.5 hull/second per power.
While powered, the core heals nearby units within three tiles at 8 HP/second. An Infirmary needs power and living assigned medics working on site: one heals at 8 HP/second, two at 16 HP/second within four tiles; an empty Infirmary cannot heal, even with the Friend working there. Healing begins after four seconds without taking damage; overlapping healing points use the strongest rate rather than stacking. A downed Friend respawns at their surviving core after 15 seconds. Lost workers must be replaced. Flying raids are disabled, including requests from old clients.
A living Friend within 2.5 tiles captures a monolith in 10 seconds, reducible to five with powered, staffed Research. Nearby rival Friends or guards contest it and pause capture. Ownership persists after leaving. Hold all four uncontested for 60 continuous seconds to win; an enemy capture attempt or contest resets that countdown. The other victory condition is last core standing. Ownership, contests and the countdown are public. Full-screen results name the winner and cause.
AI uses the same costs, physical construction, paths, capture and combat rules. Easy/Normal/Hard decision intervals are 6/3/1.5 seconds. Bots scale reactor staffing with current and queued building demand, recover from outages, build an economy, recruit guards, approach shared objectives, fight visible enemies, retreat when low on health, and use the same energy/cooldown-gated abilities. AI balance remains an early-access playtest item.
Use the self-hosting guide for local setup or a public Docker/Caddy deployment, including one-domain and separate game/API-domain configurations, HTTPS, backups, recovery and upgrades. The hosting comparison covers AWS Lightsail/EC2, GCP Compute Engine, other VPS providers, managed containers and a static frontend with a separate backend.
Farfield's production layout uses farfield.fun for the game and api.farfield.fun for the API. Both can run on one dedicated machine. Self-hosters can instead use a single domain. Run one authoritative game-server process; multiple replicas and automatic failover require match ownership/routing work.
The free ranked Preseason is enabled by the production AWS release. Generic self-hosted servers keep it disabled unless configured. Use local previews for future testing: npm run preview:local starts an isolated ranked game without paid AWS preview infrastructure.
Requires Node 22.18+ (Node 24 recommended) and npm.
npm ci
npm run devOpen http://localhost:4173. The server listens on 0.0.0.0; another device on your network can use the machine’s LAN address where its wallet supports it. Public play should use HTTPS. Rebuild/restart after source changes; this is not a hot-reload server.
npm run typecheck
npm test
npm run check
npm run buildBrowser automation belongs in Browser Testing, using its installed Chrome:
TEST_URL=https://4173--main--ai-dev-01--daniel.kethalia.com npm run test:browser
TEST_URL=https://4173--main--ai-dev-01--daniel.kethalia.com npm run test:walletconnectThe current browser suites are tests/submission-browser.mjs, tests/touch-browser.mjs, tests/combat-browser.mjs, tests/power-browser.mjs (npm run test:power) and tests/live-four-player.mjs. Older dashboard-specific suites remain as historical fixtures and their selectors are superseded. Wallet/RPC/artwork mocks run only inside browser tests, never in the public application. See validation and workspace handoff.
FriendSDK v0.1.2 is packaged in vendor/rarefriends-friendsdk-0.1.2.tgz from upstream commit 762d6f58a73ace723f7f82dc1a61bfa036c21edc. No SDK source modifications. Canonical idle/walk sprites are decoded through its sprite reader, including Colossus’s supported side-facing clips. The iframe retains sandbox="allow-scripts" and the SDK CSP.
The trusted host owns RainbowKit and wallet requests. The sandbox uses a bounded private MessageChannel for game commands, selected-Friend art, launch preferences and opening trusted wallet UI. It never receives a provider or signer. Only the exact current SDK iframe can use that relay. The room server ticks every 100ms; the trusted host receives authenticated server-sent events about every 250ms and relays monotonic revisions over a private port. The client interpolates character motion between snapshots; commands remain ordinary authenticated requests. Presence requests occur on menu/visibility changes, with heartbeat detection and bounded reconnect backoff. Canvas draws on animation frames.
The backend /api/friend-rpc read proxy avoids duplicate CORS headers observed from the public Robinhood RPC. It permits only required ownership/artwork reads, owner-filtered Transfer history, chain/block reads and native balance queries. No transaction submission, signing, arbitrary contract calls or collection-wide scans. Optional server-only FRIEND_RPC_URL selects an upstream provider. The trusted host uses same-origin API requests by default; set build-time PUBLIC_API_ORIGIN and server-side FARFIELD_ALLOWED_ORIGINS for a separate API hostname.
RainbowKit matches the game’s navy/sage theme. The connection screen offers Browser Wallet, Zerion, MetaMask and WalletConnect directly; Zerion and MetaMask use their dedicated RainbowKit connectors for extension/mobile handling. The public WalletConnect project ID is configured; override with WALLETCONNECT_PROJECT_ID=your-id npm run build. An explicitly empty value builds installed-wallet-only connections. Library compatibility pins for cuer/qr, ws and the wagmi/chains build alias are retained.
Rooms run in one authoritative process and expire after two inactive hours. Set FARFIELD_STATE_PATH to an absolute private file path outside the web root to enable practice-room snapshots every five seconds and on graceful shutdown. The prepared cloud deployment and current preview enable this; without it, rooms reset on restart. Recovery retains the same station and seat without simulating downtime; a crash loses changes since the last successful snapshot. Reloading the same tab restores your seat after reconnecting the same wallet and verifying the same Friend. Closing the tab or changing browsers does not preserve practice seat credentials. Online disconnections longer than 60 seconds forfeit even when every tab is hidden; simultaneous expiry ends in a draw.
Player sessions use displayed Friend IDs protected by unguessable room capabilities. The SDK verifies ownership in the client; the current game API does not separately attest wallet ownership cryptographically.
This needs a Node backend; static GitHub Pages alone cannot host it. Shared-host rate limits, bounded rooms and request sizes are included. The private snapshot store supports one process; there is no multi-instance coordination, ranked rating system or ranked matchmaking. See hosting options and cost estimates and the self-hosting recovery procedure. Human game balance and performance on physical phones remain playtest items.
FriendSDK and canonical Rare Friends art: spokesz/friendsdk. See third-party notices. Station graphics, UI, gameplay and multiplayer implementation are original; rymdkapsel supplies genre inspiration only. UI audio uses the SDK sound kit. Fonts use system fonts and Georgia.
The required SDK game definition is runtime scaffolding. Alloy, food and energy are simulated resources. All playable matches are free.
See submission draft. The builder has authorized submission after the live multiplayer readiness checks.