Page 1 of 1

Warp Trading

Posted: Mon Aug 21, 2017 19:52 UTC
by Zeratul
I remember in the older versions there was a way to set a link up between 2 sectors, possibly only for controlled sectors for trade. You were able to warp to 1 sector, instantly trade, warp back and trade consistently. I remember there was also the option to set where you could repeatedly do this trade setup, such as 1 sector Goods, 1 sector Ore, and just rapidly warp between them and trade in 1 go. I also remember this was a function for quickly distributing Colonists from a Special port to planets.
Is this a function that I was exploiting in the past that was not permitted, something that will be added later that's not current, or just one of those things that's eluding me to use?

Nevermind it was eluding me, it was the Trade Route option in bottom left corner of screen.

Re: Warp Trading

Posted: Mon Aug 21, 2017 19:54 UTC
by Zeratul
I would also like to ask the question about the Fuel Scoop for energy when Warping from sector to sector. Is there a specific tile distance required to get the maximum Energy per travel? I have been testing this and have spent at least 1000 turns trying to find that specific sweet spot between sectors to setup a quick trade route for an Ore and Goods Port while Warping and scooping Energy for maximized profit from trading.

Re: Warp Trading

Posted: Mon Aug 21, 2017 22:54 UTC
by TheMightyDude
Ok, just dug up some code from rsmove.php which says the following for the fuelscoop

Code: Select all

$deg = pi () / 180;

$sa1 = $start['angle1'] * $deg;
$sa2 = $start['angle2'] * $deg;
$fa1 = $finish['angle1'] * $deg;
$fa2 = $finish['angle2'] * $deg;
$x = ($start['distance'] * sin ($sa1) * cos ($sa2)) - ($finish['distance'] * sin ($fa1) * cos ($fa2));
$y = ($start['distance'] * sin ($sa1) * sin ($sa2)) - ($finish['distance'] * sin ($fa1) * sin ($fa2));
$z = ($start['distance'] * cos ($sa1)) - ($finish['distance'] * cos ($fa1));
$distance = round (sqrt (pow ($x, 2) + pow ($y, 2) + pow ($z, 2)));

$energyscooped = $distance * 100;

$free_power = NUM_ENERGY ($playerinfo['power']) - $playerinfo['ship_energy'];

And if $energyscooped is larger than $free_power cap $energyscooped to $free_power

Hope that helps :P

Re: Warp Trading

Posted: Tue Aug 22, 2017 16:46 UTC
by Zeratul
ok TheMightyDude im not too great at reading code, could you put that in a bit more basic terms for me please? =)

Re: Warp Trading

Posted: Tue Aug 22, 2017 18:15 UTC
by TheMightyDude
Zeratul wrote:ok TheMightyDude im not too great at reading code, could you put that in a bit more basic terms for me please? =)
LOL, it basically gets the distance between to locations i.e. the current sector and the destination sector and multiplies that by 100.
If that return value is greater than what you ship can store it will cap it to the max your ship can handle.

Sorry if that is confusing, I am not really good at explaining things LOL.

Re: Warp Trading

Posted: Wed Aug 23, 2017 01:58 UTC
by thekabal
Zeratul wrote:ok TheMightyDude im not too great at reading code, could you put that in a bit more basic terms for me please? =)
Any sector is stored with an X,Y,Z coordinate. It's important to realize that it's a full cube space - not simple tiles.

With those coordinates, it does essentially this: https://www.calculatorsoup.com/calculat ... points.php

(Distance between two cartesian points in a 3d/cube space).

And finally, as TMD said, it multiplies it by 100 and if its larger than the max, it reduces it to the max.

Also? I hate geometry with a fiery passion.