I moved to a new URL! Check it out!

Game Jam Procedural Generation Part II

Game Jam Procedural Generation Part II
In the last episode of Game Jam Procedural Generation I talked about the "outer layer" of my procedural generation code for my yet to be released game jam game. After the outer layer of stuff has been generated, that can be used to inform the "inner layer" of the procedural generation. So the outer layer in this case is the galaxy that the player can explore in their ship, and the inner layer is the actual side scrolling platformer level that they will explore.

Image


Where do we even begin? First keep in mind that I'm using Otter for all of this stuff, so if you see functions and code that looks totally unfamiliar, it's probably an Otter thing. Also keep in mind that all of this code was written during a 48 hour game jam, so it ain't pretty. I'm just going to be sharing big snippets of code and hopefully try to explain what is happening in each one.

In the last step I talked about how I create a config object to hold all of the possible fields that will be used to generate the level. Here's what that looks like:
class ScenePlatformingConfig {
public int Width;
public int Height;

public int ShipStartOffset;

public int TreasureDirection;
public int TreasureDistanceOffset;

public int GroundLevelOffset;

public bool Explored;
public bool Pillaged;

public int Jagginess;

public int Platforms;

public int DecaySpots;
public int DecayChance;

public int IslandSpots;
public int IslandSize;

public int Rooms;

public string Name;

public int BreakableChance;

public int CreatureChance;
}

Pretty straight forward. Just a simple class that will hold a bunch of values that can be then passed to the classes that generate the platforming level.

Doodle Post

Image

Zublax Episode 7

Zublax Episode 7
I recently sat down with some Phoenix area game developer buddies for our "weekly" podcast about game design stuff. This time we talked about randomness in games and how different types of randomness can influence a game's design.

The full episode is available here!

Doodle Post

Image


Image


Some stuff buried in my notebook!

Game Jam Procedural Generation Part I

Game Jam Procedural Generation Part I
My latest game jam game still isn't quite ready for release, and unfortunately at this point it will have to wait until after PAX, but I can still share some source code from it that will maybe help people out when it comes to procedurally generating things in their games.

The premise of my jam game is that you play as a space explorer type person who is flying a ship around the galaxy searching for planets with shiny ore on them. When the game starts the entire galaxy is procedurally generated. This is a fancy way in saying that a bunch of random things happen and hopefully it works out.
for (var i = 0; i < 99; i++) {
var size = Rand.Int(8, 64);
planetSupply -= size;
if (planetSupply <= 0) {
size = 8;
}
var x = Rand.Float(Width);
var y = Rand.Float(Height);
var d = new Destination(x, y, size);

Add(d);

while (d.CloseToOtherDestination()) {
d.X = Rand.Float(Width);
d.Y = Rand.Float(Height);
}
}

This is my CreatePlanets() function for the map scene in the game. What this does is just creates 99 planets and places them in the scene at random X and Y coordinates. The map scene has a Width and Height defined earlier in the game (in this case I believe its 5000 x 5000 pixels.)

The scene also has a planetSupply field that is defined earlier. Whenever a planet is generated, its size is subtracted from the planetSupply. If the planetSupply is less or equal to 0, all planets created from that point on will be the smallest possible size. This was to control how many huge planets were created in the scene.

Doodle Post

Image


2x Doodle Combo!