I want to generate a star map, stars/systems (no planets, just one circle to represent a whole solar system) and then star lanes between nearby systems (up to 5 connections/paths per system). So, the standard map for many 4X games.
I don't have any formal restrictions, I just want it to look decent. Starlanes are allowed to cross each other, but I prefer if that's not too frequent, also I prefer to avoid long starlanes, but again, that's not a hard restriction.
Performance is almost irrelevant. I prefer it being rather simple in implementation.
My quick idea:
- generate a star in a random position, check if not too near another star, in such case regenerate
- mark one star as starting star then connect a random, not too distant star with it by a starlane
- go to a random connected star and try to connect it with a random nearby unconnected star, repeat until all stars are marked as connected
- connect several random stars with random nearby stars until at average there are around 3 connections per star
(note I have a slight trouble defining what "nearby" means
)