ECS Agricultural Vector problem

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
Joubarbe
Engineer
Engineer
Posts: 17
Joined: 06 Dec 2019 16:14

ECS Agricultural Vector problem

Post by Joubarbe »

Hi,

Not sure if I'm allowed to post mod-related problems here...
I recently installed all ECS Vectors, because the stockpile feature seems to me a must-have after playing a bit of Transport Fever :)
Anyway, when I start a new game, I got the following error: "Callback 0x14b returned unknown/invalid result 0x0". I'm pretty sure no one would have a solution to fix it, but if at least someone could confirm that this error doesn't do much damage to the gameplay, that would be great!
2019-12-29 10_36_47-Greenshot.png
(742.6 KiB) Not downloaded yet

User avatar
jfs
Tycoon
Tycoon
Posts: 1082
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: ECS Agricultural Vector problem

Post by jfs »

Is it every time you start a new game, or only sometimes?
Which version of OpenTTD?
What NewGRFs do you have enabled apart from ECS Agricultural Vector 1.2?

User avatar
kamnet
Moderator
Moderator
Posts: 7020
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: ECS Agricultural Vector problem

Post by kamnet »

According to this post, the order you load ECS Vector NewGRFs in is important. A proper example is listed in the screenshots.
http://www.tt-ms.de/forum/showthread.php?tid=6744

Joubarbe
Engineer
Engineer
Posts: 17
Joined: 06 Dec 2019 16:14

Re: ECS Agricultural Vector problem

Post by Joubarbe »

Considering to the wiki, only the Town Vectors must be loaded first.
Attached my current load order:
2019-12-29 12_00_45-Greenshot.png
(1.04 MiB) Not downloaded yet
OpenTTD 1.10.0b2 (latest)
Sometimes, very rarely, it seems to work... Couldn't reproduce it or isolate the problem though.

User avatar
jfs
Tycoon
Tycoon
Posts: 1082
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: ECS Agricultural Vector problem

Post by jfs »

I can reproduce it with your setup, and it can also happen if I put the Basic Vector II before all the other ECS vectors, or Agricultural after everything else.

I tried hooking up a debugger, and it looks like the industry is returning cargo number 0, which in the cargo translation table appears to have code '0000' (four ASCII zeroes), and is not actually defined in any of the GRFs. It resolves to internal CargoID 255 i.e. CT_INVALID after lookup. That's not the trigger of the error, even though it should perhaps be one, what actually triggers the error is that the industry returns multiple invalid cargo numbers, meaning it attempts to add CT_INVALID to the accepts_cargo table for the industry multiple times. The error is "duplicate cargo".

Joubarbe
Engineer
Engineer
Posts: 17
Joined: 06 Dec 2019 16:14

Re: ECS Agricultural Vector problem

Post by Joubarbe »

Thank you for looking so deeply into it. So... What does it mean? :)
Should I just ignore this error, or try something?

User avatar
jfs
Tycoon
Tycoon
Posts: 1082
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: ECS Agricultural Vector problem

Post by jfs »

I'm really not sure whether it's a bug in ECS or in OpenTTD, but I'm leaning towards it being ECS depending on undefined behaviour, and that behaviour has now changed.

I think I'll make a workaround for OTTD that hides the bug, though. For NewGRF industries not using the "aware of 16 cargoes in/out" flag, returning an invalid cargo entry used to not be an error, so it may as well return to being that. It will probably be "fixed" in the next OTTD beta (or release candidate, depending on things).

For now, the industries seem to be created, but might be missing some cargoes in their acceptance list.

Edit: The fix has been merged to the master branch, with some better analysis and explanation why it's the right thing to do.

User avatar
kamnet
Moderator
Moderator
Posts: 7020
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: ECS Agricultural Vector problem

Post by kamnet »

Somebody should wake up George and ask him nicely if he could fix those error. :)

User avatar
jfs
Tycoon
Tycoon
Posts: 1082
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: ECS Agricultural Vector problem

Post by jfs »

kamnet wrote:
30 Dec 2019 10:38
Somebody should wake up George and ask him nicely if he could fix those error. :)
Well, after discussion on IRC it turns out it's not really an error after all. NewGRF industries have to be written that way, at least under the old rules, since the production callbacks and other things depend on the specific cargo slot each input and output cargo on an industry is in. Only industries written with the new (version 2) production callback would be able to work right with accepted/produced cargoes in any order/slot. There's a bit more to the explanation, but it's not really a bug in ECS after all, but an oversight in the implementation of "16 in/out" in OpenTTD 1.9.0 to 1.10-beta2.

Joubarbe
Engineer
Engineer
Posts: 17
Joined: 06 Dec 2019 16:14

Re: ECS Agricultural Vector problem

Post by Joubarbe »

Good to know, thanks! :)

Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 8 guests