Skip to content

Releases: matthewstyler/ruby-perlin-2D-map-generator

Road Generation with Prim's Algorithm and MST

10 Dec 18:38
Compare
Choose a tag to compare

Updated connected pair generation of building in a town and centroids between town for road generation to use prim's algorithm with a minimum spanning tree. This was originally generating a full graph.

Time improved from O(n^2) to O((V+E)logV). Map generation with roads is significantly faster.

Minimum Spanning Tree
Prim's Algorithm

Towns

15 Aug 00:58
Compare
Choose a tag to compare

Towns

With Poisson Disk Sampling, towns can be generated randomly or with a provided x,y coordinate used as a centroid with radius. The result will be tiles that contain Building items. Buildings in a town are connected by roads, and additionally towns are connected to other towns by roads.

Roads !

08 Aug 18:44
Compare
Choose a tag to compare

Roads can be generated through the maps randomly or through a list of coordinates.

Roads can be generated by providing a positive integer to the roads= argument. Roads are randomly seeded to begin and start at an axis (but not the same axis).

A* pathfinding is used to generate the roads with a heuristic that uses manhattan distance, favours existing roads and similar elevations in adjacent tiles.

Roads can be configured to include/exclude generating paths thorugh water, mountains and flora.

Tiles containing roads are of type road, those without are of type terrain.

The --roads_to_make option allows you to specify multiple pairs of coordinates to attempt to build paths, subject to the heuristic and other option constraints. Expects a a single list, but must be sets of 4, example of two roads: --roads_to_make=0,0,50,50,0,0,75,75

v.0.0.4

09 Jul 01:21
Compare
Choose a tag to compare
  • Added convenience index lookup and command line description of a given set of coordinates. #1

v.0.0.3

08 Jul 00:28
Compare
Choose a tag to compare
bump version

Initial Release

06 Jul 14:33
Compare
Choose a tag to compare
v.0.0.2

bump version