Re: The Starlane Nexus
Posted: Tue Nov 05, 2019 12:01 pm
I think I've made my first PR, #2631, not sure if I did it right.
I too am a little confused why we are losing this starlane when MIN_PERP_DIST=10. My best guess is it's a system outside of the screenshot. There is a test that allows close objects sufficiently far but the condition is:Oberlus wrote: ↑Tue Nov 05, 2019 9:57 am 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.
Code: Select all
// if object is further from either of the lane end systems than they
// are from eachother, it is fine, regardless of the right-angle
// distance to the line between the systems
if (dist2_12 < dist2_o1 || dist2_12 < dist2_o2)
return false;
Code: Select all
if (dist2_12 < alpha * dist2_o1 || dist2_12 < alpha * dist2_o2)
Code: Select all
scope = Object id = Source.SystemID
effects = [
AddStarlanes endpoint = MinimumNumberOf
number = 1
sortkey = DirectDistanceBetween object = Source.ID object = LocalCandidate.ID
condition = And [
System
WithinDistance distance = 250 condition = Source // <- HERE
CanAddStarlanesTo condition = Source
]
GenerateSitRepMessage
message = "EFFECT_STARLANE_BORE"
label = "EFFECT_STARLANE_BORE_LABEL"
icon = "icons/tech/n-dimensional_structures.png"
parameters = tag = "system" data = Target.ID
empire = Source.Owner
]
Code: Select all
const float MAX_LANE_DOT_PRODUCT = 0.94f; // minimum angle between starlanes
// arccos(0.94) = 0.35 rad = 19.95 degrees
Code: Select all
AddStarlanes endpoint = MinimumNumberOf
number = 1
sortkey = DirectDistanceBetween object = Source.ID object = LocalCandidate.ID
condition = And [
System
WithinDistance distance = 250 condition = Source // <- HERE
CanAddStarlanesTo condition = Source
]
The indenting is bit odd; should be more likeI don't understand the syntax of this AddStarlanes effect, different from the one in the Starlane Nexus, I'm just guessing I put the WithinDistance condition in the right place.
Code: Select all
AddStarlanes endpoint = MinimumNumberOf
number = 1
sortkey = DirectDistanceBetween object = Source.ID object = LocalCandidate.ID
condition = And [
System
WithinDistance distance = 250 condition = Source // <- HERE
CanAddStarlanesTo condition = Source
]