[not yet released] enhanced electric rails

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
madman2003
Engineer
Engineer
Posts: 116
Joined: 20 May 2004 17:21

[not yet released] enhanced electric rails

Post by madman2003 »

In short: Electric trains need power supply, add power transformers to your track to ensure that they get power, otherwise perfomance is dramatic.

This patch will be on top of the physics patch already available, since i maintain my own copy of that patch it may be slightly different (but will also be supplied when release time comes).

(mostly) done:

- Make duplicate waypoint with default graphics.
- Create memory pool to store information in.
- Expand train properties to allow storage of energy (so it can be given back once it's out of range).
- Create dynamic power(and tractive effort, currently linear to powerloss) of train based on available power.
- Treat trains individually regardless if it's first or not.
- Release power if halted.
- Release power when sold.
- Release power when crashed.

todo:

- Finetuning.
- Extensive testing.
- Expand savegame to store additional transformer(special form of waypoint) information.
- Allow old savegames (including the startup screen) to be loaded.
- Let coal supply to nearby powerplant influence power availability.

(possible) bugs:

- There may still be a power leak somewhere.
- Reaction to custom waypoint graphics untested.

Currently each transformer has 10000 power units(which can be used for trains), the map is devided in 8x8 squares, the square plus those around it (9 squares) have full power. The 16 squares around that have 80% power, while draining the full amount. The rest has 10% power(which is not "drained" anywere but given).

Don't expect a release soon, i may even release it together with the (yet-to-be-made) variable running costs system if i can manage to make that. Feedback will be appreciated, but keep in mind that am a novice c coder and this has already required considerable time and effort (there have been many very broken versions).

I have hit a bug i can't find, expect it to take longer.
madman2003
Engineer
Engineer
Posts: 116
Joined: 20 May 2004 17:21

Post by madman2003 »

After rewriting most of the code related to controlling power(about 300 lines) i figured out what problem i had. The code is cleaner now and about 50 lines shorter. I also fixed the custom waypoint graphics issue. Does noone like the idea or do people only respond when there is something to download or complain about :).
Sacro
Tycoon
Tycoon
Posts: 1145
Joined: 18 Jun 2005 21:08
Location: Here
Contact:

Post by Sacro »

The idea sounds great! :)
We Am De Best

Host of ThroughTheTube site
User avatar
Born Acorn
Tycoon
Tycoon
Posts: 7595
Joined: 10 Dec 2002 20:36
Skype: bornacorn
Location: Wrexham, Wales
Contact:

Post by Born Acorn »

It sounds a bit like micromanagement. By the same logic, conventional rail should be connected to coal mines and oil refineries, and road vehicles need petrol stations. We should keep it simple, like it is now.
Image
madman2003
Engineer
Engineer
Posts: 116
Joined: 20 May 2004 17:21

Post by madman2003 »

In real life you can put many locomotives together, but not many electric locomotives. I chose this because adapting path finders to detect nearby locomotives was probably going to be more resource intensive. And yes it's micromanagement, that's precisely the point, electric engines loose some of their edge compared to other types (my next idea, if possible to implement is variable running costs, which i may use to rebalance train types a bit).
l_Blue_l
Transport Coordinator
Transport Coordinator
Posts: 285
Joined: 29 Mar 2006 22:42
Contact:

Post by l_Blue_l »

i love the idea but it would be good to have different difficulty setting for cost and also it would be good if you could turn it on to do it automatically and to turn if off fully in the patch settings
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Post by peter1138 »

You could turn it on / off as a difficulty setting. Patch settings are over rated...
He's like, some kind of OpenTTD developer.
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Post by Moriarty »

How are patch settings over-rated? I love them. :)

As to the micromanagement - it is. But some people like micro. Quite a few people in-fact (I'm generally not one of them mind).
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Google [Bot] and 18 guests