I'm currently in the process of learning Scala, and decided to use this blog to share my learning curve with the rest of the world.
Goal
I am going to create a large-scale simulation as experienced in the games Ceasar, Settlers or CivCity. I do not pretend this will result in a full-blown game, but it will contain many of the aspects found in those games.
For those not knowing those games, the concept is simple: you, the player, are expected to turn a piece of land into a thriving city. This is done by attracting citizens, having them harvest food and resources, having them process those resources into essential and/or luxury goods, and not going broke in the process.
I chose this goal for two reasons: first, one of the selling points of Scala is the support for event-based Actors and the possibility to run thousands of them in a small JVM. To me, this sounds exciting. Secondly, creating simulations is just a lot of fun.
Prerequisites
I am not planning to write a tutorial for absolute beginners; the best way to understand each step I make is to be me. As it turns out, being me is a not a transferable skill, so let's assume the following requisites:
Knowledge
When writing the blog entries, I will assume the following knowledge:
- Experience with programming Java;
- Knowledge of functional programming constructs as experienced in e.g. Python or Haskell – especially higher-order functions and type inference;
- Scala basics as explained in A Brief Scala Tutorial and Scala by Example.
Software
Furthermore, I will assume the reader has the following software installed: