New Patch: Speed Signs

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

richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

New Patch: Speed Signs

Post by richk67 »

This adds a feature Im calling Speed Signs; it places a desired speed marker on a track, and the trains choose the routes based on what speed they can do.

For example;
Slow: trains <= 55mph prefer this route, medium trains slightly dislike it, fast trains strongly dislike it.
Medium: slow trains slightly dislike it, medium trains prefer this route, fast trains slightly dislike it
Fast: slow trains strongly dislike this route, medium trains slighty dislike, fast trains prefer the route.

Given three otherwise equal routes, the fast trains go down the fast lane, the slow trains down the slow lane, the medium down medium lane. If a track has no speed signal, there is no bias. When a train "prefers" a route, it is slightly positively biassed to it compared to a no-signal route.

If you have two slow trains following each other, and one heads down the slow route, if the second sees a red (at the point of decision) for the slow route, it will take an alternative. This way, although the train's preferred speed route is blocked, it can take other speed routes instead. This prevents deadlocks.

The GUI
I have added an extra button to the rail toolbar at the end, reusing the "purchase land" graphic button. This works similarly to placing signals.

One click on a rail tile, places a SLOW sign. A second click changes it to a MEDIUM sign, a third to a FAST sign.

Click on Remove to remove the signs.

Graphics: many many thanks to MeusH for the artwork, and egladil for the .grf.

Known issue: on tiles with 2 diagonal tracks, the speed sign appears on both tracks, and applies to both tracks. I may be able to resolve this, but I would have to use more map4 bits. Currently I only need 2, to solve this would need a speed sign per possible track side. Given that normal OTTD already has quirks with signals on these tiles (you can only have 1 type of signal per TILE), I am leaving this for the moment.

Please try it out on some big multitrack mainlines. I would be interested to get feedback.
Attachments
A screenie
A screenie
Dredburg Transport, 11th Jun 1959 #1.png (39.06 KiB) Viewed 29543 times
spdlim2.grf
The .grf file for this patch. Put this in the Data directory. (It is NOT a newgrf, so dont add an entry for it.)
(1 KiB) Downloaded 1039 times
SpeedSigns_v0.5.patch
Updated patch post elrails. (Didnt affect it.) NB: this feature doesnt work in NPF currently.
(21.55 KiB) Downloaded 1149 times
Last edited by richk67 on 29 Mar 2006 20:17, edited 4 times in total.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Very good job. You want suggestions, don't you?

I think specyfying the speed should be placed in configure patches menu.

Unfortunatelly, in multiplayer the server's settings would override players' settings. But this way is better than using small map-array space IMO.


I'm doing the graphics soon.

User avatar
Wolf01
Tycoon
Tycoon
Posts: 2013
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

very good job

now make a signal that is red when there is no train and green when there is a train
and a entrance/combo presignal that is red when at least one exit presignal is red :D

these would allow me to make AND and NOT logic gates, today we can make only OR logic gates (if linked with other presignals)

richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Wolf01 wrote:very good job

now make a signal that is red when there is no train and green when there is a train
and a entrance/combo presignal that is red when at least one exit presignal is red :D

these would allow me to make AND and NOT logic gates, today we can make only OR logic gates (if linked with other presignals)
Hardly part of my patch!! And I cant see any logical reason for their existence.... other than to create silly logic circuits out of track ;)
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography

User avatar
Brianetta
Tycoon
Tycoon
Posts: 2566
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

I think Wolf wants his trains to be part of an FSM that can count trains into and out of a station+depot area, ensuring that the station and depot together never have more trains than platforms in the station.

Personally, I think a feature request for that would be more productive than a feature request for logic gates... but making silly logic circuits out of track is pretty cool in and of itself, and I think many of us can admit to having given it a go. (:
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED

User avatar
Wolf01
Tycoon
Tycoon
Posts: 2013
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Post by Wolf01 »

that was the purpose ;)

i want to make more controlled junctions with priority

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Hey richk67, take a look at the attachement, please, and give me the suggestions :wink:
Attachments
speedsignals.png
speedsignals.png (2.7 KiB) Viewed 29971 times

richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

MeusH wrote:Hey richk67, take a look at the attachement, please, and give me the suggestions :wink:
Look good. I really like the full face triangle, but the other angles arent as strong.

Would it be possible to rework the other angles to look like a 3-sided pyramid (tetrahedron). The sign doesnt really have a facing like signals, and so a more solid look would be clearer.

Thanks for your work on this.

I think the third colour should be Orange. Red has too strong a connotation of "danger".
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

richk67 wrote:Would it be possible to rework the other angles to look like a 3-sided pyramid (tetrahedron). The sign doesnt really have a facing like signals
Sure, it is not only possible, but also required ;)
So the new tetrahedron-shaped sign would look fatter in first four, or six views?
richk67 wrote:I think the third colour should be Orange. Red has too strong a connotation of "danger".
About the colors, What are your picks? Green, blue, yellow? Green, yellow, grey?

And that's no problem, I like doing it

richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

MeusH wrote:So the new tetrahedron-shaped sign would look fatter in first four, or six views?
First 6 views would all be fatter, and the 8th view would see the edge of the tetrahedron rather than the pole. Im thinking of this as a regular tetrahedron stuck on top of the pole, so the pole will never overlap the sign.

We may only need 4 facings - front on, back on, and the side facing each way.
About the colors, What are your picks? Green, blue, yellow? Green, yellow, grey?
Green, Yellow, Blue. But maybe also Green, Yellow, Orange.
And that's no problem, I like doing it
Thanks. Appreciated.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

richk67 wrote:
MeusH wrote:So the new tetrahedron-shaped sign would look fatter in first four, or six views?
First 6 views would all be fatter, and the 8th view would see the edge of the tetrahedron rather than the pole. Im thinking of this as a regular tetrahedron stuck on top of the pole, so the pole will never overlap the sign.
Just like the big sign on the left of the attachment?
richk67 wrote:We may only need 4 facings - front on, back on, and the side facing each way.
4 facings, as in the attachment?
(Front - one side visible. Rear, two angled - two sides visible)
Attachments
signs.jpg
signs.jpg (22.22 KiB) Viewed 29914 times

richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

MeusH wrote:Just like the big sign on the left of the attachment?
richk67 wrote:We may only need 4 facings - front on, back on, and the side facing each way.
4 facings, as in the attachment?
(Front - one side visible. Rear, two angled - two sides visible)
Absolutely spot on... I really look forawrd to these :)
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Not as much as I wanted, but here's a quick preview.

The shapes still need correction, I appreciate help from advanced graphics creator on how to draw such a small shape properly.

The yellow and orange mix too much, but I can make yellow more beige. I'm wondering how would it look for colorblind people, I know some play OpenTTD.
Attachments
speedsignals2.png
speedsignals2.png (1.96 KiB) Viewed 29818 times

hertogjan
Director
Director
Posts: 560
Joined: 03 Jan 2006 20:45
Location: Netherlands

Post by hertogjan »

The yellow and orange ones are practically undistinguishable.
Can't you do something with the shapes as well? So maybe use signs with one, two or three bars (for low, medium and high speed limits, respectively). An alternative way might be a triangle with point down for low, a square sign for medium, and a triangle with point upwards for high speed limit.
Those would also fix the colour-blindness issue.
Personally, my favourite is the one with the bars, as the can easily be made visible from behind as well.

richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

MeusH wrote:Not as much as I wanted, but here's a quick preview.

The shapes still need correction, I appreciate help from advanced graphics creator on how to draw such a small shape properly.

The yellow and orange mix too much, but I can make yellow more beige. I'm wondering how would it look for colorblind people, I know some play OpenTTD.
Hmm... yeah, the orange doesnt work if we keep the yellow. However, I think the orange will work better than yellow to stand out.

Could you make the yellow, blue? A sort of mid blue.

The order I would think would be FAST-green, MEDIUM-orange, SLOW-blue.

I also quite like the upside down triangle, but the fatter pyramids I think will work well.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

And now?
Attachments
speedsignals3.png
speedsignals3.png (1.97 KiB) Viewed 29806 times

richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

MeusH wrote:And now?
Very clear. Nice :)
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography

MeusH
Tycoon
Tycoon
Posts: 4349
Joined: 25 Oct 2004 15:39
Location: Mississauga

Post by MeusH »

Blue inverted. Reworked green and blue, thus lack of detail. At least the shape is visible
Attachments
speedsignals3.png
speedsignals3.png (1.58 KiB) Viewed 29746 times

User avatar
sidew
Engineer
Engineer
Posts: 115
Joined: 31 Aug 2005 06:46
Location: Milan, Italy
Contact:

Post by sidew »

The order I would think would be FAST-green, MEDIUM-orange, SLOW-blue.
IMHO, the best is:
fast - blue
medium - green
slow - orange
Sidewinder

Italian Town names patch for OTTD (R5266) now in trunk since 0.4.8
For typo, errors or bug on OTTD italian translation, please PM me.
unofficial italian TTD/OpenTTD forum: http://wolf01.game-host.org/forum/index.php

Sacro
Tycoon
Tycoon
Posts: 1142
Joined: 18 Jun 2005 21:08
Location: Here
Contact:

Post by Sacro »

Yes, blue for fastest seems better to me also.
We Am De Best

Host of ThroughTheTube site

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 7 guests