Star Ruler 2

Star Ruler 2

dolynick's Faction Add-On v2.0.3.025
piccolo255 25 Apr, 2017 @ 11:25am
Map links
Nitpick bug report :)

DOF maps have a lot less links between systems, which results in long strings of systems. This significantly reduces strategic options and creates some access problems (e.g., central system in the Expanse).

Example maps:
unmodded[imgur.com]
DOF[imgur.com]

Is there a particular reason for this -- for example, it makes it easier for the AI -- or is it just an oversight? Since AI expands almost exclusively down the links, it may be that the reduction in number of choices helps it to focus, but on the other hand it could also be much easier for it to get stuck in an unfavorable position, or get boxed in.

Assuming for now it was an oversight, I tried to fix it myself, and it seems to work out nicely. I may be missing something major in another location, as I have only tested map generation and haven't played it yet.

Example map: modified DOF[imgur.com]

The fix is:
In file
scripts\server\map_generation.as
(which I copied to mod directory), function
generateAutomatedLinks()
(line 412), I added a multiplier to all distance constants. Specifically:
415 double distMult = 20.0; 434 if(dist > 31000.0*distMult) 438 double sz = atan(1200.0*distMult / dist); 456 double distReq = 13000.0*distMult; 472 if(distReq > 13000.0*distMult && linksMade >= targLinks) 482 distReq += 3000.0*distMult; 483 } while(linksMade < targLinks && distReq <= 31000.0*distMult);

Hope it helps. Thank you for the wonderful mods!

EDIT: Forgot to say what's going on, as far as I understood it from a quick read of the scripts.

Unmodded SR2 scans for all systems in a certain radius, and creates links to all of them (as long as the link doesn't cross another system - that's the "atan" in line 438). If it doesn't find enough systems, it gradually widens the scan area until there are enough links.

The problem in DOF was that the distance between systems was increased 20x, but the scan distance was unchanged. This means that there are no systems in the initial scan radius, and by slowly increasing it only an absolute minimum of links will be created -- usually connecting the system only to its closest neighbor. Another place in the script ensures that all systems in a galaxy are connected. Those two points result in the "string of systems" (spaghetti?) appearance.
Last edited by piccolo255; 25 Apr, 2017 @ 11:45am
< >
Showing 1-1 of 1 comments
dolynick  [developer] 26 Apr, 2017 @ 7:37am 
Thanks piccolo255. Nicely done.

I had noticed the issue before but hadn't gotten around to tracking down the underlying source of it. I'll likely be integrating this into DOF but I'm currently testing it and playing around with numbers a bit.
< >
Showing 1-1 of 1 comments
Per page: 1530 50