The International Simutrans Forum

 

Author Topic: [Error] Factory transformers generate consumption values without being connected  (Read 1303 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1845
    • Simutrans-BLOG
  • Languages: ES
While doing some tests with the Scenario tutorial, I found something strange. I realized that the transformers generate consumption without being connected to an electric power plant.

To replicate, build the transformer in the corded ones (37,6), then place high-tenure lines up to the corded ones (37,11), now build another section up to the coordinates (39,11), and for some reason the value of Factory energy in the current month is set to "-102", as seen in the image.

Savegame: https://www.mediafire.com/file/j3rz3tp39s7onxs/Tutoria-error-transform.sve/file
Script:  https://www.mediafire.com/file/2nx6on1xnb9pwjj/Tutorial-erro-transf.zip/file



Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4957
  • Languages: EN, DE, AT
I cannot reproduce it.

Why on earth is the inspection tool not allowed in the tutorial???

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1845
    • Simutrans-BLOG
  • Languages: ES

Quote
Why on earth is the inspection tool not allowed in the tutorial???
usp my mistake, I had forgotten her ... replace the following file.

Offline Yona-TYT

  • Devotee
  • *
  • Posts: 1845
    • Simutrans-BLOG
  • Languages: ES
I cannot reproduce it.
How strange, you should be able to reproduce it, try again from the transformer to (37, 11), then in a straight line take it to (42, 11) or beyond.
I have also noticed another problem (related I suppose), if you place the transformer, save the game and then load that game, consumption values will be displayed.

By the way I have left a variable with the values of the current month shown in "menssage center".

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2837
  • Languages: EN
I realized that the transformers generate consumption without being connected to an electric power plant.
Might have something to do with the power changes I made a few years ago for better JIT2 operation.

Just because an electrical network does not have any supply does not mean factories still do not want to consume power. They request power from the network but as the network has no supply it cannot fulfil any of it.

The reason I made this change is that it would make implementing demand regulated power plants, where the amount of power they produce and hence fuel they consume is based on the power demanded from them, a possibility if anyone wanted such a feature in the future. I recall it would even support factories that could consume power and generate power depending on operating state.

Power demand is negative since it represents how much power the factory wants to remove from the network. Power supply is positive as it is how much power is added to the network.

Since you are looking at scripting, it is possible I broke something with that regarding power as honestly I forgot to consider it at the time as I do not fully understand the features of the scripting support that well.

Offline Sirius

  • Devotee
  • *
  • Posts: 1662
  • Languages: DE, EN
Quote
The reason I made this change is that it would make implementing demand regulated power plants, where the amount of power they produce and hence fuel they consume is based on the power demanded from them, a possibility if anyone wanted such a feature in the future.

This would be useful especially in the early game where there are only few, maybe even one power plant on the map, which can't run at 100% for the whole month due to too few coal mines connected but could produce enough for the network if coal consumption (and power output) was based on requested power.

Also, some kind of energy storage could also be useful, additionally or instead of this feature, for the same reasons.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2837
  • Languages: EN
This would be useful especially in the early game where there are only few, maybe even one power plant on the map, which can't run at 100% for the whole month due to too few coal mines connected but could produce enough for the network if coal consumption (and power output) was based on requested power.
JIT2 already solves this... The power station operates at the rate coal can be supplied to it. If it only has enough coal being supplied to run half the month at full power then JIT2 will make the power plant run at 50% production rate continuously for the entire month resulting in it producing half the power output.

What I was referring to was functionality which would prevent a power station from running unless it has a load to supply. Currently one can deliver coal or oil to a power station and it will burn as much as it can even if nothing uses the power it produces. This would have allowed pakset creators to create industry economies where power is a secondary chain to compliment a primary chain rather than being the typical go to primary chain you make when starting a company.

Offline Sirius

  • Devotee
  • *
  • Posts: 1662
  • Languages: DE, EN
So I missunderstood your post, however, this would still be useful for the same reasons (production/load balancing), as power consumption often is not constant.
However, it's not that important, as power consumption does not vary as much as power production did before JIT2.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4957
  • Languages: EN, DE, AT
I do not know what is happening in the savegame. the error is not reproducible, sometimes it occurs, sometimes not.  It must have something to do how this is calculated. But I have no idea, where the error in the factory / electricity code might be.