Requires Unity 2021.1 (2021 for benoit-dumas/SplineMesh support) This version requires the free Assets Mapmagic2, SplineMesh to operate and the 'Objects' and the 'Splines' extensions for MapMagic2 which are not free.
The Town Init service now creates multiple cities, spreads them based on a minimum distance and the CityLink tool provides automatic splines that link the locations.
zulfajuniadi/TownGenerator Ported the code from runegri/Town to generate meshes instead of SVG. Then Twobob modified it to generate MapMagic2 objects, splines and other things like a floating mini-map area overlay from the Area Patches. This also contains a version of twobob/MapMagic2Scripts
Generated Town: (This is using not-included prefabs in a feature complete project)
Sample Scene Demo: Included
Generator Options:
Maximum and minimum spread of the town cell count
Overall world size mutliplier
The other values are required for operation and the SampleScene demonstrates complete population and provides prefabs.
- Materials: Various materials for different parts of the map
- Various other supporting objects
Usage:
View the TownTileBuilder.cs
and TownMeshBuilder.cs
file to see how the generation is initiated.
Using the demos
Add the following layers.
- Layer 18: Map
- Layer 19: NotMap
The scenes are located in the _Scenes folder
Todos:
- Migrate the scripts to use UnityEngine.Vector2.
- Reduce GC allocation for generation (Now its around 100MB per city)
- Make the generation multithreaded via jobs or MM
- Support water
- Globalise Roads
- Look at also implmenting Segs and generic future outputs
- ~~. Finish a complete a whitebox prefab demo example ~~
- ~~. Rewrite SplineMesh as an Output ~~
Copyright 2018 Zulfa Juniadi & 2021 Twobob
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Includes a version of https://github.com/benoit-dumas/SplineMesh (same license) https://github.com/benoit-dumas/SplineMesh/blob/master/LICENSE