AIsland

University Project

AIsland Procedurally Generated Island

About this project

AIsland was part of my AI experience design course at Stockholm university, where we were tasked with creating a game prototype incorporating at least one AI technique in one week. Inspired by a PCG workshop by Daniel Fors from Embark Studios, I decided to explore 3D Procedural Content Generation techniques for generating realistic terrains while leading our group to create a cohesive and interesting experience within our short timeframe.

Mesh Generation
Creating a flexible and lightweight terrain mesh system

The first step was working on a "canvas" for generating the island. I set up a mesh generator which creates a terrain by first triangulating a plane mesh, then displacing each vertex along the y axis according to a heightmap.

This approach makes it easy to integrate with 2D fractal noise algorithms - all it takes is sampling noise to quickly generate small islands or even infinite worlds during runtime. It's flexible and fun to generate levels with.

Mesh Generation Process

Known Issues & Possible Solutions

Boat Placement

Issue:

The boat is placed randomly in a range from the center of the map, which can result in it spawning in weird locations or stranded far from shore, making it difficult to find.

Possible Solution:

Implement a flood fill algorithm that starts at a corner and cuts off at the shore level. Then select a random tile that borders the shoreline. This would prevent accidental placement inside lakes or stranded on land.

Biome Sampling

Issue:

The biomes blend together too much and it's difficult to define larger biome areas with clear distinctions between regions.

Possible Solution:

Expand the biome generator to use Voronoi diagrams to define larger biome areas, then sample the distance between adjacent regions to get biome strength. Apply noise or sample randomly along borders for smoother transitions.

Closing thoughts

Working on this small project truly made me understand that PCG will keep becoming a bigger part of game development in the future. This prototype has many ways to expand and grow, and it has taught me valuable lessons that I'm looking forward to using in future projects.

By limiting our scope to a 256×256 terrain mesh with a falloff map, we could focus on making the experience stand out in a short period of time. This approach also allowed our game to be playable on a broad range of computers without extensive optimization work.

If we had more time, I would have liked to explore mesh generation methods such as marching cubes to use 3D noise for generating caves, tunnels, overhangs, and other features that our current mesh generator didn't allow. This would have opened up many more interesting design possibilities for our islands.

Project Details
Team Size7 (1 programmer)
Start DateSeptember 22, 2021
Duration1 week
ToolsUnity, C#
View Source Code
Keywords
Procedural TerrainFractal NoisePrototypeMesh generationPCGUnityC#Shader Graph