The Daily Commit 1 - 30/05/13

So far, City Builder only does a few things:

  • Generate a list of people with a distribution of wealths around an average, it 
  • Build a grid of land plots with a base “value”
  • When a citizen is put into a plot, increase the value of the plots around it

The steps today were to start the algorithm that decides where to place each citizen. It creates a list that contains all of the plots in the grid. As each plot is added to the list, a Probability Counter increments by the value of the plot. When a citizen is being place, a random number is generated, less than the end value of the counter. If the random number is <=Vplot1 (value of the first plot), then the first plot is chose. If the number is >Vplot1 but <=(Vplot2+Vplot1) then the 2nd plot is chosen, and so on.

This isn’t completely finished, but the start is there.

GitHub

Written on May 30, 2013