The International Simutrans Forum

 

Author Topic: Electricity  (Read 2881 times)

0 Members and 1 Guest are viewing this topic.

Offline accord2 pt

  • *
  • Posts: 236
  • Languages: EN, PT
Electricity
« on: December 22, 2017, 04:15:48 PM »
I don't know if it is here where we recommend stuff... Sorry.
So if possible I'd like to suggest cities consuming electricity. I know this is possible in Extended, but Extended is too complex, so for players that like simple game mechanics it is a cool feature. I think is basic and logical, cities need electricity to grow. No one wants to live in a city, in 2017, without electricity. What you think?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5496
  • Languages: EN, NO
Re: Electricity
« Reply #1 on: December 22, 2017, 05:27:02 PM »
If we added everything people found cool with Extended into Standard, it would become as complex. We have to draw the line somewhere.

Offline accord2 pt

  • *
  • Posts: 236
  • Languages: EN, PT
Re: Electricity
« Reply #2 on: December 22, 2017, 05:52:26 PM »
If we added everything people found cool with Extended into Standard, it would become as complex. We have to draw the line somewhere.
I agree, but this is not that complex though. It's not vehicle strange and complex stuff, nor pop movement, it's just electricity going to towns. If industry consumes electricity to "grow" why towns are different?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18618
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Electricity
« Reply #3 on: December 22, 2017, 05:53:38 PM »
I seem to remember from code comments that it had been intended long ago to allow connecting cities to electricity in Standard.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1224
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Electricity
« Reply #4 on: December 22, 2017, 06:33:25 PM »
That's a pretty random line there, though, and slippery slope isn't really a good arguement.

There is no harm in Standard allowing as much complexity as Extended, as long as it allows simplicity as well. That would just make it more versatile, and different paksets can cherry-pick which complexities they will actually use, or not use any for a beginner-friendly expierience. The requestes power consumption in cities could be implemented by allowing townhalls to have parameters for power consumption, just like factories can have, with the tiny difference that it scales with city size and the boost is for growth, not production. I'm not talking about the complexity of implementing that, just about the complexity the game would have from it - zero. No complexity whatsoever, since no pakset has those parameters so far. If a pakset takes advantage of a new feature, good for them - that might make that pakset a bit more complex, but still has no impact on any other pakset.

Simutrans is not just one game, it's an engine. Complexity can be tuned by what paksets and addons include, it does not need to be enforced by the program.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5496
  • Languages: EN, NO
Re: Electricity
« Reply #5 on: December 22, 2017, 06:54:01 PM »
There is no harm in Standard allowing as much complexity as Extended, as long as it allows simplicity as well.

Actually, there is (although "harm" is a bit harsh). All that complexity must be maintained by the developers. And every new feature must take into account all the features that already exists.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2687
  • Languages: EN
Re: Electricity
« Reply #6 on: December 22, 2017, 08:27:41 PM »
Cities were intended to consume electricity at some stage. However it exists only in comments and commented out code. There is even electricity boost logic commented out.

I am guessing no one defined how transformers hook to cities and hence why the logic was never fully implemented. Any code that was written for that might not work anymore as both factories and power itself have been overhauled in order to operate more reliably.

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4084
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Electricity
« Reply #7 on: December 23, 2017, 04:15:53 AM »
Cities were intended to consume electricity at some stage.

There could be some kind of electrical substation as end-consumer factory in the energy chain (coal mine -> powerplant -> city substation). To avoid that every city/town has a substation, the city growth could trigger its inauguration with a 1,000-inhabitant mark or something like "The lights are on in %s! The city has inaugurated its substation ready to receive energy." (the message is also a hint for the player to sell energy for the city substation).

Now, if my memory serves me right, using electricity to power up train/tram overhead lines was somewhat declined for adding an unnecessary extra step for the player (although it is/was pretty implicative that if you can produce energy you could also use it to power your rolling stock).


Edit:

About the part in blue: The original post doesn't make references as to using energy in the cities to power things like tram lines or, perhaps, lampposts (in reference to "No one wants to live in a city, in 2017, without electricity"). I somewhat added a related subject in the discussion.
« Last Edit: December 26, 2017, 05:27:36 AM by IgorEliezer »

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5496
  • Languages: EN, NO
Re: Electricity
« Reply #8 on: December 23, 2017, 09:23:21 AM »
Now, if my memory serves me right, using electricity to power up train/tram overhead lines was somewhat declined for adding an unnecessary extra step for the player (although it is/was pretty implicative that if you can produce energy you could also use it to power your rolling stock).

No, it is to avoid a chicken-and-egg situation where you can't power the train because the train has no power.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1224
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Electricity
« Reply #9 on: December 23, 2017, 10:31:59 AM »
Actually, there is (although "harm" is a bit harsh). All that complexity must be maintained by the developers. And every new feature must take into account all the features that already exists.
Yeah, well -
I'm not talking about the complexity of implementing that, just about the complexity the game would have from it
Accord2 is clearly talking about gameplay complexity, and I even specified that in the comment.


The thing about these substations is - what would they be? They would need to be spawned by a city through that cities growth, accept electricity, and positively affect city growth. One could create a new building type for this, but that's not very flexible. I think it would be nice to tweak factories and/or curiosities instead.

Think about it: Currently, factories are spawned because of city growth, but in no relation to the cities that grow. Wouldn't it make sense for small stores to spawn in a city, based on that cities growth? Essentially, once there are enough customers in a town, a grocery store will open. This shouldn't replace normal factory spawning - in addition to distribution_weight, factories (end consumers) could get build_time and chance to work akin to curiosities. (likewise, curiosities could get placed outside cities akin to factories)

For a city to grow, you have to deliver it's pax, mail and goods. However, there is a set growth a city can have if you deliver everything, it does not matter how much it is, only in percentage. This actually means that a new factory spawning in a city is bad for it's growth, since it's goods don't get delivered initially. Once it's fully connected, it does not peak the growth the city had before. (unless there was no factory before). That's not very sensible, instead, a fully operated factory could give an additional bonus to city growth. Since larger cities would have more factories (especially if they can spawn via build_time and chance), larger cities will naturally have more city growth (I think this is currently done in steps, multiplying growth by four once a certain size is reached).
Likewise, curiosities generate more pax and mail, which, upon spawning, actually decreases the percentage of that cities pax and mail delivered, hurting growth. Curiosities which are well connected, so their pax and mail are delivered, could boost the cities growth yet again.

Now really, all that's missing is how electricity plays a role with this. Consider this: A factory that does produce or consume has a productivity. The bonus it gives to city growth could be dependent on productivity, since that would make it change not only with provided goods, but also with pax, mail and electricity (if there are enough goods). If a factory does not have any input or output, it could still have a productivity, and permanently give it's bonus to city growth since technically, all the goods required are provided. If such a factory was to recieve a huge production bonus based on electricity, say, times 100, the city growth it provides would also be times 100. So it wouldn't affect growth to a degree worth mentioning when unpowered, only when powered. As such, power substations as described would be possible.

Now yes - that solution would be very complicated if it was only to somehow have cities consume power, but the point is that it isn't just an isolated feature, but a more general overhaul of power consumption, building spawning and city growth, that all has it's worthwhile parts on their own and can be combined to reach the actual goal - as well as many other things, depending on how pak creators decide to use them.


Alternatively - consider the power grid a player builds a high-voltage grid. A transformer currently connects a factory to the grid, but you could allow them to be placed anywhere. Transformers which don't connect to a factory could have a different graphic, and cover an area around them with low voltage supply for normal households. Coverage in percentage of the whole city decides how much growth is gained. If such a solution was used, the same low-voltage coverage could be used by some types of factories for boosts instead of the high voltage power, especially those in cities that only need little power (eg. grocery store).

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5496
  • Languages: EN, NO
Re: Electricity
« Reply #10 on: December 23, 2017, 10:47:04 AM »
The length of the above post says something about the complexity, I think.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1224
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Electricity
« Reply #11 on: December 23, 2017, 11:22:01 AM »
"Add build_time and chance to factories (that don't produce anything) and allow factories to give cities a growth boost based on their actual production if they produce/consume something and theoretical production if they don't."

Now it's simple. I don't think most people would understand it, even less so the context of why it makes sense, but giving reasons and details is just complexity...

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5496
  • Languages: EN, NO
Re: Electricity
« Reply #12 on: December 23, 2017, 12:03:28 PM »
You have not addressed all the issues of electrifying cities, and over half of it has nothing to do with electrifying cities at all (although it has a greater chance of being done).

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 18618
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Electricity
« Reply #13 on: December 23, 2017, 12:07:03 PM »
...Think about it: Currently, factories are spawned because of city growth, but in no relation to the cities that grow. Wouldn't it make sense for small stores to spawn in a city, based on that cities growth? Essentially, once there are enough customers in a town, a grocery store will open. This shouldn't replace normal factory spawning - in addition to distribution_weight, factories (end consumers) could get build_time and chance to work akin to curiosities. (likewise, curiosities could get placed outside cities akin to factories)

The long-term plan for Extended is for the building of consumer industries to be fully integrated into the city growth algorithm so that their construction uses the same algorithm as the construction of commercial and industrial city buildings.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1224
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Electricity
« Reply #14 on: December 23, 2017, 02:00:08 PM »
You have not addressed all the issues of electrifying cities, and over half of it has nothing to do with electrifying cities at all (although it has a greater chance of being done).

I explained a series of changes which, by themself, are not about electrifying city, but are good additions in their own right which create an environment where electrical substations, as Igor mentioned them, could be created more easily, so you wouldn't have to create them as their own, seperate kind of thing, which would also need to be maintained seperately etc.
Instead of walking straight through a swamp, I consider roads where they make sense, so you can drive a detour that leads not only to the goal, but many other places as well. I prefer that many times over swampwalking, since I don't like wet feet. :)

The long-term plan for Extended is for the building of consumer industries to be fully integrated into the city growth algorithm so that their construction uses the same algorithm as the construction of commercial and industrial city buildings.
Which would be awesome - though for me, it would be enough if they could have the subtype and count as such for other buildings to be buildt around them. Curiosities as well.

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4084
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Electricity
« Reply #15 on: December 24, 2017, 06:53:08 AM »
No, it is to avoid a chicken-and-egg situation where you can't power the train because the train has no power.
Really? Not sounding ironic or sarcastic, but, I thought it was because the conversation was like the game was too complex already and had a steep learning curve for newcomers.

You would be stuck in the chicken-and-egg situation that you mentioned if you were playing in a very specific timeline with very narrow range of vehicle options, such as I want to play from the year 2000 on and only with electric trains. Someone would start playing the game with electric trains to transport coal from a coal mine to a power plant when you could just use petrol and steam powered vehicles to circumvent that situation -- it's a strategy game, you got to plan ahead a bit.

I think it's a cool idea in principle, but requiring live energy to power trains not only would be a big extra step for a player to start running his first electric train, but also -- I suppose -- the game would be impacted as the overhead line network would have to be dependent on the electric grid which may fluctuate due to coal/fuel sortages.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1224
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Electricity
« Reply #16 on: December 24, 2017, 08:19:36 AM »
Quote from: IgorEliezer
You would be stuck in the chicken-and-egg situation that you mentioned if you were playing in a very specific timeline with very narrow range of vehicle options, such as I want to play from the year 2000 on and only with electric trains. Someone would start playing the game with electric trains to transport coal from a coal mine to a power plant when you could just use petrol and steam powered vehicles to circumvent that situation -- it's a strategy game, you got to plan ahead a bit.
.

Not to mention most paksets have some free energy options (solar, wind etc.)
But it begs another question: Why would you need to provide power for electric vehicles, but not coal for steam vehicles or gas for diesel vehicles, even though both goods are available in most pakset? Perhaps you need to build those towers that provide coal and water every hundred tiles? Don't get me wrong, I'm sure it all could be done and create an interesting challenge as well as a much needed distinction between types of vehicles. I'd love too see that actually - but it required tweaks pretty much everywhere, including factory creation (coal, oil and power must exist in every game) so not a big chance for that (in Standard)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5496
  • Languages: EN, NO
Re: Electricity
« Reply #17 on: December 24, 2017, 09:28:39 AM »
I think the coal for steam trains was part of the discussion as well. I don't know about the original discussion, just one that brought this up years ago. This chicken-and-egg is as mentioned solvable as long as pak sets provide a full selection of vehicles, but then you get the steep learning curve, so the two things are actually ultimately one and the same. You would have to use horses to pull the initial coal load to get the first trains going carrying coal to the power plant to get electricity to switch to electric trains. And if you miscalculate so that you run out of fuel for your trains, you have to start all over again.

Offline Leartin at

  • Devotee
  • *
  • Posts: 1224
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Electricity
« Reply #18 on: December 24, 2017, 10:49:20 AM »
I would expect it to work a bit like this:
Special Station Extension Buildings that enable trains to load up with coal/diesel. Let's call them Fuel Buildings.
Depots need to be part of a station, as they only show steam/diesel locomotives if the according Fuel Building is present.
Players get a restricted contract tool which enables them to link up Fuel Buildings with Factories that provide that kind of fuel, but not other factories.
Locomotives can only cater lines if at least one of the stations has the required Fuel Building.

So you wouldn't actually need horses, you just need to start your first steam train at a coal mine.
If you switch from coal to electricity and miscalculate, you don't actually have to start all over again. You only need to send one steam train from the coal mine to the coal power plant and you are good to go again.
BTW I don't think there needs to be exact measurements, like defining how much coal fits in which tender and how much is required at different speeds. Perhaps it's even enough if fuel buildings consume on their own, and trains only require to pass them once in a while.


Offline accord2 pt

  • *
  • Posts: 236
  • Languages: EN, PT
Re: Electricity
« Reply #19 on: December 24, 2017, 10:58:12 AM »
I would expect it to work a bit like this:

Players get a restricted contract tool which enables them to link up Fuel Buildings with Factories that provide that kind of fuel, but not other factories.
Locomotives can only cater lines if at least one of the stations has the required Fuel Building.

And the companies would pay for it.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5496
  • Languages: EN, NO
Re: Electricity
« Reply #20 on: December 24, 2017, 11:03:26 AM »
You can not be sure there even is a coal mine in the game, though.

If you switch from coal to electricity and miscalculate, you don't actually have to start all over again. You only need to send one steam train from the coal mine to the coal power plant and you are good to go again.

It's 1980. I have no steam trains. Send a diesel train instead? Well, it is out of fuel until the electric train can get it some more diesel. Solvable by giving the diesel fuel train a diesel locomotive, temporarily or permanently, but this would be a new thing in the game that adds complexity for players and steepens the learning curve. Making it optional as some for of expert switch in simuconf.tab adds a lot of complexity to already complex code.

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4084
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Electricity
« Reply #21 on: December 24, 2017, 01:37:57 PM »
But it begs another question: Why would you need to provide power for electric vehicles, but not coal for steam vehicles or gas for diesel vehicles, even though both goods are available in most pakset?
And farms to produce hay for horse-drawn vehicles. So this is where I draw the line: in the game, I manage a company to transport things for the market, not for myself. You would end up consuming most of your time taking care of your business rather than the external logistics (the goal of the game).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9472
  • Languages: De,EN,JP
Re: Electricity
« Reply #22 on: December 25, 2017, 03:34:30 PM »
The reasoning for not using electricity for city growth was that just hooking up a windfarm to a city would create free money for nothing. As transport game, city electricity does not really affect the transport volume. But mostly, cities tend to grow fast beyond a certain point, so another incentive is not really needed, and most efforts were rather to allow slower city growth by using higher precision in calculations.

Offline IgorEliezer br

  • Devotee
  • Administrator
  • *
  • Posts: 4084
  • Cake recipes are cool... REALLY!
    • Igor Eliezer Architect and Urban Planner/Arquiteto e Urbanista
  • Languages: PT, EN, AutoLISP, Python
Re: Electricity
« Reply #23 on: December 26, 2017, 05:28:00 AM »
The reasoning for not using electricity for city growth was that just hooking up a windfarm to a city would create free money for nothing.
Out of curiosity: do end-consumer factories make cities grow faster?

Back in the day when I used to play the game often, my cities grew faster if I built an efficient passenger transport, not because of the factories receiving goods in time (am I mistaken?). In fact, it was the city growth that triggered new factories (still as of today) and you as transportation company connect the dots.

What I am more inclined to -- if we are going to use electricity for something else --- would be using as end-consumer factory as if to complete the coal factory chain, with no effect on city growth.

---

Edited my post: https://forum.simutrans.com/index.php?topic=17719.msg168797#msg168797
« Last Edit: December 26, 2017, 08:40:54 AM by IgorEliezer »

Offline Leartin at

  • Devotee
  • *
  • Posts: 1224
  • PAK-DEV P192C
  • Languages: DE, EN
Re: Electricity
« Reply #24 on: December 26, 2017, 08:32:17 AM »
Out of curiosity: do end-consumer factories make cities grow faster?

Yes, goods transport does aid in city growth, if there is at least one factory and you transport it's goods. If there is no factory or you don't transport the goods, you get no city growth - naturally, if you transport parts of the goods, it should yield part of the potential growth.