Patch: Town Restructuring r11088
Moderator: OpenTTD Developers
Patch: Town Restructuring r11088
So I was thinking about what I might work on next, and here is what I have come up with. Right now if you want to do any serious construction in a town, then you need to have a couple of stations already there with a good rating with the town. If your plans are really ambitious, this alone might not be enough. Bribes may become important. So I wondered if there was a way around this. Normally, when eminent domain is used to buy out a land owner, they get some cash and most likely re-build somewhere else. In game, the building is just gone if you bulldoze it.
What I was thinking is that instead, if the player tries to buy a tile that has a town structure on it, instead of failing, the structure could be relocated. More correctly, it would still be destroyed, the town would just grow a new one on a different tile. The trade off would be an substantially increased money cost for the player, but a reduced rating cost.
I do see that there is a potential for abuse, especially in multilayer games, where a malicious player would buy everything around another players station. but this isn't any worse than what griefers already have. It is possible to repeatedly create companies and wipe out a town. At least with this tool, the size of the town doesn't shrink, just the shape of it.
UPDATE Sept. 12, 2007
Here is the first draft of the patch. Here is how it works. If the patch is enabled, and you use the Purchase Land tool on a tile that has a town building or road, the tile will be cleared and purchased automatically. However the money cost will be ten times greater than normal. The rating cost to your company in the town will be one fifth the normal cost. If the tile was a building and not a road, the town will grow a new building to replace it. Estimating cost with the shift key works too. If money is tight, the original behavior should continue to work by demolishing first then buying the tile.
I'm not going to call this good code, so suggestions and feedback for improvement are welcome.
What I was thinking is that instead, if the player tries to buy a tile that has a town structure on it, instead of failing, the structure could be relocated. More correctly, it would still be destroyed, the town would just grow a new one on a different tile. The trade off would be an substantially increased money cost for the player, but a reduced rating cost.
I do see that there is a potential for abuse, especially in multilayer games, where a malicious player would buy everything around another players station. but this isn't any worse than what griefers already have. It is possible to repeatedly create companies and wipe out a town. At least with this tool, the size of the town doesn't shrink, just the shape of it.
UPDATE Sept. 12, 2007
Here is the first draft of the patch. Here is how it works. If the patch is enabled, and you use the Purchase Land tool on a tile that has a town building or road, the tile will be cleared and purchased automatically. However the money cost will be ten times greater than normal. The rating cost to your company in the town will be one fifth the normal cost. If the tile was a building and not a road, the town will grow a new building to replace it. Estimating cost with the shift key works too. If money is tight, the original behavior should continue to work by demolishing first then buying the tile.
I'm not going to call this good code, so suggestions and feedback for improvement are welcome.
- Attachments
-
- Town_restructuring_v1_r11088.patch
- A patch to allow purchasing town land at an increased money cost and reduced rating cost. Version 1 (Built with Trunk r11088)
- (14.16 KiB) Downloaded 92 times
Last edited by wleader on 12 Sep 2007 00:50, edited 1 time in total.
Re: My next patch - Restructuring
Sounds really quite good. I would like this.
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
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
Re: My next patch - Restructuring
In my opinion a very good idea.
I would use it all the time.
I would use it all the time.
*<(:-}
Re: My next patch - Restructuring
it would be just awsome! completely and totally awsome. and imho trunkworthy 
just make sure you code it in a good and bugfree way.
and perhaps make a 2nd patch-part where you include a "cannot be done if a company have a station with catchmentarea here"-thingy
but most ppl would have a use of this all the time, this way we can "inject" a station in the middle of a city...

just make sure you code it in a good and bugfree way.
and perhaps make a 2nd patch-part where you include a "cannot be done if a company have a station with catchmentarea here"-thingy

but most ppl would have a use of this all the time, this way we can "inject" a station in the middle of a city...
- NukeBuster
- Traffic Manager
- Posts: 222
- Joined: 04 Jan 2006 18:16
- Location: Alphen aan den Rijn, The Netherlands
- Contact:
Re: My next patch - Restructuring
Very nice Idea, I sometimes wipe out almost the whole city when expanding track or a station.
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
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
Re: My next patch - Restructuring
Definitly not a waste of time! It's really annoying if you have all the money of the world, but can only remove five buildings and then have to wait another year until the rating is high enough again to go for the next five. Even only expanding an existing train station can take forever.
-
- Engineer
- Posts: 71
- Joined: 06 Sep 2007 16:36
- Location: Peterborough, United Kingdom
Re: My next patch - Restructuring
Hey,
Nice idea.
Just a thought though: what happens if you buy a town owned road will this be moved, make the road yours or will the road need to be demolished first
Nice idea.
Just a thought though: what happens if you buy a town owned road will this be moved, make the road yours or will the road need to be demolished first

- PouncingAnt
- Transport Coordinator
- Posts: 357
- Joined: 09 Nov 2004 22:33
Re: My next patch - Restructuring
I also like this idea. Though I still think there should be at least some rating penalties for doing this. Personally I think it adds to the game to limit the restructuring in towns.
NB: the below challenges are still open for submission, so feel free to perform necromancy on them!
Try the PouncingAnt National Monopoly Challenge
Or even better, the PouncingAnt National Monopoly Challenge 2
Or better still, the PouncingAnt National Monopoly Challenge 3
Or, the PouncingAnt National Monopoly Challenge 4
Or try my scenario instead!
-(A lazy) OpenTTD Japanese Translator-
-(A lazy) PNGcodec user-
"You get what you pay for, so pay attention!"
Patches:
Company Station Stats
Try the PouncingAnt National Monopoly Challenge
Or even better, the PouncingAnt National Monopoly Challenge 2
Or better still, the PouncingAnt National Monopoly Challenge 3
Or, the PouncingAnt National Monopoly Challenge 4
Or try my scenario instead!
-(A lazy) OpenTTD Japanese Translator-
-(A lazy) PNGcodec user-
"You get what you pay for, so pay attention!"
Patches:
Company Station Stats
Re: My next patch - Restructuring
Reduced doesn't mean none...., but a reduced rating cost.
Sounds like a great idea.
You all seem to have missed that placeing trees increases your rateing so people can destroy towns in minutes anyway.
Re: My next patch - Restructuring
or you have failed to realise we know this, and also know of a quicker way.
called the magic bulldoser. would be done in a instance !!
called the magic bulldoser. would be done in a instance !!
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
Re: My next patch - Restructuring
I am very happy that after waiting a couple of years
finally someone decided to code this!
To avoid misuse of it, I suggest that the cost of such an action should be much more than that of demolishing the building. This is reasonable: To purchase the building and persuade the owner to move to a different, less attractive area of the city, he needs some incentive, so does the unwilling to cooperate or sometimes greedy city council.
Double cost at least.
Unmovables (monuments, industries(except raw)) can be transferred to another place this way.

To avoid misuse of it, I suggest that the cost of such an action should be much more than that of demolishing the building. This is reasonable: To purchase the building and persuade the owner to move to a different, less attractive area of the city, he needs some incentive, so does the unwilling to cooperate or sometimes greedy city council.

That's considered cheating. We need a "legal" way or in other words a balanced way: You get what you pay for.0004tom wrote:... magic bulldoser...
Unmovables (monuments, industries(except raw)) can be transferred to another place this way.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
Re: My next patch - Restructuring
I agree with athanasios opinion on this, that's also why I made demolishing houses in towns extremely expensive with town construction cost patch. I really dislike it when in multiplayer games people demolish half of a town to build an airport. I am fine when they do it but then they should also pay properly to do so



Re: My next patch - Restructuring
I've not looked at the town construction cost patch, but I'd be interested to know how these two patches would interact.chrissicom wrote:... I made demolishing houses in towns extremely expensive with town construction cost patch.
-
- Route Supervisor
- Posts: 415
- Joined: 07 Oct 2004 10:05
Re: Patch: Town Restructuring r11088
Love the way this patch works and will test it now seperately as well as with the town construction cost patch 

Re: Patch: Town Restructuring r11088
actually, i don't like the general idea of this patch very much - sorry for the negative voice - but i'm about to try the patch now, maybe i can be convinced by how it works.
Re: Patch: Town Restructuring r11088
Well Roujin, I think the hard part here is going to be balancing the prices. The code as it is now, is a lot more effective, but still cheaper than bribing the local authority. I'm thinking that perhaps I have lowered the rating cost to much, and raised the money cost too little. I also just realized that I haven't tested this at all with a network game. Hopefully Chriscomm will like it enough to put it into ChrisIN, and then it might get some real testing. I'm still hoping for some feedback on my coding style. I probably ought to add some comments to some of the changes I ended up making. For example, I ended up changing the prototype of the clear tile command to use a uint32 instead of a byte for the flags variable. This was to allow passing more information in the flags, but it caused me to change what would have been unrelated files like station_cmd.cpp.
Re: Patch: Town Restructuring r11088
After looking at it, i changed my mind a bit. Actually it's really nice, but as you mentioned, far too powerful at the moment...
some comments:
1) When you reallocate something, the town builds something somewhere - there's no guarantee that it actually fits what you bought, right? For example you reallocate a huge skyscraper, and the town builds some small flats in the outskirts? hmm :/
2) At the moment , this makes erasing a whole town quite easy, since you can still "reallocate" if the town finds no place to rebuild. so just "reallocate" all the roads or alternatively buy all land around existing roads the town has, then "reallocate" one building after another. Since you lose rating only very slowly, you can easily erase a medium sized town... it won't reallocate its buildings because it has no space to do so.
If you exploit what i wrote in 2), this becomes just a second bulldozer, more expensive than the normal one, but with less rating loss.
Would it be possible to have the town somehow check if it can build somewhere, before allowing you to reallocate? It's probably not easy, but it would solve this issue...
some comments:
1) When you reallocate something, the town builds something somewhere - there's no guarantee that it actually fits what you bought, right? For example you reallocate a huge skyscraper, and the town builds some small flats in the outskirts? hmm :/
2) At the moment , this makes erasing a whole town quite easy, since you can still "reallocate" if the town finds no place to rebuild. so just "reallocate" all the roads or alternatively buy all land around existing roads the town has, then "reallocate" one building after another. Since you lose rating only very slowly, you can easily erase a medium sized town... it won't reallocate its buildings because it has no space to do so.
If you exploit what i wrote in 2), this becomes just a second bulldozer, more expensive than the normal one, but with less rating loss.
Would it be possible to have the town somehow check if it can build somewhere, before allowing you to reallocate? It's probably not easy, but it would solve this issue...
Re: Patch: Town Restructuring r11088
This is because I had two choices about how to do things. I could either just call GrowTown which makes its own decisions about what to build, or I could make a major change and try to re-grow exactly what was replaced by finding the building spec, and use that when constructing. For the first draft I went with the simpler method. Another thought I had was to call GrowTown until the population returned to the original value, but that didn't work so well since the population of a building doesn't count while its under construction. Unfortunately I don't see a way to correct this without a lot of work.Roujin wrote:... example you reallocate a huge skyscraper, and the town builds some small flats in the outskirts? ...
Actually since I made a change to GrowTown to correctly return True when a house is built, I can check the result before clearing the tile. If a Grow doesn't happen, then the purchase land fails. This exploit would likely be easier to correct then the first one you mentioned.Roujin wrote: ... you can still "reallocate" if the town finds no place to rebuild.
Re: Patch: Town Restructuring r11088
I've been looking into the code trying to find ways to prevent buying land if the town can't grow, Unfortunately due to the way the grow town code works currently, I won 't be able to fix either of the issues without a serious re-write of larger portions of town_cmd.cpp. Additionally it would require making the town growth code predictable. Since it currently uses random a good bit, making it predictable would require removal of the randomness, which I don't think I can do. So unfortunately the current draft of the patch is probably going to be the best I can offer for now. Perhaps as my C++ skills and familiarity with the OTTD code grows I can look again at this.
Re: Patch: Town Restructuring r11088
suggestion,
it would be great to limit reallocation by 10% of city space.
in this way you avoid the wide buldoze explained by Roujin.
10% is not too small, the spirit of this patch is to inject stations on BIG cities.
Also, it would be great to pay yearly fees on every tile you get (unconstructed)
That mean if you buy a large area of the city (not more than 10%) you have to pay to keep it unconstructed forever...
it would be great to limit reallocation by 10% of city space.
in this way you avoid the wide buldoze explained by Roujin.
10% is not too small, the spirit of this patch is to inject stations on BIG cities.
Also, it would be great to pay yearly fees on every tile you get (unconstructed)
That mean if you buy a large area of the city (not more than 10%) you have to pay to keep it unconstructed forever...
Who is online
Users browsing this forum: No registered users and 9 guests