Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Contracts ETA's display - routing assistant

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
eti
Poor
Poor
Posts: 5
Joined: Wed Feb 10, 2016 11:24 am

Contracts ETA's display - routing assistant

Post by eti »

Hi,

Cannot find "contract" and "ETA" in the same post... which makes me wonder if the idea of a "Contracts ETA's" display of sorts (in a MFD for example) is just... sacrilege. Trying to tie up few contracts on the same ride being quite entertaining, that would be a interesting feature I guess... Maybe even a reason to try to code it myself.

What do you think ?

PS: I am pretty new here and in the Galaxy
User avatar
ffutures
---- E L I T E ----
---- E L I T E ----
Posts: 2144
Joined: Wed Dec 04, 2013 12:34 pm
Location: London, UK
Contact:

Re: Contracts ETA's display - routing assistant

Post by ffutures »

See this thread for a previous discussion

https://bb.oolite.space/viewtopic.php?f=6&t=17989

It's common to take several contracts - unfortunately keeping track of the time left etc. has always been a bit challenging, especially if you have a LOT of contracts running. For example, I'm currently running with eight passengers, twelve parcel contracts and nine cargo contracts totalling around 300,000 credits. I think I'll be able to get them all delivered before it's too late, but I've been wrong about that more than once, especially if I've had to stop for servicing or expensive repairs. As an obvious example, it would be nice if contracts were flagged if e.g. there is no way you can complete them in the time available (so start selling off the cargo / don't bother including that system on your route, etc.). Actually generating a route to meet all contracts before they expire would be a VERY tough bit of programming, I think.

One thing that helps a lot is the Display Current Course OXP, which shows the course you've previously selected when you look at contract screens. For example, if you take a nice lucrative contract across a galaxy you enter that as your destination on the navigation map, then when you look at subsequent contracts you can see if the destinations are on or near the planned route. If they aren't you should think very carefully before taking them!

https://bb.oolite.space/viewtopic.php?f=4&t=17892
eti
Poor
Poor
Posts: 5
Joined: Wed Feb 10, 2016 11:24 am

Re: Contracts ETA's display - routing assistant

Post by eti »

Thanks for input !

That Display Course mod is indeed very helpful. On the other hand, I am sorry but I misswrote :D: "deadline" was the word, not ETA... but that was until I realized that the F5 panel shows the NOW-relative deadline and not the TIME_OF_CONTRACT-relative deadline and therefore was exactly what I wanted (told you I was new).

As for ETA's: I am familiar with that poor salesman travel problem... and yep, still an efficient optimization algo. is not known. Plus, if carrier contracts is the choice of career then optimization becomes part of the job/fun.

But still I guess few assistance tools could help... for example:
  • is there a way to plan routing (from F6 panel) with way-points ? Then the user could be left with the routing burden while the game could just display the best case scenario delivery (QUICKEST_WAY - TIME_TO_DEADLINE):

    Code: Select all

    Esgerean: 2 hours ahead (3 hops)
    Erbiti: 35 hours ahead (8 hops)
    Raleen: 2 hours short (11 hops)
    Geinona: 42 hours ahead (15 hops)
    
  • as we go through the contract offers, we could be offered a non-optimized routing to include that contract on our way: keep the current route as is and find "best" inserting point for the offered contract... which is a O(n) problem (if we have a precomputed routing table over the galaxy). Just need to define what "best" means.
    For example using that "best case scenario delivery" time: chose inserting position with least impact on subsequent contract... again, as a feedback. We leave the job to the commander.
The whole point being in leaving the Commander in charge but UI providing feedback on his current plan... not sure that I am clear.
User avatar
ffutures
---- E L I T E ----
---- E L I T E ----
Posts: 2144
Joined: Wed Dec 04, 2013 12:34 pm
Location: London, UK
Contact:

Re: Contracts ETA's display - routing assistant

Post by ffutures »

Way-points really would make planning a long run much easier, but at the moment aren't part of the navigation system.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16073
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Contracts ETA's display - routing assistant

Post by Cody »

ffutures wrote:
Way-points really would make planning a long run much easier...
Aye, waypoints on F6 would be cool. Currently, all you can do is mark one system on the chart.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
eti
Poor
Poor
Posts: 5
Joined: Wed Feb 10, 2016 11:24 am

Re: Contracts ETA's display - routing assistant

Post by eti »

So, as I am not familiar at all with the extension API (yet), I'm trying proof of concept implementing some advanced routing in some python script on the side. Looking good... But I am a bit frustrated though because I can't seem to get distances calculations "right".

I'm loading the oolite.app/Resources/Config/planetinfo.plist file and use the coordinates field (couple of integers). I figured there is some scaling (A, B) done to those coordinates to put them in "chart scale"... A nice regression gives me A^2=0.15828995 and B^2=0.04044415 on the sample bellow... but I thought with rounding and all, I also tried with (0.16,0.4) as it looked better.

In any case, when I compute my distance I get significant differences with distances displayed on the F6 boards... enough to mess up the link network:

Code: Select all

Ribiso( 97,166) - Vetitice(105,152):  4.3ly (Oolite says  4.0ly)
Ribiso( 97,166) -   Inonri(114,161):  6.9ly (Oolite says  6.8ly)
Ribiso( 97,166) - Ontimaxe( 84,164):  5.2ly (Oolite says  5.2ly)
Ribiso( 97,166) -   Mariar( 96,178):  2.4ly (Oolite says  2.4ly)
Ribiso( 97,166) - Encereso( 85,189):  6.6ly (Oolite says  6.4ly)
Ribiso( 97,166) - Anxebiza(104,189):  5.4ly (Oolite says  5.2ly)
Ribiso( 97,166) - Rateedar(102,193):  5.8ly (Oolite says  5.2ly)
Ribiso( 97,166) -   Vebege( 89,195):  6.6ly (Oolite says  6.4ly)
Ribiso( 97,166) -   Cemave(  6,  0): 49.3ly (Oolite says 49.2ly)
Ribiso( 97,166) -  Teaatis(  4,238): 39.9ly (Oolite says 39.6ly)
Ribiso( 97,166) - Ribilebi(252, 11): 69.3ly (Oolite says 69.2ly)
Ribiso( 97,166) -   Isdibi(251,244): 63.5ly (Oolite says 63.2ly)
Ribiso( 97,166) -   Riiser( 52, 74): 25.7ly (Oolite says 25.6ly)
Ribiso( 97,166) -   Xeesle( 53,209): 19.6ly (Oolite says 19.2ly)
Ribiso( 97,166) -    Arexe(164, 89): 30.9ly (Oolite says 30.8ly)
Ribiso( 97,166) -     Beti(150,206): 22.7ly (Oolite says 22.4ly)
So, as I am not familiar with Objc before I track how Oolite does it, I am hoping some of the devs could tell me what is the magic in translating the plist's strcture coordinates into chart coordinates in order to get the "right" distance calculations.

Cheers...

PS: on another topic... there seem to be two planets called "Inzaan" in chart #7
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16073
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Contracts ETA's display - routing assistant

Post by Cody »

There are indeed two Inzaans in the eighth octant (both inhabited by insects).
There are other duplicate systems, but not with both in the same octant.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Contracts ETA's display - routing assistant

Post by Smivs »

Well, insects lack imagination - Inzaans is 'InsectWorld' in the insectoid language.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16073
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Contracts ETA's display - routing assistant

Post by Cody »

<chortles> Yeah... just as Xeer is large yellow bug-eyed frog world in whatever language large yellow bug-eyed frogs use!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
eti
Poor
Poor
Posts: 5
Joined: Wed Feb 10, 2016 11:24 am

Re: Contracts ETA's display - routing assistant

Post by eti »

Found it ! An intriguing mixture of floor division and intermediate rounding in legacy_random.h. Sorry for the inconvenience... at least the Insects story got me curious to wonder off the first octant...
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Contracts ETA's display - routing assistant

Post by cim »

eti wrote:
Found it ! An intriguing mixture of floor division and intermediate rounding in legacy_random.h. Sorry for the inconvenience... at least the Insects story got me curious to wonder off the first octant...
For compatibility with the original Elite's hyperspace connectivity. If you poke around there's a few old threads about trying to use a "true" distance calculation, but it's not straightforward.
Post Reply