You can see how complex even simple(ish) problems can get and the bottom line is I'm excited to work on a graph problem that would have had me groaning if it were a computer science assignment back in college But how do you optimize so that you don't have a line of structures marching away into the distance? How do you make sure you're not blocking an important path? What if a previously placed structure is destroyed? Then I need to place another structure close to that structure. Then I place the structure and call that my new start point. So I need to start at the spawn and work outwards in a circle until I find a free square that is more than 1 square away. Today I intend to create a basic algorithm to create efficient building placement to minimize travel time. To give an example I started with my AI placing structures in a random free square within 10 squares of my creep(minion) spawning point. High level players go so far as to write their own pathing and search functions but to start with there's so much to do that you'll just want to get the basics in place and improve on it later.
Screeps tutorial code#
You can make do with very inefficient code to begin with but as your AI empire grows you can find your CPU usage increasing exponentially. The beauty of Screeps is that your CPU and memory are limited.
Screeps tutorial software#
Ok so it's a scripting game? New languages aside, how does it make me a better software developer if the difficult functions like path-finding and searching are already implemented? If you have never developed software before you will want to do a day or two of Javascript practice before starting to work on the game, there is a tutorial at which is recommended on the Screeps page to get you started The online tutorial is available at !/sim/tutorial You can complete the (free) online tutorial and then dive straight into the game with the AI you have developed up to that point. Many of the necessities like path-finding are available in the API so it doesn't take you weeks of work to get going.
Screeps tutorial full#
This means that you can switch languages at will, giving you full freedom to practice that new language you're learning on real problems. A list of these languages can be found at (not my page ). The language used is NodeJS-like Javascript with the lodash library included, however you can use any language which compiles to Javascript in order to write your code. Screeps is a strategic MMO where you write your own AI. Screeps is a game, but it also tricks you into spending hours on computer science problems without realizing it should be considered work. In the last week I have put in 25 hours of self development and I'm still looking forward to doing more. Towards the end of the holidays I found Screeps ( in the Steam sale. I usually manage to force myself to do an average of three or four hours a week of self development which I felt was pretty good considering how long I've been in the job. It can be very difficult to keep this up when most of these languages sink back into obscurity several months later. In order to stay relevant we need to put in the time outside of work to try out these new languages. Every year there seem to be more and more "Java killers", "Java killer-killers" and revolutionary paradigm shifts( Usually from Object-oriented to functional and back again ).