Author Topic: Map made with graph software  (Read 1186 times)

0 Members and 1 Guest are viewing this topic.

Offline superstrijder15 (OP)

  • Warrant Officer, Class 2
  • ****
  • s
  • Posts: 73
  • Thanked: 21 times
Map made with graph software
« on: June 22, 2023, 12:45:57 PM »
After spending nearly the entire afternoon on it, I have managed to make a piece of software that takes in an Aurora DB file, and then creates the star map and restructures it so it looks both spread out and is still kind of compact, and so things near each other are very likely to be close to each other. And then finally puts the result back into the DB.
It takes a lot of manual work to actually use (eg. manually turn on scramble at the start, run a bunch of times checking intermediate results, then manually move 1 or 2 nodes to help it untangle itself, or tweak the forces used) but once it is done its very nice.

I turned this map:


Into this one:


In those python visualizations, the black spot is Sol, and the coloured lines are the different jump gate networks of me and an NPR. It was quite fun to do and now my in game map is a lot more messy but still much easier in terms of judging where something is. Maybe I'll make a follow-up version sometime where it tries to keep the distance such that it fits the actual travel distance in AU.
 
The following users thanked this post: serger, Warer

Offline superstrijder15 (OP)

  • Warrant Officer, Class 2
  • ****
  • s
  • Posts: 73
  • Thanked: 21 times
Re: Map made with graph software
« Reply #1 on: June 22, 2023, 12:47:38 PM »
In the actual game, it looks like this: (note that it is mirrored around the Y axis because that is just how the python graphing software worked and I didn't put in the effort to fix that)

 
The following users thanked this post: Warer

Offline Droll

  • Vice Admiral
  • **********
  • D
  • Posts: 1704
  • Thanked: 599 times
Re: Map made with graph software
« Reply #2 on: June 22, 2023, 04:00:59 PM »
Does the script try to enforce a planar graph? It looks like it's done quite well here but I don't see any of those disruptive loops that force many to re-jig the entire map.
 

Offline Aloriel

  • Lieutenant
  • *******
  • Posts: 184
  • Thanked: 90 times
Re: Map made with graph software
« Reply #3 on: June 22, 2023, 04:50:02 PM »
I sure hope it untangles loops. The map in my most recent game is a more tangled web than a politician's lies. So many loops.
Sarah
Game Developer in Unity and UE4 and 5
 

Offline superstrijder15 (OP)

  • Warrant Officer, Class 2
  • ****
  • s
  • Posts: 73
  • Thanked: 21 times
Re: Map made with graph software
« Reply #4 on: June 22, 2023, 05:21:14 PM »
The kind of algorithm I use doesn't explicitly enforce a graph without crossings, but the way it works will cause it to often untangle loops and usually manages to do it after you do sufficient steps, but I play real stars and so I sadly am very, very unlikely to actually get loops. I would love to have some, but the chance of any one jump point being a loop is like 1 in 10000 or something, so even with over 100 jump points explored I still haven't gotten any.

It works by simulating repelling forces on all points to all points that they are not connected to, and "spring" forces on points that they are connected to: repelling when they are very close, but attracting when they are far away. The springs for jump gates are tighter, leading to a tight line of jump gated systems. Then you do small steps of moving things based on the forces, then recalculating the forces, until you are happy with the result. I let this run 50000 steps over dinner but after like 5000 steps it was already okay.

If there is a loop and it is shaped like a figure 8, it's likely the repelling forces will cause it to either stabilize with 2 even sized areas, or squeeze out one of the sides. If it stabilizes, manual editing is required (for example I could change the coordinates of a couple of nodes so they are on the other side of the 8, which would destabilize it and then with another 100 steps or so check if that fixed it)
 

Offline Aloriel

  • Lieutenant
  • *******
  • Posts: 184
  • Thanked: 90 times
Re: Map made with graph software
« Reply #5 on: June 24, 2023, 11:47:47 AM »
So, where can we get your script?
Sarah
Game Developer in Unity and UE4 and 5
 

Offline superstrijder15 (OP)

  • Warrant Officer, Class 2
  • ****
  • s
  • Posts: 73
  • Thanked: 21 times
Re: Map made with graph software
« Reply #6 on: June 24, 2023, 02:01:03 PM »
I threw it all into this git repo: https://github.com/Mennolt/Aurora_Map_Creation

Note that I actually put it all into one big jupyter notebook to be able to easily run it a bunch of iterations, check on progress, then decide if i think im done or not, so this is probably quite annoying to use. Also, it's all set up for my current game specifically, with raceIDs and such hardcoded so that is also something for you to fix.