I am creating a rather vast and complicated map generator and I am looking for some constructive feedback regarding my methods. If you can provide any help or insight I would greatly appreciate it!
Disclaimer: I am not a programmer but I will eventually get this into the source one way or another(for performance). At this time I am trying to prototype the generator while simultaneously learning how to use blueprint. This generator will be greatly expanded over time as tile types are ~doubled/tripled, functionality is added, and generation becomes more complex/intelligent in general.
Image 1 is basically the entire generator in it’s current state. Here is a general order of operation and explanation of each general area:
- Meshes are applied to my terrain variables for later use.
- (Image 2) The Vector Field Generator determines the vector for each hexagon in the map, and inserts the vectors into an array that I have visually represented.
- (Image 3 & 4) Immediately after the Vector Field Generator, Sequence 1 leads to the Biome Generators which generate vectors based on latitude and longitude principles such as continent, climate band, etc. The vectors are fed into Arrays based on tile type(Desert, Jungle, etc) for use in the Biome Locators.
- (Image 5) Once the Biome Seeds have been generated, the Vector Retriever retrieves the vectors previously generated and store in Vector Field, loops each individual tile through the Biome Locators, and finally on to the Biome Placer.
- Before the Biome Locator is a function that sets the Climate Booleans and a set of branch macros that determines what climate band the tile about to be placed in, thereby reducing unneeded loops. Tropical, Termperate, Arctic, etc. This makes it so that loops aren’t called on Desert tiles when the tile is being placed in the Arctic.
- (Image 6) Once in the Biome Locator, it is determined which tile type is closest to the tile currently being created. If the tile is closest, it sets the “Nearest” variable to be that tile type, and then it sets the Dist variable to equal that shortest distance so the next biome locator can reference against it. There is 1 Biome Locator per tile type. Currently each iteration is only filtered based on climate band. My next objective is to filter by longitude and overall sector so that it only looks for Seeds that are within say 3-5 tiles when generating instead of across the map.
- Finally, the tile is generated based on whatever Biome Seed was Nearest after all the relevant loops were run.
Image 1 - The Generator
Image 2 - A visual representation that shows how the Indexes in my Vector Field variable correspond to the Vectors. This was absolutely invaluable for the math!
Image 3 - East Continent Biome Generator
Image 4 - Grassland Biome Generator for East Continent
Image 5 - The Vector Retriever (First loop for the actual map generation.)
Image 6 - Biome Locator for all Grasslands. Checks each tile to be generated against all Grassland Biome Seeds(if they are in the right climate band).
Note 1: Map Size is 10, and scales in increments of 10. Each time the Map Size doubles, the number of tiles quadruples. All math takes into account the scalable Map Size Variable.
Note 2: More variables for Temperature, Humidity, Tectonic Age, etc will be added and everything will have to scale accordingly.
Note 3: I currently have 6 tile types. Plans are for ~8 base types, multiplied by vegetation, multiplied by hills, and later further multiplied by resources. Each additional Biome Tile increases the complexity and number of iterations significantly.
Note 4: Once I filter for Longitude or sectors, the number of iterations will decrease significantly, but not enough to drop below the iteration limit for medium and larger maps. Currently, Iteration Limit of 1,000,000 iterations is being hit on the Map Size 20, or 800 tiles.
Note 5: All Index related math is run against the Vector Field index(Image 2) and scales to map size.