Towns can't build inside other towns

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Derenzano
Engineer
Engineer
Posts: 17
Joined: 29 Jun 2012 16:02

Re: Towns can't build inside other towns

Post by Derenzano »

PPT wrote:But, then this happened;
The only thing that changed was more trains going to the station.
Both the station and the city rating increased and they let me build bus/tram stations.
The station rating is influenced positively by the presence of vehicles waiting to be loaded. The rating will slowly increase as long as there is at least one train loading, even if there is no cargo to be loaded. Just set your trains to "full load" in that station. You might lose money for a time on those trains, but the ratio will go very high. They call this a "loss leader", I think. Once you have good ratings, switch back to the normal schedule and earn money.

I think that station ratio is affected by:
a) how many vehicles stop to load
b) how long are vehicles loading
You can have many vehicles stopping briefly to load, or one vehicle stopping for a long time in loading mode (waiting for "full load").

And station rating is influenced negatively by cargo sitting idly in the station with no vehicle loading it. Where there is a lot of cargo waiting, the rating drops like a stone. You can fight this by having frequent visits from vehicles. Even if they are small vehicles and most of the cargo stays in the station, the mere fact that vehicles load at the station will prevent the rating from dropping to the floor.

If you set your trains to "full load", most cargo will take a long time to reach their destination station. This hurts the rating a little. But the bonus provided by the trains waiting for "full load" in the station compensates this loss. You can have passengers waiting for months for the train to fill, and they still give you a good station rating :lol: The only problem is that they pay very little when they reach the destination, and that train might lose money.

When you have good station ratings in that city, the city rating will start going up.
Transportman
Tycoon
Tycoon
Posts: 2792
Joined: 22 Feb 2011 18:34

Re: Towns can't build inside other towns

Post by Transportman »

Derenzano wrote:When you have good station ratings in that city, the city rating will start going up.
No, as long as a station is serviced every 50 days the rating will go up. If a station is not served within that 50 days, city rating will go down. And each station contributes. See the OpenTTD-wiki for more information.
Coder of the Dutch Trackset | Development support for the Dutch Trainset | Coder of the 2cc TrainsInNML
Derenzano
Engineer
Engineer
Posts: 17
Joined: 29 Jun 2012 16:02

Re: Towns can't build inside other towns

Post by Derenzano »

siu238X wrote:
cirdan wrote:
siu238X wrote:In any case, it would be nice to feature something that, if the expansion algorithm encounters something (building or roads) that's of another local authority, it should stop. Searching along players' roads should still be allowed, as some players prefer not letting towns build roads themselves.
Like this? (src/town_cmd.cpp:1337)

Code: Select all

/* Don't allow building over roads of other cities */
if (IsRoadOwner(tile, ROADTYPE_ROAD, OWNER_TOWN) && Town::GetByTile(tile) != t) {
        _grow_town_result = GROWTH_SUCCEED;
}
That code has been there for quite some time now.

I can't find the segment in concern in that file.

Meanwhile, that's just for roads, but I realize that sometimes players disallow towns building roads, which means if I connect two towns by myself the roads will always be mine. Therefore buildings (or at least the target building tile) have to be checked too. That wouldn't eliminate all "cross-boundary" buildings, but at least it would eliminate replacing one town building with another town's.
Yeah, that's only for roads. It checks the distance to other city centers (src/town_cmd.cpp:560)

Code: Select all

560	    // If the new tile belongs to another town,
561	    //  then stop the search altogether.
562	    if (ClosestTownFromTile(tmptile, (uint)-1) != t1) {
563	      _grow_town_result = 0;
564	      return;
565	    }
But I disallowed road construction for cities, then I destroyed all roads and rebuilt them in a grid of my liking. So, every single road is owned by the player. The house-building algorithm needs to check:
a) ownership of the road
b) ownership of house that is going to be replaced
c) nearest town center (maybe weighted by population size? bigger cities could build farther away then smaller cities)

For condition c, I suggest this pseudocode:

Code: Select all

	    // If the new tile is nearer to another town, distance being weighted by population,
	    //  then stop the search altogether.
                  // Bigger cities will build further away
 	    if (distanceTo(t1)/populationOf(t1)  < distanceTo(t2)/populationOf(t2)) {
	      _grow_town_result = 0;
	      return;
	    }
This allows big cities to grow into the territory of smaller cities, but only up to a certain distance. The limit between the cities will change as their relative sizes change.

For example, if A are separated by 20 squares, A has 10k inhabitants, and B has 5k (half the size). City A will build up to 13 squares away in the direction of B, the last 7 squares will never be built by A. Equally, B will only only build 7 squares away on that direction. This way you can have streets where one side of the street belongs to one local authority, and the other side belongs to other local authority. Just like in real life, cities won't randomly build into the territory of other cities. They will stop just at the border of their authority, where another authority starts.
Derenzano
Engineer
Engineer
Posts: 17
Joined: 29 Jun 2012 16:02

Re: Towns can't build inside other towns

Post by Derenzano »

Yoursnotmine wrote:
kotssmurf wrote: Well that heavily depends on the size of both towns... It happens that you'd have a huge station surrounded by all small buildings.
Then resizing the station to a smaller one would result in more area for building, isn't ? To let the "dwarfed" town grow for a while, you can demolish the roads connecting it to the invading town, make a border (buy land or place objects), let the small one grow for a while. Then demolish the border. Finished :D
Then the invading town(s) will grow again into the smaller town, and you are back to a "dwarfed" town.
Derenzano
Engineer
Engineer
Posts: 17
Joined: 29 Jun 2012 16:02

Re: Towns can't build inside other towns

Post by Derenzano »

Alberth wrote:If A builds in B, then B also builds in A, so what's the problem?
Also, please remember this game is about transport, not about cities.
Transportation of passengers and mail is affected by city size and shape.
Chrill wrote:What difference does it make, though? There are still houses there to transport passengers and mail to/from :P
Yeah, but they are in different places..... And it clashes with player expectations. The player expects that the local authority controls what buildings are built inside the city's influence radius. He doesn't expect that faraway cities can knock down huge office buildings in a city center that doesn't belong to them, and replace them with their own small houses. Medium-sized cites slowly become tiny villages in a process that doesn't make sense to the player. A big city can steal territory from a smaller city in the places where their borders touch, that's OK. But it shouldn't knock down randomly any building it wants at any location in the smaller city, even in the farthest side of the smaller city, as if the local authority was totally powerless to prevent this sort of abuse. A local authority should be able to forbid damaging constructions inside its influence radius.
TERdON
Engineer
Engineer
Posts: 90
Joined: 09 Nov 2010 15:30

Re: Towns can't build inside other towns

Post by TERdON »

A solution then might be to disallow towns to build houses in squares where not at least one neighboring (either directly, or across a road or similar if more suitable) square belongs to the city? And that roads owned by cities should be able to switch ownership cities...
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 5 guests