Page 1 of 2

The Starlane Nexus

Posted: Sun Aug 23, 2015 5:58 pm
by MatGB
First use, um, it might be adding slightly too many lanes:
nexus-build-1.png
nexus-build-1.png (326.91 KiB) Viewed 3724 times
The effects description says it should cross an existing lane or go too close to an existing one, I'd say at the very least the lane that skims past Silk (with the pale blue fleet) and deeper into enemy space, as well as the lane 3 steps anticlockwise that also crosses through the system circle are too much.

I am kinda glad I build a Transformer there so I can use the new Spatial Distortion mechanics ;-)

(why yes, I did deliberately play Clusters to try the new bore and nexus mechanics, isn't it obvious ;-) )

Got two more of these babies about to complete. Need to play through clusters or Spiral on High starlanes to see how much they are then...

Re: The Starlane Nexus

Posted: Sun Aug 23, 2015 6:20 pm
by Geoff the Medio
MatGB wrote:it might be adding slightly too many lanes
Try adding a NumberOf clause to limit the number of lanes generated? And distance limits?
MatGB wrote:The effects description says it should cross an existing lane or go too close to an existing one, I'd say at the very least the lane that skims past Silk (with the pale blue fleet) and deeper into enemy space, as well as the lane 3 steps anticlockwise that also crosses through the system circle are too much.
Try adjusting

Code: Select all

const float MIN_PERP_DIST = 10
and

Code: Select all

const float MAX_LANE_DOT_PRODUCT = 0.98f;
in Condition.cpp

If they are working correctly, the first should be a minimum distance in uu, and the second should be a limit on how close in angle the lanes can be to existing lanes connected to either system with lower being a more-different angle. It's quite possible I have (more) mistakes in the relevant math, though.

I suggest also trying the Black Hole Collapser...

Re: The Starlane Nexus

Posted: Sun Aug 23, 2015 6:54 pm
by MatGB
Geoff the Medio wrote:
MatGB wrote:it might be adding slightly too many lanes
Try adding a NumberOf clause to limit the number of lanes generated? And distance limits?
MatGB wrote:The effects description says it should cross an existing lane or go too close to an existing one, I'd say at the very least the lane that skims past Silk (with the pale blue fleet) and deeper into enemy space, as well as the lane 3 steps anticlockwise that also crosses through the system circle are too much.
Try adjusting

Code: Select all

const float MIN_PERP_DIST = 10
and

Code: Select all

const float MAX_LANE_DOT_PRODUCT = 0.98f;
in Condition.cpp

If they are working correctly, the first should be a minimum distance in uu, and the second should be a limit on how close in angle the lanes can be to existing lanes connected to either system with lower being a more-different angle. It's quite possible I have (more) mistakes in the relevant math, though.
This'd need recompiling, I'm backing up my autosave from last turn so I can test various iterations.
I suggest also trying the Black Hole Collapser...
It's being researched, but not as sure of the use case, my only black hole is deep in my territory and making them is a long job, if I find somewhere appropriate I'll give it a go.

Re: The Starlane Nexus

Posted: Sun Aug 23, 2015 6:59 pm
by Geoff the Medio
MatGB wrote:...my only black hole is deep in my territory and making them is a long job, if I find somewhere appropriate I'll give it a go.
Artificial black holes should also work...

Re: The Starlane Nexus

Posted: Sun Aug 23, 2015 7:16 pm
by wheals
I think a distance limit in the script sounds like a very reasonable solution here, especially with the handy new mapscale circle feature (I keep meaning to make a patch to let that be enabled/disabled from the right-click menu...)

Re: The Starlane Nexus

Posted: Sun Aug 23, 2015 7:53 pm
by MatGB
wheals wrote:I think a distance limit in the script sounds like a very reasonable solution here, especially with the handy new mapscale circle feature (I keep meaning to make a patch to let that be enabled/disabled from the right-click menu...)
alt+c does it FWIW, adding stuff to that menu is beyond me but figuring out how to set a hotkey was something I was just able to do in C++ ;-)

As to a distance limit? Um, yeah, y'know how I barely know how to actually script stuff? I gave up and instead set a max number of 10, which worked for the specific location in the picture.

Re: The Starlane Nexus

Posted: Sun Aug 23, 2015 8:04 pm
by Geoff the Medio
MatGB wrote:As to a distance limit? Um, yeah, y'know how I barely know how to actually script stuff? I gave up and instead set a max number of 10, which worked for the specific location in the picture.
Something like

Code: Select all

        EffectsGroup
            scope = Object id = Source.SystemID
            effects = AddStarlanes endpoint = And [
                System
                WithinDistance distance = 200 condition = Source
                CanAddStarlanesTo condition = Source
            ]

Re: The Starlane Nexus

Posted: Sun Aug 23, 2015 8:27 pm
by MatGB
That works, I'd been trying to use directdistancebetween because that's used in the code but it's a different thing, so I think I know where I was going wrong.

200 was too little for that place, 300 slightly too much, so I've put 250 into mine and I'll try it in more places (and more maps).

Related: Clusters galaxy map definitely has some issues in the generation, I suspect my current game would've been deathly dull without all the Bores I've used to open up new lines of attack. Which is fun, but a little unfair on the unsuspecting AI.

Re: The Starlane Nexus

Posted: Mon Aug 24, 2015 1:44 am
by MatGB
Geoff the Medio wrote: I suggest also trying the Black Hole Collapser...
I got it researched and decided to simply plug it into my generator to see what it does. Fun.

Completely cutoff a cluster except for a lane I'd Bored out earlier, and it's too slow for strategic use for the way I play, but it's nice to see effects you can play with, might have to work on other things that can move actual systems around.

Re: The Starlane Nexus

Posted: Mon Nov 04, 2019 3:55 pm
by Oberlus
The Starlane Nexus still produces too many starlanes and too close to other systems (even crossing over them).

Re: The Starlane Nexus

Posted: Mon Nov 04, 2019 9:01 pm
by alleryn
Oberlus wrote: Mon Nov 04, 2019 3:55 pm The Starlane Nexus still produces too many starlanes and too close to other systems (even crossing over them).
Part of the problem here is that the dot product code that tests for angles is only testing for two starlanes that share an endpoint in common. In your diagram the code never checks the angle between the two starlanes:

Ster B --> Zosma A and
Deep Space system near Ster B --> Ra A, as these starlanes do not share an endpoint in common.

The proximity of Ster B to that Deep Space system makes the Ster B --> Deep Space look quite close to Ster B --> Zosma A, but if you imagine that line from Ster B --> Deep Space extending out, you can imagine that by the time it got to Zosma A, there would be a fair distance between the two starlanes.

Simplest solution is to cut the distance and/or increase the minimum angle. What Geoff suggested here:
Geoff the Medio wrote: Sun Aug 23, 2015 6:20 pm Try adjusting

Code: Select all

const float MIN_PERP_DIST = 10
and

Code: Select all

const float MAX_LANE_DOT_PRODUCT = 0.98f;
in Condition.cpp
The cosine of the dot product is the angle between the starlanes, so currently the minimum angle allowed is arccos(.98) = 11.5 degrees. In theory this allows up to 15 31 starlanes radiating out, which seems like a lot. I'd suggest adjusting the minimum angle to something like 30 degrees (change .98 to .87), which would allow for a saner (imho) maximum of 12 starlanes.

[Edited for a computational error and some additional minor clarification.]

Re: The Starlane Nexus

Posted: Mon Nov 04, 2019 10:48 pm
by Oberlus
alleryn wrote: Mon Nov 04, 2019 9:01 pmI'd suggest adjusting the minimum angle to something like 30 degrees (change .98 to .87), which would allow for a saner (imho) maximum of 12 starlanes.
I've tested your suggestion. The number of starlanes is quite more saner indeed. The other problem you pointed out (not testing the angle with starlanes that does not share an end-point) is still there.
Would it be solved if the code would test for starlanes with same "start-point"? That starlane to the empty space, that was there before Nexus, has an angle well below 10 degrees to the newly created starlane Ster beta <-> Zosma betaalpha.
(I attach also a screenshot before Starlane Nexus is built.)

Edit: it's Zosma alpha, not beta.

Edit2: Maybe the problem is in ObjectTooCloseToLane(). I think it should be vetoing the starlanes Ster beta - Ra alpha and Ster bets - Zosma alpha. Going to try increasing MIN_PERP_DIST also.

Re: The Starlane Nexus

Posted: Tue Nov 05, 2019 9:57 am
by Oberlus
Attached an screenshot of the result using

Code: Select all

MIN_PERP_DIST = 30
MAX_LANE_DOT_PRODUCT = 0.87f
Some could argue 30 distance is too much, because it vetoes (by a slim margin) the starlane between Ster beta and Ra delta (the system NE of Ra alpha). But I actually like this. It allows the starlane between Ster beta and Ra gamma.

What do you (anyone) think?


Edit: Notice the absent starlane between Ster beta and the pale blue empty system in the SW corner. It is just outside of the maximum distance (250). Does anyone thing it should be connected?
Edit 2: no, it's not outside the maximum distance, it was connected when using MIN_PERP_DIST = 10 and MAX_LANE_DOT_PRODUCT = 0.87. I don't understand why increasing MIN_PERP_DIST forbids that starlane.

Re: The Starlane Nexus

Posted: Tue Nov 05, 2019 11:11 am
by em3
Definitely looks better.

Re: The Starlane Nexus

Posted: Tue Nov 05, 2019 11:40 am
by Oberlus
Oberlus wrote: Tue Nov 05, 2019 9:57 amNotice the absent starlane between Ster beta and the pale blue empty system in the SW corner.
It's not outside the maximum distance, it was connected when using MIN_PERP_DIST = 10 and MAX_LANE_DOT_PRODUCT = 0.87. I don't understand why increasing MIN_PERP_DIST forbids that starlane.
With MIN_PERP_DIST = 20 we get that Ster beta - blue pale empty space, but we also get Ster beta - Ra gamma (which I'd like to avoid).
I've tried reducing MAX_LANE_DOT_PRODUCT down to .50 but that removes the starlanes to Sulafat and Altair alpha (which I think are right) while Ster beta - Ra gamma is still allowed.
So I'm going with this:

Code: Select all

MIN_PERP_DIST = 20
MAX_LANE_DOT_PRODUCT = 0.87f