Strata Easy 2D Level Generator For Unity
A downloadable Unity asset
I've just released version 1.2 of a creative tool for Unity I've been working on, it's called Strata. See the bottom of the page for release notes. Any feedback would be much appreciated! Thanks! - Matt
Strata is an easy to use procedural toolkit for generating 2D levels which use a combination of hand-authored and procedurally generated content. It works in the Unity editor or at runtime without additional programming. Strata works with Unity’s native 2D Tilemap tools allowing you to hand-author pieces of levels and arrange and combine those pieces in interesting ways.
The design philosophy of Strata is strongly inspired by both classic roguelike dungeon crawler design approaches along with the newer school of action roguelike / roguelite games. To this end the project contains demos both for a classic top-down roguelike dungeon generator, and a 2D platformer built from a connected chain of handmade rooms. Both serve as good starting points for your own creations.
Programming procedural level generation tools can be complex and difficult, and with Strata I hope to open the creation of procedural content to artists, level and game designers and other non-programmer creators.
Here are two videos, one is a short overview, the second is a ~30 minute walk through getting started with Strata.
Setup Guide for Strata Easy 2D Level Generator For Unity
Overview of Strata Easy 2D Level Generator For Unity
Chance Tiles: Adding Additional Variation To Procedural Tilemap 2D Level Generation In Unity
3D Generation From 2D Tilemaps In Strata (Experimental)
1.1 Update Overview
How It Works
Strata works by generating level data into a grid of ASCII characters in multiple passes using what we call Generators. Each Generator contains a procedural content generation algorithm ranging from the simple, like randomly scattering 100 instances of an object, to the complex, like generating a linked series of dungeon rooms. The Generators run sequentially. This means that each new Generator’s output is applied to the previous Generator's output. This means, for example, that we can choose to generate some organic cave shapes, carve out a series of rectilinear rooms from them and then scatter objects within the empty spaces of the result. The choice of Generators and the order that the Generators are sequenced in via the Unity Inspector interface can result in significantly different generated levels.
One of the common problems in procedural generation is that you can end up with results which while technically unique, all feel the same to the player. This is sometimes referred to as the 'Thousand Bowls of Oatmeal' problem. Yes, they're all different, but who cares? To combat this, Strata supports the inclusion of hand-authored elements within the generation process so that you as the designer can choose to have as much or as little randomness as you prefer, and insert hand-authored set pieces and features for your players to discover.
- Generate complex, varied procedural levels without writing any code
- Hand author content to integrate into your procedural levels using Unity's Tilemap tools
- Multiple levels of random chance in generation: hand place items with a chance to spawn between multiple choices in authored rooms
- Generate levels at runtime for new levels on each playthrough, or generate at edit time in the editor, polish the output by hand and save.
- Supports deterministic seeded randomness and daily challenge style play
- Generators Included:
- Linked top to bottom room series for platformers
- Sequence of rooms with custom start and end rooms.
- Middle-out spreading connected room series for top-down dungeon crawlers
- Cellular automata for organic cave shapes
- Randomly placed rooms connected by tunnels (traditional ASCII roguelike style)
- Random scatter X objects
- Tunneler to connect multiple previous Generators
- Save full tilemaps and feed them back into the Generation process (randomize existing levels)
- Place objects within connected space (place player start and level exit)
- Random scatter hand-authored chunks
- Mirror / Symmetry generators for making ‘man-made’ feeling spaces.
- Flood fill
- Binary Space Partitioning for building-like subdivided series of connected rooms.
- And more coming soon!
- Professional video tutorials, text documentation, and well commented C# source code.
- Full C# source code included
- Easy to extend for programmers with a modular framework based on Delegation pattern and ScriptableObjects
- Rogue-lite platformer example scene
- Top-down dungeon example scene
- 3D Cubeworld example scene
- Just does one thing, generates map data that you can use in lots of ways, not a full game project. Doesn’t include a bunch of junk you don’t need!
What Strata Is Not
Strata is not a game-kit, engine or complete game project. It's designed to support multiple types of games which use 2D tile-based levels and procedural generation. The idea here is that you can start with strata as a procedural generation toolkit and build your game alongside it, whatever type of game it is.
It’s also not a cookie cutter, samey, single approach, single algorithm dungeon generator. You can think of Strata as a set of creative tools, not a replacement for your creativity in designing procedural levels and gameplay.
I have decided to price Strata affordably initially since it's new and I want to get people to try it out, so the initial price will be 8$ USD. Due to the modular structure of the project, I intend to introduce new generation algorithms and examples and as I do, I will raise the price.
Update: I've raised the price to $9.00 with the 1.1 update. I've spent a bunch of time working on it and improving it and I think it's still a great value for money. Thanks to everyone who's bought it so far! You should be able to download the update for free, if you can't please email me: firstname.lastname@example.org.
1.0 Initial Release!
- Replaced RoomChain Generator and with RoomSequence and a RoomChain component. RoomChain Generator proved unreliable in generating chains of desired length. New approach is much more robust and always achieves minimum chain length. Also adds support for placing start/end rooms from a RoomList at the end of the RoomSequence.
- RoomChain component is a data holding object that is created and destroyed during generation. It tracks progress of RoomSequence and RoomTiler generation so that that data is not stored in BoardGenerator, making resetting cleaner and easier.
- Added RoomTiler. RoomTiler is like RoomSequence but instead of spreading in one direction spreads in all available directions marked by exits for a number of iterations. Grows buildings with connected paths branching off from a center.
- Added TunnelBrancher: This is like WanderTunnel but has a percent chance to spawn new WanderTunnels every step. Useful for generating branching tunnel systems.
- Added turnNoiseValue parameter to WanderTunnel, this flips the generation back and forth between preferring to tunnel horizontally first or vertically first based on a random percentage roll, this makes for more irregular, squiggly tunnels. Keep at 0 for clean 90 degree turns in tunnels. Also implemented in TunnelBrancher.
- Moved some source comments into Tooltips, not all yet.
- Fixed a path bug when setting up profile for first time
- Added simple example scenes for TunnelBrancher, RoomTiler and RoomSequence to MiniRogue example.
- Added Experimental CubeWorld 3D Example Scene: This demonstrates using Strata to spawn non-Tilemap tile data, in this case a world made of cubes. Note that all editing must still be done on 2D tilemaps, 3D editing is not supported.
- Added SimpleFill Generator: This overwrites the entire grid with a character. Useful when you want to start with a filled grid and dig out.
- Added PerlinNoise Generator: Simple noise generator, no smoothing or post-processing, just fill the grid with noise, either overwriting what is already there or filling in empty space.
- Added CaveDigger Generator: Another simple generator that does a random walk clearing out a pre-defined portion of the map. Will continue moving randomly and creating empty space until a desired percentage of spaces have been cleared this pass (not including other generator passes).
- Added PathVisualizer component: This records information about the direction the path has moved in and draws an arrow Gizmo in the scene view, along with the name of the RoomTemplate that was drawn. Works with RoomSequence and PlatformerRoomChain. Useful for debugging generation.
- Cleaned up some small bugs in the example scenes.
- Added SpaceDivider Generator which allows for generation of a rectangular shape with subdivided internal rooms.
- Added custom icons for the different ScriptableObject types for easier identification in the Project window.
- Updated Editor script for BoardGenerator to hide daily seed option when useRandomSeed is true.
- Fixed Clear and ClearAndGenerate functionality for CubeWorld example
- Fixed PerlinNoise generator to use random seeding.
- Fixed some scripts that weren’t using Strata namespace.
- Some small documentation fixes.
In order to download this Unity asset you must purchase it at or above the minimum price of $9 USD. You will get access to the following files: