News:

Simutrans Forum Archive
A complete record of the old Simutrans Forum.

Electricity: City Hall demand vs Substation demand

Started by accord2, January 22, 2019, 04:40:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

accord2

I can't understand this.

the power demand in the substation has a different value from the one of the city hall. why?
For example, in my current game, the city of Victoria, according to the town hall, has a power demand of 244 KW, but in the substation connected to the city there is a demand of 2.01 KW. Is there a conversion? Doesn't make sense since both use the same power unit...

Note: I have two cities connect to the grid, according to the substations there is a total demand of 2.44 KW (according to town halls it is 296 KW) and my revenue was on the second month just 18.28$ (first month had 0 idk why)
Son of a railroad man,  growing up in train stations, lover of trains

jamespetts

Thank you for the report. Are you able to upload a saved game in which this issue can be reproduced?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

accord2

Here it is:
https://www.dropbox.com/s/ilmfiwv9u9fcxa7/Greater%20Anglia%201895%208%209.sve?dl=0 (save)
https://www.dropbox.com/s/x9bfi7hxb0lxiqa/trackpak.rar?dl=0 (pak I use in this save)

The towns are: Victoria and Duckenton End
The power station is East of them (right side of screen) near the sea. Its called 'NPGC Coal-fired power station - Victoria'
All the electrical grid is owned by UCC (player)

Thanks :)
Son of a railroad man,  growing up in train stations, lover of trains

accord2

Son of a railroad man,  growing up in train stations, lover of trains

jamespetts

Apologies for not having had chance to look into this lately: I have been very busy at home with a domestic project in the last few months.

I note that you have uploaded a few assorted .pak files; may I ask with which pakset that these go?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

accord2

Do not worry.

Those pak files go with Britain pakset. Sorry, should have told earlier   :-[
Son of a railroad man,  growing up in train stations, lover of trains

accord2

I have done some testing.

I created a new map in the year 1890 (the same year my game started) and I connect the new map towns to a gas power plant (the one that doesn't have resources input). In the first year, the bug was there. The substation had a inferior Kw demand than the town. Then with public service I got forward one year, and another one, etc. With time the substation demand increased (always a different value than the town's demand) and in 1975, both town and substation had the same demand value, so the bug was not there.


So this bug only happens in early years.. I don't know why tho.
Son of a railroad man,  growing up in train stations, lover of trains

jamespetts

Interesting - this might suggest a rounding error, although further investigation would be needed. There is somewhat of a backlog of bug fixing (especially with some extremely difficult critical bugs), so I am afraid that it might be a while before I get to non-critical bugs such as this one. Thank you for the report, however.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

#8
I guess this is due to the same reasons as I reported in other threads, that is, the data of the city is doubled only for the data of the industrial building.



EDIT:
The number of jobs affects the power demand.

This code is at uint32 stadt_t::get_power_demand() const in simcity.cc



return (((city_history_month[0][HIST_CITICENS] + city_history_month[0][HIST_JOBS] + (city_history_month[0][HIST_VISITOR_DEMAND] / 4)) << POWER_TO_MW) * electricity_per_unit) / 100000;
Since the red variable currently returns the wrong value, the electricity demand also has the wrong value.

I suspect that the city counts the number of factory job twice.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Elemental

#9
The same thing can also be seen on the Stephenson-Siemens server game: The town of Berkington has one of those early coal plants. The Berkington town hall registers a demand of 168 kW. The substation in Berkington registers a demand of 1.38 kW.

Edit: The year is 1898, that might be important.

jamespetts

Ranran - thank you for your investigations into this. I have just now incorporated your patch to fix the incorrect computation of industry demand. This will be incorporated from to-morrow's nightly build. I should be grateful if anyone could re-test to see whether this problem recurs with the next nightly build.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

accord2

Son of a railroad man,  growing up in train stations, lover of trains

Ranran(retired)

Currently the relationship between KW and MW is not correct.

This difference can be seen when displaying both MW and KW.


Maybe the conversion MW to KW is not correct.
Therefore it displays the wrong KW value in the early days when there is only a small power demand.

I suppose this commit is related to this.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

jamespetts

I have pushed a fix to the computation of kilowatts (which seem to have been too small by a factor of 100); I should be grateful if people could re-test with the next nightly build to see whether that assists.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

accord2

Thank you.

Now, in one city the town hall demand is 60 KW and the substation says the demand is 49.80 KW. In other town, city hall says it is 244 KW while the substation says it is 200.60 KW.

I suppose this is intended?

Son of a railroad man,  growing up in train stations, lover of trains

jamespetts

Thank you for checking this: this is most helpful.

The difference may be related to industries; in principle, industries in towns should be counted in both places, but industries that are partly inside and partly outside towns may not be counted in the city hall window. Can you check whether there are industries in these towns and, if so, whether any of them are partly outside the towns' boundaries?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ranran(retired)

Something weird ???


Be aware of the change in each demand.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Ranran(retired)

Neither the City Hall demand nor the Substation demand show the correct value.
And even now, the relationship between MW and KW is not correct.

The power demand of this pub is found to be 125 KW.
And when I removed pub, It dropped 125 KW from the Substation demand. This is correct but this only performed subtraction properly.
However, if remove all buildings except pub, it will be displayed as 104.80 KW. At this time, the demand of the city shows 2KW.
And if you remove pub from there, it will be displayed as 0.40 KW of Substation demand and 0 KW of City Hall demand.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)