How a famous mathematician helped me make BIG levels for my indie game - Blood Running Devlog 03


Watch Instead

Pocedural Generation

Hells-Kitchen-2.webp 

Procedural generation is like if a chef had a magical cookbook filled with special recipes. Instead of planning each recipe, the kitchen can just follow the magical cookbook to make an endless variety of different dishes. 

Just like the chef's cookbook, procedural generation is like a creative kitchen assistant that uses algorithms to cook up new and exciting things, like landscapes in video games or layouts of virtual cities. 

ss_bcc23f10c00ccd9efbce3e05806fea961028470e.1920x1080.jpg

Cellulr Automata

In my game, I use a technique called cellular automata to generate the levels.

The concept of Cellular Automata was originally discovered in the 1940s by John von Neumann and Stanislaw Ulam at Los Alamos National Laboratory.

Scientists.png 

Ulam and von Neumann created a method for calculating liquid motion in the late 1950s. The driving concept of the method was to consider a liquid as a group of discrete units and calculate the motion of each based on its neighbor’s behaviors. This was the birth of cellular automata. Conway.jpg

Conway.jpg 

Jump to the 1970s, and John Conway came up with the Game of Life which brought cellular automata to the second dimension. It involves a 2 dimensional square grid populated with cells. Each cell is either alive or dead and interacts with it’s eight neighbors. 

At each step in time in the game, these rules occur simultaneously: 

Any live cell with fewer than two neighbors dies. 

Any live cell with two or three live neighbors lives on. 

Any live cell with more than three live neighbors dies. 

Any dead cell with exactly three live neighbors becomes a live cell. 

This simple system can create all sorts of behaviors, and people even have even inside it. built computers 

68747470733a2f2f692e696d6775722e636f6d2f4a4658397151452e706e67.png

Implementation

To use this in my game, I started with basic map generation using cellular automata, then stretched the map vertically and filled in some of the smaller holes, and then made it more interesting by adding terrain details.

Level Generation V4 LARGE.png 

Then I added some grass, trees, wind turbines, and a cool parallax background to bring the level to life. Level Generation V4.png

Level Generation V4.png 

Turbines.png

Revamping the Artwork

After a month of work, I decided to redo all the art for the game and it was time to revamp the first level.

I recolored everything, adding new trees, rocks, skeletons, and a blue noise algorithm for better object generation.

Next I added mutant deer with extra legs, corrupted by the chemicals in the wasteland. And yes, they do drop you their meat…

Wastes.png


Places to Explore

The player needs buildings to find cool loot and explore, so I made prefab rooms that can appear in the level. These rooms are created like any other, and their layers are saved to a file when the game loads.

After that, I load the necessary file to make the prefab, spawn it at the bottom of the level, and I teleport the player there when they walk through a door.

This way I don’t have to save the entire state of the main level whenever the player enters a building.

Screenshot_80.png 

Each level will have a special location with important characters and enemies. For the first level I’m planning a massive crashed spaceship like in the cover art, I started by creating the design of the interior of the spaceship. Ship.png

Ship.png 

The spaceship and the land around it are controlled by a rogue AI who leads the bandits. Silva.png

Silva.png

Screenshot_Laser-169.png

Conclusion

It's still a bit rough around the edges, but that's how I made the first level for my game!

If you enjoyed reading, wishlist Blood Running on Steam and help us reach our goal!

Ramen Bar

Leave a comment

Log in with itch.io to leave a comment.