1 # Procedural Toolkit v0.1.9
2
3 Procedural Toolkit is a collection of instruments for development of procedural generation systems in Unity game engine.
4 It is free, open source and does not require a Unity Pro license.
5
6 **Warning: This is a programming toolkit, editor support is limited.**
7
8 [GitHub](https://github.com/Syomus/ProceduralToolkit) |
9 [Asset Store](https://www.assetstore.unity3d.com/#!/content/16508) |
10 [Issues](https://github.com/Syomus/ProceduralToolkit/issues) |
11 [Support email](mailto:proceduraltoolkit@syomus.com)
12
13 ## Installation instructions
14 Requires **Unity 5.4** or later. Tested on Windows, WebGL, Android and iOS. UnityScript interoperability is not supported.
15
16 You can install Procedural Toolkit from any of the following sources:
17
18 1. Import from the [Asset Store](https://www.assetstore.unity3d.com/#!/content/16508)
19 2. Download from [Releases page](https://github.com/Syomus/ProceduralToolkit/releases). Same packages as in the Asset Store.
20 3. Clone/download repository from [GitHub](https://github.com/Syomus/ProceduralToolkit). In this case you will have to create a subfolder for toolkit (e.g. `\Assets\ProceduralToolkit`).
21
22 Folder containing example classes and scenes (`ProceduralToolkit\Examples`) can be safely removed. The same is true for `ProceduralToolkit\Shaders`, if you are not using examples. Removing `ProceduralToolkit\Editor` will leave you with code-only toolkit.
23
24 After installation you can import ProceduralToolkit namespace and start building your own PCG systems:
25 ```C#
26 using UnityEngine;
27 using ProceduralToolkit;
28
29 public class Example : MonoBehaviour
30 {
31 private void Update()
32 {
33 Debug.Log(string.Format("<color=#{0}>{0}</color>", RandomE.colorHSV.ToHtmlStringRGB()));
34 }
35 }
36 ```
37
38 ## Classes
39 * ArrayE: Array extensions.
40 * ColorE: Color extensions, HTML colors.
41 * ColorHSV: Representation of color in HSV model.
42 * DebugE: Drawing methods similar to Debug.
43 * Directions: Enum with directions along three axes.
44 * Draw: Collection of drawing method-independent generic drawing algorithms.
45 * GizmosE: Drawing methods similar to Gizmos.
46 * GLE: Drawing wrappers over GL.Vertex which follow Gizmos convention.
47 * MeshDraft: Helper class for mesh generation.
48 * MeshDraftPrimitives: Constructors for MeshDraft primitives.
49 * MeshE: Mesh extensions.
50 * MeshPrimitives: Constructors for Mesh primitives.
51 * PTUtils: Various utility methods.
52 * RandomE: Value generators and extensions for collections.
53 * TextureE: Texture extensions and constructors.
54 * Vector2Int: Vector2 analogue with integer components.
55 * VectorE: Vector extensions.
56
57 ## Editor classes
58 * ProceduralToolkitMenu: Submenu with constructors for primitives at `GameObject > Procedural Toolkit` and about window at `Help > About Procedural Toolkit`.
59 * MeshFilterExtension: Mesh saving utility available at `MeshFilter context menu > Save Mesh`.
60
61 ## Examples
62 Resources folder contains prefabs used for UI. UI folder contains scripts for ui controls, including camera rotator.
63
64 ### <a href="http://syomus.com/ProceduralToolkit/BuildingGenerator">BuildingGenerator</a>
65 <img src="http://syomus.com/ProceduralToolkit/screenshot-building-generator.png">
66
67 Procedural building generator.
68 * BuildingGenerator: Main generator class. Generates buildings based on input configuration.
69 * BuildingGeneratorConfigurator: Configurator for generator with UI and editor controls.
70 * BuildingGeneratorUtils: Helper class for generator.
71 * IFacadeLayout, IFacadePanel, FacadeLayout, HorizontalLayout, VerticalLayout: Interfaces and classes used in facade layout generation.
72 * ProceduralFacadePanel: Fully procedural facade panels for building generator.
73 * BuildingGeneratorConfiguratorEditor: Custom inspector for BuildingGeneratorConfigurator.
74
75 ### <a href="http://syomus.com/ProceduralToolkit/ChairGenerator">ChairGenerator</a>
76 <img src="http://syomus.com/ProceduralToolkit/screenshot-chair-generator.png">
77
78 Procedural chair generator.
79 * ChairGenerator: Main generator class. Generates chairs based on input configuration.
80 * ChairGeneratorConfigurator: Configurator for generator with UI and editor controls.
81 * Armrests, Backs, Stretchers: Chair parts constructors.
82 * ChairGeneratorConfiguratorEditor: Custom inspector for ChairGeneratorConfigurator.
83
84 ### <a href="http://syomus.com/ProceduralToolkit/Boids">Boids</a>
85 <img src="http://syomus.com/ProceduralToolkit/screenshot-boids.png">
86
87 Single-mesh particle system with birds-like behaviour.
88 * BoidController: Generates animated mesh based on input configuration.
89 * BoidControllerConfigurator: Configurator for BoidController with UI controls.
90
91 ### <a href="http://syomus.com/ProceduralToolkit/LowPolyTerrainGenerator">LowPolyTerrainGenerator</a>
92 <img src="http://syomus.com/ProceduralToolkit/screenshot-low-poly-terrain-generator.png">
93
94 Simple Perlin noise based low poly terrain generator.
95 * LowPolyTerrainGenerator: Main generator class. Generates terrain based on input configuration.
96 * LowPolyTerrainGeneratorConfigurator: Configurator for generator with UI and editor controls.
97 * LowPolyTerrainGeneratorConfiguratorEditor: Custom inspector for LowPolyTerrainGeneratorConfigurator.
98
99 ### <a href="http://syomus.com/ProceduralToolkit/CellularAutomaton">CellularAutomaton</a>
100 <img src="http://syomus.com/ProceduralToolkit/screenshot-cellular-automata.png">
101
102 Generic cellular automaton for two-state rulesets.
103 * CellularAutomaton: Main generator class. Generates cellular automata based on input configuration.
104 * CellularAutomatonConfigurator: Configurator for generator with UI controls.
105 * Ruleset: Cellular automaton ruleset representation and static constructors.
106 * CellState: Enum for automaton cell states.
107
108 ### <a href="http://syomus.com/ProceduralToolkit/Mazes">Mazes</a>
109 <img src="http://syomus.com/ProceduralToolkit/screenshot-mazes.png">
110
111 Generic maze generator.
112 * MazeGenerator: Main generator class. Generates mazes on input configuration.
113 * MazeGeneratorConfigurator: Configurator for generator with UI controls.
114 * Maze: Maze graph representation.
115 * Cell: Maze graph cell.
116 * Edge: Maze graph edge.
117
118 ### <a href="http://syomus.com/ProceduralToolkit/Breakout">Breakout</a>
119 <img src="http://syomus.com/ProceduralToolkit/screenshot-breakout.png">
120
121 Breakout clone with procedurally generated levels.
122 * Breakout: Game engine and level generator.
123 * BreakoutConfigurator: Configurator for generator with UI controls.
124 * Brick: Disables game object on collision.
125
126 ### <a href="http://syomus.com/ProceduralToolkit/CharacterGenerator">CharacterGenerator</a>
127 <img src="http://syomus.com/ProceduralToolkit/screenshot-character-generator.gif">
128
129 Simple 2D character generator. Sprites made by <a href="https://www.patreon.com/chicmonster">Tess Young</a>.
130 * CharacterGenerator: Generates a sprite set and a name for character.
131 * NameGenerator: Generates a random name from a large array of names.
132
133 ### <a href="http://syomus.com/ProceduralToolkit/Primitives">Primitives</a>
134 <img src="http://syomus.com/ProceduralToolkit/screenshot-primitives.png">
135
136 Demonstration of primitives
137 * Cylinder, Dodecahedron, FlatSphere, Hexahedron...: Mesh generators with exposed parameters in inspector.
138
139 ### Common classes
140 * SkyBoxGenerator: Skybox generator, assuming that scene uses gradient skybox shader, animates transitions to new parameters every few seconds.
141 * ButtonControl, SliderControl, TextControl, ToggleControl: UI controls for generators.
142 * CameraRotator: Orbiting camera controller.
143 * ConfiguratorBase: Base class for configurators.
144
145 ## Shaders
146 * Unlit, Diffuse, Specular and Standard Vertex Color: Textureless shaders which use color information from vertex attributes.
147 * Gradient Skybox: Simple gradient skybox.
148
149 ## License
150 ```
151 The MIT License (MIT)
152
153 Copyright (c) Daniil Basmanov
154
155 Permission is hereby granted, free of charge, to any person obtaining a copy
156 of this software and associated documentation files (the "Software"), to deal
157 in the Software without restriction, including without limitation the rights
158 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
159 copies of the Software, and to permit persons to whom the Software is
160 furnished to do so, subject to the following conditions:
161
162 The above copyright notice and this permission notice shall be included in all
163 copies or substantial portions of the Software.
164
165 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
166 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
167 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
168 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
169 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
170 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
171 SOFTWARE.
172 ```