Patch : Show station coverage areas [v1 r17250]
Moderator: OpenTTD Developers
Patch : Show station coverage areas [v1 r17250]
This patch allows to show the acceptance and catchment area of a station. It is just a first version to get feedback (and see if people like/want it).
Features :
- add a button in the station gui (another train square icon between Location and Ratings button)
- display acceptance and catchment areas in, respectively, blue and red "selection" squares (temporary sprites)
Known Bugs :
- if using "more realistic catchment size" for station, adding or removing tiles to a station with different catchment size can crash the game (on remove). Will be fixed in v2
Next :
- fix bug 1 (more an unfinished feature)
- add specific sprites : toggle button + acceptance / catchment tiles.
- differentiate between companies with colors / patterns / ... (how to do when station areas overlap ?)
- toogle catchment in stations from town ?
- optimize / change way to get catchment area
- ...
Infos on how works acceptance and catchment areas : http://www.tt-forums.net/viewtopic.php? ... 94&start=0
Feel free to comment ...
(don't mind the code yet, also i will comment it and check code style for next version)
Features :
- add a button in the station gui (another train square icon between Location and Ratings button)
- display acceptance and catchment areas in, respectively, blue and red "selection" squares (temporary sprites)
Known Bugs :
- if using "more realistic catchment size" for station, adding or removing tiles to a station with different catchment size can crash the game (on remove). Will be fixed in v2
Next :
- fix bug 1 (more an unfinished feature)
- add specific sprites : toggle button + acceptance / catchment tiles.
- differentiate between companies with colors / patterns / ... (how to do when station areas overlap ?)
- toogle catchment in stations from town ?
- optimize / change way to get catchment area
- ...
Infos on how works acceptance and catchment areas : http://www.tt-forums.net/viewtopic.php? ... 94&start=0
Feel free to comment ...
(don't mind the code yet, also i will comment it and check code style for next version)
- Attachments
-
- coverage_v1.PNG (185.38 KiB) Viewed 4020 times
-
- show_station_coverage_v1_17250.diff
- (35.74 KiB) Downloaded 888 times
Re: Patch : Show station coverage areas [v1 r17250]
At first, i dont like the small tag for turning on/off. Also the Red highlight is not very nice, use the standart ( gray - blue, when building station ... ) one? But nice patch for concept ![Wink ;-)](./images/smilies/icon_wink.gif)
![Wink ;-)](./images/smilies/icon_wink.gif)
My patches: Day length (new concept), Conditional loading, Auto separation, Unload all adds Leave empty, Better statue placement (in trunk)
My abandoned patches: Speed limits for RVs, Day length (old concept)
My abandoned patches: Speed limits for RVs, Day length (old concept)
Re: Patch : Show station coverage areas [v1 r17250]
I think that's a cool patch. I also agree that the red is a little too much, I'd like white better.
Re: Patch : Show station coverage areas [v1 r17250]
Very nice patch, something similar was already around some time ago. I would like a "global" switch, where the catchment view is enabled for all stations. What is the difference between your red and blue tiles, or rather what's the difference between blue and unmarked tiles?
Greets
Ammler
Greets
Ammler
Town Names:
![Image](https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Flag_of_Portugal.svg/18px-Flag_of_Portugal.svg.png)
![Image](https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/Flag_of_Belarus.svg/18px-Flag_of_Belarus.svg.png)
Still work in progress: OpenGFX or/and OpenSFX - Please help!
Re: Patch : Show station coverage areas [v1 r17250]
Ammler, blue tiles are also covered in acceptance area. His patch show the direct ones (red tiles) and also the one described in other topic (link at forst post)(blue ones).
My patches: Day length (new concept), Conditional loading, Auto separation, Unload all adds Leave empty, Better statue placement (in trunk)
My abandoned patches: Speed limits for RVs, Day length (old concept)
My abandoned patches: Speed limits for RVs, Day length (old concept)
-
- Engineer
- Posts: 72
- Joined: 21 Jan 2009 12:24
Re: Patch : Show station coverage areas [v1 r17250]
I like the look of this, it reminds me of the areas you can set workers to in RCT. (Maybe you could use the same colour blue as a homage
)
I think it'd be very handy for bus routes. Maybe if you are running a feeder service to a train station or airport to make sure you get 100% coverage in cities.
![Wink ;)](./images/smilies/icon_wink.gif)
I think it'd be very handy for bus routes. Maybe if you are running a feeder service to a train station or airport to make sure you get 100% coverage in cities.
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch : Show station coverage areas [v1 r17250]
update to R17532
removed becuse of bug and updated below
Also a great patch cant wait for V2
removed becuse of bug and updated below
Also a great patch cant wait for V2
Last edited by 2007Alain2007 on 20 Sep 2009 22:52, edited 1 time in total.
For Community Integrated Version http://code.google.com/p/civopenttd/
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch : Show station coverage areas [v1 r17250]
There is a small bug the coverage is not updated if you remove part of a station.
All so if you end a game with it showing it will also show on the main screen on the background game
All so if you end a game with it showing it will also show on the main screen on the background game
For Community Integrated Version http://code.google.com/p/civopenttd/
-
- Chief Executive
- Posts: 658
- Joined: 11 Nov 2007 12:06
- Contact:
Re: Patch : Show station coverage areas [v1 r17250]
bug fixed with romoveing lorry stops becuse of my bad update heres a working one
code should never been changed
We all hope gehene will get back to this patch
code should never been changed
Code: Select all
- InvalidateWindowData(WC_STATION_LIST, st->owner, 0);
+ SetWindowWidgetDirty(WC_STATION_LIST, st->owner, 0);
For Community Integrated Version http://code.google.com/p/civopenttd/
-
- Engineer
- Posts: 1
- Joined: 14 Jan 2011 17:13
Re: Patch : Show station coverage areas [v1 r17250]
Is this patch always in production ?
I think this is an important function to see stations coverage.
If needed, I can help to develop this, but I'm not very familiar with openttd code (and I'm French
)
I think this is an important function to see stations coverage.
If needed, I can help to develop this, but I'm not very familiar with openttd code (and I'm French
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Re: Patch : Show station coverage areas [v1 r17250]
maybe this patch is more developed: http://www.tt-forums.net/viewtopic.php?f=33&t=33701
- Vaulter
- Traffic Manager
- Posts: 185
- Joined: 21 Dec 2004 05:35
- Skype: andrey-zaharov
- Location: St. Petersburg, Russia
- Contact:
Re: Patch : Show station coverage areas [v1 r17250]
This patch works with other NewGRFs, and more robust against performanceEddi wrote:maybe this patch is more developed: http://www.tt-forums.net/viewtopic.php?f=33&t=33701
- Vaulter
- Traffic Manager
- Posts: 185
- Joined: 21 Dec 2004 05:35
- Skype: andrey-zaharov
- Location: St. Petersburg, Russia
- Contact:
Re: Patch : Show station coverage areas [v1 r17250]
Fixed & updated
- Attachments
-
- station-cover.r22604M.patch
- (33.41 KiB) Downloaded 514 times
Re: Patch : Show station coverage areas [v1 r17250]
i made this simple modification in "rail_cmd.cpp" file and get a correct draw of coverage over rails (was not happening before).
"//DrawOverlay(ti, MP_RAILWAY);" is on the original place.
Thank you for the update & fix![Smile :)](./images/smilies/icon_smile.gif)
"//DrawOverlay(ti, MP_RAILWAY);" is on the original place.
Code: Select all
===================================================================
--- src/rail_cmd.cpp (revision 22660)
+++ src/rail_cmd.cpp (working copy)
@@ -2218,11 +2218,15 @@
_drawtile_track_palette = COMPANY_SPRITE_COLOUR(GetTileOwner(ti->tile));
if (IsPlainRail(ti->tile)) {
+ //DrawOverlay(ti, MP_RAILWAY);
+
TrackBits rails = GetTrackBits(ti->tile);
DrawTrackBits(ti, rails);
if (HasBit(_display_opt, DO_FULL_DETAIL)) DrawTrackDetails(ti, rti);
+
+ DrawOverlay(ti, MP_RAILWAY);
if (HasCatenaryDrawn(GetRailType(ti->tile))) DrawCatenary(ti);
Thank you for the update & fix
![Smile :)](./images/smilies/icon_smile.gif)
Re: Patch : Show station coverage areas [v1 r17250]
I love this patch therefore dedicated some time looking it.
probably big changes are beyond my knowledge![Smile :)](./images/smilies/icon_smile.gif)
but somehow this one is working in the beta4 and without crashes, so i'll ask to someone test it too (more then I
)
thx again![Bowing Down :bow:](./images/smilies/bowdown.gif)
Edit: added diff file against trunk
probably big changes are beyond my knowledge
![Smile :)](./images/smilies/icon_smile.gif)
but somehow this one is working in the beta4 and without crashes, so i'll ask to someone test it too (more then I
![Razz :P](./images/smilies/icon_razz.gif)
thx again
![Bowing Down :bow:](./images/smilies/bowdown.gif)
Edit: added diff file against trunk
- Attachments
-
- Station_Coverage_1.2.0-beta4M.diff
- (29.5 KiB) Downloaded 456 times
-
- Station_Coverage_r23919M.diff
- (29.5 KiB) Downloaded 467 times
Last edited by ST2 on 09 Feb 2012 21:11, edited 1 time in total.
Re: Patch : Show station coverage areas [v1 r17250]
Patching against a release is not very useful.
After patching a release the program is not the same as the release itself (so use as a drop-in version of that release does not work), and in general the patch will fail in trunk due to changes between the release and trunk (making it impossible to merge it into trunk).
(Although, since beta4 is relatively young, the latter may still work in this particular case.)
After patching a release the program is not the same as the release itself (so use as a drop-in version of that release does not work), and in general the patch will fail in trunk due to changes between the release and trunk (making it impossible to merge it into trunk).
(Although, since beta4 is relatively young, the latter may still work in this particular case.)
Re: Patch : Show station coverage areas [v1 r17250]
IF (and only if) the patch maintains network compatibility - i.e. most (though not all) GUI improvements would fall in this category - then it is useful to create patch against the release. Then you can use such modified release to connect to unmodified servers too (you just have to override the build to not add "M" to the end of the version)Alberth wrote:Patching against a release is not very useful.
Yes, but sometimes patch from release may work within some range of revisions and with reasonably small modification within quite large range of revisions. Creating patch for trunk from patch for reasonably new release is usually not very hard - though there are exceptions ... .Alberth wrote:... in general the patch will fail in trunk due to changes between the release and trunk (making it impossible to merge it into trunk).
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: Patch : Show station coverage areas [v1 r17250]
I am aware of that, but for many patch creators/updaters the notion of "network compability" is too complicated to understand. As a result, I simplified the rules to just exclude releases entirely. It makes sense as in leveling the playing field. Also, the number of patches that are adversely affected is very small, and people understanding the deeper issues will understand why I say it, and also know when it does or does not hold.Bilbo wrote:IF (and only if) the patch maintains network compatibility - i.e. most (though not all) GUI improvements would fall in this category - then it is useful to create patch against the release. Then you can use such modified release to connect to unmodified servers too (you just have to override the build to not add "M" to the end of the version)Alberth wrote:Patching against a release is not very useful.
Even then, from a development point of view, making a patch against a release is not helping in getting it in trunk.
I thought I covered that in "in general ..." already.Bilbo wrote:Yes, but sometimes patch from release may work within some range of revisions and with reasonably small modification within quite large range of revisions. Creating patch for trunk from patch for reasonably new release is usually not very hard - though there are exceptions ... .Alberth wrote:... in general the patch will fail in trunk due to changes between the release and trunk (making it impossible to merge it into trunk).
I think getting the general idea across that patches and releases should not be combined is more useful.
People without good understanding cannot do anything with "sometimes" and "there are exceptions".
Like above, people that understand working with patches also know that the limits are less hard than I state them.
Re: Patch : Show station coverage areas [v1 r17250]
ok, lets make it in simple words...
1 - i'm not a pro in coding knowledge. Fact!
2 - not even average level!
2 - i've pick this patch and made couple changes (few)...
3 - starts working stable (no crashes) in SP and MP (yes, overriding !!VERSION!! and !!REVISION!! when needed to test in MP)
4 - after many many tests, no crashes, i shared the code that i got, here! (yes, was beta4 at the time - but good in RC1 and in r24000)
now, the 5th point can be:
a) i keep the code to myself as a "precisous opensource" code secret?
b) or i share it to community, that previously shared it to me? (imo, the way to get improved)
probably not a big improvement/changes i made... but i shared it!!! (this line will hit someone)
I didn't wanted that version to trunk/stable... i've only shared some code i think i got stable (PS: "i think" is important), and that i found somewhere in "OpenTTD Development" forums
i use it, even in release versions! So what!!
finally, questions to Alberth:
- have you tested it? (before you post a answer)
- if not, can you explain me better your fundaments? (patch i have changed VERSION and REVISION, patch i shared doesn't)
- better, can you explain any answer without testing it?
- if you're so worried with patched versions (network compatibilities), why those still appears in MP list?
- and the last question, any bug found, can you post it at this thread, right?!
PS: Alberth got my respect because gave huge help to solved some problems when i was compiling using MSYS earlier times.
PS2: When i make questions is because i'm prepared for all possible answers (side effects of working in a newspapper)
PS3: "I'm not big enough to start a war but powerfull enough to fight on it" <<-- quote
JRC/ST2
Edit: typo
1 - i'm not a pro in coding knowledge. Fact!
2 - not even average level!
2 - i've pick this patch and made couple changes (few)...
3 - starts working stable (no crashes) in SP and MP (yes, overriding !!VERSION!! and !!REVISION!! when needed to test in MP)
4 - after many many tests, no crashes, i shared the code that i got, here! (yes, was beta4 at the time - but good in RC1 and in r24000)
now, the 5th point can be:
a) i keep the code to myself as a "precisous opensource" code secret?
b) or i share it to community, that previously shared it to me? (imo, the way to get improved)
probably not a big improvement/changes i made... but i shared it!!! (this line will hit someone)
I didn't wanted that version to trunk/stable... i've only shared some code i think i got stable (PS: "i think" is important), and that i found somewhere in "OpenTTD Development" forums
i use it, even in release versions! So what!!
finally, questions to Alberth:
- have you tested it? (before you post a answer)
- if not, can you explain me better your fundaments? (patch i have changed VERSION and REVISION, patch i shared doesn't)
- better, can you explain any answer without testing it?
- if you're so worried with patched versions (network compatibilities), why those still appears in MP list?
- and the last question, any bug found, can you post it at this thread, right?!
PS: Alberth got my respect because gave huge help to solved some problems when i was compiling using MSYS earlier times.
PS2: When i make questions is because i'm prepared for all possible answers (side effects of working in a newspapper)
PS3: "I'm not big enough to start a war but powerfull enough to fight on it" <<-- quote
JRC/ST2
Edit: typo
Re: Patch : Show station coverage areas [v1 r17250]
What can I find out by testing?ST2 wrote:- have you tested it? (before you post a answer)
Does it patch cleanly against beta4? I believe you without trying it.
Does it work? You say it does, I did not try it, so I believe you.
So, you have a good working patch against 1.2 beta 4.
And now?
So you have a modified beta4, and hacked the protection mechanisms to fake it as beta4. Ok.ST2 wrote:- if not, can you explain me better your fundaments? (patch i have changed VERSION and REVISION, patch i shared doesn't)
In a MP game, you now get two things:
- You get an unfair advantage compared to others.
- If you hit a desync, we are the people that get the report at our doorstep, and have to look for days only to come up with nothing, because you are using other software than we think.
The other thing you may want with a patch is inclusion in the OpenTTD program.
However trunk is not the same as beta4, so it cannot be applied.
(Yes I am aware that there is a non-zero chance that it works, but you're talking 1 in 1000 or so, and I am not prepared to download a patch, create a copy of the repository, apply the patch, try to compile, and mess around with improvements with about 0.1% chance of succes. I have better things to do with those hours.)
I just did, didn't I?ST2 wrote:- better, can you explain any answer without testing it?
In fact, I don't even have source code of any released version at my machine in a state where I can work in it. I only use trunk. There are two simple reasons for it. One is that we make many many releases, so I'd have to keep lots and lots of source code around just in case. Second, if I'd download the sources, setup a working environment around it, apply your patch, compile, try it, it works. Then what?
The only thing I can do then is report "it works". Well, you did that already.
Moving it into trunk does not work in general (see above). My conclusion is therefore it is a futile exercise in the first place.
Because 'network compability' is not something you can detect without actual playing, and getting a desync. If you get one, you know it is not compatible. If you don't get one, either you are compatible, or you did not test good enough. There is no way of being sure the software is fully network compatible at all times. Heck, we had desyncs between servers and clients where all programs were known to be an official version. These bugs can linger for several years before being triggered, just because the specific condition is so rare, it almost never happens. In other words, "I tested and it worked" is just reducing the chance, not eliminating existence.ST2 wrote:- if you're so worried with patched versions (network compatibilities), why those still appears in MP list?
(And thank you for proving my point about network compability being too complicated to understand for many people.)
How does a player or do we know the bug was due to your software changes?ST2 wrote:- and the last question, any bug found, can you post it at this thread, right?!
If you fake to be an official version, there is no way to decide the software was actual a different version.
Such bugs just get filed un 'beta4', and we waste hours finding out how the problem may have happened in the official version. If we are very lucky, the crash log gives weird line numbers, and we can see it was actually a faked version, but which patch was added then? It could be any of the patches floating around, including non-published ones.
I don't fight wars, it's just a waste of energy and time. Writing this post cost me one hour, time I could have spend more usefully.ST2 wrote:PS3: "I'm not big enough to start a war but powerfull enough to fight on it" <<-- quote
I am however willing to explain why I think like I do, and am willing to accept good arguments against it.
Albert
Who is online
Users browsing this forum: No registered users and 0 guests