Monthly Archives: March 2013

Dev Update #4

Lighting, Fluids, Platforms & Random Rooms

This is the 4th post in the  dev update series. The last two weeks have been pretty productive and a couple new features have been implemented.


Liquid fluids have been implemented to support lava and water to hinder the player in his quest to exit the dungeons. Lava for example, when fallen in, will hurt the player badly. The player will need to somehow cross the lava (if possible). The cool thing about the liquids are that they can flood areas. You can tell the flooding control to start filling from X,Y position and it will try to fill up everything from start point to largest X on current Y.



Some rooms are dark and require an illumination source. It’s harder to spot enemies and other dangerous obstacles.

“Lantern with 5000 turns”

Random Rooms

In dev update #3 I mentioned that Suit Guy’s Levels (levels are not to be mistaken for rooms) are randomly generated. At that time I still had to create rooms by hand with the RandEditor, which was annoying (I’m also lazy). And because it was the initial plan; I created a random room generator which can create a room any size, height or width. The largest room created so far is a 8*1500 tile room. The editor can now be used to create specific rooms for specific needs such as bossfight, special room types, etc.

How does it work

The room generation code works in several stages:

  1. Generate a 2d array of given size and mark all as ‘filled with sprite’
  2. Cut a random line until you’ve reached the other side (it cuts from left to right). This will serve as the bottom.
  3. Do the same but this time for the ceiling (there’s some code involved which does pass-way checking.
  4. Open up the cave from ceiling to bottom.
  5. Generate the actual tiles in the level
  6. Generate an outline around the level
  7. Mark parts of the cave as corridors (there’s an algorithm involved to determine wether something is a corridor or not)
  8. Decorate cave & flood areas
  9. Determine the light intensity of the area.

When it completed its generation it’s then handed over to a room class and presented in game.

In a later post I’ll write up more in-depth blog post about the room generation.


If you like the development of Suit Guy and would like to get rid of your Bitcoins or Litecoins; feel free to donate on one of the following addresses:

LTC: LShzpHCESzpcirnVijtwqY33HegHTwyUoU


Dev Update #3

Suit Guy Infinity & Editor

Suit Guy’s level generation code finally got the needed overhaul and is now capable of generating random levels and rooms based on templates generated from the RandEditor. Suit’s level system is based on a grid in which you can place rooms (randomly) with a specific layout; vertical, horizontal or box layout and connects them accordingly. Because each room takes up 1, 2 or 3 spaces in the grid it’s easy to match specific layouts to specific rooms. Here’s a sample of what a level may look like:

You can see that each level is uniquely in shape, corridors and layouts and once a level is generated the room generator takes over and generates rooms based on a randomly picked templates. At this point the generator generates items within the rooms, such as plants, monsters, backgrounds, etc.

The goal is to eventually support random picked quests or puzzles for each room so you can progress to the next in order to finish the level and move on to the next.


Suit Guy’s editor, which previously were included within the game itself, has been re-written as a native OSX Cocoa app and features basic tile placement, object placement and will eventually support item template placement (one in X spawn X item). Here’s a side by side comparison of a room template and the room in game room:

Basic room with randomly picked filling tiles. Nothing too fancy.

This is all for this weeks update. Not much images or fancy graphics. Just a whole lotta code 🙂