YACD - Yet Another CargoDestinations (v2.3 released)

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

User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: YACD - Yet Another CargoDestinations

Post by andythenorth »

Trains 20 and 22 are dropping scrap metal for Binkyton Steel Mill at Cheekywig. That surprises me as they should provide the best route to Binktyon Steel Mill. (in fact they are the only possible link from Cheekywig for that cargo).
Attachments
Fallington Transport, 9th May 1900.sav
(217.95 KiB) Downloaded 174 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: YACD - Yet Another CargoDestinations

Post by Zuu »

It would be useful if one could ctrl+click on station names in the via/transfer etc. displays at stations/vehicle details. The expected behaviour would be to center the main viewport at the location of the station.


A more complicated (to implement) feature would be to have a link to map button at industries that would show desire lines in the minimap. (desire lines is lines that show the demand going from one point to another) Extra nice if the lines get thicker for higher demand. :-) But just showing an a line to all destinations of a given industry would be helpful. However, attempting to implement a map that show all desire lines at the same time is just wasted time - you will not be able to see anything because of all lines in the way. :-)
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: YACD - Yet Another CargoDestinations

Post by planetmaker »

For some reason the train doesn't continue to load all available cargo from the station. I added orders 3 and 4 while it was heading to the station. But also cycling through the orders so that the train arrives anew doesn't solve that all cargo will be loaded, just some additional one.
Attachments
train
train
Brown & Co., 1970-01-20.png (114.03 KiB) Viewed 892 times
yacd-test.sav
with same newgrfs as before
(546.98 KiB) Downloaded 158 times
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations

Post by Michi_cc »

planetmaker wrote:Right after game start (2nd January) I checked a random town. Seems the % calcuated are slightly off ;-)
These numbers will go away in the next release as they are somewhat broken and don't show something useful except for debugging.
planetmaker wrote:There seem to be issues with automatic orders, or maybe it's only that the cargo or routing cache has not being updated (yet); in any case it's a bit surprising:
Yes, automatic orders got broken somewhere during one of the last YACD updates to trunk, will be fixed.
Zuu wrote:It would be useful if one could ctrl+click on station names in the via/transfer etc. displays at stations/vehicle details. The expected behaviour would be to center the main viewport at the location of the station.
Good idea. The industry/town destination list already does it (normal click is enough) and also implementing it for the station view makes sense. Some graphs are planed for later, but I think fixing bugs is more important :)

-- Michael Lutz
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: YACD - Yet Another CargoDestinations

Post by andythenorth »

In this save, Snoozeweed Forest is showing some odd behaviour.

Snoozeweed Woods doesn't appear to be receiving cargo. Yet cargo is being distributed from the forest. I thought it might be a catchment area issue, with cargo going straight to Snoozeweed Valley, but can't see what would cause that.

This is in a build with the change to DistanceSquare you suggested.
Attachments
Snoozeweed Transport, 7th May 1884.sav
(157.98 KiB) Downloaded 155 times
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations

Post by Michi_cc »

The bugfix release 1.1 is out. The git repo was rebased to get rid of all the embarrassing fix commits, so please follow the instructions on the repo page.

Notable changes:
  • economy.cargodest.ind_chances was changed, delete the entry from your openttd.cfg to get the new value. Unfortunately, changing this value via the in-game console is not possible.
  • A bug regarding the path cost limiting algorithm leading to lower than expected cargo creation was fixed.
  • Automatic transfer handling was somewhat broken for stations that don't accept the cargo and for automatic orders.
  • Order pre-fill was broken when an order list contained two orders with the same destination directly after each other.
-- Michael Lutz
Attachments
yacd_v1_1_r22377.patch
YACD 1.1
(264.74 KiB) Downloaded 184 times
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Eddi »

something i noticed:
i had an industry chain A->B, and A said it produces cargo for B, but it didn't actually produce anything until i put all of B into the catchment area of my station, just some of it didn't work. this is kind of a serious deviation from trunk behaviour.
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Eddi »

i have a weird behaviour: in the attached savegame, tram 34 (and judging from the income, a few others as well) of tram line "Loisachkirchen Linie 1" (Fabrik-Hafen-Zentrum-Süd) is running around completely full, never unloading anything at any stop. I rerouted this line a while ago (was: Bahnhof-Hafen-Zentrum-Süd), so maybe that was the cause.


I'm still using version 1.0, have not updated to 1.1 yet.

I can send my GRFs per PM if needed.
Attachments
Loisachkirchen Transport, 26. Jun 1934.sav
(141.52 KiB) Downloaded 159 times
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Zuu »

I got an assertion in version 1.0 of this patch. As from what I can see in your changelog this issue has not been addressed so try to explain how it happened.

When I clicked on "Total Cargo" on the detail window of Train 10 (see screenshot), I got an assertion error (also displayed in the screenshot). [edit: the previous text I wrote about the train being on a detour + changed orders was wrong. That was another train.]


I don't have a recent savegame for this game, so that's not much of a help. (the latest one is about 10-20 game years old)

In case it helps, I have the openttd.pdb file that is needed in order to interpret the crash.dmp file. If I figure out how to pair them together to get a call trace, I'll post it.

Edit: Callstack:

Code: Select all

 	kernel32.dll!7655fbae() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	
 	kernel32.dll!7655fbae() 	
 	ntdll.dll!773f4cb0() 	
 	ntdll.dll!773bbd86() 	
>	openttd.exe!CustomAbort(int signal=22)  Line 547	C++
 	openttd.exe!raise(int signum=22)  Line 590 + 0x4 bytes	C
 	openttd.exe!abort()  Line 71 + 0x7 bytes	C
 	openttd.exe!error(const char * s=0x0074f624, ...)  Line 125	C++
 	openttd.exe!FormatString(char * buff=0x00000000, const char * str_arg=0x00000000, StringParameters * args=0x0012e820, unsigned int casei=0, const char * last=0x0012f58f, bool dry_run=true)  Line 785	C++
 	openttd.exe!FormatString(char * buff=0x00000000, const char * str_arg=0x00000000, StringParameters * args=0x0012e820, unsigned int casei=0, const char * last=0x0012f58f, bool dry_run=false)  Line 687	C++
 	openttd.exe!GetStringWithArgs(char * buffr=0x00000000, unsigned int string=0, StringParameters * args=0x0012e820, const char * last=0x0012f58f)  Line 189	C++
 	openttd.exe!FormatString(char * buff=0x00000000, const char * str_arg=0x00000000, StringParameters * args=0x007da42c, unsigned int casei=0, const char * last=0x0012f58f, bool dry_run=true)  Line 820	C++
 	openttd.exe!FormatString(char * buff=0x00000000, const char * str_arg=0x00000000, StringParameters * args=0x007da42c, unsigned int casei=0, const char * last=0x0012f58f, bool dry_run=false)  Line 687	C++
 	openttd.exe!GetStringWithArgs(char * buffr=0x00000000, unsigned int string=0, StringParameters * args=0x007da42c, const char * last=0x0012f58f)  Line 189	C++
 	openttd.exe!GetString(char * buffr=0x0012ed90, unsigned short string=2520, const char * last=0x0012f58f)  Line 196	C++
 	openttd.exe!DrawString(int left=18, int right=411, int top=129, unsigned short str=2520, TextColour colour=TC_BEGIN, StringAlignment align=SA_LEFT, bool underline=false)  Line 653	C++
 	openttd.exe!DrawTrainDetails(const Train * v=0x00639888, int left=2, int right=411, int y=0, int vscroll_pos=-5, unsigned short vscroll_cap=7, TrainDetailsWindowTabs det_tab=1242572)  Line 444	C++
 	openttd.exe!VehicleDetailsWindow::DrawVehicleDetails(const Vehicle * v=0x00000000, int left=0, int right=0, int y=0, int vscroll_pos=0, unsigned int vscroll_cap=7, TrainDetailsWindowTabs det_tab=TDW_TAB_TOTALS)  Line 1933	C++
 	openttd.exe!VehicleDetailsWindow::DrawWidget(const Rect & r={...}, int widget=7)  Line 1994	C++
 	openttd.exe!NWidgetLeaf::Draw(const Window * w=0x021878a8)  Line 2318	C++
 	openttd.exe!NWidgetSmallmapDisplay::Draw(const Window * w=0x021878a8)  Line 1619 + 0x10 bytes	C++
 	openttd.exe!NWidgetSmallmapDisplay::Draw(const Window * w=0x021878a8)  Line 1619 + 0x10 bytes	C++
 	openttd.exe!NWidgetSmallmapDisplay::Draw(const Window * w=0x021878a8)  Line 1619 + 0x10 bytes	C++
 	openttd.exe!Window::DrawWidgets()  Line 549	C++
 	openttd.exe!VehicleDetailsWindow::OnPaint()  Line 2045 + 0x5 bytes	C++
 	openttd.exe!DrawOverlappedWindow(Window * w=0x00000000, int left=0, int top=144, int right=704, int bottom=328)  Line 530 + 0x7 bytes	C++
 	openttd.exe!DrawOverlappedWindowForAll(int left=256, int top=144, int right=704, int bottom=328)  Line 547	C++
 	openttd.exe!RedrawScreenRect(int left=256, int top=0, int right=0, int bottom=0)  Line 1561	C++
 	openttd.exe!DrawDirtyBlocks()  Line 1645 + 0xb bytes	C++
 	openttd.exe!UpdateWindows()  Line 2433	C++
 	openttd.exe!VideoDriver_Win32::MainLoop()  Line 900	C++
 	openttd.exe!ttd_main(int argc=, char * * argv=)  Line 715	C++
 	openttd.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00252fd6, int nCmdShow=1)  Line 431 + 0x9 bytes	C++
 	openttd.exe!__tmainCRTStartup()  Line 263 + 0x1b bytes	C
 	kernel32.dll!7656d0e9() 	
 	ntdll.dll!773d16c3() 	
 	ntdll.dll!773d1696()
Attachments
yacd-assertion.png
(617.27 KiB) Downloaded 1 time
crash.sav
(164.39 KiB) Downloaded 137 times
crash.zip
crash.dmp, crash.png and crash.log
(813.51 KiB) Downloaded 139 times
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Zuu »

Win32 binary of version 1.1 of this patch.

Build type: Release
Compiler: Visual Studio Express 2008
openttd-r22377M-win32-YACD-1.1.zip
(4.1 MiB) Downloaded 194 times

Michi_cc: I have edited my crash report above a bit as I found out I had mixed up the crash-train with another train.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Michi_cc »

Zuu wrote:I got an assertion in version 1.0 of this patch. As from what I can see in your changelog this issue has not been addressed so try to explain how it happened.
Bad luck, that error is actually already fixed in 1.1. I didn't write all changes in the post as they weren't publicly reported anywhere. Sorry for the extra work.

-- Michael Lutz
User avatar
fonso
President
President
Posts: 945
Joined: 13 Oct 2007 08:28

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by fonso »

I think it'll be rather simple to get cargodist-style distribution based on YACD. The attached patch is quite rough around the edges as I hacked it together quickly just to see if I'm getting anywhere. It creates new destinations as you connect places to the network. It doesn't remove them, yet and it doesn't completely prevent the creation of YACD-style destinations and I haven't tested it for anything but passengers, but in principle it does the trick.
Attachments
dist.diff
distyacd, maybe?
(4.23 KiB) Downloaded 156 times
The guy on the picture is not me, it's Alonso.
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Lord Aro »

OK, i've just started playing, and have some suggestions:

- industry/town windows should expand width-ways as well as length-ways (Less resizing/scrolling required)
- the amount of cargo going to each location should be in order of size

hope that makes sense :)
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
acabin
Engineer
Engineer
Posts: 27
Joined: 05 Mar 2009 18:40

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by acabin »

Maybe I found a bug?
In a game the first journey of any line has not income?
I speak Chinglish...
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Terkhen »

There are many places in the GUI already where a click will take you to the destination. The only one I'm missing are the cargo destinations in the stations themselves. It would be quite nice to allow to check where is the cargo from a given station going.

I also found an issue. See the following screenshot:
Rendnor End Transport, 1971-10-26.png
Rendnor End Transport, 1971-10-26.png (57.45 KiB) Viewed 5296 times
As you can see, almost all chemicals want to go to a Lumber Yard. As a result of this, I am not able to supply with chemicals any Plastics Plant.
acabin wrote:Maybe I found a bug?
In a game the first journey of any line has not income?
That happened to me too. If required I can check if it happens everytime and which steps are required to reproduce it.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by planetmaker »

Another thing I noticed in my test game:
In a train I can quickly check where the cargo comes from and wants to go in the details view. A ship does not allow that (EDIT: this was still from 1.0):
Attachments
destinations.png
destinations.png (44.3 KiB) Viewed 5292 times
Eddi
Tycoon
Tycoon
Posts: 8267
Joined: 17 Jan 2007 00:14

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Eddi »

i'm having another weird effect, this time i updated to 1.1 to make sure.

in this savegame i have added coal trains from Wiedhof Ost to Loisachkirchen Fabrik, and coal ships from Loisachkirchen Fabrik to Wörnitzkirchen Mühle, on a route previously serviced by ore ships. but the coal trains are not picking up any coal, only after i unshare the coal ship orders from the ore ship orders, the coal transport starts
Attachments
Loisachkirchen Transport, 19. Apr 1944.sav
(233.5 KiB) Downloaded 149 times
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Michi_cc »

Terkhen wrote:There are many places in the GUI already where a click will take you to the destination. The only one I'm missing are the cargo destinations in the stations themselves. It would be quite nice to allow to check where is the cargo from a given station going.
Will be added to the station window, Ctrl+Click though, as Click only is already used for expanding/collapsing the lines.
Terkhen wrote:As you can see, almost all chemicals want to go to a Lumber Yard. As a result of this, I am not able to supply with chemicals any Plastics Plant.
Is the lumber yard producing cargo? If yes, changing economy.cargodest.weight_scale_ind to "25,40" or so should help (as this var is a list, the in-game console won't work). You can also increase economy.cargodest.min_weight_ind (which can be changed in-game).
Terkhen wrote:That happened to me too. If required I can check if it happens everytime and which steps are required to reproduce it.
The vehicle is carrying cargo, right? If yes, that definitely sounds like a bug.

-- Michael Lutz
acabin
Engineer
Engineer
Posts: 27
Joined: 05 Mar 2009 18:40

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by acabin »

Michi_cc wrote: The vehicle is carrying cargo, right? If yes, that definitely sounds like a bug.
Yes, NOT any income while carrying cargo, but only happens at the first journey of a line.

And how can I know all the upstream industries of a specific industry?
I speak Chinglish...
Michi_cc
OpenTTD Developer
OpenTTD Developer
Posts: 619
Joined: 14 Jun 2004 23:27
Location: Berlin, Germany
Contact:

Re: YACD - Yet Another CargoDestinations (v1.1 released)

Post by Michi_cc »

acabin wrote:And how can I know all the upstream industries of a specific industry?
By checking all other producing industries. (Not ideal, I know.)
planetmaker wrote:In a train I can quickly check where the cargo comes from and wants to go in the details view. A ship does not allow that
Both things could indeed have better GUI support, but as I'm lazy, GUI stuff has a lower priority :)

-- Michael Lutz
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 49 guests