Android: Positioning Isometric Tiles & Displaying Levels At Optimum Zoom

The Problem

City Flow is an Android game where players must rotate puzzle tiles until all flows (rivers, paths, etc) match up. Players can play existing levels, or create their own in a level editor. They can zoom in, out, and pan, so as to navigate larger puzzles easily. Whilst playing a level players are on a time limit, so ensuring all of the puzzle is on screen to begin with is very important to ensure the player doesn’t become frustrated having to initially get the puzzle in a good position.

Continue reading “Android: Positioning Isometric Tiles & Displaying Levels At Optimum Zoom”

Android: Asynchronous Map Generator

The Problem

City Flow is an Android game that tasks players with solving puzzles by rotating tiles to make all “flows” match up with no loose ends. Each tile has a flow (e.g. road, path, grass, river) on each side, as well as a height (high, normal, low). There are a few hundred built-in levels, but players can also create, share, and import their own levels for extended playability.

The game features a level generator, where players can specify:

  • Puzzle width (2-15)
  • Puzzle height (2-15)
  • Environment (subset of tiles to use)
  • Whether a blank puzzle should be generated
  • Whether they wish to edit the puzzle before playing

Since a puzzle can contain up to 225 tiles (15×15), each from a pool of 200+ different tile types, the amount of data to process can swiftly ramp up.

Additionally, since this process could take a long time, it must be performed off the main thread (asynchronously). The player also needs to be kept updated throughout the process with current progress, and have the ability to cancel midway through.

Continue reading “Android: Asynchronous Map Generator”