You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
Hello, I’m TheMoop and I’m creating a sci-fi RTS game. Ship travel mechanics are complete, but I want them to travel along specific paths between stars, hyperlanes in other words, which helps to encourage defensive strategy and tactical planning.
So the goal is to create a Hyperlane generator similar to the game Stellaris’ hyperlane map. This is essentially just creating random paths between points, but the paths can never cross, and any given point has to be able to reach all other points through connected paths. I understand this is a difficult mathematical problem, so I’ve been searching outside of roblox for solutions… the trouble is, most developers will use a math plugin and even then the result is not really what I’m looking for.
Ideally, this should also create attachments on parts representing stars, and beams between those attachments where travel is feasible. Any time a player tries to move a fleet from one star to another, there has to be exactly one hyperlane connecting them. This part is much easier to figure out and is much less mathematical, so I’m less concerned with that question being answered.
This is achievable on roblox, Hyperant (Rise of Nations) created an unfinished game “Stellar Conquest” (Stellar Conquest - Roblox) that did exactly this.
- What is the issue? Include screenshots / videos if possible!
The effect I’m trying to create:
Hyperant’s hyperlane generation:
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
My first attempt at this was simple brute force by creating a set of 5 hyperlane maps. My thinking is that a ship should check a two-dimensional table generated in a module script to check if travel from their current star (row) to destination star (column) is possible. If travel is possible, the [row][column] will return a 1, and if otherwise it will return a 0. However, the trouble is that 100 stars will have to have 10,000 entries filled out in its matrix. I’d be happy with even 20-40 stars, but I still don’t want to fill out 400-1600 entries.
A side note that you might want to read if you have questions about the specific mechanics: this game involves system to system (star system) travel via hyperlanes; fleets should not be able to skip over stars through hyperlane travel, because this would ruin defensive strategies.
Thanks for your help!