Moderator: OpenTTD Developers
(Posting "some scripts are missing" offers very few clues as to what it actually wants, there are several hundred to thousand of scripts.)
Change line 474 of OpHibernia.nut from
Code: Select all
AIOrder.AppendOrder(MyVehicle, DockLocation, AIOrder.OF_NONE);
Code: Select all
AIOrder.AppendOrder(MyVehicle, DockLocation, AIOrder.OF_NO_LOAD);
Code: Select all
AIOrder.AppendOrder(MyVehicle, DockLocation, AIOrder.OF_UNLOAD | AIOrder.OF_NO_LOAD);
WmDOT wants to duplicate ships based on waiting cargo on two routes, example, log route 47 and 48 (group route 48 and 49), with 1300 oil waiting at the same oil rig "A" for both routes.
It proceeds to duplicate 2 ships using the depot of log route 47 and 48 (group route 48 and 49) which share the same depot. However, the orders they get are wrong. They get the orders of log route 55 (group route 56) which is more than 1000 tiles away from the ship depot choice. Also, log route 55 (group route 56) oil rig "B", is already well serviced with ships saturating with no oil waiting. All these duplicated 200+ ships that cross the world aren't even going to profit once they reach their destination.
I guess there is some industry/order pair mismatching that happens at some point past 2010. I've never seen WmDOT with this issue before this year.
One other strange observation, is that WmDOT does very well from 1950 to 2010. At this point, it sells most of his ships, like 90% of all ships are sold, he only keeps a few. I am unsure if it's related, but by year 2010, the old oil cargo ship model is no longer available, but doesn't seem to make much sense, as it expires around 1990, not 2010.
EDIT: OOPS, nevermind, the log range for routes is from 0 to 55, the group names for routes are from 1 to 56, my bad. The log was misleading me. Fixed explanation to mention both.
EDIT2: Oh, you may notice that the ships have unload and leave empty in the orders, I was using a modified version of wmdot based on v13, I think it should be compatible with the original v13.
- Unnamed, 2044-08-29.sav
- (728.73 KiB) Downloaded 76 times
As for the extra ships being creating, I agree with you that the wrong depot is being used. I'm still not sure why. WmDOT assigns the depot when the route is first created, but also recreates them on reloading the game from a save.
WmDOT doesn't do anything if an industry closes. If all the applicable ships were sent to a depot, they should be sold automatically. The stub code, however, can be found in Event.Handler.nut, lines 149-151:
Code: Select all
case AIEvent.ET_INDUSTRY_CLOSE: Log.Note("Nice event and all, but I have no idea what to do about it...", 4); break;
The ship portion of the AI has never been as polished as the road portion. The ships were created mostly to keep WmDOT from going broke from road building, and to that end, I feel like they work reasonably well. That said, I will continue to happy accept suggestions and improvements.
I see that my explanation is still confusing. I will try to explain a bit better. Also, I forgot to mention, my testing was running for 100 years straight, from 1950 to 2051 without loading any savegame. I had the server configured to do monthly autosaves, and keep all autosaves, but the testing sessions were uninterrupted.
The issues start after a 60+ years game session, by the year 2010. From 1950-1960 WmDOT doesn't build any ship, but that's normal. Oil Rigs only start showing up from 1960 onwards.
From 1960-2010, all his ship management, and build construction seem correct. I haven't noticed anything abnormal during this period, profit graphs are always rising. One particular thing I notice is that when the new oil ship model becomes available (350 m3), and WmDOT finds out that some routes need more ships, it still duplicates the old ship model (220 m3) on already existant routes. Only the new routes get to use the new model. I see that this new model becomes available around 1969. Both old and new models co-exist from 1969 to 1990. Past 1990, I am not really sure what WmDOT does about those routes created before 1969 in regards to the need of adding more ships to a route.
Regardless, there is nothing strange happening during this period from 1990 to 2010, or at least, I have not noticed anything gone wrong. Sometimes I see some routes that have the exact same oil rig, same ship depot assignment and same orders. I'm unsure if this is how WmDOT deals with the two different ship models. Profits are still going strong, with no sign of declining, up till the year ~2010.
Once in ~2010, WmDOT goes crazy. I remember in one of the sessions, WmDOT had about 120 ships, but sells almost everything it had, and reached a minimum of 8 ships. I tried to look at the model of those 8 ships, and there is something in common, 7 out of 8 ships were the 350 m3 model, only the other lonely ship was the 220 m3 model. What could this mean? I'm not really sure. If my memory serves me right, these 8 ships were still profiting, but going from 120 to 8 really had a serious impact on the profit graph, it took a really sharp decline in the span of a few quarters.
From 2010 onwards, WmDOT does appear to reawake and start rebuilding more ships, but the profits grow at a slower pace, the profits start rising up again, everything seems to be ok, but then, at some point past 2010, sometimes 5 years later, sometimes even later, it will start having the issues about the duplication of ships.
Taking the example from my previous post, Here's the pairings that I could observe:
- log of route 47: has the oil rig "A", the orders "oil rig A to A refinery", ship names have "route 48" mentioned, vehicle group name is "group 48". Ship depot is nearby, close to the oil rig A.
- log of route 48: has the oil rig "A", the orders "oil rig A to A refinery", ship names have "route 49" mentioned, vehilce group name is "group 49". Ship depot is nearby, close to the oil rig A. Coincidence or not, the oil rig, the orders and the ship depot are the same as of log or route 47.
- log of route 55: has the oil rig "B", the orders "oil rig B to B refinery", ship names have "route 56" mentioned, vehicle group name is "group 56".
Reading the log that WmDOT prints, it iterates over all the oil rigs from all routes to see if it would need a new ship:
- at log of route 47, it mentions the oil rig got 1300 oil waiting and adds one more ship. It correctly choses the nearest depot, but then when adding the orders, they are from log of route 55. The ship gets named with "route 56" mentioned in it, and is added to the "group 56"
- at log of route 48, it mentions the oil rig got 1300 oil waiting and adds one more ship. It correctly choses the nearest depot, but then when adding the orders, they are from log of route 55. The ship gets named with "route 56" mentioned in it, and is added to the "group 56".
- at log of route 55, it mentions the oil rig got 0 oil waiting and doesn't do anything more. This is also coincides with the last route from the logged iteration list, and also the last vehicle group from the vehicle group list.
When I first reported about the issue, it gave me the impression that WmDOT was picking the wrong ship depot, but giving the correct orders, but it's the other way around. It is picking the correct ship depot, but giving the wrong orders.
One image is worth a thousand words.
There are several problems after all, they were only being masked. wmdot is trying to clone ships based on the old model. There is no error message, but it's repeatedly trying to do that everytime re-checks.
The mass selling of ships is originated by an oil rig closure. Some ships are told to go to depot, twice in a row, which means they cancel that order.
Some parts of the script seems to be running twice. One example was that of ships going to depot twice, another one I noticed was about the save message "save not implemented" appearing twice.
Post-1990, it seems that on routes where the old, small ship is in use, WmDOT tries to duplicate the small ship, but this fails (in your image, see "Funds Request -1L" for routes 4, 5, 6, and 9; WmDOT is asking for an additional loan to build the ship). In theory, eventually the oil rigs serviced by these routes will become under-serviced enough for WmDOT to re-create the route, but with a different route number and the new ship. (This would be the cause of the multiple route numbers for the same combinations of oil rig-refinery-ship depot you're seeing). I suppose the "proper" solution would be to have a check when attempting to buy an additional ship to see if that model is still available, and if it isn't, to do something about it.
As for selling ships, WmDOT has a check that if a bunch of ships are setting empty at the loading dock, they should be sold off. (These are the log lines "Vehicle #XXX has been sent to the depot to be sold" are about. I'm not sure why #177 shows up twice....).
As for the 'save not implemented'; that's actually produced by the OpenTTD host directly rather than the AI. And I never knew why it was shown twice.
So based on what you've told me here, it seems that the next two features to be added to WmDOT should answers to the questions:
- what should WmDOT do if it wants to add a ship to a route and the current model is not available, or there's a new model available (probably upgrade? upgrade all the ships on the route?)
- what should WmDOT do is a source industry closes? (empty the ships and sell them all?)
- and, for bonus points, what should WmDOT do if the destination industry closes? (change the route to a new destination? close down the current route and make a new one?)
Users browsing this forum: No registered users and 15 guests