[BUG] get_jump_path

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
DeadAirRT
Posts: 1008
Joined: Fri, 25. Jan 19, 03:26
x4

[BUG] get_jump_path

Post by DeadAirRT » Wed, 3. Apr 19, 19:26

Hello,

After modifying the map to have additional sectors, no highway, and different gates; There is an issue with the route created by the get_jump_path for long routes that end in a cluster with two sectors. Wall of text to follow.

Using the following md to route ALL routes in the game:
Spoiler
Show

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<mdscript name="DeadAir_Debug_Pathing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="md.xsd">
	<cues>
		<cue name="Start" instantiate="true" checkinterval="30min" checktime="player.age + 30s">
			<cues>
				<cue name="TravelReport">
					<actions>
						<find_sector name="$Origins" multiple="true" space="player.galaxy" />
						<find_sector name="$Destinations" multiple="true" space="player.galaxy" />
						<do_if value="$Origins.count == $Destinations.count">
							<do_all exact="$Origins.count" counter="$i">
								<set_value name="$Origin" exact="$Origins.{$i}" />
									<do_all exact="$Destinations.count" counter="$j">
										<set_value name="$Destination" exact="$Destinations.{$j}" />
										<get_jump_path component="$JumpPaths" start="$Origin" end="$Destination" multiple="true"/>
											<set_value name="$DebugLine" exact="'%1 : %2 to %3 --'.[$i, $Origin.name, $Destination.name]" />
											<do_all exact="$JumpPaths.count" counter="$k">
												<set_value name="$JumpPath" exact="$JumpPaths.{$k}" />
												<set_value name="$DebugLine" exact="$DebugLine + '//' + $JumpPath.knownname" />
												<wait exact="10ms"/>
											</do_all>
										<debug_to_file name="'TravelReport'" directory="'Travel_Report'" text="$DebugLine" output="false" append="true" />
										<wait exact="10ms"/>
									</do_all>
							</do_all>
							<wait exact="10ms"/>
							<show_help duration="15s" custom="'Debug Completed'"/>
						</do_if>
						<do_else>
							<show_help duration="15s" custom="'Debug Failed'"/>
						</do_else>
					</actions>
				</cue>
			</cues>
		</cue>
	</cues>
</mdscript>
Will create a very large report that shows routes with the following format:
Spoiler
Show

Code: Select all

1 : Litany of Fury to Hewa's Twin V --//Litany of Fury//Jump Gate//Jump Gate//True Sight//Jump Gate//Jump Gate//Pontifex's Claim//Jump Gate//Jump Gate//Prior's Void//Jump Gate//Jump Gate//Armada's Rage//Jump Gate//Jump Gate//Guiding Star//Jump Gate//Jump Gate//Legal Directive//Jump Gate//Jump Gate//Profit Imperative//Jump Gate//Jump Gate//Open Market//Jump Gate//Jump Gate//Memory of Profit IX//Jump Gate//Jump Gate//Profit Center Alpha//Jump Gate//Jump Gate//Ianamus Zura IV//Jump Gate//Jump Gate//Path to Profit//Jump Gate//Jump Gate//Hewa's Twin I//Jump Gate//Jump Gate//Hewa's Twin III//Jump Gate//Jump Gate//Hewa's Twin V
And that is how I finally was able to reliably document the bad pathing that occurs. The following are examples of routes wildly diverging, sometimes adding as many as 10 jumps when it should only be one extra.
Spoiler
Show

Code: Select all

1 : [b][u]Litany of Fury to Scale Plate Green I[/u][/b] --//Litany of Fury//Jump Gate//Jump Gate//True Sight//Jump Gate//Jump Gate//Pontifex's Claim//Jump Gate//Jump Gate//Priest Rings//Jump Gate//Jump Gate//Prior's Void//Jump Gate//Jump Gate//Armada's Rage//Jump Gate//Jump Gate//Guiding Star//Jump Gate//Jump Gate//Perpetual Sin//Jump Gate//Jump Gate//Sanctum Verge//Jump Gate//Jump Gate//Unholy Retribution//Jump Gate//Jump Gate//Trinity Sanctum VII//Jump Gate//Jump Gate//Sacred Relic//Jump Gate//Jump Gate//Pious Mists IV//Jump Gate//Jump Gate//Consecrated Fire//Jump Gate//Jump Gate//Nopileos' Memorial//Jump Gate//Jump Gate//Scale Plate Green VII//Jump Gate//Jump Gate//Scale Plate Green I
1 : [b][u]Litany of Fury to Scale Plate Green VII[/u][/b] --//Litany of Fury//Jump Gate//Jump Gate//True Sight//Jump Gate//Jump Gate//Pontifex's Claim//Jump Gate//Jump Gate//Prior's Void//Jump Gate//Jump Gate//Armada's Rage//Jump Gate//Jump Gate//Guiding Star//Jump Gate//Jump Gate//Legal Directive//Jump Gate//Jump Gate//Profit Imperative//Jump Gate//Jump Gate//Open Market//Jump Gate//Jump Gate//Memory of Profit IX//Jump Gate//Jump Gate//Profit Center Alpha//Jump Gate//Jump Gate//Ianamus Zura IV//Jump Gate//Jump Gate//Path to Profit//Jump Gate//Jump Gate//First Flight//Jump Gate//Jump Gate//Watchful Gaze//Jump Gate//Jump Gate//Perdition's End//Jump Gate//Jump Gate//Trinity Sanctum VII//Jump Gate//Jump Gate//Sacred Relic//Jump Gate//Jump Gate//Pious Mists IV//Jump Gate//Jump Gate//Consecrated Fire//Jump Gate//Jump Gate//Nopileos' Memorial//Jump Gate//Jump Gate//Scale Plate Green VII

66 : [b][u]Antigone Memorial to Hatikvah's Choice III[/u][/b] --//Antigone Memorial//Jump Gate//Jump Gate//The Void//Jump Gate//Jump Gate//Sanctuary of Darkness//Jump Gate//Jump Gate//The Shallows//Jump Gate//Jump Gate//Shadow's End//Jump Gate//Jump Gate//Wretched Skies//Jump Gate//Jump Gate//Willing Sacrifice//Jump Gate//Jump Gate//Hewa's Twin V//Jump Gate//Jump Gate//Hewa's Twin III//Jump Gate//Jump Gate//Hewa's Twin I//Jump Gate//Jump Gate//Path to Profit//Jump Gate//Jump Gate//Profit Center Alpha//Jump Gate//Jump Gate//Memory of Profit X//Jump Gate//Jump Gate//Memory of Profit IX//Jump Gate//Jump Gate//Spaceweed Drift//Jump Gate//Jump Gate//Blue Horizon//Jump Gate//Jump Gate//Dark Horizon//Jump Gate//Jump Gate//Silent Witness I//Jump Gate//Jump Gate//Morning Star III//Jump Gate//Jump Gate//Hatikvah's Choice I//Jump Gate//Jump Gate//Hatikvah's Choice III
66 : [b][u]Antigone Memorial to Hatikvah's Choice I[/u][/b] --//Antigone Memorial//Jump Gate//Jump Gate//The Void//Jump Gate//Jump Gate//Sanctuary of Darkness//Jump Gate//Jump Gate//The Reach//Jump Gate//Jump Gate//Argon Prime//Jump Gate//Jump Gate//Silent Witness I//Jump Gate//Jump Gate//Morning Star III//Jump Gate//Jump Gate//Hatikvah's Choice I
Here is a quick image of the routes taken.
https://imgur.com/aZiUHia *forum is blocking the image for some reason
  • Litany of Fury to Scale Plate Green I can be done in 14 jumps. The game generates a path of 16 jumps. It is depicted in green. This result is acceptable due to gate distance.
  • Litany of Fury to Scale Plate Green VII can be done in 13 jumps. The game generates a path of 21 jumps. It is depicted in yellow. It actually starts off better but at Guiding Star it gets lost and takes a further gate for a tour of the universe.
  • Antigone Memorial to Hatikvah's Choice III can be done in 7 jumps. The game generates a path of 20 jumps. It is depicted in red. It gets lost at Santuary of Darkness and takes a further gate for a tour of the universe.
  • Antigone Memorial to Hatikvah's Choice I can be done in 6 jumps. The game generates a path of 7 jumps. It is depicted in green. This result is acceptable due to gate distance.
Theory: Something is breaking the algorithm when a long route ends in a multi-sector cluster sector002. That or there is a randomization factor to prevent all traffic from taking the same route even though it must pass through sector001 for sector002.

Full report of jump routes created:
https://www.dropbox.com/s/y83i02so33b5o ... t.txt?dl=0

Post Reply

Return to “X4: Foundations - Scripts and Modding”