The International Simutrans Forum

 

Author Topic: Substation not connecting  (Read 1101 times)

0 Members and 1 Guest are viewing this topic.

Offline zook2

  • *
  • Posts: 321
Substation not connecting
« on: January 30, 2014, 09:36:57 AM »
I'm trying to connect a happily producing clay pit (open countryside; demands 2 MW) to a powered net. The substation is next to the industry and the powerlines carry >160 MW. But the substation itself has a different net ID and neither it nor the pit receive power.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18565
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Substation not connecting
« Reply #1 on: January 30, 2014, 10:38:01 AM »
Does this happen in every case of trying to connect an industry not in a town, or only in this instance? If the latter, would you be able to upload a saved game in which the issue can be reproduced reliably? I should be most grateful.

Offline zook2

  • *
  • Posts: 321
Re: Substation not connecting
« Reply #2 on: January 30, 2014, 04:04:05 PM »
Weird. The Clay Pit at is the original problem and it works now. The substation's network ID has changed, probably when I connected the Quarry at 897,668 to the same net (also has demand, is producing and connected, but shows no boost yet).

http://freakshare.com/files/ficr4y83/1.rar.html

Offline zook2

  • *
  • Posts: 321
Re: Substation not connecting
« Reply #3 on: January 30, 2014, 09:44:41 PM »
It seems to work after a long time (several months?). Shouldn't it work immediately?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18565
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Substation not connecting
« Reply #4 on: January 30, 2014, 10:46:33 PM »
Yes, it should. I will investigate when I have finished tracking down the bug that is stopping the server from working...

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18565
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Substation not connecting
« Reply #5 on: February 02, 2014, 05:47:08 PM »
Hmm - this is a very curious one indeed. The substation is actually connecting to the factory, and the factory to the substation, without difficulty. The problem occurs, it seems, because the factory is not regarded as "producing". The code for whether a factory is regarded as producing is unchanged from Standard, and is as follows:

Code: [Select]
// produce
               if(  ausgang[product].menge < ausgang[product].max  ) {
                  // to find out, if storage changed
                  delta_menge += p;
                  ausgang[product].menge += p;
                  ausgang[product].book_stat(p, FAB_GOODS_PRODUCED);
                  // if less than 3/4 filled we neary always consume power
                  currently_producing |= (ausgang[product].menge*4 < ausgang[product].max*3);
               }

The boolean flag "currently_producing" must be true for the factory to demand any electricity. In this particular quarry, it never seems to be set to true, and it is not currently clear to me why that should be despite the fact that, slowly, production numbers are going up. This is very odd.

Edit: I have established what the issue is: as discussed in this thread, industries do not demand electricity when their output stores are more than 75% full. This seems to me somewhat arbitrary and unrealistic, although it was intentional in Standard. I have now removed this behaviour on the 11.x branch.
« Last Edit: February 02, 2014, 08:15:55 PM by jamespetts »