Screeps Part 10 is the latest in my screeps story, you can read the rest here.

RC6 Twice

After the respawn in the last post, my rooms have been plodding along nicely. I now have 2 rooms at RC6. This means 2 rooms extracting and selling minerals.

My AI doesn’t make full use of labs yet so instead of leaving minerals alone I extract and sell as much as I can. This is leading to a pretty healthy credits balance which I will be putting to use in the future.

Having 2 high-level rooms is great. My economy is performing pretty well and when I add a third room to the mix it should be lifted to a self-sustaining level quickly.

Mining another room

Way back in part 2 I made some creeps to mine from other rooms I didn’t own. It wasn’t hard with my new AI to re-implement them.

The workflow is something like this:

  • Am I full?
    • Yes:
      • Am I in the drop off room?
        • Yes: Run normal hauler code
        • No: Move to drop off room
    • No:
      • Am I in the harvest room?
        • Yes: Run normal harvester code
        • No: Move to harvest room

My AI has all the code I need to do this already.

My creep director checks for a few things in a creeps memory before it runs the normal functions. In this case, the goToRoom memory entry is used to specify a room to go to. If this key exists the director runs a separate function instead of the usual function for that creeps action. Once it is in the room it needs to be in normal operations resume and the creep performs its intended job.

Attack!

It’s time to give my AI some teeth.

It’s time to stop being passive and instead take what I need.

E63S74

A 2 source room held by a player who’s AI seems very basic.

The only barrier for me is their tower. It can destroy one of my creeps before I can reach it. So I need to feed infantry into it until it runs out of energy.

Half of the battle in screeps is observing the way the other players AI is working. My opponents AI has some exploitable flaws.

  • It tries to pick up any dropped energy.
    • When my creeps die to the tower they send creeps to pick up the energy.
    • This puts his creeps in striking distance of mine.
    • Killing all his creeps means no resupply of that tower.
    • All his creeps come to the energy. This is the problem I solved in part 7.
  • If their creeps stray too close to the room exit they pass into mine and make no attempt to flee.
    • My 2 towers destroy them very quickly.
  • They are at RC5 but only have 5 extensions.
    • Their creeps are underpowered, it’s like attacking someone at RC2.

After sending 2 creeps to their death I had caused a pretty big disruption to their room. They are down to 2 surviving creeps which is affecting their supply situation. No deliveries to spawn or the tower will be a great help to my war effort.

screeps part 10 attack
Poor cannon fodder

4 creeps in and the tower is down to 50% energy but I’m now feeling the energy use.

My attackers aren’t cheap, and they dropped a road which caused builders to spawn who in turn use more energy. I may destroy myself with this war. That is if it wasn’t for the energy support part of my AI. The room I was launching my attack from was beginning to suffer on the energy front which triggered my second room to send some energy over to help out.

Capture

Once the tower ran out of energy it was a quick and painless move to destroy the tower and the spawn (their only two structures).

At this point, I swapped my instructions from attacking the room to claiming it which is going to take a long time. Given the average tick takes around 4 seconds it’s going to take nearly 2 days to downgrade from RC5 to RC4. After that, it has to downgrade through every level before it is unclaimed.

I could increase the speed of the downgrade using a creep but the creep would need a minimum of 5 CLAIM parts, 3000 energy. I can’t afford that. All I can do is wait.

If the other player hits respawn the room will become available instantly. To that end, I have a creep sat waiting to claim the room just in case.

Its a waiting game now.

Get Screeps

You can follow my progress on my profile.

You can read more about Screeps on their site. I purchased it through steam giving me the permanent 10 CPU and the desktop client.

You can see my code as it was at the end of this post here.

Screeps Part 10 – RC6 Twice and a Third Room

2 thoughts on “Screeps Part 10 – RC6 Twice and a Third Room

  • 20th January 2017 at 8:26 am
    Permalink

    Love the series. Just started playing last week and I’m at the point where you rewrote everything. Funny that I started out with a multi-job creep that prioritised harvesting, then building, then upgrading and now am moving towards specialised creeps (hauler, miner). You did it the other way around!

    Reply
  • 24th January 2017 at 10:20 pm
    Permalink

    I’ve read your series. It’s interesting. Started playing on my own 2 weeks ago and i’m loving it.
    Used your ideas code inspirations for my own rooms and creeps. Just implemented my own needs. Thanl you. Looking forward to read a new post!

    Reply

Leave a Reply

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