News:

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

[Error] Factory transformers generate consumption values without being connected

Started by Yona-TYT, September 27, 2019, 03:33:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

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



Dwachs

I cannot reproduce it.

Why on earth is the inspection tool not allowed in the tutorial???
Parsley, sage, rosemary, and maggikraut.

Yona-TYT


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

Yona-TYT

Quote from: Dwachs on September 28, 2019, 09:06:15 AMI 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".

DrSuperGood

Quote from: Yona-TYT on September 27, 2019, 03:33:50 PMI 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.

Mariculous

QuoteThe 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.

DrSuperGood

Quote from: Freahk on September 28, 2019, 11:05:01 PMThis 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.

Mariculous

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.

Dwachs

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.
Parsley, sage, rosemary, and maggikraut.