Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Road connections #431

Merged
merged 15 commits into from
Oct 30, 2024
Merged

Road connections #431

merged 15 commits into from
Oct 30, 2024

Conversation

snipercup
Copy link
Collaborator

Requires #430
Fixes #419

A new implementation of road connections. Previously, the cities would be connected by going down the list and connecting each one to another city. This worked fine but it's not really organic.

In this implementation:

  • Put the cities on the map
  • Create a list of city pairs
  • Create hub positions in between cities at some distance
  • Connect each hub to a city within range
  • If any city is left unconnected, connect it to cities within range.

I fiddled with the range numbers a bit. The longest connection will be 40 distance and the hubs will be 15 distance away from cities. Cities are also placed at a minimum of 15 distance from each other. This removes some of the randomness but we get better road connections. I'm sure we can improve some more in this area but this is better then the last approach.

@snipercup snipercup added the enhancement New feature or request label Oct 25, 2024
@snipercup snipercup mentioned this pull request Oct 26, 2024
@snipercup snipercup merged commit d777453 into Khaligufzel:main Oct 30, 2024
@snipercup snipercup deleted the road-connections branch October 30, 2024 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review the road connection strategy
1 participant