Zoning - Local Authorities

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

Psicho
Engineer
Engineer
Posts: 112
Joined: 27 Apr 2004 09:37
Location: Switzerland
Contact:

Re: Zoning - Local Authorities

Post 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?
greetz,
Rasael
User avatar
Svip
Engineer
Engineer
Posts: 31
Joined: 11 Nov 2005 10:36
Location: Copenhagen, Denmark

Re: Zoning - Local Authorities

Post 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.
Anon
Engineer
Engineer
Posts: 16
Joined: 20 Jun 2010 19:20

Re: Zoning - Local Authorities

Post by Anon »

Interested, this patch will be very useful.
User avatar
Svip
Engineer
Engineer
Posts: 31
Joined: 11 Nov 2005 10:36
Location: Copenhagen, Denmark

Re: Zoning - Local Authorities

Post 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!
Attachments
Just showing the two basic zone options right now: Authority and can't build.
Just showing the two basic zone options right now: Authority and can't build.
User avatar
Svip
Engineer
Engineer
Posts: 31
Joined: 11 Nov 2005 10:36
Location: Copenhagen, Denmark

Re: Zoning - Local Authorities

Post 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).
Attachments
A town who disapprove of me and one who approves of me.
A town who disapprove of me and one who approves of me.
zoning-1.0.patch
The patch.
(16.62 KiB) Downloaded 155 times
innerhighlight.grf
The grf file (just shove into your data-dir).
(6.79 KiB) Downloaded 158 times
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: Zoning - Local Authorities

Post by Zephyris »

Nice, very nice! I like this a lot!
User avatar
kamnet
Moderator
Moderator
Posts: 8588
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Zoning - Local Authorities

Post by kamnet »

This looks really nifty, I'd like to see it make it into trunk.
User avatar
Svip
Engineer
Engineer
Posts: 31
Joined: 11 Nov 2005 10:36
Location: Copenhagen, Denmark

Re: Zoning - Local Authorities

Post 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.
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!
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.
Testing whether the showcase is different from the actual handling.
boogieman1402
Engineer
Engineer
Posts: 11
Joined: 14 Jun 2010 17:11

Re: Zoning - Local Authorities

Post 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! :bow:
User avatar
Svip
Engineer
Engineer
Posts: 31
Joined: 11 Nov 2005 10:36
Location: Copenhagen, Denmark

Re: Zoning - Local Authorities

Post 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.
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.
The buildings with an orange ring can be delivered to, but cannot provide goods themselves.
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Zoning - Local Authorities

Post 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. :)
Attachments
suggestions_coding_style_zoning-1.0.txt
(1.17 KiB) Downloaded 171 times
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Psicho
Engineer
Engineer
Posts: 112
Joined: 27 Apr 2004 09:37
Location: Switzerland
Contact:

Re: Zoning - Local Authorities

Post 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!
greetz,
Rasael
User avatar
Lordmwa
President
President
Posts: 899
Joined: 20 May 2006 19:30
Location: West Sussex, England

Re: Zoning - Local Authorities

Post by Lordmwa »

very nice
The TT forums trivia tournament! Come along and join in the fun
http://www.funtrivia.com/private/main.cfm?tid=90722
User avatar
Svip
Engineer
Engineer
Posts: 31
Joined: 11 Nov 2005 10:36
Location: Copenhagen, Denmark

Re: Zoning - Local Authorities

Post 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!
User avatar
ChillCore
Tycoon
Tycoon
Posts: 2822
Joined: 04 Oct 2008 23:05
Location: Lost in spaces

Re: Zoning - Local Authorities

Post 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.
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.
Psicho
Engineer
Engineer
Posts: 112
Joined: 27 Apr 2004 09:37
Location: Switzerland
Contact:

Re: Zoning - Local Authorities

Post 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?
greetz,
Rasael
Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Zoning - Local Authorities

Post 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.
Last edited by Kogut on 09 Jul 2010 14:27, edited 1 time in total.
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD
User avatar
Svip
Engineer
Engineer
Posts: 31
Joined: 11 Nov 2005 10:36
Location: Copenhagen, Denmark

Re: Zoning - Local Authorities

Post 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.
User avatar
Svip
Engineer
Engineer
Posts: 31
Joined: 11 Nov 2005 10:36
Location: Copenhagen, Denmark

Re: Zoning - Local Authorities

Post 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.
Attachments
zoning-1.1.patch
Patch created for r20082.
(29.13 KiB) Downloaded 232 times
innerhighlight.grf
Attaching this again for old time sake (nothing has changed, btw, so if you already have it, it would be pointless to obtain).
(6.79 KiB) Downloaded 200 times
User avatar
Svip
Engineer
Engineer
Posts: 31
Joined: 11 Nov 2005 10:36
Location: Copenhagen, Denmark

Re: Zoning - Local Authorities

Post 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 city catchment
Only industry catchment.
Only industry catchment.
Using both industry and city catchment at the same time.
Using both industry and city catchment at the same time.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Amazon [Bot] and 44 guests