The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: zook2 on January 30, 2014, 09:36:57 AM

Title: Substation not connecting
Post by: zook2 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.
Title: Re: Substation not connecting
Post by: jamespetts 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.
Title: Re: Substation not connecting
Post by: zook2 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
Title: Re: Substation not connecting
Post by: zook2 on January 30, 2014, 09:44:41 PM
It seems to work after a long time (several months?). Shouldn't it work immediately?
Title: Re: Substation not connecting
Post by: jamespetts 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...
Title: Re: Substation not connecting
Post by: jamespetts 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:


// 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 (http://forum.simutrans.com/index.php?topic=13235) 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.