Screeps, a game for programmers

Earlier this year, I discovered Screeps. I hesitated buying it at first because it’s a subscription based game (MMO), but I did it anyway, because it can still be played without subscription, although with limited CPU (I’ll get back on that) and they plan to release the server software, so that we can host our own worlds with custom settings.

What is Screeps

Using the javascript API of the game, we write the AI code of our units which will continue to play while we are offline.

Screeps

Following the suggestion of the game, you should play the tutorial first, it provides a good code base to improve upon. Once you start playing, you write code to make your units do more things, such as: gather ressources, build structures, repair structures, fight other players, etc. Then, you die.

Dying is not the end though, you can re-spawn in a new room with your existing script which, if you wrote it right, will bring you back to the state you were before quickly enough.

I mentioned earlier that this game is subscription based, what this mean is that your script has a CPU time limit, the unit of it is “CPU”, for example a call to get the list of units might cost 0.5 CPU, by default, you get 10 free CPU and your CPU budget resets after each game ticks, once you try to call something that would exceed your CPU for that tick, the game will output an error and everything after that will not be executed. The game does have a system allowing for CPU spikes, which is cool.

Ressources

Add a Comment

Your email address will not be published. Required fields are marked *