I thought I would take some time off this nice afternoon and talk about my upcoming game codenamed City Plots. The idea for the game came from many sources. The goal was to take the best aspects of online strategy games, and make one perfect game.

Without wasting any more precious programming time, I would like to explain how a very crucial component of the game works. When you register for the game, you have to name your city. You are given a small parcel of land (100sq. units). In that land you can build buildings. Much like traditional rts’s, you can choose where these buildings are placed. Most online games like City Plots do not allow you to chose where to put the building. Many times you only build one of them and expand that one. The flaw here is that a real city doesn’t have one building that everyone lives on, unless… well I’m not going there.

Upon entering the buildings page, you will be presented with a map of your city. You can scroll around to view any area you have expanded into outside of your viewing threshold. The map shows pretty little icons for each building type. If you click in an empty square, you can build a new building (assuming you have the existing prerequisites). This type of game model allows for rapid creation of a city. You can build two buildings at once, but you have to have enough workers available to do the jobs. The more workers you have, the faster constructions goes.

What types of buildings will there be?

There are many types of buildings in City Plots. At first you start out with very primitive structures as your city is small. As you grow, there will be a need for various services. You will be able to accommodate these by meetings the prerequisites listed. After all, you can’t build a weapon shop without an ore mine.

The technical side

No to fear! This isn’t that hard to understand. To create a city for each user, and array of all possible units must be created. Instead of doing this by hand (which would take an awful long time that could be spend doing other non-productive things), I used a simple loop to create the array.

$blocks = array( array( array() ) );

$x = 4;
$y = -4;

while( $x > -5 )
{
$blocks[$x][$y] = $blocks[$x][$y]['blank'];

if( $y < 4 )
{
$y++;
}
else
{
$y = -4;
$x–;
}
}

That creates what I call a ‘blank slate’. The array is then stored safely in the database. What the script basically does it start at the uppermost x value (we do have to make a graph-like system) and go through all possible y values starting at the lowest. Once the y value reaches the largest value it can, the x value is then lowered one step. This process is continued until all values are generated. When the x value reaches it’s lower limit, the loop breaks and the array is ready for storage. A similar method is used when adding new rows, et cetera.

That’s pretty much it for now. Expect more to come on the inner workings of City Plots.

You can now create an account on City Plots (working title) as well as create your city. There isn’t anything to do yet. You can view the game’s change log to see exactly how the game is progressing. I would like to take this time to test the account management scripts for bugs that may appear. If you happen to find a bug, please let me know asap. Other feedback is also requested.

The game is located: http://cityplots.ojaisoft.com