Page 3 of 4
Re: Zoning - Local Authorities
Posted: 31 Dec 2008 16:33
by Psicho
Just an idea. What about using this patch to create nations aswell?
I think it could be cool to use this system to join cities aswell into nations. This could give a nicer level of gaming in ttd, we could make real national/international/intercontinental transportations and have special taxes and fees for that... With cargodest aswell it could be a nice implementation
think is a nice idea?
Re: Zoning - Local Authorities
Posted: 05 Jul 2010 20:53
by Svip
What a bump! Or eh.
No seriously, I am considering reviving this patch again, given whether there is still any interest in this patch left or whether it has actually made its way towards trunk or some such! I don't feel like reinventing the wheel or inventing a wheel nobody wants to use.
Sure, it wasn't perfect, but all things have rough beginnings. I think what happened was me getting distracted by life in general. And then, unfortunately, I forgot about OpenTTD. It's shameful, I know.
So if someone out there is still hooked on the idea, I am willing to get cracking.
Re: Zoning - Local Authorities
Posted: 06 Jul 2010 06:41
by Anon
Interested, this patch will be very useful.
Re: Zoning - Local Authorities
Posted: 06 Jul 2010 10:52
by Svip
I am currently working on updating my 3 year old code to the modern versions of OpenTTD. So that might take some time getting all the bolts working.
Edit: Just a little status update for those who care. I have now successfully converted my former code to the new version of OpenTTD. The basics work now, and there is a widget and all. However, I still cannot figure out how to make the dropdown menus show what you select. Even after spending hours trying to understand the newgame gui.
But anyway, here is a screenshot.
By the way, suggestions for types of zoning are very welcome. Right now I have local authority and where you cannot build working. And I am working on implementing industry catchment. But there could be many more!
Re: Zoning - Local Authorities
Posted: 06 Jul 2010 20:27
by Svip
Apologies for the double post, but excellent happenings!
I have fixed all the obvious issues with this patch, and shall now release a simple 1.0 version. It will get many more features, but this is a stable simple version, that should provide you with the two basics. I realise the dropdown has a setting called 'Industry catchment', but it does not work as of right now.
So here is a screenshot, the patch and of course the grf file (though it is the same as before).
Re: Zoning - Local Authorities
Posted: 06 Jul 2010 21:57
by Zephyris
Nice, very nice! I like this a lot!
Re: Zoning - Local Authorities
Posted: 07 Jul 2010 02:02
by kamnet
This looks really nifty, I'd like to see it make it into trunk.
Re: Zoning - Local Authorities
Posted: 07 Jul 2010 09:32
by Svip
I appreciate the positive feedback. Also, I am having the following extra ideas for zoning types (in addition to industry catchment):
- City catchment (or 'building catchment')
- Unserved industries
- Unserved buildings
Edit: Well, as it turns out, doing 'industry/city catchment' won't be easy, since the catchment does not vary depending on industry, but rather depending on the type of station. The solution is thus to vary the colour of the tiles as they get further from the industries.
- 1-3 White (lorry/bus)
- 4 Blue (train station/some airports)
- 5 Green (docks/some airports)
- 6 Yellow (some airports)
- 7-9 Light blue (international airport)
And of course, there should be a 'station catchment', where you can see at a glance all tiles being served by your stations.
Edit 2: A little tease on the unserved buildings. It is however, not perfect. It would have produced the same results had I placed a lorry station, which cannot serve buildings. But checking for such will come!

- Notice which buildings are red, and which are not.
For the record, right now a building is a MP_HOUSE that accepts and/or produces mail and/or passengers.
Edit 3: And a showcase of station catchment!

- A combination of station catchment and unserved buildings. Notice how there are no unserved buildings!

- Testing whether the showcase is different from the actual handling.
Re: Zoning - Local Authorities
Posted: 07 Jul 2010 13:42
by boogieman1402
This looks really interesting! I've had many occasions in the past where I would've liked to have a station catchment display. It would be extra interesting if the cells belonging to a specific station would highlight when you hover your mouse over that station (or maybe right-click the station, if hover isn't something the UI can detect). Or as another alternative, put a button on a station window to toggle the catchment area for that station on or off. Lots of potential here, keep it up!

Re: Zoning - Local Authorities
Posted: 07 Jul 2010 14:25
by Svip
Well, right now the focus is overlay, rather than interaction. But maybe in a future 'offspring', perhaps.
Anyway, after some trial and error, I fixed the dreaded 'station catchment' issue. And here is a screenshot to showcase this.

- Notice the light blue area, which is where the station accepts goods for. While the dark blue area is both accepts and provides.
So it would only be natural to combine this with unserved buildings, so you can see if some of the buildings are only getting served, but cannot serve back.

- The buildings with an orange ring can be delivered to, but cannot provide goods themselves.
Re: Zoning - Local Authorities
Posted: 08 Jul 2010 14:30
by ChillCore
Svip wrote:
Edit 2: A little tease on the unserved buildings. It is however, not perfect. It would have produced the same results had I placed a lorry station, which cannot serve buildings. But checking for such will come!
Are you sure lorry stations do not serve buildings?
Mail is delivered to houses, mail is transported by lorries, lorries stop at lorry stations.
When I was testing player owned stations are marked as "where I can't build". I think this should be changed in the final version.
For player owned roads the behaviour is correct.
Looking forward to the next version of this very nice patch.
I have attached a few suggestions, hope you do not mind.

Re: Zoning - Local Authorities
Posted: 08 Jul 2010 14:51
by Psicho
Hi, is nice to see this project moving forward!
I give my little suggestion some time ago, in one of the latest posts.
if you like I can get more in detail with it
nice work anyhow!
Re: Zoning - Local Authorities
Posted: 08 Jul 2010 19:07
by Lordmwa
very nice
Re: Zoning - Local Authorities
Posted: 08 Jul 2010 22:49
by Svip
ChillCore wrote:Svip wrote:
Edit 2: A little tease on the unserved buildings. It is however, not perfect. It would have produced the same results had I placed a lorry station, which cannot serve buildings. But checking for such will come!
Are you sure lorry stations do not serve buildings?
Mail is delivered to houses, mail is transported by lorries, lorries stop at lorry stations.
You are right! But some buildings (like stations) only accept passengers. So there still need to be a check.
ChillCore wrote:When I was testing player owned stations are marked as "where I can't build". I think this should be changed in the final version.
For player owned roads the behaviour is correct.
This is true. Fix shall come!
ChillCore wrote:Looking forward to the next version of this very nice patch.
I have attached a few suggestions, hope you do not mind.

Well, I usually do my coding by first getting it to work, then I clean it up afterwards. I prefer to clean up code that works. But that's just me.
Psicho wrote:Hi, is nice to see this project moving forward!
I give my little suggestion some time ago, in one of the latest posts.
if you like I can get more in detail with it
nice work anyhow!
Oh, I wouldn't mind if you
did repost it. And if you have further details, even better!
Re: Zoning - Local Authorities
Posted: 09 Jul 2010 00:35
by ChillCore
Svip wrote:
ChillCore wrote:
Looking forward to the next version of this very nice patch.
I have attached a few suggestions, hope you do not mind.
Well, I usually do my coding by first getting it to work, then I clean it up afterwards. I prefer to clean up code that works. But that's just me.
Which is perfectly fine. I used to think the same way.
However after debugging, and applying coding style to, a certain patch for quite some time now, I have two good reasons for applying coding style as I go:
- When I know I have done it, I have peace of mind knowing that it is done and I do not have to go back just for coding style.
- When someone reviews the code and does coding style in his head at the same time (we all do that automatically I think), it distracts from the essential which is the code. (I know for a fact some people will stop reading just for that reason ...)
Anyway I do not want to get to far off topic so I'll leave it at that.
Re: Zoning - Local Authorities
Posted: 09 Jul 2010 10:29
by Psicho
h, I wouldn't mind if you did repost it. And if you have further details, even better!
Sure, it was just on the top of this page
Psicho wrote:Just an idea. What about using this patch to create nations aswell?
I think it could be cool to use this system to join cities aswell into nations. This could give a nicer level of gaming in ttd, we could make real national/international/intercontinental transportations and have special taxes and fees for that... With cargodest aswell it could be a nice implementation
think is a nice idea?
Re: Zoning - Local Authorities
Posted: 09 Jul 2010 10:32
by Kogut
Psicho wrote:I think it could be cool to use this system to join cities aswell into nations. This could give a nicer level of gaming in ttd, we could make real national/international/intercontinental transportations and have special taxes and fees for that... With cargodest aswell it could be a nice implementation

think is a nice idea?
Maybe, but probably there is no connection with that existing path. And merging it into one path is probably the best way to avoid including it into trunk.
Re: Zoning - Local Authorities
Posted: 09 Jul 2010 13:18
by Svip
Kogut is right. The introduction of nations should not be served by this patch. While this patch could 'illustrate' them, the idea of this patch is not to introduce new gameplay features, but rather a new interface module, that will help you with currently implemented gameplay features.
It is not that I do not like the idea of introducing nations and such; I love it (one of the things I love about Railroad Tycoon 3), but this is the wrong patch.
Re: Zoning - Local Authorities
Posted: 09 Jul 2010 14:27
by Svip
Svip wrote:ChillCore wrote:Looking forward to the next version of this very nice patch.
I have attached a few suggestions, hope you do not mind.

Well, I usually do my coding by first getting it to work, then I clean it up afterwards. I prefer to clean up code that works. But that's just me.
I did my effort and cleaned up most of my code, so I have attached version 1.1 (however, industry/city catchment remains unimplemented and there are TODOs on the other methods as well, but many things works rather nicely, so it is worthy of a 1.1 release).
Remember, this patch is developed for r20082. It should most likely have no problems with current trunk version, but I have not tested this myself yet.
I do apologise for the double post, but I felt a real update was worthy of its own post.
Re: Zoning - Local Authorities
Posted: 10 Jul 2010 13:38
by Svip
Oh my goodness, I be triple posting, yo.
But I have screenshots to compensate for that! Specifically three. I have now created industry and city catchments, as you can see in these screenshots.

- Only city catchment

- Only industry catchment.

- Using both industry and city catchment at the same time.