![screeps review screeps review](https://c.opencritic.com/images/games/3628/A4c99wkmdT8Qt6uocZ0biRV2VL9nFquz.jpg)
This has been my last 3 lines of code on my main.js for ages:Ĭonsole.log('-')Ĭonsole.log('CPU Bucket ' + + ' GT: ' + Game.time)Ĭonsole.
![screeps review screeps review](https://cdn.cloudflare.steamstatic.com/steam/apps/464350/ss_71e20a8bc527f3de4edf3149864b47a113ddcd19.1920x1080.jpg)
![screeps review screeps review](https://www.touchtapplay.com/wp-content/uploads/2018/07/castle-creeps-battle-review-1.jpg)
One simple little thing I like doing is having the console print out my cpu bucket at the end of each tick, it's a nice simple way to keep tabs on how everything is performing in realtime. And then later on you can get creative with different methods of sharing that build queue over multiple spawns etc. Determining your build queue for example, you don't really need to be checking your creep count every tick to see what needs building next, but to start with it's perfectly fine to have a simple check every tick, you can leave a little TODO comment in your code to solve that later. Perhaps it's not running that complex bit of decision making code every tick since it doesn't need to etc. That's one thing I like the most is solving that little puzzle. It's really rewarding too to come up with pragmatic solutions at that later stage once you have a decent grasp of the basics. The good thing is that happens later on too when you tend to be pushing your boundaries with multiple rooms, so you can write that sloppy code at first to get by, but then you'll revisit it and rewrite it later. I've written terrible code and had to refactor it later on and/or get creative in order to stop my CPU bucket running dry. That's actually one of the benefits of the CPU cap too.
#Screeps review how to#
You'll quickly learn how to make loops tighter, or how to skip them altogether, and how to minimise wasteful cycles. You'll learn how to replicate data, cache it for later storage, and how to analyse multiple sources of data using only code to determine what the next strategic course of action should be. There's so much data in screeps, and you don't need all of it every frame. The screeps API is not easy or straightforward, reflecting most of the APIs in the real world. Other things screeps will teach you in a huge way: How to use an API that's non-standard. But I still think it's far more important to have ugly code that works rather than pretty code that's broken or useless. Theres so much data in screeps, and you dont need all of it every frame. The (small) downside is that you can learn how to do it the wrong way, but still end up with something that works. Other things screeps will teach you in a huge way: How to use an API thats non-standard. Like you said, because it makes you actually implement functional scripts it does more than what most other tutorials do. I learnt a crap-tonne about javascript from playing screeps.