News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Factory production ratios

Started by TurfIt, July 23, 2017, 03:54:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

TurfIt

Factory production ratios aren't being respected. See attached example save.
Steel Mill is listed as iron @57%, coal @43%. Actually consuming 50/50 based on the trains schedule supplying it. Train arrives carrying 34t coal, factory only receives 15 (which is 43%). Same when 34t iron arrives, only 20t in stock. Production consumption then follows the 43/57 ratio and depletes both inventories for an effective 50/50.
Appears fabrik_t::liefere_an() wasn't updated as required for changes in 1e36bdfa450d9146b2647100c9523541371662b8.

Other issues noticed in save:
Halt info windows don't update when goods arrive and enter a transferring state. Close and reopen window then shows the Transfers: line.
Hardware factory stops ordering steel when only 54/62 in stock.  54/2(553)/62  is complete status line. Would expect the ability to deliver until full.
Colliery and Iron stations with capacity 96 are ending up with > 300t in them. (and then spam station crowded messages at you...)
Forest/Sawmill station with capacity 0 still accepts.
Train(2) reverts to drive-by-sight upon leaving forest station, would expect to remain in one train staff since it's never given back the staff... It then gets completely stuck upon entering time interval mode and won't move. (I know this isn't the 'right' setup, and OTS is completely unnecessary in this case, just showing an expected to work configuration that completely fails.)

Others not in save:
Low production factories still wait for 10 units before the distribution if they have a big enough output store.  If something only produces 7/month, waiting 6 weeks for cargo to show up is....
Horses die if shown a hill. Any horse drawn vehicle (rail, road, pax, freight, whatever), routed up a 1 tile rise drops to 1km/h and takes a week to climb.


jamespetts

#1
Thank you for the reports. I should be grateful if you could in future make one bug report per thread, as having multiple reports per thread does make it very difficult to keep a track of which issues have been fixed and which are outstanding.

I think that I have now fixed the error with the one train staff signalling. Looking at the issue regarding updating the stop information window, it was not I who wrote that code, and I am less familiar with the GUI code than other parts; do you happen to know how the update is triggered when passengers/mail/goods arrive at/depart from a stop so that I can apply this to transferring passengers/mail/goods, too?

Edit 1: I think that I have now fixed the headline problem relating to factory production ratios: thank you very much indeed for finding where the error was for this, which has saved me a great deal of time. I think that I missed it because it came with a lot of code for JIT2, but, looking at it again, I also missed a lot of code not relating to JIT2. Merging from Standard is becomingly increasingly hazardous as the codebases become more different.

Edit 2: I am having some difficulty in understanding the issue that you describe thus,

Quote from: TurfIt
Hardware factory stops ordering steel when only 54/62 in stock.  54/2(553)/62  is complete status line. Would expect the ability to deliver until full.

It is somewhat difficult to reproduce with precision the cessation of the demand for new steel, as the production is severely bottlenecked by the speed of the deliveries of the coal and iron ore. May I ask you to elaborate on the method that you used to test this?

As to the issue with horses, may I ask what combinations that you tested (i.e., what type of horse, how many horses, what height of hill and what trailing load)? This issue has been extensively discussed here. Without fully understanding how Bernd Gabriel's physics engine works, it is exceptionally difficult for me to understand this issue fully; I pushed a workaround which involved reducing the calculated severity of road hills, this apparently being less of a problem with railways (where the gradient severity seemed to be approximately appropriate), although I did not test with rail horses. Can you or anyone else suggest where I might look to find an accurate understanding of where something deviates from reality so as to cause this problem?

In relation to the overcrowding of stations, I suspect that this occurs because the goods stations do not stop accepting goods until the storage is full, rather than when the storage plus transferring goods would mean that, when all the transferring goods have transferred, the storage would be full. This was a deliberate choice, as I thought that it would be too difficult for players if it worked otherwise (and might also be very confusing; players might legitimately wonder why a station that is not actually full has stopped accepting goods). Have you (or has anyone else) any suggestions as to a sensible remedy for this?

As to this issue:

Quote
Low production factories still wait for 10 units before the distribution if they have a big enough output store.  If something only produces 7/month, waiting 6 weeks for cargo to show up is....

Is this different to how it works in Standard? I have not looked at this in detail, at least recently. May I ask which method contains the code for waiting for the 10 units so that I can look into this?

Thank you again for your reports.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

TurfIt

Quote from: jamespetts on July 23, 2017, 03:12:15 PM
Thank you for the reports. I should be grateful if you could in future make one bug report per thread, as having multiple reports per thread does make it very difficult to keep a track of which issues have been fixed and which are outstanding.
Maybe you need a bug tracker rather than a discussion forum. Post count whoring is usually frowned on...


Quote from: jamespetts on July 23, 2017, 03:12:15 PM
I think that I have now fixed the error with the one train staff signalling.
Seems more sensible. I have seen trains revert to drive by sight after leaving a non-reversing stop. Haven't been able to produce a save where it does it...


Quote from: jamespetts on July 23, 2017, 03:12:15 PM
Looking at the issue regarding updating the stop information window, it was not I who wrote that code, and I am less familiar with the GUI code than other parts; do you happen to know how the update is triggered when passengers/mail/goods arrive at/depart from a stop so that I can apply this to transferring passengers/mail/goods, too?
Perhaps set resort_freight_info in haltestelle_t::add_to_waiting_list()? and at any other places where you modify the freight at a station...


Quote from: jamespetts on July 23, 2017, 03:12:15 PM
Edit 1: I think that I have now fixed the headline problem relating to factory production ratios: thank you very much indeed for finding where the error was for this, which has saved me a great deal of time. I think that I missed it because it came with a lot of code for JIT2, but, looking at it again, I also missed a lot of code not relating to JIT2. Merging from Standard is becomingly increasingly hazardous as the codebases become more different.
Inputs appear fixed. Outputs still wrong - e.g. factory drops from 52 to 48 in stock with 10t showing up at the station. Missing the rescaling in fabrik_t::verteile_waren() ?  and at any other places freight comes into or out of a station. The internal units used in factories were changed to be different from elsewhere...


Quote from: jamespetts on July 23, 2017, 03:12:15 PM
It is somewhat difficult to reproduce with precision the cessation of the demand for new steel, as the production is severely bottlenecked by the speed of the deliveries of the coal and iron ore. May I ask you to elaborate on the method that you used to test this?
Run the game fast forward until Feb. You'll see steel sitting in the steelmills ausgang, nothing (or very little) in transit, and the hardware factory only half full of steel. The same situation exists at the hardware factory with hardware in stock, nothing in transit to the Shop, and Shop empty. Run the game a little more and finally some of the stock gets released. Perhaps a further scaling issue with the "10" distributions....


Quote from: jamespetts on July 23, 2017, 03:12:15 PM
In relation to the overcrowding of stations, I suspect that this occurs because the goods stations do not stop accepting goods until the storage is full, rather than when the storage plus transferring goods would mean that, when all the transferring goods have transferred, the storage would be full. This was a deliberate choice, as I thought that it would be too difficult for players if it worked otherwise (and might also be very confusing; players might legitimately wonder why a station that is not actually full has stopped accepting goods). Have you (or has anyone else) any suggestions as to a sensible remedy for this?
I'd say just include the transferring in the full calc. When transferring cargo just disappeared, that'd be confusing, but with it now displayed...


Quote from: jamespetts on July 23, 2017, 03:12:15 PM
Is this different to how it works in Standard? I have not looked at this in detail, at least recently. May I ask which method contains the code for waiting for the 10 units so that I can look into this?
Standard is still 10, but very different code - has a minimum_shipment logic added that could be more flexible. In general, Standard just doesn't handle such low production amounts so not an issue. But if for claimed realism you want factories in Extended to produce a handful per month, then code needs changing to keep a workable gameplay.  The '10' is in ::step() and ::verteile_waren().

jamespetts

I have not had a chance to look into this fully, but I have just committed a change reducing the minimum industry output before shipping from 10 to 1, albeit I have not had a chance to test it yet. I agree that a hard minimum of 10 does not make any sense in Extended where industry production figures can be really quite low. Thank you very much for identifying in the code where I can find the relevant parts: this does make it much easier for me to adopt the suggestion.

Incidentally, as to the idea of a bug tracker, this was discussed some years ago, but the consensus at the time (and advice from Prissi, among others) was that it is best to use the forum as a bug tracker, as it is easier for people, especially new or occasional users, to deal with.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

I have now had a chance to look into this in a little more detail - thank you again for your testing.

Firstly, I think that I have solved the issue with the stop GUI not updating when new goods in transit were added: thank you very much for your suggestion as to how to do this.

As to factory inputs/outputs, looking carefully at the code and comparing it with Standard, I have realised that I missed quite a lot of the code to convert to/from internal units: I think that I must have believed incorrectly that this code was specific to JIT2. I have just pushed a large commit to the master branch fixing these issues, which also, I think, fixes some issues reported some time ago about the industry graphs not showing correct figures.

In relation to station overcrowding messages, I notice that Standard has recently(ish) commented out the following code, with the comment as reproduced below:


else {
// overflowed with our own ware and we have still nearly full stock
// if(  output[product].menge>= (3 * output[product].max) >> 2  ) {
/* Station too full, notify player */
// best_halt->bescheid_station_voll();
// }
// for now report only serious overcrowding on transfer stops


Was this intended to fix the issue of "station overcrowded" messages where player action is not necessary, as here? I have not applied this change to Extended, but I wonder whether this would fix the station crowding message issue that you reported? I do know that the current system of adding the in transit amount to what counts as overcrowded was thus set as a result of feedback from players.

Thank you again for your useful testing and feedback - it is much appreciated.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

I notice that this discussion has lain dormant since July, but it is not entirely clear whether the issues reported here have yet been fully resolved - does anyone know whether any of these issues remain outstanding, or can this report now be archived?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Jando

Quote from: jamespetts on September 16, 2017, 11:54:21 PM
I notice that this discussion has lain dormant since July, but it is not entirely clear whether the issues reported here have yet been fully resolved - does anyone know whether any of these issues remain outstanding, or can this report now be archived?

I have seen no further bugs in industry demand and production, James, after the bug fixing you did a few weeks ago. Thanks again for that! There are quite some balance issues with industries (to discuss in the pakset forum) but all industries in my actual games work correctly according to the numbers in the industry information window.

jamespetts

Splendid, thank you for checking.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.