Procedural World Generator

Platform

  • Unity Asset Store

Tools Used

  • C#
  • Unity Game Engine
  • Blender

Team

  • Independent

Role

  • All aspects

Overview

Asset Tool for Unity Store Easily generate small island-format grids complete with terrain and tree prefabs(still in development).

Goals

  • • Create an asset tool ready for publishing on the Unity Asset Store
  • • Develop a tool to generate islands
  • • Implement an algorithm to spawn trees at random points on the terrain
  • • Create a user-friendly GUI for easy tool usage within the inspector of the game engine
  • • Ensure good performance

Asset Info

  • Script Reference:
  • Grid.cs
  • Namespace:
  • WorldGeneratorTool.Core
  • Description:
  • This script handles the procedural generation of a grid-based world.
  • Properties:
  • [SerializeField] private GameObject[] treePrefabs;Array of tree prefabs used for tree generation.
  • [SerializeField] private Material terrainMaterial;Material used for the terrain.
  • [SerializeField] private Material edgeMaterial;Material used for the edges.
  • [SerializeField] private float waterLevel;Threshold for water level.
  • [SerializeField] private float scale;Scale of the noise used for terrain generation.
  • [SerializeField] private float treeNoiseScale;Scale of the noise used for tree distribution.
  • [SerializeField] private float treeDensity;Density of trees in the terrain.
  • [SerializeField] private float riverNoiseScale;Scale of the noise used for river generation.
  • [SerializeField] private int rivers;Number of rivers to generate.
  • [SerializeField] private int size;Size of the grid.
  • Methods
  • void Start()Initializes the grid and generates the procedural world.
  • void DrawTerrainMesh(Cell[,] grid)Draws the terrain mesh based on the grid data.
  • void DrawEdgeMesh(Cell[,] grid)Draws the edge mesh around the water areas.
  • void DrawTexture(Cell[,] grid)Draws the texture for the terrain based on the grid data.
  • void GenerateTrees(Cell[,] grid)Generates trees on the terrain based on the grid data.
  • Source code on GitHub.