The International Simutrans Forum

 

Author Topic: Ironworks always at staff shortage  (Read 24934 times)

0 Members and 1 Guest are viewing this topic.

Offline wlindley

  • Devotee
  • *
  • Posts: 936
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Ironworks always at staff shortage
« on: April 16, 2018, 11:37:39 PM »

Playing in 1820.  Ironworks was built in town with 2,566 population, but the Ironworks says it needs 999 jobs so it's always at staff shortage.





When building a new ironworks, it requires 65,535 workers?  (negative-one as unsigned 16-bit integer)





Something seems wrong here...


p.s., With latest source for pak and program; problem has been the same with nightly compiles for months.

Offline wlindley

  • Devotee
  • *
  • Posts: 936
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: Ironworks always at staff shortage
« Reply #1 on: April 17, 2018, 12:01:32 AM »
That is for the 1785 ironworks.  The 1750 ironworks (obsolete in 1820) likewise says 65535 passenger demand in the preview window, and has a jobs demand of 520 if built. 

However in the .dat file, I ask for employment_capacity=250 (yields 520?) for the 1750 ironworks, and 320 (yields 998?) for the 1790 ironworks.  Why the difference?

Should I change the .dat files?  Regardless, why would any industry be automatically built in a town that cannot support its employment?



Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 17321
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Ironworks always at staff shortage
« Reply #2 on: April 17, 2018, 11:05:26 PM »
The manual building of industry has given some odd numbers in the past, but investigating this has not been a priority because more normally industries are automatically placed. Can I check whether this issue affects ironworks that are automatically placed and also whether there is any difference between the extent to which this affects ironworks and other industries?

Incidentally, the numbers specified in the .dat files will not be the same as those seen in the game, as those in the game need to be adjusted for meters per tile and bits per month (which together determine the hours per month against which these figures are calibrated).

As to the industry being built in a town that cannot support its employment, it would be a very large amount of work indeed (and probably practically impossible) to add an algorithm that checks whether a town can supply enough workers to an industry, especially if one has to take into account (as would be necessary for the algorithm not to produce perverse results) (1) the other industries that workers in that town may go to instead (including industries outside the town to which workers may or may not be transported, depending on the local transport infrastructure); and (2) the workers in other towns that may or may not be transported to work in this town, depending again on the local transport infrastructure.