Today’s Groups

GroupMembers
ADanielle, Amber, Sanie
BTalia, Bateel, Jane, Sachi
CJennifer, Jonathan, Dorothy
DEnayet, Kim, Gabriel

Homework Review

Today’s Learning Objectives

Assignment

This is the last week of the “Foundation” unit. Look back at the topics covered so far: tile systems, using random, user parameters, using noise, and now thinking strategically.

Begin by completing the challenge for this week. Completing this week’s challenge will result in two posts.

Keep Sketching! For the remaining three posts, I encourage you to build a more complex sketch than usual. Post work in progress as you go.

Challenge: A->B->X

Two of your sketches this week should be based on the challenges below.

For each of the challenge:

Part One: Dot Challenge

Dot Challenge Starting Code

Part Two: Line Challenge

Line Challenge Starting Code

Reading + Viewing Assignment

Procedural Content Generation in Games is a collection of research in the field of procedural game content. It covers many interesting topics including dungeon+maze generation, fractals, L-systems, generating rules/mechanics, and mixing proc-gen and human-authored content.

Read: PCG Book, Chapter 1

Game Maker’s Toolkit is a Youtube channel that features high-quality video essays on game design.

Watch: GMT: Spelunky

If you want to play Spelunky, the original version (not the HD Remake) is free.

Play (Optional): PC, Mac

Special Assignment

Don’t forget to sign up for orientations for the Laser Cutter and 3D printer.

You must complete orientations for the Laser Cutter and 3D Printer before spring break!

Computational Form Strategies

So far we’ve been looking at low-level, tactical topics like how to use random() and noise(). Achieving specific, complex results requires looking at problems from at a higher level. You must first have a clear understanding of the effect you would like to achieve, and then begin to plan a series of steps to reach your goal.

How might you make something like this?

tighten_relax.png

As you work in computational form. You will find than many problems involve the techniques composed in different ways. Hopefully you are already seeing that the techniques we have already discussed are common building-blocks that can be used to create a wide array of forms. This trend will continue as we explore other tools and media.

There are many techniques that are widely used in math, physics, or game programming that provide further building-blocks: brownian motion, noise sampling, L-systems, neural nets, turtles, Markov chains, poisson-disc sampling, particle systems, fractals, metaballs.

Placing Points on a Square

Today, we will be looking at a single problem domain: placing points on a square. There are countless strategies we might use to place the points depending on the look we want to achieve.

pp2.png

Study each example above:

There are many techniques one may use when scattering points. The examples above were made by composing the following few techniques in different ways.

Random Placement

Place each point at a random location on the square.

// psudeocode
...
x = random() * width;
y = random() * height;
...

Noise Placement

Place each point at a location determined by a noise lookup.

// psudeocode
...
x = noise(i * frequency, 0) * w;
y = noise(i * frequency, 1000) * h;
...

Grid Placement

Place points in the center points of grid squares. One way to do this is a nested loop.

// psudeocode
...
for (row = 0; row < grid_rows; row++) {
    for (col = 0; col < grid_cols; col++) {
        x = (row + .5) / grid_size * w;
        y = (col + .5) / grid_size * h;
        ...
    }
}
...

Cull Placement

Place points randomly, but reject a point if it is too close to an existing point and/or too far from all existing points.

place_cull_explained

Tile Placement

Create hand-made (or generated) arrangements of points. Copy these arrangements onto different locations on the square.

tile_explained

Random Displacement

Given a set of points, offset the location of each point a random amount.

// psudeocode
...
x = x + random() * width;
y = y + random() * height;
...

Noise Displacement

Displace each point at by an amount determined by a noise lookup.

// psudeocode
...
x = x + noise(i * frequency, 0) * w;
y = x + noise(i * frequency, 1000) * h;
...

Relaxation Displacement

Find pairs of points that are near each other. Move them towards or away from each other a small amount. This technique is often applied several times with small movements this avoids the problem of pushing a point away from one, but then into another.

relax_explained

Noise Culling

Sample noise based on the location of the point. Use the sampled value to determine if the point should be culled (discarded).

noise_cull_explained

Point Placing Demo

Point Placing Demo

Properties of PCG System

When designing a procedural generation system there are several properties to consider. The following properties are borrowed from PCGBook: Chapter 1

Speed

Reliability

Controllability

Expressivity and Diversity

Creativity and Believability

Repeatability

Miscellaneous Links