Important change: Memory parsing

Starting from October 26, 11:00 UTC, the Memory object parsing will run inside a game script upon accessing the global variable Memory for the first time, and not on the server side before the script launches, as before. It means that the CPU cost on executing JSON.parse will be counted as your script expense.

This change will mostly affect those players who use Memory to store large amounts of small objects that require a long time to parse. Optimizing Memory structure instead of merely saving its volume will now become an essential part of the game process.

You may use the following code to check how much time your current Memory structure parsing takes:

var stringified = JSON.stringify(Memory);
var startCpu = Game.getUsedCpu();
JSON.parse(stringified);
console.log('CPU spent on Memory parsing:', Game.getUsedCpu() - startCpu);

Also, we are going to allow using raw Memory data as a string object, in case if you want to implement your own serializer/deserialzer instead of JSON.

Changelog 2015-10-12

Gameplay changes

  • Increased maximum creep size from 30 to 50 body parts.
  • Roads now can be built in rooms with any Controller Level, and even without controller.
  • The maximum number of construction sites per player is 100.
  • Increased available extensions number on RCL 7 from 50 to 80.
  • Increased the amount of WORK body parts required for Creep.reserveController method from 24 to 40.

API changes

  • Added new constants FIND_MY_CONSTRUCTION_SITES, FIND_HOSTILE_CONSTRUCTION_SITES.
  • Each API method that changes the game object state (like move, transferEnergy, createCreep etc.) consumes constant CPU amount rather than zero usage before. Learn more in this article.

Important change: CPU cost of API methods

The world of Screeps is in constant development, and so are players' achievements in controlling their colonies. Some players have managed to achieve such a high level of optimization of their scripts that they now rule hundreds of creeps simultaneously. We are really impressed by their performance. However, it created a new situation that requires our interference.

The matter is that when a player optimizes control of a large number of creeps so that they stop spending CPU, he or she becomes capable to create a large number of game objects that puts the server under a huge pressure. Our CPU payment system was developed in order to let players compensate their expenses on the server load they create and to encourage optimizations. However, this new type of load becomes unaccounted. It leads to trouble for all the players since we can't scale our servers in such circumstances. We were considering various ways to solve this problem including limiting the number of creeps, but finally decided to act more in the spirit of a programming sandbox game.

Starting from October 12, 11:00 UTC, each API method that changes the game object state (like move, transferEnergy, createCreep etc.) will consume exactly 0.2 CPU rather than zero usage before. The CPU cost of such methods will be marked as CONST in the documentation. I. e., it will look the following way:

var startCpu = Game.getUsedCpu(); 
creep.move(LEFT); 
console.log( Game.getUsedCpu() - startCpu ); // 0.2 
creep.transferEnergy(spawn); 
console.log( Game.getUsedCpu() - startCpu ); // 0.4

If the object state change has already been requested in the current tick, the CPU won't be spent (UPD: this statement is not valid anymore).

If you have 100 creeps, your expenses to move them will be 20 CPU even in the case you don't use any pathfinding computation. By optimizing your colony so that the same functions are performed by 50 creeps rather than 100, you will get the effectiveness increase by 10 CPU.

Therefore, saving CPU will require you to optimize not just code algorithms, but also the game tactics itself, using creeps, and enlarging their bodies.

While we understand that all the players will see CPU usage increase in their scripts, the game in general will benefit from it: we'll be able to calculate our server expenses and scale them more precisely, which will give us faster ticks and better gaming experience for all the players.

To compensate for some negative after-effects of this change, three more edits will be implemented in parallel:

  • The maximum creep size will be increased from 30 to 50 parts.
  • Roads will be possible to build with any RCL, even zero, i.e. in neutral rooms and rooms without a contoller! You'll be able to build paths to your remote mining area by decreasing the required number of MOVE body parts and enlarging carrier creeps (the optimal configuration for a carrier on a road is 16M 32C).
  • During a limited time period after this change, a special promotion will launch: the 14,000 CPU Credits package with 40% OFF the base price of a Credit, so you pay just $28! This promotion will last one week, till October 19.

 


 
UPD: The CPU change will be implemented gradually as the cost will slowly increase according to the schedule:
  • October 12: 0.05 CPU per operation
  • October 14: 0.1 CPU per operation
  • October 16: 0.2 CPU per operation

Game situation review: October 5, 2015

The September season has passed. A new sector E15S5 was opened and was immediately populated by strong players. In order to let novice players get accustomed, a Novice Area was opened in the special sector W15S25. After some time, and it will be accessible from the main map. We plan to keep one dedicated sector as a Novice Area at any time, it will be moved as activity increases.

А new sector E5S15 is also open and gradually being occupied. Here is the current map view:

The season leaders are NhanHo (GCL 12), 1st place, and DarkTrooper7 (GCL 12), 2nd place. They did not get involved into serious bickering, but focused on embracing the maximum number of sources which allowed them to beat top players by roughly 3 rooms. Here is the September Top 10:

The last season (August) leader, chris (GCL 8), did not claimed the Expansion Rank leadership this time and finished as merely the 19th. A monthly result is a very rough approximation of the power balance. Thanks to user danny (GCL 7) who made an auto-updated chart to monitor users progress in real time. Here is the September chart:

This chart shows not only one-on-one duels but also individual status of players who, for example, fell into a coma (strict horizontal line), like Rumatah (GCL 6) 09.20, waited to attack, was attacked, or self-destructed, like Aeneas (GCL 7).

For the bronze, AzuraStar (GCL 11) clashed with Hernanduer (GCL 10), and some fighting ensued as well: AzuraStar wiped 3 Hernanduer's rooms:

Aftershocks of this battle may still be seen: Hernanduer's controller in E12S5 is imprisoned - AzuraStar besieged it with walled rooms and doesn't let the downgrade timeout to expire. It's an interesting tactics that we'll cover some time later.

Previously, Hernanduer were siegeing a DunknDonuts' (GCL 3) stronghold in W7S14 for several days. The offense turned out to be successful: the room was included into his domain.

Then Hernanduer supported the campaign against abnessor (GCL 5), destroyed strabino (GCL 4) and Gipphe (GCL 2). So he may be awarded the title of the warrior of the season, and "his" sector, the flashpoint of the season.

Abnessor's defeat was initiated by the red-white-blue alliance. The same fate loomed for all the rest in the sector W5S5, and now there are only 2 competitive rooms in it: W1S4 (theAEmix, GCL 8) and W1S3 (unimatrixZero, GCL 4). We're definitely having a monopoly. If we show sectors schematically according to their total RCL leader, we'll see the following picture:

* Reservation is equivalent to level 2.

We can see here a telling situation: the three-colored devour three sectors: W5N5, W5S5, and W15N5. For example, here is how Vision (GCL 7) does that:

In the sector W15N5, Vision has stepped into a fight for dominance over the whole sector. Initially, sources in the center of the sector were controlled by Rumatah who was gathering them into his remote colony in W14N7, but Vision started to systematically drive him out of the sector. First, he blocked his mining activities in remote rooms, then he besieged the W14N7. Rumatah tried to counter-attack in Vision's rear rooms by destroying his infrastructure in the W12N7 and keeping doing the same in other rooms as well. This battle is still ongoing at the moment.

Room history playback feature

In this review, we are happy to announce a new major feature that many players have long waited for.

Would you like to see how your creeps have acted for the past several days while you were absent? You were attacked, and now you need to review how the attack had gone and how your defense had behaved? Or you just like to watch your colony the 10x speed?

Now it becomes possible with the room history playback. All the actions history in all the world rooms for the last 500,000 ticks (8-12 days depending on the tick duration) is saved and available for review by any player. Click on the "Replay room history" button in the room properties to playback.

You can set the review speed from 50% to 2000%, pause, rewind to any moment, and review any objects and their properties in the same way as with live objects in the game.

Moreover, history playback is available without signing in. By using the "Share" button, you can send a link to a specified moment in the room to anyone, and he or she will be able to watch the course of the game without having a Screeps account.

To demo this function, we've prepared a collection of links to some interesting battles for the past several days:

If you have interesting moment in your history, share them in the comments below the article!

New main loop architecture

We have just implemented an important feature which affects how the runtime engine treats your script modules. Now we have two module architectures available at the same time.

What is new here is the way you main module is executed. In the old-style architecture, it is executed every tick, and every module required from it is also executed every tick. In the new architecture, your main module should contain the module.exports.loop function which is executed in a game loop, while the rest of the main module contents are executed only after a new global is instantiated. It's the same with required modules - their contents are executed only once per global instantiation, after which they get cached. You have to export some functions from your required module and run it explicitly from the main loop. The architecture is switched automatically upon detecting module.exports.loop function in the main.

Here is a comparison table:

OLD NEW

main:

// executed every tick

var mod = require('mod');

mod.foo();


main:

// executed on new global 
var mod = require('mod');

module.exports.loop = function() {
    // executed every tick
    mod.foo();
}

mod:

// executed every tick

module.exports.foo = function() {
    // executed every tick
}

mod:

// executed on new global

module.exports.foo = function() {
    // executed every tick
}

This new style is now recommended. It allows caching of your modules which drastically affects your script performance. Also, you can perform some initial operatons in your modules body (e.g. extending prototypes) which won't be executed every tick, thus saving your CPU.

Game situation review: September 5, 2015

The first season of the release version of the game has come to an end several days ago. Although it was not complete, players have already managed to build inpregnable strongholds, defeat less fortunate strongholds of others, and even experience a lot of interaction with each other in their mutual interest.

There are 9 opened sectors at the moment:

In our previous Early Preview reviews, we registered only top 10 players, though this time we have many more of them, so we'll do the Top 30:

The Expansion Rank August leader is chris (GCL 7), AzuraStar (GCL 7) follows him closely. The common thing about them is that they both have wiped the bronze leader DarkTrooper7 (GCL 7).

Therefore, DarkTrooper7 has become the most often killed player among the leading players, and besides, his defeat became the first military cooperation. Here are some screens of this battle:

It's noteworthy that Rumatah (GCL 5) has travelled very far to carry out his attack, so that his creeps had only 100-200 ticksTiLive left as he approached his target. Rumatah's other thrust against aggressor qthree (GCL 3) from a recently opened sector W15N5 resulted in a very close and equally successful attack.

Later on, chris focused on upgrading his controller and wasn't seen in any battles. Now he's been occupying some distant parts of the map:

After the sector E15N5 was opened, AzuraStar immediately tried to claim it, but DarkTrooper7 moved out to prevent it - and an epic battle broke out, AzuraStar vs DarkTrooper7:

After this battle, AzuraStar was keeping watch for long, amassing forces through two highways into his new base being built in E14N1. And now both AzuraStar and chris peacefully coexist in sector E15N5, while DarkTrooper7 possesses 5 rooms in it.

As DarkTrooper7 and NhanHo (GCL 6) have been staying without rampart defense for quite a long time, they didn't go on to attack each other. But Ranger (GCL 4) in E16N7-E18N7 for example was defeated. This sector is likely to become very hot soon.

AzuraStar has chosen the tactics of very sparse rooms. Their positions are consistent - near centers of different sectors, which has its pros and cons. His expansion into E5S5 also resulted in a fight, and this time it was halted by QzarSTB (GCL 6). This provoked an attack and destruction of a newfangled QzarSTB's base in W4N18.

Later on, rooms were restored from both directions. Now QzarSTB holds one of the strongest positions and is a leader in the number of extensions.

Totally, there are 10 rooms of level 8, but soon there will be dozens of them.

Another sector where AzuraStar has placed his branch, this time silently, is W5S5 (W6S3). It's noteworthy that his neighbours have badges with similar colors, which implies an alliance. Waveofbabies (GCL 5), Vertigan (GCL 5) and KEVIN (GCL 4) have already cleansed this sector of several other players. Red-white-blue badges are likely to multiply even more in this sector after the GCL increase.

One of the main aspects of the game is players cooperation. In future, there will be more interaction opportunities. Meanwhile, theAEmix (GCL 5) is the most notable in this regard:

    • Firstly, he was assisting AzuraStar in developing the room E3S4 by delivering energy from adjacent rooms.
    • Secondly, he himself found a "provider" in DXWarlock (GCL 4) who still sponsors his room E7N1.

Energy is the source of life, and the more effectively it is mined and used, the stronger a player. The transportation method most visible from above is "from hand to hand in a chain." This algorithm is utilized by AzuraStar, QzarSTB, and The_General (GCL 5).

The_General was the first one who endeavoured energy mining from protected sources, and did it pretty well, though currently he has paused his work with keepers. So as for now, nobody dares to face Source Keepers.

The_General's domain looks very impressive due to a dense placement in his only sector E5S5:

These riches once were on the brink of destruction: DarkTrooper7 seized the moment of coma but couldn't make it to the last spawn - The_General revived and repelled his attack.

A modest counterattack followed, but without much success.

The map is getting revealed more and more, players develop by leaps and bounds, new players come, others go or fall into a coma, fight remnants are notable in many places. Here are some scenes:

Soon we plan to launch a new function to playback history of any room. This will allow you to replay and see the most interesting moments on your own.