tlongstretch / freeserf-with-AI-plus

THIS PROJECT WAS MOVED TO 'Forkserf', GO THERE INSTEAD
https://github.com/forkserf/forkserf
GNU General Public License v3.0
1 stars 0 forks source link

idea for implementing alternate map search patterns than "spirally" #58

Closed tlongstretch closed 3 years ago

tlongstretch commented 3 years ago

I have been thinking of using different patterns, such as chevron shape, or at least changing the fill pattern of a circular (hexagonal, really) search area that "spirally" considers.

The limiting factor for me has been coding an offset map for each pattern, or an algorithm to create one (either once initially and storing, or on every request)

One pattern I really see a need for is "farthest away positions first" within a given area. I think a simple way to find this is

This should result in an "outermost first (relative to the center of the larger spiral area) fill area" that can be used to place buildings as close to territory borders as possible while still being within the resource search/scoring area used to choose that area for building placement.

Drawing

tlongstretch commented 3 years ago

I added this exactly as described, and it works very nicely. Right now only using it for Sawmills, but will start changing over things over to use it