Advertisement

Anyone tried Screeps, the MMO for programmers?

Started by June 21, 2015 12:29 AM
59 comments, last by Dragonsoulj 9 years, 2 months ago

I think alliances are inevitable in the game, you simply can't take on everyone at the same time as you'd probably have to defend from various attackers simultaneously. Of course, that might be a pretty interesting game to watch I suppose.

So, what strategies are being taken when it comes to building creeps? I currently just take the amount of available energy into account and build new creeps based on that. Still using mostly statics bodies.

This seems really neat. If anyone has an available key, can you send it my way?

*Edit* I got one

Advertisement

This seems really neat. If anyone has an available key, can you send it my way?

I'll PM you one now.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

Well, I got obliterated by Tvoy laugh.png guess I'll respawn this weekend and build something a little more robust.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

Well, I got obliterated by Tvoy laugh.png guess I'll respawn this weekend and build something a little more robust.


There's a guy seizing the room below me. I've got about 24h, but I'm going to poke a small hole early and try to zerg him and secure the room, since I'm nearly optimal in my current room. I just need to set up my defenders and come up with a plan to hold the second room once I have it.
void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.


So, what strategies are being taken when it comes to building creeps? I currently just take the amount of available energy into account and build new creeps based on that. Still using mostly statics bodies.

Granted I have to rework some of my gathering scheme, I presently cap off my creep count at a set number (whatever I am feeling at the time). I'll generate my gatherers first, up to say or 5, then any other roles (fixers, builders), then I have bulkier gatherers fill the void.

Advertisement

Also, here are two useful bits of code. One is a respawner for if you want to keep a certain set of creeps: https://github.com/avdg/screeps/blob/e98cf551ec3393c2c165d9a465851ee843694d2e/scripts/unit_deathChecker.js

And the other is something I keep losing and come back for. A memory cleanup. Keeps your Memory.Creeps list clean, removing all dead creeps: http://support.screeps.com/hc/communities/public/questions/201107272-Small-snippet-to-clear-the-memory-of-dead-creeps-

Do read the comments for some usage notes. Don't want to wipe your memory before you use it.

Managed to get my controller to Lv5, which raised my GCL to 2.

Got bored and decided to Leeroy. I wiped out the room immediately outside mine and was almost finished with the one beyond that, but then the guy that owned the first room started sending in super-units and pushed me back to my base. I was able to hold them at bay for a half hour or so, but then he altered them to be more aggressive and they wiped out my attackers. At that point I just shut off my spawner and suicided all my remaining creeps and construction sites. :p

I know the general strategy I want to use now, but scripting in this game is such a pain in the butt what with the debugging in realtime. The required vigilance is also problematic. It's starting to feel a bit like a chore already, tbh.

Don't know if I'll continue. Will decide later.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

There are solutions around the debugging which can mostly be found in the form of unit tests. You use run them using node.js combined with a unit testing framework. Write a bunch of mocks for game functionality you want to test and viola. It will of course be more work to build stuff but at least you know it checks out when you put it in production.

I think once you have a basic framework covering production, construction and planning the game becomes more about strategy.

So, anyone still playing but me? I scrolled around the map to find any of you but couldn't find your room and looking by the ranking it seems your AIs have been obliterated and never respawned.

Over the past week I kinda came to the conclusion that I tried to solve too many issues at the same time in code. I wanted to automatically build miners, balance trucks, find the most ideal energy distribution scheme, build creeps based upon the amount of energy in store combined with production statistics and threat level. So I ended up with a big ball of clutter that tried to do everything and failed at it all.

So I took a tinsy detour and refactored the whole thing into a message based system where each message would pretty much just do 1 thing(heh, turns out SRP isn't such a bad idea after all) and the AI executes message by message, measures the amount of time left and if CPU is about to run out it will cease message processing. Much more robust and turns out, much easier to develop as well. Most things are still done manually: if I want to mine a source I have to issue a command and the AI will then spawn a builder and trucks for it but with these basic commands I can start building more complex ones and then a decision making module that will trigger.

This topic is closed to new replies.

Advertisement