Town Construction Cost [13/08/2007] Compatibility: r10877

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

Post Reply
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Town Construction Cost [13/08/2007] Compatibility: r10877

Post by chrissicom »

Original Patch Idea: http://www.tt-forums.net/viewtopic.php?t=24759.

Special thanks to peter1138 and Eddi for helping me so much! The code of this patch is completely rewritten and has nothing in common with Advanced Town Handling code. I also renamed the patch since its intention is to increase costs when building/demolishing close to a town and the original name was misleading.

The patch option can be found in "Construction" and is also available in ChrisIN.

- Building road, railway etc. close to a town and demolishing or buying land next to a town is more expensive the closer you get to the city center.
- Demolishing water is also more expensive but costs have been reduced a little compared to railway building etc. or they would be too high.
- Demolishing a house (not road) in a town/city is very expensive!
- Removing railroad does not make profit in any case. At the time inflation has virtually risen the selling price of your tracks to the buying price they are rotted so much that they are worthless :P
- Demolishing a station next to a town is more expensive than building it, because towns don't like when you demolish their bus station e.g.

Please let me know any suggestions or feedback.
Attachments
r10877-towncost.diff
.diff file from SVN download.
(5.74 KiB) Downloaded 340 times
r10877-towncost.zip
Win32 build including English language file.
(827.23 KiB) Downloaded 305 times
Last edited by chrissicom on 13 Aug 2007 17:08, edited 4 times in total.
User avatar
PouncingAnt
Transport Coordinator
Transport Coordinator
Posts: 357
Joined: 09 Nov 2004 22:33

Post by PouncingAnt »

Had a good go with this patch.

I have to say, I've not seen how it integrates with my usual gameplay, but I was doing some experimenting on property investment, which was quite interesting. Investing in the property around a growing city can cash one a huge amount of dosh. Personally I like this, since its a known fact that railways sold off the land surrounding their lines, and it adds another interesting aspect to the game
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
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

PouncingAnt wrote:Had a good go with this patch.

I have to say, I've not seen how it integrates with my usual gameplay, but I was doing some experimenting on property investment, which was quite interesting. Investing in the property around a growing city can cash one a huge amount of dosh. Personally I like this, since its a known fact that railways sold off the land surrounding their lines, and it adds another interesting aspect to the game
This may be good to deposit money ... build tracks all around city when they aer cheap and sell them later for big sums when the city grows large. However, this may have pretty much ill effects in multiplayers, since many people will "deposit" their money in tracks around the city, effectively blocking everybody in access to that city.

This may need still lot of tweaking ...
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)
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Post by chrissicom »

This is definitely not supposed to happen, I will tweak the patch so you can't make profit by selling rail after it has been built no matter how long you wait (well after 200 years maybe ;))
Tom0004
Chairman
Chairman
Posts: 822
Joined: 01 Jul 2007 22:33
Location: Manchester, UK

Post by Tom0004 »

then this is become in to away of making money, in which all ready excist in TTD all versions.
User avatar
PouncingAnt
Transport Coordinator
Transport Coordinator
Posts: 357
Joined: 09 Nov 2004 22:33

Post by PouncingAnt »

It probably is best to remove, I agree. After fiddling a while, I noticed that mainly it is the massive increase in property prices once a settlement becomes larger than 400, which allows large amounts of money to be made. Other than that, I think it would take far to long to use a source of income.

(In this sense, it wouldn't have been much of an impedence in multiplayer since players would more or less have to rely on using towns with populations of less than 400 as "deposits". )

Anyway if it is made less profitable at this stage, that should fix the problem, I think. :wink:

EDIT:
I've done some more playtesting, it certainly makes things a lot more interesting at the beginning of the game, it makes one need be more selective as to which industries to link up.

However, it might be a little restrictive with development in urban areas. Considering it would cost several times the worth of a train to remove a house... but I'm going to test urban gameplay before I think any harder on that. (afterall the relativity between different aspects of the game is skewed anyway)
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
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Post by chrissicom »

I've tweaked a lot of the values with the new version making building/demolishing road a little less expensive.

Demolishing houses is pretty expensive on purpose because you are simply not supposed to just raze down a house in a city, you can't do it in real life either unless you have a lot of money and this patch should have some realism.

When buying land in a city with e.g. 398 people (short before the patch would kick in @400) there will be no jump in the land value once the city reaches a population of 400. Land selling prices won't go up until the city is well over 1000 people while the land buying prices will start to go up when the city is at 400 already.

There is one really ugly bug though:
Let's say a city has a population of 20000 then you would get quite a lot of money for selling an owned piece of land. Now when you demolish some land it is drawn brown as a demolished tile. When you build on the demolished tile it will be really cheap but when selling again right after it you still get a lot of money. That way by quickly purchasing/selling land you can make a lot of money in just a few seconds which is definitely not the intention.

If anybody has an idea how to solve this please let me know :) I could just make the demolished tile be grass immediately again when demolishing rail or bought land but that would be a bad "hack".

Also let me know if the tweaks have a good effect on the prices now. The distance has become a smaller factor now which should make the patch not noticeable when building far away from cities.
Youri219
Traffic Manager
Traffic Manager
Posts: 191
Joined: 28 Apr 2007 11:53

Post by Youri219 »

I tested this patch in your IN, and it contains a really serious exploit.

- Build track on road
- Remove road
- Demolish track
- About 60k profit

I also noticed that the real contruction cost comes from 'clearing the tile'. While this makes sense for buildings, it's a bit odd for grass.

I also think that the cost increases to fast with the city size. At the start of the game you won't even be able to connect two medium sized cities.

PS - this patch could greatly promote using busses if there were roads between all towns at the beginning of the game.

I also wonder what the effect of upgrading an airport would be.
User avatar
PouncingAnt
Transport Coordinator
Transport Coordinator
Posts: 357
Joined: 09 Nov 2004 22:33

Post by PouncingAnt »

Yeah, I noticed that. For instance, building track on a farm/forested area nearer a town was exceptionally expensive.

I imagine the algorithm as looking something like this

Cost to clear land * (LocalAuthorityPopulation*ANormalizingFactor)/ (DistanceFromTown*Another NormalizingFactor)

where something like:

if(DemolishedTile != TownBuilding){
Cost to clear land + (LocalAuthorityPopulation*ANormalizingFactor)/ (DistanceFromTown*AnotherNormalizingFactor)
}

may be more appropriate, if implementable[/u]
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
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Post by Zephyris »

I really like this! It adds a lot to the gameplay and helps promote road transport - a much needed balancing.
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Post by athanasios »

I don't like it like this. A house costs 3 times more than to fund a new industry. It is completely illogical to increase the values so much.
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.
sc79
Director
Director
Posts: 586
Joined: 22 Feb 2005 09:51

Post by sc79 »

Back when this was in the MiniIN I played with it a fair bit. I found it was necessary to turn the patch off for a new game, then turn it on after 10-15 years when profit starts to take off exponentially. At that point, it usually worked very well.

The major problem I have with the patch is it actually discourages realistic behavior, ie. connecting larger cities, then adding smaller ones to a network as it grows, because its not viable (or even possible) early on.
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Post by chrissicom »

Thanks for all the good input you give me on this patch :)

The version currently posted here is newer than the one in ChrisIN, therefor my ChrisIN Public Server also has the feature turned off right now.

As I said demolishing a house is very expensive on purpose because you simply should not do it unless you're very very wealthy and can afford it. It is not necessary to demolish a house to build a bus station for example, there are drive through road stops which can be built on a town owned road tile as well with a patch option. If you add this patch to 0.5.2 then demolishing road will still be a lot cheaper than demolishing a house.

Bug???
- Build track on road
- Remove road
- Demolish track
- About 60k profit

I cannot reproduce this, as demolishing railroad with the current version should be more expensive than actually building it. So right now this exploit should not exist. It did exist in the first version since that is the same problem when building on cleared land.

I just tested to build a road from two 1,5k cities to connect them with each other with a distance of about 25 tiles. While the price through grass land was reasonable with 100k the costs through farm land were extrordinary high with more than 400k. I am not sure yet if I find that exaggerated or not, but it definitely puts in some realism since in real life building through grass land is much cheaper too than buying an acre and build through the farm land.

What I could change is that really small towns with only 400, 500... population have no effect. The overall algorithm could stay the same but I will just disable the cost multiplier if a population of let's say 1200 or so is not reached.

If you want to check out the formulas I use you can simply download and open the .diff file with a text reader :)
I'll tweak this a little more today and release a newer build in the evening :)
Last edited by chrissicom on 11 Jul 2007 19:40, edited 1 time in total.
User avatar
PouncingAnt
Transport Coordinator
Transport Coordinator
Posts: 357
Joined: 09 Nov 2004 22:33

Post by PouncingAnt »

chrissicom wrote:Thanks for all the good input you give me on this patch :)
Rather, thanks for making the patch :wink:

After giving the patch a few hours of testing, I think it's improved greatly from the first version I tried.
I'd be willing to bet that it's no longer economically viable to invest property (I think in the majority of cases property maintainance will outweigh property price increase).
Also I think the cost of destroying housing is very reasonable after some consideration.

I can't really think of anything I'd like improved on it anymore. Great job
:)

EDIT: Out of interest, I tried that trick where you destroy all the trees around a town and replant them to gain town ratings. It costs about £1M to do with a decent sized town now, so makes the endeavor all the more pointless.
I'm glad of that, I hated that you could do that so easily
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
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

PouncingAnt wrote:
chrissicom wrote:Thanks for all the good input you give me on this patch :)
Rather, thanks for making the patch :wink:

After giving the patch a few hours of testing, I think it's improved greatly from the first version I tried.
I'd be willing to bet that it's no longer economically viable to invest property (I think in the majority of cases property maintainance will outweigh property price increase).
Also I think the cost of destroying housing is very reasonable after some consideration.

I can't really think of anything I'd like improved on it anymore. Great job
:)

EDIT: Out of interest, I tried that trick where you destroy all the trees around a town and replant them to gain town ratings. It costs about £1M to do with a decent sized town now, so makes the endeavor all the more pointless.
I'm glad of that, I hated that you could do that so easily
This trick works because the value "how much they hate/like" you is capped ( I think at -1000 from below), so no mater what bad you do, it stays at -1000 .... and if you bulldoze all nearby trees, you get basically there. By lpanting trees "all around the city you can get maybe 2000 plus, but there is limit that by lpanting trees only you can get to 200 max.

Another way to "disable" the tree trick may be lowering the cap (to -5000 for example) so once you raze the trees around, even planting them all back will not help you, they will still hate you (you end up by -3000 or 0-2000 and nowhere to plant another tree).
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)
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Post by chrissicom »

Before lowering the cap more I think there should be something changed about building roads. For example you get a very bad rating very quickly when you conenct a city to a few others with roads. But if at all I think that should increase your rating, I mean shouldn't the city be happy that you connect them to others and send bus service there or whatever... they should be honoured not give you a poor rating :D

Anyway I'm glad you find the patch improved and like it in the current state.

I still try to fix this little exploit where you can buy demolished land super cheaply and sell it at "normal" prices. The problem there is that I modified CmdLandscapeClear for the patch to minimize code changes required, but that function is not executed on clear land obviously it seems.
User avatar
PouncingAnt
Transport Coordinator
Transport Coordinator
Posts: 357
Joined: 09 Nov 2004 22:33

Post by PouncingAnt »

Bilbo: Yes, I'm aware how that trick is done. What I'm saying is anything that cuts down on it (this patch makes it more uneconomical) in the meantime is a good thing.

Chrissicom: That sounds like it would be difficult to program. Besides, towns should technically already have roads leading to them, since most settlements develop on roads/roads develop around settlements as they are first built.

As I see it, because the roads aren't already there, the citizens should welcome a road link to/from another town, but should oppose excessive road building. Off the top of my head I don't see a pretty way of doing it..

...Maybe when passengers from another town arrive at a town for the first time it can cause a big boost to town ratings to undo some of the tree-flattening you inevitably just did...

Anyway, I stray slightly from the topic..
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
User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Post by Bilbo »

chrissicom wrote:Before lowering the cap more I think there should be something changed about building roads. For example you get a very bad rating very quickly when you conenct a city to a few others with roads. But if at all I think that should increase your rating, I mean shouldn't the city be happy that you connect them to others and send bus service there or whatever... they should be honoured not give you a poor rating :D
Well, but if you bulldoze half of local forests to get that highway to the town in the process, people will hate you (at least for some time...), even if they will have nice bus service :)
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)
chrissicom
Route Supervisor
Route Supervisor
Posts: 415
Joined: 07 Oct 2004 10:05

Re: Town Construction Cost [13/08/2007] Compatibility: r10877

Post by chrissicom »

I tweaked the code of the patch a little and fixed a bug that made the game crash when using the scenario editor to level land while the patch is enabled and no towns have been created yet.

Savegames made with the last version of the patch are still compatible.
User avatar
Vaulter
Traffic Manager
Traffic Manager
Posts: 185
Joined: 21 Dec 2004 05:35
Skype: andrey-zaharov
Location: St. Petersburg, Russia
Contact:

Re: Town Construction Cost [13/08/2007] Compatibility: r108

Post by Vaulter »

Updated to trunk
Attachments
towncost.r25649M.patch
fixed
(7.1 KiB) Downloaded 206 times
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 27 guests