Patch: RouteMarkers

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

Haukinger
Engineer
Engineer
Posts: 110
Joined: 15 Mar 2006 16:38

Post by Haukinger »

You're right.

But the idea is different, I think.
As it works no, if a blue train encounters a blue marker, it get's a penalty (this works with A* because the penalty adds to the cost of the route)
in my version, if a blue train encounters a blue marker, it get's no penalty, instead, every train that is not blue, will get a penalty at this marker (this works with A* too as it's basically the same thing, only different coloured trains get the penalty).
To me, it looks more natural and understandable this way.

As I tried to make clear this has drawback - an unmarked route will look as good to a blue train as a blue marked one. To solve this, a junction with one marked exit has to have all exits marked. I'd reserve one colour for marking unmarked exits, and trains can't be of that colour. This constraint may be superfluous, but I think it makes things more understandable and intuitive for the user.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Post by MagicBuzz »

richk67 wrote:The bottom line with the A* pathfinding algorithm is that you *CANNOT* have negative penalties on a tile. If the cost of a tile < the cost of a straight piece of track, then the A* performance is *multiple* times slower.
When I speak about "-10 penality", I just put a minus sign as it's a penality. But my whole post was about using penality correctly, to simulate a nevative penality.
User avatar
MagicBuzz
Tycoon
Tycoon
Posts: 1357
Joined: 15 Feb 2003 17:32
Location: Vergezac, France

Post by MagicBuzz »

Haukinger wrote:You're right.

But the idea is different, I think.
As it works no, if a blue train encounters a blue marker, it get's a penalty (this works with A* because the penalty adds to the cost of the route)
in my version, if a blue train encounters a blue marker, it get's no penalty, instead, every train that is not blue, will get a penalty at this marker (this works with A* too as it's basically the same thing, only different coloured trains get the penalty).
To me, it looks more natural and understandable this way.
You're right, it's exaclty what about I said :)
But I think both markers should exists.
We should just need a new marker picture (the same without the red cross sounds perfect), then use the "old" marker with CTRL key.

By default, we should be able to put "every color gets a penality but the current color" marker, and CTRL should use the "this color will get a penality" marker.
Quark
Transport Coordinator
Transport Coordinator
Posts: 325
Joined: 20 Sep 2006 11:36
Location: Russia, Moscow

Post by Quark »

I think reversed markers is good. We will have two types of markers: 1) don't prefer this route if color not match and 2) don't prefer this route if color match. Because we just need filter all other trains from marker it will work :) But, it will not work as «please, prefer this route instead of unmarked one», so we need to place marker on shorter path for fast trains instead of on longer for freight.
Image
User avatar
Ayehow
Engineer
Engineer
Posts: 1
Joined: 13 Feb 2007 08:24
Location: Prague, Czech Republic (Central Europe, World, etc.)
Contact:

Blind routes

Post by Ayehow »

Have you considered another type of markers, that would mark the track for the train as blind (i.e. exactly like RR in TTDPatch)? It would be useful when there is no place for adding many normal markers in line (like station platform enterance). Or at least a marker with much more significant penalty, though I think marking a route blind shouldn't be a problem in the pathfinder algorithm.

So I suggest having 4 types of markers (still not too much):
1. Don't prefer matching colour
2. Don't prefer not matching colours
3. Mark blind for matching colour
4. Mark blind for not matching colours

This would allow a variety of route specifications, almost like RR (still missing restrictions based on signal state, though :( ) but with simpler UI.

Another question, I'm not sure if it is possible to have a marker and a signal on the same tile. It looks so in the screenshots. Is it really?
Vacua vasa plurimum sonant.
BamBam
Engineer
Engineer
Posts: 34
Joined: 06 May 2007 17:49

Post by BamBam »

Is the patch still in development?

I use it and it's great. I have only made a little changes:
- added the suggestions from Bjarni (now the route marker colour will be cloned/copied)
- change the location from the button, it's now next to the signal button
- you can use the shortcut 'm' to build a route marker
- and of course make it compatible to the current trunk

BamBam

Edit 04. July 2007: removed download, newest one see below
Last edited by BamBam on 03 Jul 2007 23:47, edited 1 time in total.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Wow - thanks. I've sort of parked this while I have a bit of a hiatus before digging into airports in a big way. Nice to see people like & use it.
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
LordOfThePigs
Route Supervisor
Route Supervisor
Posts: 435
Joined: 01 Jul 2004 10:28
Location: Jura/Switzerland

Post by LordOfThePigs »

I must say this sounds really cool. And do agree that making a blue sign to mean "blue trains will prefer this route" is better than "blue trains won't take this route", but I also think that both type of markers are required (click build a "same color prefers marked route" signal, and ctrl+click builds a "same color dislikes marked rout" signal.

In order to do that and in addition to adding 10 penalty for each non-blue color, you could just get the speed sign to set the penalty of the tile it sits on to be 1 (or 0 if A* permits it), or max(1, tilePenalty - 10). When I say that, I assume the default rail penalty is something like 5, is it the case?

Oh, and one UI concern. Wouldn't it be more usable if the color selection was in the order window instead of the train status window? That would save 2 click (close the order window, open the status window) for each train built, plus it would put the control at a place more easily visible and logical (after all, both orders and colors decide where your train goes...) for beginners.
Sometimes I'm told "Brilliant"...
Sometimes I'm told "Charming"...
And Often I'm told "Shut Up"!
BamBam
Engineer
Engineer
Posts: 34
Joined: 06 May 2007 17:49

Post by BamBam »

I hope richk67 has nothing against it that I editing his Patch :oops: .

Before some revs the Signal bit was changed and so the patch doesn't work. I have edit it but I am not lucky with this changes because I changed Tile.m4 from byte to uint16. I have no idea to avoid it.

I know only one bug: the route markers can be overbuild with roads. I will fix it the next days unless richk67 has nothing against it.

I love this patch very much. What must be change to get it into trunk?

Regards,
BamBam

Edit 04. July 2007: removed download, newest one see below
Last edited by BamBam on 03 Jul 2007 23:48, edited 1 time in total.
User avatar
glx
OpenTTD Developer
OpenTTD Developer
Posts: 623
Joined: 02 Dec 2005 15:43
Location: Drancy(93) - France
Contact:

Post by glx »

There are enough free bits in the map, so you don't need to increase m4 size.
Check docs/landscape.html and docs/landscape_grid.html to find free space.
boekabart
Transport Coordinator
Transport Coordinator
Posts: 333
Joined: 25 Aug 2005 09:44
Location: Eindhoven, Netherlands

Post by boekabart »

glx wrote:There are enough free bits in the map, so you don't need to increase m4 size.
Check docs/landscape.html and docs/landscape_grid.html to find free space.
Excellent idea though, just make m* uint32s !! no more map array problems ;) ;) 8)
doghousedean
Traffic Manager
Traffic Manager
Posts: 141
Joined: 30 Apr 2007 10:26

Post by doghousedean »

BamBam wrote:I hope richk67 has nothing against it that I editing his Patch :oops: .

Before some revs the Signal bit was changed and so the patch doesn't work. I have edit it but I am not lucky with this changes because I changed Tile.m4 from byte to uint16. I have no idea to avoid it.

I know only one bug: the route markers can be overbuild with roads. I will fix it the next days unless richk67 has nothing against it.

I love this patch very much. What must be change to get it into trunk?

Regards,
BamBam
I have sent you a PM regarding this,

It wont compile, i get lots of errors, i have included the buildlog
madman2003
Engineer
Engineer
Posts: 116
Joined: 20 May 2004 17:21

Post by madman2003 »

boekabart wrote:
glx wrote:There are enough free bits in the map, so you don't need to increase m4 size.
Check docs/landscape.html and docs/landscape_grid.html to find free space.
Excellent idea though, just make m* uint32s !! no more map array problems ;) ;) 8)
Keep in mind that a 32 (8*32 bits) byte tile, would use 128 MiB of memory for a 2048x2048 map, which is too much.
Archonix
Chief Executive
Chief Executive
Posts: 733
Joined: 01 May 2003 17:29
Location: Manchester, UK
Contact:

Post by Archonix »

madman2003 wrote:
boekabart wrote:
glx wrote:There are enough free bits in the map, so you don't need to increase m4 size.
Check docs/landscape.html and docs/landscape_grid.html to find free space.
Excellent idea though, just make m* uint32s !! no more map array problems ;) ;) 8)
Keep in mind that a 32 (8*32 bits) byte tile, would use 128 MiB of memory for a 2048x2048 map, which is too much.
I rather suspect that was his point. ;)
Brignell’s law of consensus: At times of high scientific controversy, the consensus is always wrong.
Haukinger
Engineer
Engineer
Posts: 110
Joined: 15 Mar 2006 16:38

Post by Haukinger »

madman2003 wrote:
boekabart wrote:
glx wrote:There are enough free bits in the map, so you don't need to increase m4 size.
Check docs/landscape.html and docs/landscape_grid.html to find free space.
Excellent idea though, just make m* uint32s !! no more map array problems ;) ;) 8)
Keep in mind that a 32 (8*32 bits) byte tile, would use 128 MiB of memory for a 2048x2048 map, which is too much.
You get 1GB for under 40€ - why should one care about memory usage ?
User avatar
NukeBuster
Traffic Manager
Traffic Manager
Posts: 222
Joined: 04 Jan 2006 18:16
Location: Alphen aan den Rijn, The Netherlands
Contact:

Post by NukeBuster »

Haukinger wrote:
madman2003 wrote:
boekabart wrote:Excellent idea though, just make m* uint32s !! no more map array problems ;) ;) 8)
Keep in mind that a 32 (8*32 bits) byte tile, would use 128 MiB of memory for a 2048x2048 map, which is too much.
You get 1GB for under 40€ - why should one care about memory usage ?
That's just one type of memory. Having A LOT of memory still doesn't make it acceptable to use the hole lot.
NukeBuster

Transport Empire: The Transport Empire Linux effort
Join the Transport Empire IRC channel: [url]irc://irc.oftc.net/transportempire[/url] !

OpenTTD patch(es): Password at join
doghousedean
Traffic Manager
Traffic Manager
Posts: 141
Joined: 30 Apr 2007 10:26

Post by doghousedean »

Haukinger wrote:
madman2003 wrote:
boekabart wrote:Excellent idea though, just make m* uint32s !! no more map array problems ;) ;) 8)
Keep in mind that a 32 (8*32 bits) byte tile, would use 128 MiB of memory for a 2048x2048 map, which is too much.
You get 1GB for under 40€ - why should one care about memory usage ?
thats why office 2007 is on a DVD!

Thats why some HP printer drivers are 75Mb

its just bad programming
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Ding ding. Time out.

Please keep this thread on the topic of the Routemarkers patch. Please!

(As a general point: If you are going to quote, just quote the last relevant line not the whole post. We dont need to see 5 levels of nesting, when we can see the original a few posts above.)
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
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Post by DJ Nekkid »

perhaps a stupid question, but why make it 10041 when the sources u can DL is 32,43 and 48 ?
User avatar
pecet
Engineer
Engineer
Posts: 124
Joined: 21 Mar 2007 13:22
Location: Poland
Contact:

Post by pecet »

7of9 wrote:perhaps a stupid question, but why make it 10041 when the sources u can DL is 32,43 and 48 ?
Maybe because you can use svn to dowload specific build..? http://wiki.openttd.org/index.php/SVN#W ... version.3F
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 1 guest