The International Simutrans Forum

Community => Simutrans Help Center => Topic started by: micslu on March 25, 2009, 11:23:25 pm

Title: City limit and factory
Post by: micslu on March 25, 2009, 11:23:25 pm
I made a rather careless complaint in the Pak 128 graphics section (http://forum.simutrans.com/index.php?topic=1544.msg17523#msg17523 (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!
Title: Re: City limit and factory
Post by: colonyan on March 26, 2009, 12:25:38 am
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.
Title: Re: City limit and factory
Post by: z9999 on March 26, 2009, 01:00:09 pm
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.
Title: Re: City limit and factory
Post by: micslu on March 31, 2009, 08:02:20 pm
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) --

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.
Title: Re: City limit and factory
Post by: jamespetts on April 01, 2009, 06:26:52 pm
The city limits vary, don't they, with the size of the cities? They can be seen on the minimap with "city limits" enabled.
Title: Re: City limit and factory
Post by: IgorEliezer on April 01, 2009, 07:05:41 pm
The city limit is a rectangular boundary that is 2 or 3 tiles far from outmost city building at N/S/W/Eastward.

Also, I'd like city limits were visible in terrain. This could be useful too see how far the city will expand.
Title: Re: City limit and factory
Post by: jamespetts on April 01, 2009, 07:16:25 pm
Perhaps they could be visible when grid view is turned on?
Title: Re: City limit and factory
Post by: gerw on April 02, 2009, 08:47:39 am
Or just toggleable like the station coverage.
Title: Re: City limit and factory
Post by: Spike on April 02, 2009, 01:19:06 pm
  • 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.

Title: Re: City limit and factory
Post by: micslu on April 02, 2009, 08:27:57 pm
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?
Title: Re: City limit and factory
Post by: jamespetts on April 02, 2009, 08:38:34 pm
Comments in the source code suggest that "workers live in city name" is merely cosmetic, and has no impact on game play.
Title: Re: City limit and factory
Post by: prissi on April 02, 2009, 08:46:45 pm
Not, only for these cities a connect make sense. All other cities will not sent workes here.