[dependencies] screeps-game-api = "0.17" log = "0.4" fern = "0.6"
In Rust, objects are not persistent across ticks by default (because the Wasm memory is reset or re-instantiated). To persist data, you have two main options:
Before we discuss Rust, we have to acknowledge the elephant in the room. Screeps was built on for the server backend and V8 for the simulation. The game’s API— Game.spawns['Spawn1'].spawnCreep([WORK, CARRY, MOVE], 'Harvester1') —is fundamentally JavaScript.
is an MMO RTS sandbox game where players control their empires entirely through real-world programming. While traditionally played using JavaScript or TypeScript, leveraging Rust via WebAssembly (WASM) provides unparalleled runtime performance, type safety, and memory predictability. This article breaks down why Rust excels in the Screeps ecosystem, how to build an AI loop, and how to conquer the game's strict CPU constraints. Why Choose Rust for Screeps?