Skip to main content
Topic: City limit and factory (Read 20486 times) previous topic - next topic

City limit and factory

I made a rather careless complaint in the Pak 128 graphics section (http://forum.simutrans.com/index.php?topic=1544.msg17523#msg17523) regarding factory's missing P****enger/Mail level when it is located outside a city limit. I now ****ume that a factory must be located within a city limt to have P****enger/Mail level.

Few questions:
1) What is the extent of a city limit?

2) Is the city limit static (unchanging throughout the game) or is it dynamic (growing/expanding with the growth of the city)?
-- If dynamic, does it expand uniformly in all directions or directionally depending on the direction of development?

3) If the city limit expands, then will that incorporate a factory now in no-man's land when the city limit reaches that factory (thus factory gaining P****enger/Mail capability)?

4) If a city limit remains unchanged, then I guess that the only way to have the factory gain P****enger/Mail capability is to start a new city in the vicinity?

I've been playing for over 2 years now but only now trying a rather larger map. Thanks!

Re: City limit and factory

Reply #1
city limit determines area where city buildings are built.

there is another area limit based on city same as "city limit".
where factories, raw producers within it
are ****igned p****/mail level.

Above are of my knowledge. Please correct me if I'm wrong.

Re: City limit and factory

Reply #2
It depends on the distance between cityhall and factory.
So, it never change by city growth.

Code: [Select]
/* add workers to factory list */
void stadt_t::add_factory_arbeiterziel(fabrik_t* fab)
{
const koord k = fab->get_pos().get_2d() - pos;
// worker do not travel more than 50 tiles
if(  (k.x*k.x) + (k.y*k.y) < 5000  ) {

IIRC, in very old versions, this distance was recalculated when cityhall was moved to different place. But in recent versions, I guess this recalculation never happen.

Re: City limit and factory

Reply #3
I tried a simple experiment with blank map (no cities, no factories) and placing a new city in middle of nowhere. (latest r2392+Pak128v535)
Using a road originating straight from the new City Hall as guide (to make counting easier) --
  • a new factory placed 70 tiles from City Hall has no "Workers live in city " (no P****enger/Mail level).
  • a new factory starting on 69th tile has Worker (and thus P****enger/Mail level). Of course factories within 69 tile radius will have P****enger/Mail level.

So the city limit for a factory to have P****enger/Mail activity is 69 tile radius. Factories outside city limit do function as Goods producer/consumer.
And the city limit boundary seems to be a circle with 69 tile radius from the City Hall.
Also the city limit does not seem to affect Tourist Attractions (curiosities), as P****enger/Mail level appears whether inside or outside city limit.

Now that we can build whatever factory anywhere (as public player), I guess new factory location enters into the strategy if you want p****enger traffic there.

Re: City limit and factory

Reply #4
The city limits vary, don't they, with the size of the cities? They can be seen on the minimap with "city limits" enabled.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.


Re: City limit and factory

Reply #6
Perhaps they could be visible when grid view is turned on?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: City limit and factory

Reply #7
Or just toggleable like the station coverage.

Re: City limit and factory

Reply #8
  • a new factory placed 70 tiles from City Hall has no "Workers live in city " (no P****enger/Mail level).
  • a new factory starting on 69th tile has Worker (and thus P****enger/Mail level). Of course factories within 69 tile radius will have P****enger/Mail level.

Must be a rounding issue. Check in code is "distance < sqrt(5000)" which (for integers) is equivalent to "distance < 70".

So your findings say the code indeed works as shown a few messages above ;) But the comment in the code ("worker do not travel more than 50 tiles") does not match the actual calculation.


Re: City limit and factory

Reply #9
Ooops, yes indeed there is city limit indication on the mini-map! I should start looking at all the options on this game.  ::)

Perhaps my use of "city limits" in my context is wrong. Maybe "city-factory boundary"?
My point was to find how far a factory can be from the City Hall in order to generate P****enger/Mail ("Workers live in Cityname").

I've tried again on blank map, new city and new factories one 69th tile away and another 70+ tiles away.
69th tile factory has P****enger/Mail and 70+ does not.
Running a bus from City Hall to both these factories, there is p****enger traffic between City Hall (with few surrounding houses) and 69th tile factory but not with 70+.
So at least on this simple experiment (no other cities/factories etc on map), workers do travel more than 50 tiles.

Perhaps with more houses (after city growth) and/or other factories, this result may change?

Re: City limit and factory

Reply #10
Comments in the source code suggest that "workers live in city name" is merely cosmetic, and has no impact on game play.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

 

Re: City limit and factory

Reply #11
Not, only for these cities a connect make sense. All other cities will not sent workes here.