Game Development (October 2013)

Not too much has changed over the last couple of months, nothing at face value at least. I’d been doing some testing of the game on a tablet and wasn’t completely happy with the city transition. On the mobile device there was a slight lag when moving between the city blocks as it was generating each city block instantly which had an effect on the performance. In usual cases this would be solved by threading but unfortunately in AS3, threading is currently only available in beta for android applications and currently in development for iOS.

After some time thinking of solutions I came up with changing the city generation from using standard loops which would run through everything there & then to using the game’s frame rate as the loop instead. This would result in spreading out the processing over multiple frames allowing to maintain a good FPS. The only drawback of this method is that it will take longer for the city blocks to be generated which shouldn’t cause too much of an issue, the city will be large enough that the generation would have finished long before the player reaches the edge of the city.

There’s been two other relatively small changes, the first is random buildings which is quite significant for a random city generator. The second change was so buildings at the edge of city blocks get grouped together into one building instead of fragments.

random city buildings

 

This is a rough example just implementing the classes used for the city. The different coloured squares represent the different building types and the roads poking out the sides are the roads which link up to neighbouring blocks.