Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

twobob/TownGenerator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Medieval Town(s) Generator

(With MapMagic2, and SplineMesh implementation)

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)

Generated

Sample Scene Demo: Included

WhiteBox

CloseUp

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

layers

Add the following layers.

  • Layer 18: Map
  • Layer 19: NotMap

The scenes are located in the _Scenes folder

Todos:

  1. Migrate the scripts to use UnityEngine.Vector2.
  2. Reduce GC allocation for generation (Now its around 100MB per city)
  3. Make the generation multithreaded via jobs or MM
  4. Support water
  5. Globalise Roads
  6. Look at also implmenting Segs and generic future outputs
  7. ~~. Finish a complete a whitebox prefab demo example ~~
  8. ~~. Rewrite SplineMesh as an Output ~~

License

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


SUPPORT THIS DEVELOPER: https://paypal.me/Geekwife

A kind soul has agreed to collect any money from other nice people that want to support more scripts like these and time spent making these solid / better

About

Medieval Town Generator for Unity

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%