Cargo Distribution

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Kaos
Engineer
Engineer
Posts: 7
Joined: 14 Feb 2013 09:04

Re: Cargo Distribution

Post by Kaos »

I attached the latest savegame, I'm running a few newgrfs, but nothing exotic.

Even though the island is small I find it very confusing to look at the expanded entries. It looks to me like people certainly want to use the ferries.

My question really is: What's most efficient? I can't help myself, no matter how much money I'm making in a business simulation, I want to maximise profits. The first time I used Cargodist was on the "road vehicle map" scenario. And I got too confused trying to directly connect all the towns and having busses run empty so I went for a simple set up, have bus lines run just between two towns and forcing the passengers to transfer up to 10 times to reach their destination - and Cargodist handled it really well.

So I think it'd be more efficient for this island to have ferries just run from one dock to the next. But it's... less elegant than the two routes going around the island servicing every dock.
Attachments
Kinningley Transport, 25th May 2000.sav
(31.33 KiB) Downloaded 38 times
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Most of the people waiting at the docks have gotten off the ships and are now waiting for bus connections to their (inland) destinations. As the bus connections are sparse and of low capacity they pile up. Some of the ferry connections (e.g. Deadhead Valley <-> Deadhead North) are also overloaded with people piling up. You can see that by switching to Amount:Waiting and Via-Destination-Source in the station GUI.
The guy on the picture is not me, it's Alonso.
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

The savegame is still very educational as it allowed me to find a different bug which might be Jacko's problem (whose savegame I can't load due to missing grfs): Occasionally there are passengers waiting for a transfer to the same station they are waiting at. Those will never be picked up.

Jacko: Can you switch to the via-destination-source and Amount:Waiting view in that station, fully expand all entries and post another screenshot of that?
The guy on the picture is not me, it's Alonso.
Kaos
Engineer
Engineer
Posts: 7
Joined: 14 Feb 2013 09:04

Re: Cargo Distribution

Post by Kaos »

Thank you, Fonso. Those options in the station GUI were total news to me, so many little things to discover in this game. Only on this map and far too late I learned about shared orders and cloning with shared orders, my network would be a lot better if I had worked it out earlier. I was quite embarrassed to post this savegame. :)

In case anybody is interested, here's the map as a scenario. With just four small villages (about 100 inhabitants each) and four industries (forest/sawmill and oilrig/refinery). Takes a long time to get going.
Attachments
test2.scn
(10.7 KiB) Downloaded 40 times
island.jpg
island.jpg (56.62 KiB) Viewed 2047 times
kormer
Engineer
Engineer
Posts: 39
Joined: 11 Sep 2004 17:05

Re: Cargo Distribution

Post by kormer »

I already know the answer is almost certainly no, but I want to ask it anyways. Is there any way that a game script could interact with the added information available in this patch? I'd be particularly interested in knowing what the destinations are for cargo waiting at a station.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Cargo Distribution

Post by Zuu »

Patches can contain additions to the GS (or AI) API. If that is the case, it is possible to write AIs/GSes specifically for a patched version of OpenTTD. For example, locally I have a test GS that make use of the Story Book GS API which is added my my work-in-progress patch.

That being said, it adds to the list of things to maintain for a patch author. If you believe that the AI/GS interface is not a main part of your patch, it is possible to leave that until the main part have been stabilized.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

AI and GS interfaces will be implemented when the base functionality has been merged. For now I'm concentrating on improving the link graph construction and handling. There's nothing to stop other people from adding GS and AI interfaces earlier, though.
The guy on the picture is not me, it's Alonso.
kormer
Engineer
Engineer
Posts: 39
Joined: 11 Sep 2004 17:05

Re: Cargo Distribution

Post by kormer »

Is there a way to tell what revision the diff file in the first post is meant for? I tried applying to trunk, but I ended up getting errors on almost every file.

Also for what it's worth, I've been playing with this on an older revision on a multiplayer server for several weeks now without any stability issues.
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

You can always find the current trunk revision the patch is meant to be applied to by looking at the topmost commit at https://github.com/fonsinchen/openttd-c ... its/master . You can also download a source package from https://github.com/fonsinchen/openttd-c ... ive/cd.zip and directly compile that without patching. It is equivalent to the openttd source package, but has cargodist included.
The guy on the picture is not me, it's Alonso.
kormer
Engineer
Engineer
Posts: 39
Joined: 11 Sep 2004 17:05

Re: Cargo Distribution

Post by kormer »

fonso wrote:You can always find the current trunk revision the patch is meant to be applied to by looking at the topmost commit at https://github.com/fonsinchen/openttd-c ... its/master . You can also download a source package from https://github.com/fonsinchen/openttd-c ... ive/cd.zip and directly compile that without patching. It is equivalent to the openttd source package, but has cargodist included.
Thanks.
dasy2k1
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 20 Sep 2006 23:43
Location: UK
Contact:

Re: Cargo Distribution

Post by dasy2k1 »

Any chance of the link graph overlay being dependant on the drive side

its quite confusing for me at the moment as I play UK games with road and rail traffic on the left yet the overlay shows right hand traffic.
Given the signals allready read this parameter, should be relitivly easy to implement.
dasy2k1
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 20 Sep 2006 23:43
Location: UK
Contact:

Re: Cargo Distribution

Post by dasy2k1 »

Also I think i have found a bug.... happening since the last branch of the git repo (i have to keep reseting it everytime you branch and merege)

If i have a bus route

A -- B --- C -- D and back again, where D is the station most pax transfer on to elesewhere at and A is a really quiet station that hardly anyone gets on or off at, B and C are simple inner city bus stops...

bus (say with a capacity of 10) comes along and loads mabie 2 or 3 pax at A, then drives to B where hundreds of pax arwaiting to get to D,
what should happen is that it loads more pax at B untill full then continues to C etc

but at the moment the bus is loading at A, then not really stopping to load or unload at B leaving all the pax waiting.
It works normally if any pax from A want to get off at B but this is rare as most are for D and onwards

see attached savegame where chapel le ferne west is A central is B. and stn is D
Road vehicle 35 is just about to show this behaviour...
(all newgrfs avalalable from Bananas )
Attachments
Allan & Co., 17th Jun 1839.sav
(416.45 KiB) Downloaded 27 times
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Thanks a lot for the report. Today's version g4a83d91a-cd fixes that and is savegame compatible with g0eedca67-cd.
The guy on the picture is not me, it's Alonso.
Arie-
Director
Director
Posts: 593
Joined: 20 Jan 2009 16:07

Re: Cargo Distribution

Post by Arie- »

Cargoflow overlay does not show links to non-company stations. FIRS dredging site or default oil rig eg. Bug also submitted here
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Thanks for the report. I know that bug and its cause already. I somehow lost track of it but I'll fix it now.
The guy on the picture is not me, it's Alonso.
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Today's version g65dc2687-cd has an entirely rewritten handling of the basic link graph components. You should see the following effects:
  • better performance. There are no moving averages which have to be constantly decreased anymore. Also the starting and stopping of link graph jobs executes less code in the main game thread now.
  • Separate settings for the interval between subsequent starts of jobs and the time for each job to run. You can adapt that to your CPU. The defaults are 4 and 16. That means at most 4 (= 16/4) parallel jobs can be running. Most of the time there will be less because generally the jobs take less than those 16 days. If you have a single core CPU and a big game you may want to increase the interval to reduce the parallelism.
  • shorter delay between changes in the game and changes in the cargo distribution. The link graph job scheduling is somewhat more intelligent now.
  • There is a partly finished french translation now, thanks to keoz.
As the changes are quite massive, please watch out for any bugs and report them. There might be platform-specific compilation problem I'm not aware of. If that's the case the new version will not be released tonight, but probably tomorrow.
The guy on the picture is not me, it's Alonso.
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

Actually g65dc2687-cd will crash whenever you try to play with cargodist switched off. Also the smallmap window sometimes doesn't correctly show the cargoes you selected. That bug must have been around for ages, though. Please report those things when you see them. gdc70fe7-cd fixes both bugs.
The guy on the picture is not me, it's Alonso.
dasy2k1
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 20 Sep 2006 23:43
Location: UK
Contact:

Re: Cargo Distribution

Post by dasy2k1 »

not sure if this is a cargodist bug or an upstream bug
but when i am in a text entry box (such as rename station, rename vhechle group, place sign etc) and also have the road building toolbar open
if i hit R it enables the road building tool rather than typing R, and from then onwards i am unable to enter any text save with the rubbish on screen keyboard
untill i restart the game.
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: Cargo Distribution

Post by fonso »

I can't reproduce this. Does it also happen when you start a new game instead of loading an existing one? Can you post your hotkeys.cfg, please?
The guy on the picture is not me, it's Alonso.
dasy2k1
Transport Coordinator
Transport Coordinator
Posts: 344
Joined: 20 Sep 2006 23:43
Location: UK
Contact:

Re: Cargo Distribution

Post by dasy2k1 »

yes it does happen when starting a new game,

and my hotkeys.cfg is below, it seems to be a priorities issue, the hot keys do what i would expect them to do normally (not that i use many, just esc and del normally) but i would have thought having your cursour in a text entry box would override everything else and just type text
Attachments
hotkeys.cfg
(3.37 KiB) Downloaded 35 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 13 guests