<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.openttdcoop.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hazzard</id>
		<title>#openttdcoop wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.openttdcoop.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Hazzard"/>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/Special:Contributions/Hazzard"/>
		<updated>2026-05-14T20:29:13Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.25.2</generator>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28506</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28506"/>
				<updated>2020-01-10T22:48:05Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Town growth speed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N): [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L1524-L1540]&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads. [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L2307-L2335]&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3356-L3370] * 185 [https://github.com/OpenTTD/OpenTTD/blob/2fd871e2af5cb9e239628843fbd40499ee43406a/src/date_type.h#L32] = 3700 ticks, or 50 days ago. Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
*If no station is present and growth is not funded, there is only a 1/12 probability that the town grows at all [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3450]. The random chance is calculated at the start of each month.&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth: [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3372-L3399]&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases.&lt;br /&gt;
Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
This is approximately the number of days between town growth. The actual number of days is about 5% less, since a day is 74 ticks but a town growth cycle is 70 ticks. [https://github.com/OpenTTD/OpenTTD/blob/5c10c426fe2a7722daa0d66dbaed2a0887f69891/src/town.h#L299][https://github.com/OpenTTD/OpenTTD/blob/2fd871e2af5cb9e239628843fbd40499ee43406a/src/date_type.h#L37]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
[[File:Deadend.jpg|thumb|right|A dead end towards east]]&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28505</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28505"/>
				<updated>2020-01-10T22:11:59Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Town growth speed */ 1/12 probability citation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N): [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L1524-L1540]&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads. [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L2307-L2335]&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3356-L3370] * 185 [https://github.com/OpenTTD/OpenTTD/blob/2fd871e2af5cb9e239628843fbd40499ee43406a/src/date_type.h#L32] = 3700 ticks, or 50 days ago. Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
*If no station is present and growth is not funded, there is only a 1/12 probability that the town grows at all [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3450]. (It's not clear to me how often this is re-rolled)&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth: [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3372-L3399]&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases.&lt;br /&gt;
Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
This is approximately the number of days between town growth. The actual number of days is about 5% less, since a day is 74 ticks but a town growth cycle is 70 ticks. [https://github.com/OpenTTD/OpenTTD/blob/5c10c426fe2a7722daa0d66dbaed2a0887f69891/src/town.h#L299][https://github.com/OpenTTD/OpenTTD/blob/2fd871e2af5cb9e239628843fbd40499ee43406a/src/date_type.h#L37]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
[[File:Deadend.jpg|thumb|right|A dead end towards east]]&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28504</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28504"/>
				<updated>2020-01-10T22:04:26Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Town growth speed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N): [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L1524-L1540]&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads. [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L2307-L2335]&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3356-L3370] * 185 [https://github.com/OpenTTD/OpenTTD/blob/2fd871e2af5cb9e239628843fbd40499ee43406a/src/date_type.h#L32] = 3700 ticks, or 50 days ago. Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
*If no station is present and growth is not funded, there is a 11/12 probability that the town does not grow at all.&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth: [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3372-L3399]&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases.&lt;br /&gt;
Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
This is approximately the number of days between town growth. The actual number of days is about 5% less, since a day is 74 ticks but a town growth cycle is 70 ticks. [https://github.com/OpenTTD/OpenTTD/blob/5c10c426fe2a7722daa0d66dbaed2a0887f69891/src/town.h#L299][https://github.com/OpenTTD/OpenTTD/blob/2fd871e2af5cb9e239628843fbd40499ee43406a/src/date_type.h#L37]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
[[File:Deadend.jpg|thumb|right|A dead end towards east]]&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28503</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28503"/>
				<updated>2020-01-10T22:03:19Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Town growth speed */ update recent cargo days&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N): [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L1524-L1540]&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads. [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L2307-L2335]&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3356-L3370] * 185 [https://github.com/OpenTTD/OpenTTD/blob/2fd871e2af5cb9e239628843fbd40499ee43406a/src/date_type.h#L32] = 3700 ticks, or 50 days ago.&lt;br /&gt;
&lt;br /&gt;
Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
*If no station is present and growth is not funded, there is a 11/12 probability that the town does not grow at all.&lt;br /&gt;
&lt;br /&gt;
The following is based on this function: [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3372-L3399]&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth:&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases. Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
This is approximately the number of days between town growth. The actual number of days is about 5% less, since a day is 74 ticks but a town growth cycle is 70 ticks. [https://github.com/OpenTTD/OpenTTD/blob/5c10c426fe2a7722daa0d66dbaed2a0887f69891/src/town.h#L299][https://github.com/OpenTTD/OpenTTD/blob/2fd871e2af5cb9e239628843fbd40499ee43406a/src/date_type.h#L37]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
[[File:Deadend.jpg|thumb|right|A dead end towards east]]&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28501</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28501"/>
				<updated>2020-01-10T20:04:47Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Hazzard moved page User:Mfb/Towns to Town Growth Mechanics: Make a proper page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N): [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L1524-L1540]&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads. [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L2307-L2335]&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 (days?) ago. Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
&lt;br /&gt;
*If no station is present and growth is not funded, there is a 11/12 probability that the town does not grow at all.&lt;br /&gt;
&lt;br /&gt;
The following is based on this function: [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3372-L3399]&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth:&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases. Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
This is approximately the number of days between town growth. The actual number of days is about 5% less, since a day is 74 ticks but a town growth cycle is 70 ticks. [https://github.com/OpenTTD/OpenTTD/blob/5c10c426fe2a7722daa0d66dbaed2a0887f69891/src/town.h#L299][https://github.com/OpenTTD/OpenTTD/blob/2fd871e2af5cb9e239628843fbd40499ee43406a/src/date_type.h#L37]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
[[File:Deadend.jpg|thumb|right|A dead end towards east]]&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=User:Mfb/Towns&amp;diff=28502</id>
		<title>User:Mfb/Towns</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=User:Mfb/Towns&amp;diff=28502"/>
				<updated>2020-01-10T20:04:47Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Hazzard moved page User:Mfb/Towns to Town Growth Mechanics: Make a proper page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Town Growth Mechanics]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28500</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28500"/>
				<updated>2020-01-10T20:03:42Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Town growth speed */ add town growth scale&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N): [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L1524-L1540]&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads. [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L2307-L2335]&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 (days?) ago. Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
&lt;br /&gt;
*If no station is present and growth is not funded, there is a 11/12 probability that the town does not grow at all.&lt;br /&gt;
&lt;br /&gt;
The following is based on this function: [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3372-L3399]&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth:&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases. Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
This is approximately the number of days between town growth. The actual number of days is about 5% less, since a day is 74 ticks but a town growth cycle is 70 ticks. [https://github.com/OpenTTD/OpenTTD/blob/5c10c426fe2a7722daa0d66dbaed2a0887f69891/src/town.h#L299][https://github.com/OpenTTD/OpenTTD/blob/2fd871e2af5cb9e239628843fbd40499ee43406a/src/date_type.h#L37]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
[[File:Deadend.jpg|thumb|right|A dead end towards east]]&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28499</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28499"/>
				<updated>2020-01-10T19:57:13Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Town growth speed */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N): [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L1524-L1540]&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads. [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L2307-L2335]&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 (days?) ago. Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
&lt;br /&gt;
*If no station is present and growth is not funded, there is a 11/12 probability that the town does not grow at all.&lt;br /&gt;
&lt;br /&gt;
The following is based on this function: [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L3372-L3399]&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth:&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases. Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[I think that the result is equal to the number of days between town growth, but I did not check the scale yet.]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
[[File:Deadend.jpg|thumb|right|A dead end towards east]]&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28498</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28498"/>
				<updated>2020-01-09T22:29:31Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N): [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L1524-L1540]&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads. [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L2307-L2335]&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 (days?) ago. Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
&lt;br /&gt;
*If no station is present and growth is not funded, there is a 11/12 probability that the town does not grow at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth:&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases. Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[I think that the result is equal to the number of days between town growth, but I did not check the scale yet.]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
[[File:Deadend.jpg|thumb|right|A dead end towards east]]&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28497</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28497"/>
				<updated>2020-01-09T22:27:33Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N):&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads. [https://github.com/OpenTTD/OpenTTD/blob/39e6247bec6b958b11c6ab58430a4197eb1deb6a/src/town_cmd.cpp#L2307-L2335]&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 (days?) ago. Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
&lt;br /&gt;
*If no station is present and growth is not funded, there is a 11/12 probability that the town does not grow at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth:&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases. Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[I think that the result is equal to the number of days between town growth, but I did not check the scale yet.]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
[[File:Deadend.jpg|thumb|right|A dead end towards east]]&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28496</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28496"/>
				<updated>2020-01-09T19:45:14Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Application to town building */ typo fix&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N):&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads.&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 (days?) ago. Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
&lt;br /&gt;
*If no station is present and growth is not funded, there is a 11/12 probability that the town does not grow at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth:&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases. Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[I think that the result is equal to the number of days between town growth, but I did not check the scale yet.]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
[[File:Deadend.jpg|thumb|right|A dead end towards east]]&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28495</id>
		<title>Town Growth Mechanics</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Town_Growth_Mechanics&amp;diff=28495"/>
				<updated>2020-01-09T19:44:15Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Bringing info up to date&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In [[PublicServer:Archive_-_Games_221_-_230#gameid_228|PSG228]], we tried to extend a single city over the full 512x512-map. The first issue was the road design, which stopped town growth at about 350,000 inhabitants. We got rid of all dead ends, and the town got bigger again. However, after we reached a population of ~1.5 million, the town refused to increase its population. Growth tunnels spread more houses on the outside, but the result were many empty spots closer to the city center, which decreased the total population.&lt;br /&gt;
&lt;br /&gt;
This inspired me to do some research how towns work, and how this can be used to grow towns. The source code of OpenTTD is public and can be accessed at [https://github.com/OpenTTD/OpenTTD]. For towns, the most important file is [https://github.com/OpenTTD/OpenTTD/blob/master/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
The approximate original version of town_cmd.cpp this article is based on is [https://github.com/OpenTTD/OpenTTD/blob/c8ce0faca49f85bbe72a3257bc327d14208f3d6c/src/town_cmd.cpp].&lt;br /&gt;
&lt;br /&gt;
==Algorithm of town growth==&lt;br /&gt;
&lt;br /&gt;
The algorithm to build new houses works like this:&lt;br /&gt;
&lt;br /&gt;
1) First, calculate how many times the town tries to build a house (which I will call N):&lt;br /&gt;
* If the town is founded with &amp;quot;2x2 grid&amp;quot; or &amp;quot;3x3 grid&amp;quot; as road layout, N = 10 + housenumber*1/9&lt;br /&gt;
* If the town is founded with &amp;quot;better roads&amp;quot;, N = 10 + housenumber*2/9&lt;br /&gt;
* If the town is founded with &amp;quot;original roads&amp;quot;, N = 10 + housenumber*4/9&lt;br /&gt;
&lt;br /&gt;
This means that the chosen road layout of the town is important - even if we build all roads ourself, which is usually done in coop games.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) now, begin at the city center (usually the road under the town sign, or a road next to it)&lt;br /&gt;
* If there is no road or if there is another, unconnected road, build a road (if allowed by game settings) and always stop the function&lt;br /&gt;
* If not, choose a random direction. If the current tile has a road connection in this direction, do nothing. Otherwise, if the neighbor tile in this direction is empty, build a house there and stop the function. There are more checks involved (e.g. &amp;quot;is the tile in water?&amp;quot;), but they are not important here. If towns are allowed to build roads and have a grid layout, no house will be built at tiles reserved for roads.&lt;br /&gt;
** Starting in version 1.6, choices that are trivially dead ends are ignored. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
&lt;br /&gt;
3) If the function was not stopped for one of the reasons above, follow the road in a random direction, except the one where you came from. For regular roads, this just follows the road. At cross-roads, a random direction is chosen. If the road has a connection to one side only (and therefore is a dead end), the function is stopped.&lt;br /&gt;
&lt;br /&gt;
4) Try to build something there again. Repeat steps 3 and 4, until the number of attempts is larger than the maximal number calculated in step 1.&lt;br /&gt;
&lt;br /&gt;
If the algorithm hits a bridge (or tunnel) instead of a regular road, it continues at the other side, independent of the length of the bridge. If a bridge begins at the tile of the city center, the other side is used only half of the time.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For interpretation, it is important to compare N to typical town sizes: A town with 200,000 inhabitants might have something like 2000 houses and therefore N=230 to 900, depending on the road layout of the town. But it fits in a circle with a radius of about 50 tiles. Where does the difference come from? As mentioned in step 3, the town follows roads in random directions at each crossroads. This leads to a pattern which is called random walk in mathematics. I don't want to annoy you with details, but it is important to keep in mind that the resulting path might visit the same roads multiple times and the average distance from the origin grows with the square root of the pathlength. This is fine, as the town radius grows with the square root of the house number, too, if it can grow in all directions.&lt;br /&gt;
&lt;br /&gt;
[[File:Towngrowingrange.png|thumb|550px|right|This town demonstrates the large difference between potential growth radius and usual town sizes. The map shows a single road, 4135 tiles long, with houses on both sides. The central structure is disconnected to enforce town growth in the direction of the long road.]]&lt;br /&gt;
&lt;br /&gt;
==House quality==&lt;br /&gt;
&lt;br /&gt;
Towns have four different areas, which can be distinguished by the road layout:&lt;br /&gt;
* region 4 with street lights&lt;br /&gt;
* region 3 with trees on the roads&lt;br /&gt;
* (region 2 is not used)&lt;br /&gt;
* region 1 with sidewalks&lt;br /&gt;
* region 0 has no special road design&lt;br /&gt;
&lt;br /&gt;
Towns with less than 92 houses use a table to look up the size of these regions, if they have more houses they use the following formulas:&lt;br /&gt;
m=housenumber/8 (rounded down)&lt;br /&gt;
*region 4: range=m*3+5&lt;br /&gt;
*region 3: range=m*5-5&lt;br /&gt;
*region 1: range=m*9-15&lt;br /&gt;
*region 0: range=m*14-40&lt;br /&gt;
&lt;br /&gt;
A tile is within a certain area if its squared distance to the town center is smaller than this range.&lt;br /&gt;
Region 3 has an area of about pi*5/8*housenumber tiles, which is nearly 2*housenumber. If half of the town tiles can be used for houses, the whole town can be within this area.&lt;br /&gt;
&lt;br /&gt;
[[File:Towndistance.png|thumb|550px|center|An example with a town in PSG218: It has 1171 houses, therefore m=[1171/8]=146 and region 4 has range=146*3+5=443. The tile with street lights is (19,9) tiles away, the squared distance is 19^2+9^2=442 which is smaller than 443. Therefore, the tile is in region 4.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Town growth speed==&lt;br /&gt;
&lt;br /&gt;
Town growth speed is always &amp;quot;once per x days&amp;quot; or &amp;quot;does not grow&amp;quot;. In the former case, the town tries to build a new house every x days. This number is updated frequently, with the following algorithm:&lt;br /&gt;
&lt;br /&gt;
*First, the game checks whether town can grow at all. If town growth is not funded and the town needs water, food or whatever (and has population&amp;gt;90 for subarctic, population&amp;gt;60 for subtropic), it does not grow at all. If town growth is funded, these checks are ignored and the town always grows.&lt;br /&gt;
*Active stations can influence town growth: A station is counted if it is within region 0 of the town and the last loading or unloading process of any type is at most 20 (days?) ago. Up to 5 different stations are counted, everything above that is useless.&lt;br /&gt;
&lt;br /&gt;
*If no station is present and growth is not funded, there is a 11/12 probability that the town does not grow at all.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the towns grows, &amp;quot;the number of times towns are processed before a new building is built&amp;quot; (comment in the code) is then looked up in of two arrays, where smaller numbers indicate faster growth:&lt;br /&gt;
*With funded growth: { 120, 120, 120, 100, 80, 60 } with { 0, 1, 2, 3, 4, 5 } stations. This means that the first two stations are pointless (120-&amp;gt;120) and 5 stations double town growth (only 60 units instead of 120)&lt;br /&gt;
*Without funded growth: { 320, 420, 300, 220, 160, 100 } with { 0, 1, 2, 3, 4, 5 } stations. The value for 0 stations (320) is smaller than the value with 1 station (420), but without any stations we get this growth only in 1/12 of the cases. Therefore, the first station is very important for town growth, and additional stations can speed up growth by an additional factor of 4 (1-&amp;gt;5 stations). 5 stations without funding are just a bit better than no stations with funding - if the town does not allow to build stations, simply fund growth.&lt;br /&gt;
&lt;br /&gt;
This number is then divided by 2^i where i refers to the settings of town growth rate:&lt;br /&gt;
*None: i=1 divisor 2, this is used for funded growth only&lt;br /&gt;
*slow: i=0, divisor 1&lt;br /&gt;
*normal: i=1, divisor 2&lt;br /&gt;
*fast: i=2, divisior 4&lt;br /&gt;
*very fast: i=3, divisor 8&lt;br /&gt;
For a &amp;quot;city&amp;quot;, it the result is again divided by 2. The number is rounded down in each step.&lt;br /&gt;
&lt;br /&gt;
The result is then divided by ([housenumber / 50] + 1) (where [housenumber/50] gets rounded down). housenumber is the number of houses the town has.&lt;br /&gt;
Again, the result is rounded down.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[I think that the result is equal to the number of days between town growth, but I did not check the scale yet.]&lt;br /&gt;
&lt;br /&gt;
==House number and town size==&lt;br /&gt;
&lt;br /&gt;
Every house has a (minimal) lifetime. After reaching this time, it is destroyed and might be replaced by another house. If not, the tile gets empty.&lt;br /&gt;
Large towns spend a lot of their &amp;quot;growth&amp;quot; attempts to fill these gaps again. The best growth rate is 1/day.&lt;br /&gt;
This gives a natural upper limit of the house number of towns: As soon as the rate of dying houses is equal to the rate of new houses, the town cannot grow any more.&lt;br /&gt;
I am not sure if NewGRFs change the lifetime of buildings. In addition, different house sizes might have different lifetimes.&lt;br /&gt;
For a regular town layout and original houses, I think the limit is somewhere around 27000 to 30000 houses and about 2.4 to 3 million inhabitants, where the lower values were reached in my tests and the upper values might be possible somehow.&lt;br /&gt;
A town of this size needs about 80 years to remove and rebuild the house on each tile once.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Application to town building==&lt;br /&gt;
&lt;br /&gt;
* Avoid dead ends in populated areas. The town growth algorithm might run into them and stop without building a house. A dead end somewhere outside does not matter - as long as there are no houses, the town does not use this road anyway at the moment.&lt;br /&gt;
* A single road tile with an open end may count as a dead end. The town might follow it, try to build a road (and fail) and stop. [[File:Deadend.jpg|thumb|right|A dead end towards east]]. This was adjusted in 1.6 [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43].&lt;br /&gt;
* Avoid having too many road junctions. Every junction is a place where the town might change its search direction, reducing the effective range where it searches for empty spots to build new houses.&lt;br /&gt;
* Use growth tunnels/bridges if your road layout near the city center is so complex that the outer parts get too few houses. However, let them end within region 3 (roads with trees) until this area is filled with houses.&lt;br /&gt;
&lt;br /&gt;
==The &amp;quot;best&amp;quot; road layout==&lt;br /&gt;
The best road layout is everything where each growth attempt is successful and ends in a new house. Most simple SBahn-grids get close to 100%, you can grow a city with at least 2 millions inhabitants with that.&lt;br /&gt;
To always get a new house, build a few long roads, going from the town center outwards. The town growth algorithm will follow them and pick one of the nearest empty spots.&lt;br /&gt;
This results in houses everywhere along the road, and always enough empty tiles after some point.&lt;br /&gt;
&lt;br /&gt;
With just two roads (connected in the town center to get a single long road), each road piece can support ~2 houses, therefore the town has to perform roughly housenumber/4 steps in the searching algorithm.&lt;br /&gt;
With &amp;quot;original layout&amp;quot;, it can do up to housenumber*4/9 steps, which is larger than this number. Therefore, this layout is basically the best you can do without other constraints. These roads can be winded around the town center in some spiral-shape.&lt;br /&gt;
[[File:Spiraltown.png|thumb|400px|right|A town with a single long road, as described in the text. The town uses every available spot in the inner parts (except some corner tiles) and fills gaps there nearly instantly.]]&lt;br /&gt;
[[File:9 big towns.png|thumb|400px|left|This map has a serious problem with overpopulation. 13 million people live on 512x512 tiles, with a transportation rate of about 80% via transrapid trains.]]&lt;br /&gt;
&lt;br /&gt;
== Algorithm Changes ==&lt;br /&gt;
* Starting in 1.6, the town growth algorithm ignores trivial dead ends. [https://github.com/OpenTTD/OpenTTD/commit/915aad7603d33dadc47b335ed6369e94da625933#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;br /&gt;
* Starting in 1.9, towns can build bridges over one-way roads and rail lines. [https://github.com/OpenTTD/OpenTTD/commit/50a0cf19158a1a1fda628a64e3ea490c9d06c42c#diff-7cb08cdaf3c712e038974cf3b954fa43]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Ruleset&amp;diff=28494</id>
		<title>Ruleset</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Ruleset&amp;diff=28494"/>
				<updated>2019-10-15T04:15:10Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Note==&lt;br /&gt;
Rules are used to ease the cooperative gameplay. Do not think of rules as laws, being punished if you don't follow them, but rules as a cornerstone to play together.&lt;br /&gt;
&lt;br /&gt;
Please note: individual games may have different rulesets. These rules are a default set, and in different games different rules may be needed - look at our [[Gametypes|Gametype-pages]] for further information.&lt;br /&gt;
&lt;br /&gt;
=&amp;lt;center&amp;gt;Rules of our games&amp;lt;/center&amp;gt;=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Playing in a team is very challenging. Imagine a team of skilled players who stick to their own individual playing style. If we want to set up a comprehensive and efficient transportation network we need to stick to certain rules. &lt;br /&gt;
&lt;br /&gt;
These rules help us to understand what our teammates are doing. Also, it keeps us away from additional work caused by a lack of proper building style. If you want to join us, you are very welcome; but we request you to pay attention to our rules. &lt;br /&gt;
&lt;br /&gt;
===Communication===&lt;br /&gt;
* '''You should be on [[IRC]] or [https://discord.gg/mAWqWPQ Discord] in case we need to have a discussion for which in game chat is not sufficient.'''&lt;br /&gt;
* We have no choice but to kick and/or ban players who are disruptive to the cooperative style of play, to make sure everyone can enjoy the game.&lt;br /&gt;
* Try not to disrupt the whole network. If that's necessary, talk to everyone else; so they know what's going on.&lt;br /&gt;
* Two people building in the same place is generally about as many as can be without a large amount of confusion. So communicate what and where you are doing something.&lt;br /&gt;
* For the same reason in order to make communication easier: choose the same (or at least a recognisably similar) ingame name as your IRC nick.&lt;br /&gt;
* If you have a special intention about something, use the ingame signs. Use them to comment out your ideas, like programmers use comments in their code. In fact, playing OTTD is like programming a system. &lt;br /&gt;
* ''No Sign overkill is needed!'' If you see obsolete signs, delete them (if you are not sure, keep them).&lt;br /&gt;
* Language is english (due to popular demand ;-) )&lt;br /&gt;
* We '''always''' name our hubs and add the name of the builder on the sign to ease bugtracking and communication. Look at our [[Naming_conventions|naming conventions]].&lt;br /&gt;
&lt;br /&gt;
===Game Start===&lt;br /&gt;
Most games start with money makers using airplanes, unless the map contributor states otherwise.  Please refer to the [[Game Start with Airplanes]] guide for more details.&lt;br /&gt;
&lt;br /&gt;
The company color is always orange. Don't question this. It leads to nothing at all ;-)&lt;br /&gt;
&lt;br /&gt;
===Construction===&lt;br /&gt;
*Stick to our construction guides for a proper building style unless a plan says something different. In case of doubt, ask others ingame.&lt;br /&gt;
*No 90 degree turns! Trains can't take them due to our patch-settings.&lt;br /&gt;
*No 2*45 degree curves, due to too high speed penalties. It should and can be avoided in 99.9% of all situations. Only at some less-frequented, bad-located stations, 2*45s are acceptable. This holds true also for &amp;quot;chaos style&amp;quot;.&lt;br /&gt;
*Stations are all equally long - depending on game type and strategy. Usually the smallest stations have 2 platforms but on larger games, like 1024x1024, you should stick to even larger stations - because of the long train running times there some queuings can occur.&lt;br /&gt;
*On 2+/2+ lines ([[Mainline|''Mainlines'']]) be sure to leave some spaces in between the two lanes (the more the better, depending on space restrictions).&lt;br /&gt;
*We (well most of us) drive on the right side of the road, the trains should too ;-).&lt;br /&gt;
*Unless stated otherwise we keep terraforming as low as possible. Moving a few tiles for a station or a curve is OK, but carving out a valley to lay your Sideline is a no-no. Also see [[Terraforming]].&lt;br /&gt;
&lt;br /&gt;
===Network Design===&lt;br /&gt;
*Often, we build large mainlines (at least LLRR or even more depending on traffic) and use them as backbones for all of the traffic.  Everything is connected to those mainlines by the [[Line_hierarchy|standard line hierarchy]]. On the other hand, this can vary basing on a specific plan. Be sure to search for a sign like &amp;quot;  !Network plan!  &amp;quot; to gain further information. They may mention one of the proven [[Gametypes|concepts]] in order to avoid writing down everything anew.&lt;br /&gt;
*We build sidelines (LR, sometimes LLRR) that access the mainlines via [[Guides:Glossary:Sideline_Hub|Sideline Hubs]]. &lt;br /&gt;
*Never ever connect a station directly to the mainline. This makes a fast mainline slow. Always connect a station via a sideline.&lt;br /&gt;
&lt;br /&gt;
===Trains===&lt;br /&gt;
*At the very beginning of a map we try to agree on a train length. A certain trainlength and speed needs a certain curve radius, therefore we try to avoid different lengths or train speeds.&lt;br /&gt;
*Shared orders are a must if more than one vehicle shares the same route. Ctrl+click while cloning trains. Exception: never ctrl+clone trains from trainyard&lt;br /&gt;
&lt;br /&gt;
===Public Server===&lt;br /&gt;
*The [[Public Server]] is a special case. Rules must be observed even more stringently than elsewhere.&lt;br /&gt;
*The password for the [[Public Server]] is available only from [[IRC]]. You can query the password easily via an [[IRC Commands|IRC command]] at any time.&lt;br /&gt;
*NEVER join the server twice. Ask others to join as well. It's a '''coop server''' - and you can hardly call playing by yourself co-operation.&lt;br /&gt;
*If you plan to be AFK for some reasons, please leave or join spectactors.&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Flat_Hubs&amp;diff=28492</id>
		<title>Flat Hubs</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Flat_Hubs&amp;diff=28492"/>
				<updated>2019-08-31T06:36:52Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Ghetto_hub.png|thumb|right|The Original]]&lt;br /&gt;
Flat Hubs (also known as Ghetto Style Hubs), are not a recommended hub design. However, they are useful in certain situations...&lt;br /&gt;
* When you don't have a lot of money (in the beginning of a game for a [[cashmaker]])&lt;br /&gt;
* You need a quick hub&lt;br /&gt;
* You're short on space&lt;br /&gt;
* You need a temporary hub&lt;br /&gt;
* All of the above&lt;br /&gt;
It should be noted, that Flat Hubs are very prone to jamming, and should be used in low traffic situations only. The original Flat Hub is shown on the right. It was used in the 1950s of the [[Collective Transport]] game, and is something that is pretty much unique to #OpenTTDCoop.&lt;br /&gt;
&lt;br /&gt;
[[Category:History]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Flat_Hubs&amp;diff=28490</id>
		<title>Flat Hubs</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Flat_Hubs&amp;diff=28490"/>
				<updated>2019-08-31T06:36:09Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Hazzard moved page Ghetto Style Hubs to Flat Hubs: renaming&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{obsolete}}&lt;br /&gt;
&lt;br /&gt;
[[Image:Ghetto_hub.png|thumb|right|The Original]]&lt;br /&gt;
Ghetto Style Hubs, are not a recommended hub design. However, they are useful in certain situations...&lt;br /&gt;
* When you don't have a lot of money (in the beginning of a game for a [[cashmaker]])&lt;br /&gt;
* You need a quick hub&lt;br /&gt;
* You're short on space&lt;br /&gt;
* You need a temporary hub&lt;br /&gt;
* All of the above&lt;br /&gt;
It should be noted, that Ghetto Style Hubs are very prone to jamming, and should be used in low traffic situations only. The original Ghetto Style Hub is shown on the right. It was used in the 1950s of the [[Collective Transport]] game, and is something that is pretty much unique to #OpenTTDCoop.&lt;br /&gt;
&lt;br /&gt;
[[Category:History]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Ghetto_Style_Hubs&amp;diff=28491</id>
		<title>Ghetto Style Hubs</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Ghetto_Style_Hubs&amp;diff=28491"/>
				<updated>2019-08-31T06:36:09Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Hazzard moved page Ghetto Style Hubs to Flat Hubs: renaming&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Flat Hubs]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Glossary&amp;diff=28489</id>
		<title>Glossary</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Glossary&amp;diff=28489"/>
				<updated>2019-08-29T16:44:48Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Glossary contains definitions for words often used in cooperative games and on the IRC channel. See also [[Naming conventions]].&lt;br /&gt;
&lt;br /&gt;
Please keep the list alphabetically sorted when you edit it. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{JargonHeader}}&lt;br /&gt;
{{Jargon|&amp;lt;nowiki&amp;gt;#&amp;lt;random number&amp;gt;&amp;lt;/nowiki&amp;gt;|||When using any number in game chat (sometimes prefixed with a #) we are talking about a train, with the number being the train's number so other people can look it up quickly.}}&lt;br /&gt;
{{Jargon|1st tier, primaries|||The name used for all industries that produce raw (not processed) cargo, the coalmine for example. It is also used for trains that transport raw cargo, they are called &amp;quot;1st tier trains&amp;quot; or &amp;quot;primary trains&amp;quot;.}}&lt;br /&gt;
{{Jargon|2nd tier, secondaries|||The name used for all the industries that accept raw cargo and possibly produce a new cargo. When trains transport this new cargo they're called &amp;quot;2nd tier trains&amp;quot; or &amp;quot;secondary trains&amp;quot;.}}&lt;br /&gt;
{{Jargon|BBH|Backbone_Hub|Backbone hub|A hub that connects multiple mainlines with each other.}}&lt;br /&gt;
{{Jargon|Cashmaker|Cashmaker|Cashmaker|See moneymaker.}}&lt;br /&gt;
{{Jargon|CL|Max Curve Speed|Curve Length|Mostly used to describe how big a curve must be to let trains with a certain train length pass at full speed.}}&lt;br /&gt;
{{Jargon|CW|||CW stands for ClockWise.}}&lt;br /&gt;
{{Jargon|Destructive Interference|Destructive Interference|Destructive Interference|Describes the situation where trains exiting a double-bridge or tunnel interfere with each other's progression.}}&lt;br /&gt;
{{Jargon|Drop|Junctionary_-_Stations_-_Drops|Junctionary|A Station where cargo is delivered to.}}&lt;br /&gt;
{{Jargon|Dummy Train|||A general term for any train that is not intended to deliver cargo. This includes logic trains and SRNW pickup trains (ensure full load but only pickup then transfer at same stations).}}&lt;br /&gt;
{{Jargon|Evil Mode|Evil Mode|Evil Mode|See destructive interference.}}&lt;br /&gt;
{{Jargon|GRF|GRF|GRF|GRFs are small extensions to OpenTTD's graphics and gameplay.}}&lt;br /&gt;
{{Jargon|Hub|Hub|Hub|An intersection of multiple railroad tracks that go in different directions.}}&lt;br /&gt;
{{Jargon|Merger|Merging Tracks|Merging Tracks|A place where some amount of lines are joined together.}}&lt;br /&gt;
{{Jargon|ML|Mainline|Mainline|The most important line in a network, it is where most of the trains spend the biggest part of their journey.}}&lt;br /&gt;
{{Jargon|MM|Moneymaker|Money maker|Initial infrastructure built to provide early-game income to start building the main network.}}&lt;br /&gt;
{{Jargon|MSH|MSH|Main station hub|A hub that connects main stations to mainlines}}&lt;br /&gt;
{{Jargon|IRC|IRC|IRC|Internet Relay Chat. Chat system used by us to communicate.}}&lt;br /&gt;
{{Jargon|LL / RR|||or variations are indicating directions and number of tracks on a main- or sideline.}}&lt;br /&gt;
{{Jargon|Pax|||A shorter way to say passengers.}}&lt;br /&gt;
{{Jargon|PBS|PBS|PBS|Path Based Signal, a type of signal.}}&lt;br /&gt;
{{Jargon|Pickup|Junctionary_-_Stations_-_Pickups|Junctionary|A station where trains pick up cargo.}}&lt;br /&gt;
{{Jargon|Prio|Priorities|Priority|A faster way to say priority line.}}&lt;br /&gt;
{{Jargon|Ro-Ro|Roll in Roll out|Roll in Roll out|A train station where trains enter and exit from oppopsing sides.}}&lt;br /&gt;
{{Jargon|RV|Road_stations|Road vehicle|A vehicle that travels on roads.}}&lt;br /&gt;
{{Jargon|SL|Sideline|Sideline|A line that connects industry stations with the mainline. It leads from stations to the sideline hub which connects them to the mainline.}}&lt;br /&gt;
{{Jargon|SLH|Sideline_Hub|Sideline hub|A hub that connects a sideline to the mainline.}}&lt;br /&gt;
{{Jargon|SML|Shift_Mainlines|SML page|SML stands for Shift Main Line.}}&lt;br /&gt;
{{Jargon|Slow mode|Destructive Interference|Destructive Interference|See destructive interference.}}&lt;br /&gt;
{{Jargon|TF|Terraforming|Terraforming|The action of raising or lowering land..}}&lt;br /&gt;
{{Jargon|TL|User:Tim/Tilelength|TrainLength|Total length of a train measured in the amount of tiles it occupies.}}&lt;br /&gt;
{{Jargon|Terminus station|Main station|Main station|A train station where trains enter and exit from the same direction, as opposed to [[Roll in Roll out|Ro-Ro]].}}&lt;br /&gt;
{{Jargon|Tile|||A square on the map.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28488</id>
		<title>Logic</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28488"/>
				<updated>2019-08-27T21:16:02Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Advanced logic elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenTTD allows to control trains with [[signals]]. The introduction of presignals allows to build more complex setups - the state of a signal (green/red) does not only depend on the following signal block, but also on other signals. For details, see the signal-article in the OpenTTD wiki [http://wiki.openttd.org/Signals].&lt;br /&gt;
&lt;br /&gt;
Presignals are frequently used to control trains in [[priorities]] and station entries. The combination with [[dummy train]]s, however, allows even more powerful constructions. Signals can be green or red, those states can be identified with 0 and 1, respectively (this is just a convention, it could be used the other way round as well). With trains and signals, it is possible to build all basic computer elements. In theory, it is possible to build a CPU in a game. You could even simulate OpenTTD ''in'' OpenTTD, if map size and computing power would not be a limit.&lt;br /&gt;
&lt;br /&gt;
To keep constructions simple, most logic constructions are built out of several standard elements, called gates. Usually, those gates are separated with combo signals to avoid unplanned influences. If the setup is sensitive to the timing (train A has to arrive before train B or similar), this has to be taken into account in the design. Otherwise, logic gates can be combined in arbitrary way to get the desired output (green/red signals) based on some input (usually: train positions).&lt;br /&gt;
&lt;br /&gt;
== Logic gates ==&lt;br /&gt;
&lt;br /&gt;
There are always many ways to build gates. The constructions shown here are the most simple setups - if space is limited, it is often useful to change their shape a bit.&lt;br /&gt;
&lt;br /&gt;
=== NOT ===&lt;br /&gt;
The most common logic gate you will see on coop servers is the NOT gate. It inverts the input: If the input is green, the result is red, if the input is red the result is green. This is done with two trains running on a 3x3-tile ring. If the input is green, they keep moving and at least one train keeps the output red. If the input is red, both trains stop behind an entry signal and the output is green. It is possible to use TL0.5-trains (single engine), but the gates work better with TL1-trains (two engines or double engine).&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
|| [[File:NOT.png|thumb|430px|right|Two NOT gates, one converting red to green and the other one converting green to red.]]&lt;br /&gt;
|| [[File:AND.png|thumb|430px|center|AND &amp;quot;gates&amp;quot; with different input states]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AND ===&lt;br /&gt;
AND gates are red if and only if all inputs are red. This is a feature of presignals - an entry or combo signal is red if all exit and combo signals leading to that block are red. There is no (practical) limit on the number of inputs.&lt;br /&gt;
&lt;br /&gt;
=== OR ===&lt;br /&gt;
OR gates are red if and only if at least one input is red. There are two ways to implement this: An OR gate or a construction similar to a [[priority]]. The latter method requires less space, but it works only with trains in that signal block itself - you cannot combine arbitrary logic lines like that.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
|| [[File:OR.png|thumb|430px|left|OR gates with different input states]]&lt;br /&gt;
|| [[File:OR prio.png|thumb|430px|center|OR, built like a priority]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Advanced logic elements ==&lt;br /&gt;
&lt;br /&gt;
[[File:XOR.png|thumb|220px|left|XOR construction, you can see the OR and NOT gate inside]]&lt;br /&gt;
[[File:Edge_detector_falling_inverted.png|thumb|220px|right|Falling edge detector (inverted). Output (right) flashes green when input (left) changes from red to green.]]&lt;br /&gt;
[[File:Logic traincounter.png|thumb|220px|left|A simple train counter. It can fail if the line jams. The counter train (lower left part) is released if the TL2-train blocks the NOT gate entry, but not the signal block behind and in front of it.]]&lt;br /&gt;
[[File:Logic_delay.png|thumb|220px|right|A delay circuit. When the input (top right) turns green, after the train traverses the loop the output (bottom left) will flash green. The delay depends on the speed of the train.]]&lt;br /&gt;
[[File:Logic_abs_red_converter.png|thumb|220px|left|A green to absolute red converter (red PURR). The dummy train on the right alternates moves left or right depending on the input (bottom left), creating the absolute red output (bottom right). Used to make an absolute red based OR gate with the yellow line.]]&lt;br /&gt;
=== XOR ===&lt;br /&gt;
XOR gates are red if exactly one of its two inputs is red. There is no known elementary gate for this, but it can be built as combination of multiple gates: (A XOR B) = (A OR B) AND (NOT(A AND B)) where A and B are the inputs.&lt;br /&gt;
&lt;br /&gt;
=== Edge detector ===&lt;br /&gt;
An edge detector is sensitive to ''changes'' of its input: If the input switches from red to green (or green to red, depending on the implementation), its output becomes green (or red) for some time, and switches back to its original position afterwards. This can be used to detect trains running on a line.&lt;br /&gt;
&lt;br /&gt;
=== Basic train counter ===&lt;br /&gt;
A train, running in a loop, can be used as counter: Most of the time, all signals for this train are red. To count up, all signals get green for a short time, and the train travels to the next signal. This can be used to store data, for example in [[Self-regulating Network|self-regulating networks]].&lt;br /&gt;
&lt;br /&gt;
=== Delay ===&lt;br /&gt;
A delay has the same output as its input, but it needs some (usually fixed) time to change the output. This can be useful if timing is important.&lt;br /&gt;
&lt;br /&gt;
=== Red -&amp;gt; absolute red ===&lt;br /&gt;
A special gate to produce absolute red: A train in a signal block instead of a red presignal.&lt;br /&gt;
&lt;br /&gt;
=== Clocks ===&lt;br /&gt;
Clocks are used to track time, for example time after the last train went through a line. See [[:File:Mark Clock.png|Mark's clock]] for an example. A very simple clock can be built with a train and a timetable to stay in a station for x days.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
=== SRNW stations ===&lt;br /&gt;
Stations in self-regulating networks are the most common application of logic. The trains themself cannot have a full load order, therefore it is required to control that with logic. Usually, this is done with dummy or feeder trains - they have a full load order, and SRNW trains are allowed to go into a station only if a feeder/dummy train is unloading there.&lt;br /&gt;
&lt;br /&gt;
There are many possible layouts for SRNW stations, some of them are collected in the [[Junctionary_-_Stations_-_Special_Cases|Junctionary]].&lt;br /&gt;
&lt;br /&gt;
[[File:Logic forcedsplit.png|thumb|400px|right|A split for lost trains: If the SL (western exit) is free, the NOT gate switches the twoway signal on the ML to red.]]&lt;br /&gt;
=== Flipflop-Split ===&lt;br /&gt;
A flipflop is a small memory with two possible states. This allows splits where exactly 50% of the trains go to one side and 50% go to the other side: The flipflop stores the direction of the last train and directs the new train to the other side.&lt;br /&gt;
&lt;br /&gt;
=== Forced Split ===&lt;br /&gt;
If trains are lost, their destination at a split can be unpredictable. With a red twoway signal, they can be forced to split in a specific direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Advanced concepts ===&lt;br /&gt;
*1 in 1 out (PSG239)&lt;br /&gt;
*Bigger feeder SRNW station (PZ22, PSG199)&lt;br /&gt;
*Self-regulating RV (PSG229)&lt;br /&gt;
&lt;br /&gt;
Things to check: [[PublicServer:Archive_-_Games_231_-_240#gameid_239|PSG239]], [[PublicServer:Archive_-_Games_221_-_230#gameid_223|PSG223]], [[PublicServer:Archive_-_Games_211_-_220#gameid_214|PSG214]], [[SRNW]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced Networking]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28487</id>
		<title>Logic</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28487"/>
				<updated>2019-08-27T21:14:13Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Advanced logic elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenTTD allows to control trains with [[signals]]. The introduction of presignals allows to build more complex setups - the state of a signal (green/red) does not only depend on the following signal block, but also on other signals. For details, see the signal-article in the OpenTTD wiki [http://wiki.openttd.org/Signals].&lt;br /&gt;
&lt;br /&gt;
Presignals are frequently used to control trains in [[priorities]] and station entries. The combination with [[dummy train]]s, however, allows even more powerful constructions. Signals can be green or red, those states can be identified with 0 and 1, respectively (this is just a convention, it could be used the other way round as well). With trains and signals, it is possible to build all basic computer elements. In theory, it is possible to build a CPU in a game. You could even simulate OpenTTD ''in'' OpenTTD, if map size and computing power would not be a limit.&lt;br /&gt;
&lt;br /&gt;
To keep constructions simple, most logic constructions are built out of several standard elements, called gates. Usually, those gates are separated with combo signals to avoid unplanned influences. If the setup is sensitive to the timing (train A has to arrive before train B or similar), this has to be taken into account in the design. Otherwise, logic gates can be combined in arbitrary way to get the desired output (green/red signals) based on some input (usually: train positions).&lt;br /&gt;
&lt;br /&gt;
== Logic gates ==&lt;br /&gt;
&lt;br /&gt;
There are always many ways to build gates. The constructions shown here are the most simple setups - if space is limited, it is often useful to change their shape a bit.&lt;br /&gt;
&lt;br /&gt;
=== NOT ===&lt;br /&gt;
The most common logic gate you will see on coop servers is the NOT gate. It inverts the input: If the input is green, the result is red, if the input is red the result is green. This is done with two trains running on a 3x3-tile ring. If the input is green, they keep moving and at least one train keeps the output red. If the input is red, both trains stop behind an entry signal and the output is green. It is possible to use TL0.5-trains (single engine), but the gates work better with TL1-trains (two engines or double engine).&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
|| [[File:NOT.png|thumb|430px|right|Two NOT gates, one converting red to green and the other one converting green to red.]]&lt;br /&gt;
|| [[File:AND.png|thumb|430px|center|AND &amp;quot;gates&amp;quot; with different input states]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AND ===&lt;br /&gt;
AND gates are red if and only if all inputs are red. This is a feature of presignals - an entry or combo signal is red if all exit and combo signals leading to that block are red. There is no (practical) limit on the number of inputs.&lt;br /&gt;
&lt;br /&gt;
=== OR ===&lt;br /&gt;
OR gates are red if and only if at least one input is red. There are two ways to implement this: An OR gate or a construction similar to a [[priority]]. The latter method requires less space, but it works only with trains in that signal block itself - you cannot combine arbitrary logic lines like that.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
|| [[File:OR.png|thumb|430px|left|OR gates with different input states]]&lt;br /&gt;
|| [[File:OR prio.png|thumb|430px|center|OR, built like a priority]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Advanced logic elements ==&lt;br /&gt;
&lt;br /&gt;
[[File:XOR.png|thumb|220px|left|XOR construction, you can see the OR and NOT gate inside]]&lt;br /&gt;
[[File:Edge_detector_falling_inverted.png|thumb|220px|right|Falling edge detector (inverted). Output (right) flashes green when input (left) changes from red to green.]]&lt;br /&gt;
[[File:Logic traincounter.png|thumb|220px|left|A simple train counter. It can fail if the line jams. The counter train (lower left part) is released if the TL2-train blocks the NOT gate entry, but not the signal block behind and in front of it.]]&lt;br /&gt;
[[File:Logic_delay.png|thumb|220px|right|A delay circuit. When the input (top right) turns green, after the train traverses the loop the output (bottom left) will flash green. The delay depends on the speed of the train.]]&lt;br /&gt;
[[File:Logic_abs_red_converter.png|thumb|220px|left|A green to absolute red converter (red PURR). The dummy train on the right alternates moves left or right depending on the input, creating the absolute red. Used to make an absolute red based OR gate with the yellow line.]]&lt;br /&gt;
=== XOR ===&lt;br /&gt;
XOR gates are red if exactly one of its two inputs is red. There is no known elementary gate for this, but it can be built as combination of multiple gates: (A XOR B) = (A OR B) AND (NOT(A AND B)) where A and B are the inputs.&lt;br /&gt;
&lt;br /&gt;
=== Edge detector ===&lt;br /&gt;
An edge detector is sensitive to ''changes'' of its input: If the input switches from red to green (or green to red, depending on the implementation), its output becomes green (or red) for some time, and switches back to its original position afterwards. This can be used to detect trains running on a line.&lt;br /&gt;
&lt;br /&gt;
=== Basic train counter ===&lt;br /&gt;
A train, running in a loop, can be used as counter: Most of the time, all signals for this train are red. To count up, all signals get green for a short time, and the train travels to the next signal. This can be used to store data, for example in [[Self-regulating Network|self-regulating networks]].&lt;br /&gt;
&lt;br /&gt;
=== Delay ===&lt;br /&gt;
A delay has the same output as its input, but it needs some (usually fixed) time to change the output. This can be useful if timing is important.&lt;br /&gt;
&lt;br /&gt;
=== Red -&amp;gt; absolute red ===&lt;br /&gt;
A special gate to produce absolute red: A train in a signal block instead of a red presignal.&lt;br /&gt;
&lt;br /&gt;
=== Clocks ===&lt;br /&gt;
Clocks are used to track time, for example time after the last train went through a line. See [[:File:Mark Clock.png|Mark's clock]] for an example. A very simple clock can be built with a train and a timetable to stay in a station for x days.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
=== SRNW stations ===&lt;br /&gt;
Stations in self-regulating networks are the most common application of logic. The trains themself cannot have a full load order, therefore it is required to control that with logic. Usually, this is done with dummy or feeder trains - they have a full load order, and SRNW trains are allowed to go into a station only if a feeder/dummy train is unloading there.&lt;br /&gt;
&lt;br /&gt;
There are many possible layouts for SRNW stations, some of them are collected in the [[Junctionary_-_Stations_-_Special_Cases|Junctionary]].&lt;br /&gt;
&lt;br /&gt;
[[File:Logic forcedsplit.png|thumb|400px|right|A split for lost trains: If the SL (western exit) is free, the NOT gate switches the twoway signal on the ML to red.]]&lt;br /&gt;
=== Flipflop-Split ===&lt;br /&gt;
A flipflop is a small memory with two possible states. This allows splits where exactly 50% of the trains go to one side and 50% go to the other side: The flipflop stores the direction of the last train and directs the new train to the other side.&lt;br /&gt;
&lt;br /&gt;
=== Forced Split ===&lt;br /&gt;
If trains are lost, their destination at a split can be unpredictable. With a red twoway signal, they can be forced to split in a specific direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Advanced concepts ===&lt;br /&gt;
*1 in 1 out (PSG239)&lt;br /&gt;
*Bigger feeder SRNW station (PZ22, PSG199)&lt;br /&gt;
*Self-regulating RV (PSG229)&lt;br /&gt;
&lt;br /&gt;
Things to check: [[PublicServer:Archive_-_Games_231_-_240#gameid_239|PSG239]], [[PublicServer:Archive_-_Games_221_-_230#gameid_223|PSG223]], [[PublicServer:Archive_-_Games_211_-_220#gameid_214|PSG214]], [[SRNW]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced Networking]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:Logic_abs_red_converter.png&amp;diff=28486</id>
		<title>File:Logic abs red converter.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:Logic_abs_red_converter.png&amp;diff=28486"/>
				<updated>2019-08-27T21:11:55Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28485</id>
		<title>Logic</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28485"/>
				<updated>2019-08-27T21:08:53Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Advanced logic elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenTTD allows to control trains with [[signals]]. The introduction of presignals allows to build more complex setups - the state of a signal (green/red) does not only depend on the following signal block, but also on other signals. For details, see the signal-article in the OpenTTD wiki [http://wiki.openttd.org/Signals].&lt;br /&gt;
&lt;br /&gt;
Presignals are frequently used to control trains in [[priorities]] and station entries. The combination with [[dummy train]]s, however, allows even more powerful constructions. Signals can be green or red, those states can be identified with 0 and 1, respectively (this is just a convention, it could be used the other way round as well). With trains and signals, it is possible to build all basic computer elements. In theory, it is possible to build a CPU in a game. You could even simulate OpenTTD ''in'' OpenTTD, if map size and computing power would not be a limit.&lt;br /&gt;
&lt;br /&gt;
To keep constructions simple, most logic constructions are built out of several standard elements, called gates. Usually, those gates are separated with combo signals to avoid unplanned influences. If the setup is sensitive to the timing (train A has to arrive before train B or similar), this has to be taken into account in the design. Otherwise, logic gates can be combined in arbitrary way to get the desired output (green/red signals) based on some input (usually: train positions).&lt;br /&gt;
&lt;br /&gt;
== Logic gates ==&lt;br /&gt;
&lt;br /&gt;
There are always many ways to build gates. The constructions shown here are the most simple setups - if space is limited, it is often useful to change their shape a bit.&lt;br /&gt;
&lt;br /&gt;
=== NOT ===&lt;br /&gt;
The most common logic gate you will see on coop servers is the NOT gate. It inverts the input: If the input is green, the result is red, if the input is red the result is green. This is done with two trains running on a 3x3-tile ring. If the input is green, they keep moving and at least one train keeps the output red. If the input is red, both trains stop behind an entry signal and the output is green. It is possible to use TL0.5-trains (single engine), but the gates work better with TL1-trains (two engines or double engine).&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
|| [[File:NOT.png|thumb|430px|right|Two NOT gates, one converting red to green and the other one converting green to red.]]&lt;br /&gt;
|| [[File:AND.png|thumb|430px|center|AND &amp;quot;gates&amp;quot; with different input states]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AND ===&lt;br /&gt;
AND gates are red if and only if all inputs are red. This is a feature of presignals - an entry or combo signal is red if all exit and combo signals leading to that block are red. There is no (practical) limit on the number of inputs.&lt;br /&gt;
&lt;br /&gt;
=== OR ===&lt;br /&gt;
OR gates are red if and only if at least one input is red. There are two ways to implement this: An OR gate or a construction similar to a [[priority]]. The latter method requires less space, but it works only with trains in that signal block itself - you cannot combine arbitrary logic lines like that.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
|| [[File:OR.png|thumb|430px|left|OR gates with different input states]]&lt;br /&gt;
|| [[File:OR prio.png|thumb|430px|center|OR, built like a priority]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Advanced logic elements ==&lt;br /&gt;
&lt;br /&gt;
[[File:XOR.png|thumb|220px|left|XOR construction, you can see the OR and NOT gate inside]]&lt;br /&gt;
[[File:Edge_detector_falling_inverted.png|thumb|220px|right|Falling edge detector (inverted). Output (right) flashes green when input (left) changes from red to green.]]&lt;br /&gt;
[[File:Logic traincounter.png|thumb|220px|left|A simple train counter. It can fail if the line jams. The counter train (lower left part) is released if the TL2-train blocks the NOT gate entry, but not the signal block behind and in front of it.]]&lt;br /&gt;
[[File:Logic_delay.png|thumb|220px|right|A delay circuit. When the input (top right) turns green, after the train traverses the loop the output (bottom left) will flash green. The delay depends on the speed of the train.]]&lt;br /&gt;
=== XOR ===&lt;br /&gt;
XOR gates are red if exactly one of its two inputs is red. There is no known elementary gate for this, but it can be built as combination of multiple gates: (A XOR B) = (A OR B) AND (NOT(A AND B)) where A and B are the inputs.&lt;br /&gt;
&lt;br /&gt;
=== Edge detector ===&lt;br /&gt;
An edge detector is sensitive to ''changes'' of its input: If the input switches from red to green (or green to red, depending on the implementation), its output becomes green (or red) for some time, and switches back to its original position afterwards. This can be used to detect trains running on a line.&lt;br /&gt;
&lt;br /&gt;
=== Basic train counter ===&lt;br /&gt;
A train, running in a loop, can be used as counter: Most of the time, all signals for this train are red. To count up, all signals get green for a short time, and the train travels to the next signal. This can be used to store data, for example in [[Self-regulating Network|self-regulating networks]].&lt;br /&gt;
&lt;br /&gt;
=== Delay ===&lt;br /&gt;
A delay has the same output as its input, but it needs some (usually fixed) time to change the output. This can be useful if timing is important.&lt;br /&gt;
&lt;br /&gt;
=== Red -&amp;gt; absolute red ===&lt;br /&gt;
A special gate to produce absolute red: A train in a signal block instead of a red presignal.&lt;br /&gt;
&lt;br /&gt;
=== Clocks ===&lt;br /&gt;
Clocks are used to track time, for example time after the last train went through a line. See [[:File:Mark Clock.png|Mark's clock]] for an example. A very simple clock can be built with a train and a timetable to stay in a station for x days.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
=== SRNW stations ===&lt;br /&gt;
Stations in self-regulating networks are the most common application of logic. The trains themself cannot have a full load order, therefore it is required to control that with logic. Usually, this is done with dummy or feeder trains - they have a full load order, and SRNW trains are allowed to go into a station only if a feeder/dummy train is unloading there.&lt;br /&gt;
&lt;br /&gt;
There are many possible layouts for SRNW stations, some of them are collected in the [[Junctionary_-_Stations_-_Special_Cases|Junctionary]].&lt;br /&gt;
&lt;br /&gt;
[[File:Logic forcedsplit.png|thumb|400px|right|A split for lost trains: If the SL (western exit) is free, the NOT gate switches the twoway signal on the ML to red.]]&lt;br /&gt;
=== Flipflop-Split ===&lt;br /&gt;
A flipflop is a small memory with two possible states. This allows splits where exactly 50% of the trains go to one side and 50% go to the other side: The flipflop stores the direction of the last train and directs the new train to the other side.&lt;br /&gt;
&lt;br /&gt;
=== Forced Split ===&lt;br /&gt;
If trains are lost, their destination at a split can be unpredictable. With a red twoway signal, they can be forced to split in a specific direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Advanced concepts ===&lt;br /&gt;
*1 in 1 out (PSG239)&lt;br /&gt;
*Bigger feeder SRNW station (PZ22, PSG199)&lt;br /&gt;
*Self-regulating RV (PSG229)&lt;br /&gt;
&lt;br /&gt;
Things to check: [[PublicServer:Archive_-_Games_231_-_240#gameid_239|PSG239]], [[PublicServer:Archive_-_Games_221_-_230#gameid_223|PSG223]], [[PublicServer:Archive_-_Games_211_-_220#gameid_214|PSG214]], [[SRNW]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced Networking]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28484</id>
		<title>Logic</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28484"/>
				<updated>2019-08-27T21:08:33Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Advanced logic elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenTTD allows to control trains with [[signals]]. The introduction of presignals allows to build more complex setups - the state of a signal (green/red) does not only depend on the following signal block, but also on other signals. For details, see the signal-article in the OpenTTD wiki [http://wiki.openttd.org/Signals].&lt;br /&gt;
&lt;br /&gt;
Presignals are frequently used to control trains in [[priorities]] and station entries. The combination with [[dummy train]]s, however, allows even more powerful constructions. Signals can be green or red, those states can be identified with 0 and 1, respectively (this is just a convention, it could be used the other way round as well). With trains and signals, it is possible to build all basic computer elements. In theory, it is possible to build a CPU in a game. You could even simulate OpenTTD ''in'' OpenTTD, if map size and computing power would not be a limit.&lt;br /&gt;
&lt;br /&gt;
To keep constructions simple, most logic constructions are built out of several standard elements, called gates. Usually, those gates are separated with combo signals to avoid unplanned influences. If the setup is sensitive to the timing (train A has to arrive before train B or similar), this has to be taken into account in the design. Otherwise, logic gates can be combined in arbitrary way to get the desired output (green/red signals) based on some input (usually: train positions).&lt;br /&gt;
&lt;br /&gt;
== Logic gates ==&lt;br /&gt;
&lt;br /&gt;
There are always many ways to build gates. The constructions shown here are the most simple setups - if space is limited, it is often useful to change their shape a bit.&lt;br /&gt;
&lt;br /&gt;
=== NOT ===&lt;br /&gt;
The most common logic gate you will see on coop servers is the NOT gate. It inverts the input: If the input is green, the result is red, if the input is red the result is green. This is done with two trains running on a 3x3-tile ring. If the input is green, they keep moving and at least one train keeps the output red. If the input is red, both trains stop behind an entry signal and the output is green. It is possible to use TL0.5-trains (single engine), but the gates work better with TL1-trains (two engines or double engine).&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
|| [[File:NOT.png|thumb|430px|right|Two NOT gates, one converting red to green and the other one converting green to red.]]&lt;br /&gt;
|| [[File:AND.png|thumb|430px|center|AND &amp;quot;gates&amp;quot; with different input states]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AND ===&lt;br /&gt;
AND gates are red if and only if all inputs are red. This is a feature of presignals - an entry or combo signal is red if all exit and combo signals leading to that block are red. There is no (practical) limit on the number of inputs.&lt;br /&gt;
&lt;br /&gt;
=== OR ===&lt;br /&gt;
OR gates are red if and only if at least one input is red. There are two ways to implement this: An OR gate or a construction similar to a [[priority]]. The latter method requires less space, but it works only with trains in that signal block itself - you cannot combine arbitrary logic lines like that.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
|| [[File:OR.png|thumb|430px|left|OR gates with different input states]]&lt;br /&gt;
|| [[File:OR prio.png|thumb|430px|center|OR, built like a priority]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Advanced logic elements ==&lt;br /&gt;
&lt;br /&gt;
[[File:XOR.png|thumb|220px|left|XOR construction, you can see the OR and NOT gate inside]]&lt;br /&gt;
[[File:Edge_detector_falling_inverted.png|thumb|220px|right|Falling edge detector (inverted). Output (right) flashes green when input (left) changes from red to green.]]&lt;br /&gt;
[[File:Logic traincounter.png|thumb|220px|left|A simple train counter. It can fail if the line jams. The counter train (lower left part) is released if the TL2-train blocks the NOT gate entry, but not the signal block behind and in front of it.]]&lt;br /&gt;
[[File:Logic traincounter.png|thumb|220px|right|A delay circuit. When the input (top right) turns green, after the train traverses the loop the output (bottom left) will flash green. The delay depends on the speed of the train.]]&lt;br /&gt;
=== XOR ===&lt;br /&gt;
XOR gates are red if exactly one of its two inputs is red. There is no known elementary gate for this, but it can be built as combination of multiple gates: (A XOR B) = (A OR B) AND (NOT(A AND B)) where A and B are the inputs.&lt;br /&gt;
&lt;br /&gt;
=== Edge detector ===&lt;br /&gt;
An edge detector is sensitive to ''changes'' of its input: If the input switches from red to green (or green to red, depending on the implementation), its output becomes green (or red) for some time, and switches back to its original position afterwards. This can be used to detect trains running on a line.&lt;br /&gt;
&lt;br /&gt;
=== Basic train counter ===&lt;br /&gt;
A train, running in a loop, can be used as counter: Most of the time, all signals for this train are red. To count up, all signals get green for a short time, and the train travels to the next signal. This can be used to store data, for example in [[Self-regulating Network|self-regulating networks]].&lt;br /&gt;
&lt;br /&gt;
=== Delay ===&lt;br /&gt;
A delay has the same output as its input, but it needs some (usually fixed) time to change the output. This can be useful if timing is important.&lt;br /&gt;
&lt;br /&gt;
=== Red -&amp;gt; absolute red ===&lt;br /&gt;
A special gate to produce absolute red: A train in a signal block instead of a red presignal.&lt;br /&gt;
&lt;br /&gt;
=== Clocks ===&lt;br /&gt;
Clocks are used to track time, for example time after the last train went through a line. See [[:File:Mark Clock.png|Mark's clock]] for an example. A very simple clock can be built with a train and a timetable to stay in a station for x days.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
=== SRNW stations ===&lt;br /&gt;
Stations in self-regulating networks are the most common application of logic. The trains themself cannot have a full load order, therefore it is required to control that with logic. Usually, this is done with dummy or feeder trains - they have a full load order, and SRNW trains are allowed to go into a station only if a feeder/dummy train is unloading there.&lt;br /&gt;
&lt;br /&gt;
There are many possible layouts for SRNW stations, some of them are collected in the [[Junctionary_-_Stations_-_Special_Cases|Junctionary]].&lt;br /&gt;
&lt;br /&gt;
[[File:Logic forcedsplit.png|thumb|400px|right|A split for lost trains: If the SL (western exit) is free, the NOT gate switches the twoway signal on the ML to red.]]&lt;br /&gt;
=== Flipflop-Split ===&lt;br /&gt;
A flipflop is a small memory with two possible states. This allows splits where exactly 50% of the trains go to one side and 50% go to the other side: The flipflop stores the direction of the last train and directs the new train to the other side.&lt;br /&gt;
&lt;br /&gt;
=== Forced Split ===&lt;br /&gt;
If trains are lost, their destination at a split can be unpredictable. With a red twoway signal, they can be forced to split in a specific direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Advanced concepts ===&lt;br /&gt;
*1 in 1 out (PSG239)&lt;br /&gt;
*Bigger feeder SRNW station (PZ22, PSG199)&lt;br /&gt;
*Self-regulating RV (PSG229)&lt;br /&gt;
&lt;br /&gt;
Things to check: [[PublicServer:Archive_-_Games_231_-_240#gameid_239|PSG239]], [[PublicServer:Archive_-_Games_221_-_230#gameid_223|PSG223]], [[PublicServer:Archive_-_Games_211_-_220#gameid_214|PSG214]], [[SRNW]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced Networking]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:Logic_delay.png&amp;diff=28483</id>
		<title>File:Logic delay.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:Logic_delay.png&amp;diff=28483"/>
				<updated>2019-08-27T21:07:14Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28482</id>
		<title>Logic</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28482"/>
				<updated>2019-08-27T20:33:31Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenTTD allows to control trains with [[signals]]. The introduction of presignals allows to build more complex setups - the state of a signal (green/red) does not only depend on the following signal block, but also on other signals. For details, see the signal-article in the OpenTTD wiki [http://wiki.openttd.org/Signals].&lt;br /&gt;
&lt;br /&gt;
Presignals are frequently used to control trains in [[priorities]] and station entries. The combination with [[dummy train]]s, however, allows even more powerful constructions. Signals can be green or red, those states can be identified with 0 and 1, respectively (this is just a convention, it could be used the other way round as well). With trains and signals, it is possible to build all basic computer elements. In theory, it is possible to build a CPU in a game. You could even simulate OpenTTD ''in'' OpenTTD, if map size and computing power would not be a limit.&lt;br /&gt;
&lt;br /&gt;
To keep constructions simple, most logic constructions are built out of several standard elements, called gates. Usually, those gates are separated with combo signals to avoid unplanned influences. If the setup is sensitive to the timing (train A has to arrive before train B or similar), this has to be taken into account in the design. Otherwise, logic gates can be combined in arbitrary way to get the desired output (green/red signals) based on some input (usually: train positions).&lt;br /&gt;
&lt;br /&gt;
== Logic gates ==&lt;br /&gt;
&lt;br /&gt;
There are always many ways to build gates. The constructions shown here are the most simple setups - if space is limited, it is often useful to change their shape a bit.&lt;br /&gt;
&lt;br /&gt;
=== NOT ===&lt;br /&gt;
The most common logic gate you will see on coop servers is the NOT gate. It inverts the input: If the input is green, the result is red, if the input is red the result is green. This is done with two trains running on a 3x3-tile ring. If the input is green, they keep moving and at least one train keeps the output red. If the input is red, both trains stop behind an entry signal and the output is green. It is possible to use TL0.5-trains (single engine), but the gates work better with TL1-trains (two engines or double engine).&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
|| [[File:NOT.png|thumb|430px|right|Two NOT gates, one converting red to green and the other one converting green to red.]]&lt;br /&gt;
|| [[File:AND.png|thumb|430px|center|AND &amp;quot;gates&amp;quot; with different input states]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AND ===&lt;br /&gt;
AND gates are red if and only if all inputs are red. This is a feature of presignals - an entry or combo signal is red if all exit and combo signals leading to that block are red. There is no (practical) limit on the number of inputs.&lt;br /&gt;
&lt;br /&gt;
=== OR ===&lt;br /&gt;
OR gates are red if and only if at least one input is red. There are two ways to implement this: An OR gate or a construction similar to a [[priority]]. The latter method requires less space, but it works only with trains in that signal block itself - you cannot combine arbitrary logic lines like that.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
|| [[File:OR.png|thumb|430px|left|OR gates with different input states]]&lt;br /&gt;
|| [[File:OR prio.png|thumb|430px|center|OR, built like a priority]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Advanced logic elements ==&lt;br /&gt;
&lt;br /&gt;
[[File:XOR.png|thumb|220px|right|XOR construction, you can see the OR and NOT gate inside]]&lt;br /&gt;
=== XOR ===&lt;br /&gt;
XOR gates are red if exactly one of its two inputs is red. There is no known elementary gate for this, but it can be built as combination of multiple gates: (A XOR B) = (A OR B) AND (NOT(A AND B)) where A and B are the inputs.&lt;br /&gt;
&lt;br /&gt;
[[File:Edge_detector_falling_inverted.png|thumb|220px|right|Falling edge detector (inverted). Output flashes green when input changes from red to green.]]&lt;br /&gt;
=== Edge detector ===&lt;br /&gt;
An edge detector is sensitive to ''changes'' of its input: If the input switches from red to green (or green to red, depending on the implementation), its output becomes green (or red) for some time, and switches back to its original position afterwards. This can be used to detect trains running on a line.&lt;br /&gt;
&lt;br /&gt;
[[File:Logic traincounter.png|thumb|220px|right|A simple train counter. It can fail if the line jams. The counter train (lower left part) is released if the TL2-train blocks the NOT gate entry, but not the signal block behind and in front of it.]]&lt;br /&gt;
=== Basic train counter ===&lt;br /&gt;
A train, running in a loop, can be used as counter: Most of the time, all signals for this train are red. To count up, all signals get green for a short time, and the train travels to the next signal. This can be used to store data, for example in [[Self-regulating Network|self-regulating networks]].&lt;br /&gt;
&lt;br /&gt;
=== Delay ===&lt;br /&gt;
A delay has the same output as its input, but it needs some (usually fixed) time to change the output. This can be useful if timing is important.&lt;br /&gt;
&lt;br /&gt;
=== Red -&amp;gt; absolute red ===&lt;br /&gt;
A special gate to produce absolute red: A train in a signal block instead of a red presignal.&lt;br /&gt;
&lt;br /&gt;
=== Clocks ===&lt;br /&gt;
Clocks are used to track time, for example time after the last train went through a line. See [[:File:Mark Clock.png|Mark's clock]] for an example. A very simple clock can be built with a train and a timetable to stay in a station for x days.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
=== SRNW stations ===&lt;br /&gt;
Stations in self-regulating networks are the most common application of logic. The trains themself cannot have a full load order, therefore it is required to control that with logic. Usually, this is done with dummy or feeder trains - they have a full load order, and SRNW trains are allowed to go into a station only if a feeder/dummy train is unloading there.&lt;br /&gt;
&lt;br /&gt;
There are many possible layouts for SRNW stations, some of them are collected in the [[Junctionary_-_Stations_-_Special_Cases|Junctionary]].&lt;br /&gt;
&lt;br /&gt;
[[File:Logic forcedsplit.png|thumb|400px|right|A split for lost trains: If the SL (western exit) is free, the NOT gate switches the twoway signal on the ML to red.]]&lt;br /&gt;
=== Flipflop-Split ===&lt;br /&gt;
A flipflop is a small memory with two possible states. This allows splits where exactly 50% of the trains go to one side and 50% go to the other side: The flipflop stores the direction of the last train and directs the new train to the other side.&lt;br /&gt;
&lt;br /&gt;
=== Forced Split ===&lt;br /&gt;
If trains are lost, their destination at a split can be unpredictable. With a red twoway signal, they can be forced to split in a specific direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Advanced concepts ===&lt;br /&gt;
*1 in 1 out (PSG239)&lt;br /&gt;
*Bigger feeder SRNW station (PZ22, PSG199)&lt;br /&gt;
*Self-regulating RV (PSG229)&lt;br /&gt;
&lt;br /&gt;
Things to check: [[PublicServer:Archive_-_Games_231_-_240#gameid_239|PSG239]], [[PublicServer:Archive_-_Games_221_-_230#gameid_223|PSG223]], [[PublicServer:Archive_-_Games_211_-_220#gameid_214|PSG214]], [[SRNW]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced Networking]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:Edge_detector_falling_inverted.png&amp;diff=28481</id>
		<title>File:Edge detector falling inverted.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:Edge_detector_falling_inverted.png&amp;diff=28481"/>
				<updated>2019-08-27T20:31:11Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: output flashes green when input changes from red to green&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;output flashes green when input changes from red to green&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28480</id>
		<title>Logic</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Logic&amp;diff=28480"/>
				<updated>2019-08-27T20:30:20Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Advanced logic elements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OpenTTD allows to control trains with [[signals]]. The introduction of presignals allows to build more complex setups - the state of a signal (green/red) does not only depend on the following signal block, but also on other signals. For details, see the signal-article in the OpenTTD wiki [http://wiki.openttd.org/Signals].&lt;br /&gt;
&lt;br /&gt;
Presignals are frequently used to control trains in [[priorities]] and station entries. The combination with [[dummy train]]s, however, allows even more powerful constructions. Signals can be green or red, those states can be identified with 0 and 1, respectively (this is just a convention, it could be used the other way round as well). With trains and signals, it is possible to build all basic computer elements. In theory, it is possible to build a CPU in a game. You could even simulate OpenTTD ''in'' OpenTTD, if map size and computing power would not be a limit.&lt;br /&gt;
&lt;br /&gt;
To keep constructions simple, most logic constructions are built out of several standard elements, called gates. Usually, those gates are separated with combo signals to avoid unplanned influences. If the setup is sensitive to the timing (train A has to arrive before train B or similar), this has to be taken into account in the design. Otherwise, logic gates can be combined in arbitrary way to get the desired output (green/red signals) based on some input (usually: train positions).&lt;br /&gt;
&lt;br /&gt;
== Logic gates ==&lt;br /&gt;
&lt;br /&gt;
There are always many ways to build gates. The constructions shown here are the most simple setups - if space is limited, it is often useful to change their shape a bit.&lt;br /&gt;
&lt;br /&gt;
=== NOT ===&lt;br /&gt;
The most common logic gate you will see on coop servers is the NOT gate. It inverts the input: If the input is green, the result is red, if the input is red the result is green. This is done with two trains running on a 3x3-tile ring. If the input is green, they keep moving and at least one train keeps the output red. If the input is red, both trains stop behind an entry signal and the output is green. It is possible to use TL0.5-trains (single engine), but the gates work better with TL1-trains (two engines or double engine).&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
|| [[File:NOT.png|thumb|430px|right|Two NOT gates, one converting red to green and the other one converting green to red.]]&lt;br /&gt;
|| [[File:AND.png|thumb|430px|center|AND &amp;quot;gates&amp;quot; with different input states]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== AND ===&lt;br /&gt;
AND gates are red if and only if all inputs are red. This is a feature of presignals - an entry or combo signal is red if all exit and combo signals leading to that block are red. There is no (practical) limit on the number of inputs.&lt;br /&gt;
&lt;br /&gt;
=== OR ===&lt;br /&gt;
OR gates are red if and only if at least one input is red. There are two ways to implement this: An OR gate or a construction similar to a [[priority]]. The latter method requires less space, but it works only with trains in that signal block itself - you cannot combine arbitrary logic lines like that.&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
|| [[File:OR.png|thumb|430px|left|OR gates with different input states]]&lt;br /&gt;
|| [[File:OR prio.png|thumb|430px|center|OR, built like a priority]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Advanced logic elements ==&lt;br /&gt;
&lt;br /&gt;
[[File:XOR.png|thumb|200px|right|XOR construction, you can see the OR and NOT gate inside]]&lt;br /&gt;
=== XOR ===&lt;br /&gt;
XOR gates are red if exactly one of its two inputs is red. There is no known elementary gate for this, but it can be built as combination of multiple gates: (A XOR B) = (A OR B) AND (NOT(A AND B)) where A and B are the inputs.&lt;br /&gt;
&lt;br /&gt;
=== Edge detector ===&lt;br /&gt;
An edge detector is sensitive to ''changes'' of its input: If the input switches from red to green (or green to red, depending on the implementation), its output becomes green (or red) for some time, and switches back to its original position afterwards. This can be used to detect trains running on a line.&lt;br /&gt;
&lt;br /&gt;
[[File:Logic traincounter.png|thumb|200px|right|A simple train counter. It can fail if the line jams. The counter train (lower left part) is released if the TL2-train blocks the NOT gate entry, but not the signal block behind and in front of it.]]&lt;br /&gt;
=== Basic train counter ===&lt;br /&gt;
A train, running in a loop, can be used as counter: Most of the time, all signals for this train are red. To count up, all signals get green for a short time, and the train travels to the next signal. This can be used to store data, for example in [[Self-regulating Network|self-regulating networks]].&lt;br /&gt;
&lt;br /&gt;
=== Delay ===&lt;br /&gt;
A delay has the same output as its input, but it needs some (usually fixed) time to change the output. This can be useful if timing is important.&lt;br /&gt;
&lt;br /&gt;
=== Red -&amp;gt; absolute red ===&lt;br /&gt;
A special gate to produce absolute red: A train in a signal block instead of a red presignal.&lt;br /&gt;
&lt;br /&gt;
=== Clocks ===&lt;br /&gt;
Clocks are used to track time, for example time after the last train went through a line. See [[:File:Mark Clock.png|Mark's clock]] for an example. A very simple clock can be built with a train and a timetable to stay in a station for x days.&lt;br /&gt;
&lt;br /&gt;
== Applications ==&lt;br /&gt;
&lt;br /&gt;
=== SRNW stations ===&lt;br /&gt;
Stations in self-regulating networks are the most common application of logic. The trains themself cannot have a full load order, therefore it is required to control that with logic. Usually, this is done with dummy or feeder trains - they have a full load order, and SRNW trains are allowed to go into a station only if a feeder/dummy train is unloading there.&lt;br /&gt;
&lt;br /&gt;
There are many possible layouts for SRNW stations, some of them are collected in the [[Junctionary_-_Stations_-_Special_Cases|Junctionary]].&lt;br /&gt;
&lt;br /&gt;
[[File:Logic forcedsplit.png|thumb|400px|right|A split for lost trains: If the SL (western exit) is free, the NOT gate switches the twoway signal on the ML to red.]]&lt;br /&gt;
=== Flipflop-Split ===&lt;br /&gt;
A flipflop is a small memory with two possible states. This allows splits where exactly 50% of the trains go to one side and 50% go to the other side: The flipflop stores the direction of the last train and directs the new train to the other side.&lt;br /&gt;
&lt;br /&gt;
=== Forced Split ===&lt;br /&gt;
If trains are lost, their destination at a split can be unpredictable. With a red twoway signal, they can be forced to split in a specific direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
=== Advanced concepts ===&lt;br /&gt;
*1 in 1 out (PSG239)&lt;br /&gt;
*Bigger feeder SRNW station (PZ22, PSG199)&lt;br /&gt;
*Self-regulating RV (PSG229)&lt;br /&gt;
&lt;br /&gt;
Things to check: [[PublicServer:Archive_-_Games_231_-_240#gameid_239|PSG239]], [[PublicServer:Archive_-_Games_221_-_230#gameid_223|PSG223]], [[PublicServer:Archive_-_Games_211_-_220#gameid_214|PSG214]], [[SRNW]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Advanced Networking]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:Logic_base1_counter.png&amp;diff=28479</id>
		<title>File:Logic base1 counter.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:Logic_base1_counter.png&amp;diff=28479"/>
				<updated>2019-08-11T19:09:28Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Hazzard uploaded a new version of File:Logic base1 counter.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Train counter for SRNW&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Junctionary_-_Logic_and_Other&amp;diff=28478</id>
		<title>Junctionary - Logic and Other</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Junctionary_-_Logic_and_Other&amp;diff=28478"/>
				<updated>2019-08-11T19:05:08Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{JunctionaryLogicAndOtherMenu}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
It is hard to describe [[logic]] shortly since it's very purpose is to do something extra. This section lists mechanisms and thingies that usually control trains somehow, and thus improve how our network works. Although there are for sure cases that are completely useless like train counters.&lt;br /&gt;
&lt;br /&gt;
{{JunctionaryTableHeader|headline=Logic and other constructions &amp;lt;font size=&amp;quot;small&amp;quot;&amp;gt;([[Logic|what is that?]])}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|13/07/2008|[[Image:Lensort.jpg|center|140px|]]|Train Length Sorter|Sorts trains by their length. In this example trains longer than 5 cars (or 2 tiles)  will be sorted via the penalty, those of 5 cars or less through the non-penalty line. this is useful when trains of varying type use a station, and some platforms are shorter than others. It can also be used at junctions where there are two options of track, to move shorter trains onto a loop with tighter turns. Finally it may be used to seperate main line trains from local trains (assuming different train lengths). A local train may be forced onto a longer, slower loop to allow mainline trains to pass.|Audigex, original credit unknown.|}}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|16/12/2008|[[Image:psg121_MarkClock.png|center|140px|]]|Advanced Timer|An advanced timer which works with a certain cycle. Once the dummy train finishes the cycle, a train is released by the timer. However this has one crucial condition - if a train overflows, the whole cycle is cancelled and the counting starts again.|{{User|Mark}}|{{PublicServerGameSave|121}} }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg131_Compressor.png|center|140px|]]|'''Train packing'''|The so called compressor. Waits until a few trains are ready to go and then releases them very close together, allowing trains further down the line join. |{{User|Mark}}|{{PublicServerGameSave|131}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg180_flipflop.png|center|140px|]]|'''Flipflop'''|A typical flipflop splitting trains into 6 directions equally. |{{User|V453000}}|{{PublicServerGameSave|180}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg196_counter.png|center|140px|]]|'''Counter'''|A mechanism which counts how many trains have passed a certain spot. Completely useless for the network. |{{User|HDIEagle}}|{{PublicServerGameSave|196}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg200_comparer.png|center|140px|]]|'''Counter/comparer'''|This array of stations had a special overflow which counted which station gets the least amount of trains and released trains to that. Therefore there are logic mechanisms which count how many trains have passed (based on Mark's clock) and a mechanism which says which station had gotten X trains as the last one. |{{User|V453000}}|{{PublicServerGameSave|200}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg203_sparta.png|center|140px|]]|'''Long train abuse'''|This mechanism is meant to pack looong trains in just 3x3. It is very slow due to the effective more than 1xTL signal gap. |{{User|V453000}}|{{PublicServerGameSave|203}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg224_flipflop.png|center|140px|]]|'''Flipflop without memory''' (SR-NOR latch)|A very interesting way how to make a flipflop without memories, using the NOT gates swap their states. Unfortunately (probably) only usable for 1:1 split. |{{User|mfb}}|{{PublicServerGameSave|224}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|16.10.12|[[Image:psg245_split_to_N.png|center|140px|]]|'''Pathfinder-based Perfect N-way split'''|A split from 1 to N (here 7) tracks. Fairly easy to build, with full throughput and does not seem to break. |{{User|V453000}}|{{PublicServerGameSave|245}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|2019-07-20|[[Image:3waysplit.png|center|140px|]]|'''Logic-based Perfect N-way split'''|A split from 1 to N (here 3) tracks. Fail-safe. |{{User|Hazzard}}|}}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|2019-08-11|[[Image:Logic base1 counter.png|center|140px|]]|'''Base-1 (tally) counter'''|Train counter using memories as counting tally marks. Used for clock-synchronized SRNW. Allows N (6) trains per clock cycle. In this screenshot the input/output is in the top right with a testing dummy train. |{{User|Hazzard}}| {{PublicServerGameSave|334}}}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Junctionary_-_Logic_and_Other&amp;diff=28477</id>
		<title>Junctionary - Logic and Other</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Junctionary_-_Logic_and_Other&amp;diff=28477"/>
				<updated>2019-08-11T19:03:42Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{JunctionaryLogicAndOtherMenu}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
It is hard to describe [[logic]] shortly since it's very purpose is to do something extra. This section lists mechanisms and thingies that usually control trains somehow, and thus improve how our network works. Although there are for sure cases that are completely useless like train counters.&lt;br /&gt;
&lt;br /&gt;
{{JunctionaryTableHeader|headline=Logic and other constructions &amp;lt;font size=&amp;quot;small&amp;quot;&amp;gt;([[Logic|what is that?]])}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|13/07/2008|[[Image:Lensort.jpg|center|140px|]]|Train Length Sorter|Sorts trains by their length. In this example trains longer than 5 cars (or 2 tiles)  will be sorted via the penalty, those of 5 cars or less through the non-penalty line. this is useful when trains of varying type use a station, and some platforms are shorter than others. It can also be used at junctions where there are two options of track, to move shorter trains onto a loop with tighter turns. Finally it may be used to seperate main line trains from local trains (assuming different train lengths). A local train may be forced onto a longer, slower loop to allow mainline trains to pass.|Audigex, original credit unknown.|}}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|16/12/2008|[[Image:psg121_MarkClock.png|center|140px|]]|Advanced Timer|An advanced timer which works with a certain cycle. Once the dummy train finishes the cycle, a train is released by the timer. However this has one crucial condition - if a train overflows, the whole cycle is cancelled and the counting starts again.|{{User|Mark}}|{{PublicServerGameSave|121}} }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg131_Compressor.png|center|140px|]]|'''Train packing'''|The so called compressor. Waits until a few trains are ready to go and then releases them very close together, allowing trains further down the line join. |{{User|Mark}}|{{PublicServerGameSave|131}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg180_flipflop.png|center|140px|]]|'''Flipflop'''|A typical flipflop splitting trains into 6 directions equally. |{{User|V453000}}|{{PublicServerGameSave|180}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg196_counter.png|center|140px|]]|'''Counter'''|A mechanism which counts how many trains have passed a certain spot. Completely useless for the network. |{{User|HDIEagle}}|{{PublicServerGameSave|196}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg200_comparer.png|center|140px|]]|'''Counter/comparer'''|This array of stations had a special overflow which counted which station gets the least amount of trains and released trains to that. Therefore there are logic mechanisms which count how many trains have passed (based on Mark's clock) and a mechanism which says which station had gotten X trains as the last one. |{{User|V453000}}|{{PublicServerGameSave|200}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg203_sparta.png|center|140px|]]|'''Long train abuse'''|This mechanism is meant to pack looong trains in just 3x3. It is very slow due to the effective more than 1xTL signal gap. |{{User|V453000}}|{{PublicServerGameSave|203}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg224_flipflop.png|center|140px|]]|'''Flipflop without memory''' (SR-NOR latch)|A very interesting way how to make a flipflop without memories, using the NOT gates swap their states. Unfortunately (probably) only usable for 1:1 split. |{{User|mfb}}|{{PublicServerGameSave|224}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|16.10.12|[[Image:psg245_split_to_N.png|center|140px|]]|'''Pathfinder-based Perfect N-way split'''|A split from 1 to N (here 7) tracks. Fairly easy to build, with full throughput and does not seem to break. |{{User|V453000}}|{{PublicServerGameSave|245}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|2019-07-20|[[Image:3waysplit.png|center|140px|]]|'''Logic-based Perfect N-way split'''|A split from 1 to N (here 3) tracks. Fail-safe. |{{User|Hazzard}}|}}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|2019-08-11|[[Image:Logic base1 counter.png|center|140px|]]|'''Base-1 (tally) counter'''|Train counter using memories as counting tally marks. Used for clock-synchronized SRNW. Allows N (6) trains per clock cycle. |{{User|Hazzard}}| {{PublicServerGameSave|334}}}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:Logic_base1_counter.png&amp;diff=28476</id>
		<title>File:Logic base1 counter.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:Logic_base1_counter.png&amp;diff=28476"/>
				<updated>2019-08-11T19:01:15Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Train counter for SRNW&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Train counter for SRNW&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_331_-_340&amp;diff=28475</id>
		<title>PublicServer:Archive - Games 331 - 340</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_331_-_340&amp;diff=28475"/>
				<updated>2019-07-30T19:01:51Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: adding 333&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PublicServerArchiveMenu}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=333&lt;br /&gt;
|date= 17.05.19 - 30.07.19&lt;br /&gt;
|players= {{User|virtualrandomnumber}}, {{User|Hazzard}}, {{User|V453000}},  {{User|Arveen}},  {{User|tyteen}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=Various&lt;br /&gt;
|mapsize=256x256 Temperate&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=Tiny YETI map.&lt;br /&gt;
|imagedescription=todo}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=332&lt;br /&gt;
|date= xx.04.19 - 17.05.19&lt;br /&gt;
|players= {{User|virtualrandomnumber}}, {{User|Hazzard}}, {{User|V453000}},  {{User|Arveen}},  {{User|tyteen}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=3&lt;br /&gt;
|mapsize=512x512 Temperate&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=A fairly standard refit game using DB set and TL3 2x BR 182, where we managed to get almost 1800 trains running on the network.&lt;br /&gt;
|imagedescription=BBH 02, one of the places with biggest traffic.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=331&lt;br /&gt;
|date= 03.07.18 - xx.04.19&lt;br /&gt;
|players= {{User|bio}}, {{User|virtualrandomnumber}}, {{User|Jam35}}, {{User|eirc}}, {{User|Maraxus}}, {{User|Arveen}},  {{User|The_Saladman}}, {{User|codertux}}, {{User|dfceaef}}, {{User|Kolo}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=3&lt;br /&gt;
|mapsize=512x512 Temperate&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=Well, as the only survivor of this PSG (as V called it) I (Arveen) declare this the possibly longest PSG ever. Started during summer 2018 and ending in spring 2019 a lot of construction, expansion and redesign has been done. Massive hubs overgrown small cities and 14 people died during a train accident near Nadingham (RIP 14 passengers on a cargo train).&lt;br /&gt;
|imagedescription=We sure like symmetric stuff.}}&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Junctionary_-_Logic_and_Other&amp;diff=28474</id>
		<title>Junctionary - Logic and Other</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Junctionary_-_Logic_and_Other&amp;diff=28474"/>
				<updated>2019-07-24T00:32:56Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{JunctionaryLogicAndOtherMenu}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
It is hard to describe [[logic]] shortly since it's very purpose is to do something extra. This section lists mechanisms and thingies that usually control trains somehow, and thus improve how our network works. Although there are for sure cases that are completely useless like train counters.&lt;br /&gt;
&lt;br /&gt;
{{JunctionaryTableHeader|headline=Logic and other constructions &amp;lt;font size=&amp;quot;small&amp;quot;&amp;gt;([[Logic|what is that?]])}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|13/07/2008|[[Image:Lensort.jpg|center|140px|]]|Train Length Sorter|Sorts trains by their length. In this example trains longer than 5 cars (or 2 tiles)  will be sorted via the penalty, those of 5 cars or less through the non-penalty line. this is useful when trains of varying type use a station, and some platforms are shorter than others. It can also be used at junctions where there are two options of track, to move shorter trains onto a loop with tighter turns. Finally it may be used to seperate main line trains from local trains (assuming different train lengths). A local train may be forced onto a longer, slower loop to allow mainline trains to pass.|Audigex, original credit unknown.|}}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|16/12/2008|[[Image:psg121_MarkClock.png|center|140px|]]|Advanced Timer|An advanced timer which works with a certain cycle. Once the dummy train finishes the cycle, a train is released by the timer. However this has one crucial condition - if a train overflows, the whole cycle is cancelled and the counting starts again.|{{User|Mark}}|{{PublicServerGameSave|121}} }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg131_Compressor.png|center|140px|]]|'''Train packing'''|The so called compressor. Waits until a few trains are ready to go and then releases them very close together, allowing trains further down the line join. |{{User|Mark}}|{{PublicServerGameSave|131}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg180_flipflop.png|center|140px|]]|'''Flipflop'''|A typical flipflop splitting trains into 6 directions equally. |{{User|V453000}}|{{PublicServerGameSave|180}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg196_counter.png|center|140px|]]|'''Counter'''|A mechanism which counts how many trains have passed a certain spot. Completely useless for the network. |{{User|HDIEagle}}|{{PublicServerGameSave|196}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg200_comparer.png|center|140px|]]|'''Counter/comparer'''|This array of stations had a special overflow which counted which station gets the least amount of trains and released trains to that. Therefore there are logic mechanisms which count how many trains have passed (based on Mark's clock) and a mechanism which says which station had gotten X trains as the last one. |{{User|V453000}}|{{PublicServerGameSave|200}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg203_sparta.png|center|140px|]]|'''Long train abuse'''|This mechanism is meant to pack looong trains in just 3x3. It is very slow due to the effective more than 1xTL signal gap. |{{User|V453000}}|{{PublicServerGameSave|203}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg224_flipflop.png|center|140px|]]|'''Flipflop without memory''' (SR-NOR latch)|A very interesting way how to make a flipflop without memories, using the NOT gates swap their states. Unfortunately (probably) only usable for 1:1 split. |{{User|mfb}}|{{PublicServerGameSave|224}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|16.10.12|[[Image:psg245_split_to_N.png|center|140px|]]|'''Pathfinder-based Perfect N-way split'''|A split from 1 to N (here 7) tracks. Fairly easy to build, with full throughput and does not seem to break. |{{User|V453000}}|{{PublicServerGameSave|245}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|16.10.12|[[Image:3waysplit.png|center|140px|]]|'''Logic-based Perfect N-way split'''|A split from 1 to N (here 3) tracks. Fail-safe. |{{User|Hazzard}}|}}&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Junctionary_-_Logic_and_Other&amp;diff=28473</id>
		<title>Junctionary - Logic and Other</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Junctionary_-_Logic_and_Other&amp;diff=28473"/>
				<updated>2019-07-24T00:32:30Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{JunctionaryLogicAndOtherMenu}}&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
It is hard to describe [[logic]] shortly since it's very purpose is to do something extra. This section lists mechanisms and thingies that usually control trains somehow, and thus improve how our network works. Although there are for sure cases that are completely useless like train counters.&lt;br /&gt;
&lt;br /&gt;
{{JunctionaryTableHeader|headline=Logic and other constructions &amp;lt;font size=&amp;quot;small&amp;quot;&amp;gt;([[Logic|what is that?]])}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|13/07/2008|[[Image:Lensort.jpg|center|140px|]]|Train Length Sorter|Sorts trains by their length. In this example trains longer than 5 cars (or 2 tiles)  will be sorted via the penalty, those of 5 cars or less through the non-penalty line. this is useful when trains of varying type use a station, and some platforms are shorter than others. It can also be used at junctions where there are two options of track, to move shorter trains onto a loop with tighter turns. Finally it may be used to seperate main line trains from local trains (assuming different train lengths). A local train may be forced onto a longer, slower loop to allow mainline trains to pass.|Audigex, original credit unknown.|}}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|16/12/2008|[[Image:psg121_MarkClock.png|center|140px|]]|Advanced Timer|An advanced timer which works with a certain cycle. Once the dummy train finishes the cycle, a train is released by the timer. However this has one crucial condition - if a train overflows, the whole cycle is cancelled and the counting starts again.|{{User|Mark}}|{{PublicServerGameSave|121}} }}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg131_Compressor.png|center|140px|]]|'''Train packing'''|The so called compressor. Waits until a few trains are ready to go and then releases them very close together, allowing trains further down the line join. |{{User|Mark}}|{{PublicServerGameSave|131}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg180_flipflop.png|center|140px|]]|'''Flipflop'''|A typical flipflop splitting trains into 6 directions equally. |{{User|V453000}}|{{PublicServerGameSave|180}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg196_counter.png|center|140px|]]|'''Counter'''|A mechanism which counts how many trains have passed a certain spot. Completely useless for the network. |{{User|HDIEagle}}|{{PublicServerGameSave|196}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg200_comparer.png|center|140px|]]|'''Counter/comparer'''|This array of stations had a special overflow which counted which station gets the least amount of trains and released trains to that. Therefore there are logic mechanisms which count how many trains have passed (based on Mark's clock) and a mechanism which says which station had gotten X trains as the last one. |{{User|V453000}}|{{PublicServerGameSave|200}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg203_sparta.png|center|140px|]]|'''Long train abuse'''|This mechanism is meant to pack looong trains in just 3x3. It is very slow due to the effective more than 1xTL signal gap. |{{User|V453000}}|{{PublicServerGameSave|203}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|11.01.11|[[Image:psg224_flipflop.png|center|140px|]]|'''Flipflop without memory''' (SR-NOR latch)|A very interesting way how to make a flipflop without memories, using the NOT gates swap their states. Unfortunately (probably) only usable for 1:1 split. |{{User|mfb}}|{{PublicServerGameSave|224}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|16.10.12|[[Image:psg245_split_to_N.png|center|140px|]]|'''Pathfinder-based Perfect N-way split'''|A split from 1 to N (here 7) tracks. Fairly easy to build, with full throughput and does not seem to break. |{{User|V453000}}|{{PublicServerGameSave|245}} }}&lt;br /&gt;
&lt;br /&gt;
{{Junctionary|16.10.12|[[Image:3waysplit.png|center|140px|]]|'''Logic-based Perfect N-way split'''|A split from 1 to N (here 3) tracks. Fail-safe. |{{User|Hazzard}} }}&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:Line_hierarchy.PNG&amp;diff=28471</id>
		<title>File:Line hierarchy.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:Line_hierarchy.PNG&amp;diff=28471"/>
				<updated>2019-06-19T19:18:37Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Hazzard uploaded a new version of File:Line hierarchy.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_321_-_330&amp;diff=28467</id>
		<title>PublicServer:Archive - Games 321 - 330</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_321_-_330&amp;diff=28467"/>
				<updated>2019-05-18T05:08:12Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: fix psg 332 start date&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PublicServerArchiveMenu}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=332&lt;br /&gt;
|date= xx.04.19 - 17.05.19&lt;br /&gt;
|players= {{User|virtualrandomnumber}}, {{User|Hazzard}}, {{User|V453000}},  {{User|Arveen}},  {{User|tyteen}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=3&lt;br /&gt;
|mapsize=512x512 Temperate&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=A fairly standard refit game using DB set and TL3 2x BR 182, where we managed to get almost 1800 trains running on the network.&lt;br /&gt;
|imagedescription=BBH 02, one of the places with biggest traffic.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=331&lt;br /&gt;
|date= 03.07.18 - xx.04.19&lt;br /&gt;
|players= {{User|bio}}, {{User|virtualrandomnumber}}, {{User|Jam35}}, {{User|eirc}}, {{User|Maraxus}}, {{User|Arveen}},  {{User|The_Saladman}}, {{User|codertux}}, {{User|dfceaef}}, {{User|Kolo}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=3&lt;br /&gt;
|mapsize=512x512 Temperate&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=Well, as the only survivor of this PSG (as V called it) I (Arveen) declare this the possibly longest PSG ever. Started during summer 2018 and ending in spring 2019 a lot of construction, expansion and redesign has been done. Massive hubs overgrown small cities and 14 people died during a train accident near Nadingham (RIP 14 passengers on a cargo train).&lt;br /&gt;
|imagedescription=We sure like symmetric stuff.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=330&lt;br /&gt;
|date= 18.04.18 - 03.07.18&lt;br /&gt;
|players= {{User|Vinnie}}, {{User|AlphaSC}}, {{User|loeky}}, {{User|bio}}, {{User|virtualrandomnumber}}, {{User|V453000}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=3 &amp;amp; 5&lt;br /&gt;
|mapsize=512x256 Temperate&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=TL3 in the east vs TL5 in the west. See in-game plan for details :)&lt;br /&gt;
|imagedescription=Some rails here.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=329&lt;br /&gt;
|date= 28.12.17 - 17.04.18&lt;br /&gt;
|players= {{User|V453000}}, {{User|Mark}}, {{User|Jam35}}, {{User|Bio}},  {{User|Arveen}}, {{User|Loeky}}, {{User|AlphaSC}}&lt;br /&gt;
|type=Tropic&lt;br /&gt;
|TL= 2&lt;br /&gt;
|mapsize=512x512&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=As most FIRS games, a lot of planning is required to make the network construction go smoothly. We chose a plan where all of the engineering supplies would be distributed evenly to all primaries at a rate sufficient to make them reach maximum production. Only when they would all be at gung-ho and fully serviced, we would add more primaries. Turns out we only needed 2 primary industries of each type to cause massive traffic of 3430 slugs.&lt;br /&gt;
|imagedescription=The ES pickup, distributing ES evenly over all industries.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=328&lt;br /&gt;
|date= 23.10.17 - 28.12.17&lt;br /&gt;
|players= {{User|Loeky}}, {{User|Jam35}}, {{User|Deactivated}},  {{User|Arveen}}, {{User|John}}, {{User|V453000}}, {{User|Imutrainfolks}}, {{User|John}}, {{User|Mark}}&lt;br /&gt;
|type=Arctic&lt;br /&gt;
|TL= 5&lt;br /&gt;
|mapsize=512x256&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=Little arctic map to try out the awesome new BRIX. Original trainset's Lev3 Pegasus turned out to be tricky to work with on this small map. In the end we managed to have 750 trains running smoothly on a mostly LLL_RRR network.&lt;br /&gt;
|imagedescription=Boats, Trucks, and Trains}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=327&lt;br /&gt;
|date= 26.07.17 - 23.10.17&lt;br /&gt;
|players= {{User|Loeky}}, {{User|Jam35}}, {{User|Lejving}}, {{User|Maraxus}}, {{User|AzureSpeed|}}, {{User|Vinnie}}, {{User|Clockworker}}, {{User|Deactivated}},  {{User|Arveen}}&lt;br /&gt;
|type=Temperate&lt;br /&gt;
|TL= 3&lt;br /&gt;
|mapsize=512x512&lt;br /&gt;
|version=r27742 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=Another nice game.&lt;br /&gt;
|imagedescription=BBH 01}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=326&lt;br /&gt;
|date= 02.04.17 - 26.07.17&lt;br /&gt;
|players= {{User|Loeky}}, {{User|Jam35}}, {{User|Lejving}}, {{User|Maraxus}}, {{User|AzureSpeed|}}, {{User|Vinnie}}, {{User|Clockworker}}, {{User|Deactivated}},  {{User|Arveen}}&lt;br /&gt;
|type=Toyland&lt;br /&gt;
|TL= 2&lt;br /&gt;
|mapsize=256x256&lt;br /&gt;
|version=r27742 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description= A game to welcome BRIX 0.0.1. People built and kept expanding over months which lead the game to end with many trains.&lt;br /&gt;
|imagedescription=BRIX apparently doesn't stop people from building a lot of trains.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=325&lt;br /&gt;
|date= 30.01.17 - 02.04.17&lt;br /&gt;
|players= {{User|Jam35}}, {{User|Lejving}}, {{User|Maraxus}}, {{User|AzureSpeed|}}, {{User|Vinnie}}, {{User|Clockworker}}, {{User|Deactivated}}, {{User|Loeky}}&lt;br /&gt;
|type=YETI game utilizing PURR Barcode&lt;br /&gt;
|TL= 5&lt;br /&gt;
|mapsize=256x512&lt;br /&gt;
|version=r27742 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description= A nice game making use of the PURR/MEOW magic for conditional orders on a whole-map scale. Even though this game didn't grow to it's full potential, the system works quite nicely.&lt;br /&gt;
|imagedescription=A pickup station with 6 different colour patterns for 6 different outputs.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=324&lt;br /&gt;
|date= 14.01.17 - 30.01.17&lt;br /&gt;
|players={{User|V453000}}, {{User|Lejving}},  {{User|absolutis}}, {{User|zxbiohazardzx}}, {{User|Jam35}}, {{User|Maraxus}}, {{User|happpy}}, {{User|TheRisen}}, {{User|AzureSpeed|}}, {{User|mari_kari|}}&lt;br /&gt;
|type=Standard cargo in Toyland&lt;br /&gt;
|TL= 5&lt;br /&gt;
|mapsize=512x512&lt;br /&gt;
|version=r27680 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description= There was initially three plans which none of them felt just right, so V453000 took the best part of them all and created the winning plan. The games glory piece was the really big HELL secondary station {{User|V453000}} created, one of the biggest in PSG history. To add further to this we had a nice LLLL_RRRR system going with many good and creative MSHs which the CL 1,5 can take some credit for. Game ended with 2000 trains, capped Fizzy Drinks factory (9180), 8 lane hell and 8 lane drop!&lt;br /&gt;
|imagedescription=HELL!}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=323&lt;br /&gt;
|date= 04.01.17 - 14.01.17&lt;br /&gt;
|players={{User|V453000}}, {{User|Lejving}},  {{User|absolutis}}, {{User|zxbiohazardzx}}, {{User|Jam35}}, {{User|Maraxus}}, {{User|Cornelius}}, {{User|TheRisen}}, {{User|Mark}}&lt;br /&gt;
|type=Cargo Refit&lt;br /&gt;
|TL= 3&lt;br /&gt;
|mapsize=1024 x 256&lt;br /&gt;
|version=r27680 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description= A simple 'snake' style network with refitting at each end and return stuff to SL drop. We got to 5 lines end to end and 2600+ trains before getting some laggy connections. Game ended slightly prematurely but still a nice game.&lt;br /&gt;
|imagedescription=Unfinished in the end but still impressive.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=322&lt;br /&gt;
|date= 27.12.16 - 04.01.17&lt;br /&gt;
|players={{User|Jam35}}, {{User|Lejving}}, {{User|zxbiohazardzx}}, {{User|V453000}}, {{User|Techinica}}, {{User|Deactivated}}, {{User|fleet75}}, {{User|TheRisen}}&lt;br /&gt;
|type=Simplified YETI&lt;br /&gt;
|TL= n/a (Many different)&lt;br /&gt;
|mapsize=256x512 Sub-arctic&lt;br /&gt;
|version=r27680 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=An easygoing and short game for the end of 2016. Plan was chaos mode, so we utilized all modes of transportation (planes, ships, trains, rvs, trams). Happy new year!&lt;br /&gt;
|imagedescription=Station with nearly all modes of transportation}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=321&lt;br /&gt;
|date=04.12.16 - 27.12.16&lt;br /&gt;
|players={{User|Jam35}}, {{User|Lejving}}, {{User|zxbiohazardzx}}, {{User|lol}}, {{User|Techinica}}, {{User|Maraxus}}, {{User|Ethereal}}, {{User|mari}}, {{User|happpy}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL= 4 Maglev 'Get Heavy'&lt;br /&gt;
|mapsize=512x512 Arctic&lt;br /&gt;
|version=r27680 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=A cargo game with two drops for most primaries. It was hoped that this would give a balanced network overall with traffic spreading in all directions fairly evenly. This worked to a certain degree with everything needing expansion before returning to expand the same, busier areas again. Some areas ultimately ending with 5 lines .The game was getting hard for some to join so it was ended.&lt;br /&gt;
|imagedescription=MSH 04}}&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_321_-_330&amp;diff=28463</id>
		<title>PublicServer:Archive - Games 321 - 330</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_321_-_330&amp;diff=28463"/>
				<updated>2019-05-02T05:36:34Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PublicServerArchiveMenu}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=331&lt;br /&gt;
|date= 03.07.18 - xx.04.19&lt;br /&gt;
|players= {{User|bio}}, {{User|virtualrandomnumber}}, {{User|Jam35}}, {{User|eirc}}, {{User|Maraxus}}, {{User|Arveen}},  {{User|The_Saladman}}, {{User|codertux}}, {{User|dfceaef}}, {{User|Kolo}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=3&lt;br /&gt;
|mapsize=512x512 Temperate&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=Well, as the only survivor of this PSG (as V called it) I (Arveen) declare this the possibly longest PSG ever. Started during summer 2018 and ending in spring 2019 a lot of construction, expansion and redesign has been done. Massive hubs overgrown small cities and 14 people died during a train accident near Nadingham (RIP 14 passengers on a cargo train).&lt;br /&gt;
|imagedescription=We sure like symmetric stuff.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=330&lt;br /&gt;
|date= 18.04.18 - 03.07.18&lt;br /&gt;
|players= {{User|Vinnie}}, {{User|AlphaSC}}, {{User|loeky}}, {{User|bio}}, {{User|virtualrandomnumber}}, {{User|V453000}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=3 &amp;amp; 5&lt;br /&gt;
|mapsize=512x256 Temperate&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=TL3 in the east vs TL5 in the west. See in-game plan for details :)&lt;br /&gt;
|imagedescription=Some rails here.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=329&lt;br /&gt;
|date= 28.12.17 - 17.04.18&lt;br /&gt;
|players= {{User|V453000}}, {{User|Mark}}, {{User|Jam35}}, {{User|Bio}},  {{User|Arveen}}, {{User|Loeky}}, {{User|AlphaSC}}&lt;br /&gt;
|type=Tropic&lt;br /&gt;
|TL= 2&lt;br /&gt;
|mapsize=512x512&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=As most FIRS games, a lot of planning is required to make the network construction go smoothly. We chose a plan where all of the engineering supplies would be distributed evenly to all primaries at a rate sufficient to make them reach maximum production. Only when they would all be at gung-ho and fully serviced, we would add more primaries. Turns out we only needed 2 primary industries of each type to cause massive traffic of 3430 slugs.&lt;br /&gt;
|imagedescription=The ES pickup, distributing ES evenly over all industries.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=328&lt;br /&gt;
|date= 23.10.17 - 28.12.17&lt;br /&gt;
|players= {{User|Loeky}}, {{User|Jam35}}, {{User|Deactivated}},  {{User|Arveen}}, {{User|John}}, {{User|V453000}}, {{User|Imutrainfolks}}, {{User|John}}, {{User|Mark}}&lt;br /&gt;
|type=Arctic&lt;br /&gt;
|TL= 5&lt;br /&gt;
|mapsize=512x256&lt;br /&gt;
|version=r27951 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=Little arctic map to try out the awesome new BRIX. Original trainset's Lev3 Pegasus turned out to be tricky to work with on this small map. In the end we managed to have 750 trains running smoothly on a mostly LLL_RRR network.&lt;br /&gt;
|imagedescription=Boats, Trucks, and Trains}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=327&lt;br /&gt;
|date= 26.07.17 - 23.10.17&lt;br /&gt;
|players= {{User|Loeky}}, {{User|Jam35}}, {{User|Lejving}}, {{User|Maraxus}}, {{User|AzureSpeed|}}, {{User|Vinnie}}, {{User|Clockworker}}, {{User|Deactivated}},  {{User|Arveen}}&lt;br /&gt;
|type=Temperate&lt;br /&gt;
|TL= 3&lt;br /&gt;
|mapsize=512x512&lt;br /&gt;
|version=r27742 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=Another nice game.&lt;br /&gt;
|imagedescription=BBH 01}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=326&lt;br /&gt;
|date= 02.04.17 - 26.07.17&lt;br /&gt;
|players= {{User|Loeky}}, {{User|Jam35}}, {{User|Lejving}}, {{User|Maraxus}}, {{User|AzureSpeed|}}, {{User|Vinnie}}, {{User|Clockworker}}, {{User|Deactivated}},  {{User|Arveen}}&lt;br /&gt;
|type=Toyland&lt;br /&gt;
|TL= 2&lt;br /&gt;
|mapsize=256x256&lt;br /&gt;
|version=r27742 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description= A game to welcome BRIX 0.0.1. People built and kept expanding over months which lead the game to end with many trains.&lt;br /&gt;
|imagedescription=BRIX apparently doesn't stop people from building a lot of trains.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=325&lt;br /&gt;
|date= 30.01.17 - 02.04.17&lt;br /&gt;
|players= {{User|Jam35}}, {{User|Lejving}}, {{User|Maraxus}}, {{User|AzureSpeed|}}, {{User|Vinnie}}, {{User|Clockworker}}, {{User|Deactivated}}, {{User|Loeky}}&lt;br /&gt;
|type=YETI game utilizing PURR Barcode&lt;br /&gt;
|TL= 5&lt;br /&gt;
|mapsize=256x512&lt;br /&gt;
|version=r27742 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description= A nice game making use of the PURR/MEOW magic for conditional orders on a whole-map scale. Even though this game didn't grow to it's full potential, the system works quite nicely.&lt;br /&gt;
|imagedescription=A pickup station with 6 different colour patterns for 6 different outputs.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=324&lt;br /&gt;
|date= 14.01.17 - 30.01.17&lt;br /&gt;
|players={{User|V453000}}, {{User|Lejving}},  {{User|absolutis}}, {{User|zxbiohazardzx}}, {{User|Jam35}}, {{User|Maraxus}}, {{User|happpy}}, {{User|TheRisen}}, {{User|AzureSpeed|}}, {{User|mari_kari|}}&lt;br /&gt;
|type=Standard cargo in Toyland&lt;br /&gt;
|TL= 5&lt;br /&gt;
|mapsize=512x512&lt;br /&gt;
|version=r27680 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description= There was initially three plans which none of them felt just right, so V453000 took the best part of them all and created the winning plan. The games glory piece was the really big HELL secondary station {{User|V453000}} created, one of the biggest in PSG history. To add further to this we had a nice LLLL_RRRR system going with many good and creative MSHs which the CL 1,5 can take some credit for. Game ended with 2000 trains, capped Fizzy Drinks factory (9180), 8 lane hell and 8 lane drop!&lt;br /&gt;
|imagedescription=HELL!}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=323&lt;br /&gt;
|date= 04.01.17 - 14.01.17&lt;br /&gt;
|players={{User|V453000}}, {{User|Lejving}},  {{User|absolutis}}, {{User|zxbiohazardzx}}, {{User|Jam35}}, {{User|Maraxus}}, {{User|Cornelius}}, {{User|TheRisen}}, {{User|Mark}}&lt;br /&gt;
|type=Cargo Refit&lt;br /&gt;
|TL= 3&lt;br /&gt;
|mapsize=1024 x 256&lt;br /&gt;
|version=r27680 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description= A simple 'snake' style network with refitting at each end and return stuff to SL drop. We got to 5 lines end to end and 2600+ trains before getting some laggy connections. Game ended slightly prematurely but still a nice game.&lt;br /&gt;
|imagedescription=Unfinished in the end but still impressive.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=322&lt;br /&gt;
|date= 27.12.16 - 04.01.17&lt;br /&gt;
|players={{User|Jam35}}, {{User|Lejving}}, {{User|zxbiohazardzx}}, {{User|V453000}}, {{User|Techinica}}, {{User|Deactivated}}, {{User|fleet75}}, {{User|TheRisen}}&lt;br /&gt;
|type=Simplified YETI&lt;br /&gt;
|TL= n/a (Many different)&lt;br /&gt;
|mapsize=256x512 Sub-arctic&lt;br /&gt;
|version=r27680 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=An easygoing and short game for the end of 2016. Plan was chaos mode, so we utilized all modes of transportation (planes, ships, trains, rvs, trams). Happy new year!&lt;br /&gt;
|imagedescription=Station with nearly all modes of transportation}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=321&lt;br /&gt;
|date=04.12.16 - 27.12.16&lt;br /&gt;
|players={{User|Jam35}}, {{User|Lejving}}, {{User|zxbiohazardzx}}, {{User|lol}}, {{User|Techinica}}, {{User|Maraxus}}, {{User|Ethereal}}, {{User|mari}}, {{User|happpy}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL= 4 Maglev 'Get Heavy'&lt;br /&gt;
|mapsize=512x512 Arctic&lt;br /&gt;
|version=r27680 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=A cargo game with two drops for most primaries. It was hoped that this would give a balanced network overall with traffic spreading in all directions fairly evenly. This worked to a certain degree with everything needing expansion before returning to expand the same, busier areas again. Some areas ultimately ending with 5 lines .The game was getting hard for some to join so it was ended.&lt;br /&gt;
|imagedescription=MSH 04}}&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:PSG328.png&amp;diff=28462</id>
		<title>File:PSG328.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:PSG328.png&amp;diff=28462"/>
				<updated>2019-05-02T05:35:17Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Boats, Trucks, and Trains&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Boats, Trucks, and Trains&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:PSG327.png&amp;diff=28461</id>
		<title>File:PSG327.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:PSG327.png&amp;diff=28461"/>
				<updated>2019-05-02T05:29:45Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: BBH 01&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;BBH 01&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:3waysplit.png&amp;diff=28460</id>
		<title>File:3waysplit.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:3waysplit.png&amp;diff=28460"/>
				<updated>2019-04-28T11:00:26Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Hazzard uploaded a new version of File:3waysplit.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:3waysplit.png&amp;diff=28459</id>
		<title>File:3waysplit.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:3waysplit.png&amp;diff=28459"/>
				<updated>2019-04-28T10:51:53Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Two-way_end_of_line&amp;diff=28447</id>
		<title>Two-way end of line</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Two-way_end_of_line&amp;diff=28447"/>
				<updated>2019-04-16T07:23:45Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: /* Station with overflow */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Two-way end of line ===&lt;br /&gt;
''Two-way end of line'' is a setting in OpenTTD that can be altered to create interesting train behaviour. By default it is off, but it is activated on every openttdcoop server.&lt;br /&gt;
A red two-way signal directs train to a different route if one is available. &lt;br /&gt;
&lt;br /&gt;
''While used in combination with the default YAPF pathfinder, two-way signals have a weird and often misunderstood property. This property, called rail_firstred_twoway_eol, means that if the first encountered signal is a red two-way, that signal is considered a dead end. Now to understand the impact of this, one must first understand the basics of YAPF. In a nutshell: YAPF calculates all possible routes, called paths, from the train's current position. Each path is evaluated to a single score, determined by the length of the path, obstacles like stations, roads and hills, and upcoming red signals and of course the ability to reach the destination (station). The train then chooses the path with the lowest penalty score.&lt;br /&gt;
&lt;br /&gt;
Consider the train is on a junction and has multiple exit possibilities. The issue with red two-way signals is that if the first signal on a path is a red two-way, that path is not evaluated at all as it is considered a dead end. You could say that the path gets a penalty score of infinity. This also means that any other possible path, if it exists, is automatically better than the two-way path. Even if the other possibility is a trivial, detouring or outright useless path.&lt;br /&gt;
What this means in practice is:&lt;br /&gt;
* If all possible paths start with red two-way signals, the paths are considered equal and a choice is made without considering the network after the signals.&lt;br /&gt;
* If there is a single path not starting with a red two-way signal, that path is automatically chosen without considering the usefulness of the path itself.&lt;br /&gt;
Most important is that a choice is made without looking ahead at all. This includes checking if the chosen path actually leads to the desired destination. This can cause massive problems in our games, with trains detouring or even driving themselves into a station or actual dead end.&lt;br /&gt;
&lt;br /&gt;
Now is the EOL property a setting that can be changed. However, on our servers it is always on, as it gives trains the ability of free choice. If two different paths share a destination, but are considered by the pathfinder to be very unequal penalty-wise, with single signals a train might decide to take the path with the lowest penalty, even though that means waiting for a red light. With two-way signals this will never happen.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In short:&lt;br /&gt;
* Only use two-way signals when you understand their workings and use. Otherwise, use single signals.&lt;br /&gt;
* Only use two-way signals in situations where each path has the same destination but a possibly very unequal penalty, and where it is important for the train to make an indiscriminate choice. You can think of mergers and SLH joins. But please remember that you don't always have to use them. If you can avoid them, do so.&lt;br /&gt;
* Especially avoid two-way signals when not all of the exits are two-way, and not all paths lead to the same place. The most common error is combining a double bridging of a mainline with the exit of a track.&lt;br /&gt;
* The exception is of course for track that actually has to be two-way, like the signals next to platforms in terminus stations.&lt;br /&gt;
* Two-way signals can also legitimately be used in logic systems and the creation of priorities.''&lt;br /&gt;
&lt;br /&gt;
=== Pathfinder trap ===&lt;br /&gt;
The most use of this setting is found in our [[SRNW]] games, we control trains to either take an exit to the sideline or stay on the mainline. We also combine this signal with a certain station or shortcut to create pathfinder traps. Pathfinder traps give us options to trick trains, we can decrease the pathfinder penalties to an actual station and so create more balanced traffic or we can balance mainline mergers. There are occasions where the inner lane is preferred so much we will create a shortcut from each lane to the inner lane after a merger. We disable an exit with the pathfinder trap so the trains will not actually take this path and a merger gives us a balanced output. &lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
|| [[File:Pftrap.png|300px|thumb|center|Pathfinder trap in its raw form.]]&lt;br /&gt;
|| [[File:Pftraponmainline.png|300px|thumb|center|Pathfinder trap on mainline to create a shortcut that can never be used.]]&lt;br /&gt;
|}&lt;br /&gt;
=== Station with overflow ===&lt;br /&gt;
[[Overflow|Full article]]&lt;br /&gt;
&lt;br /&gt;
In our games we often use overflows and this setting can help us create easy to implement overflows for our primaries. One example of this is found in the picture below.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
|| [[File:Overflow primary.png|300px|thumb|center|Overflow on the a primary with reverser arrows.]]&lt;br /&gt;
|| [[File:TerminusPrimary.png|300px|thumb|right|Arrows on a primary station]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the picture you can see the “ arrow” in the reverser. It is not eye-candy it actually has a use. The pathfinder sees that the other tracks are blocked and considers the reverser only a viable line if it has at least 2 options. This means we create a split in the reverser so the pathfinder thinks it has two options.&lt;br /&gt;
&lt;br /&gt;
Similarly we advise you to also use this arrow on every reverser, and in every terminus station with  pre-signals at the final X as seen in picture below.  In theory only the track that has a straight line to the exit track should have one, but we still prefer using them on all platforms for a terminus station.&lt;br /&gt;
&lt;br /&gt;
=== Setting up two-way end of line ===&lt;br /&gt;
To setup this behaviour in your own game you can do this in two ways: We at openttdcoop prefer you use the second way because it is permanent, stable and easier. &lt;br /&gt;
&lt;br /&gt;
*Either in game trough the console command accessible with the “~”  key. Follow this by sending the following command:&lt;br /&gt;
“set yapf.rail_firstred_twoway_eol 1”&lt;br /&gt;
*The second way of changing this setting is by editing your openttd config file. And please do this when the game is closed. The location of this file is a question Google has an answer to. In here you find the line “yapf.rail_firstred_twoway_eol = false” and change it to “yapf.rail_firstred_twoway_eol = true” Follow this by saving and closing the config file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;br /&gt;
[[Category:Advanced Networking]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Talk:Line_sync&amp;diff=28446</id>
		<title>Talk:Line sync</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Talk:Line_sync&amp;diff=28446"/>
				<updated>2019-04-16T06:46:24Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
The X-Sync picture has tracks of different lengths before and after the X in the bridges version.  There are 6 straight squares before the X and 5 after. Does this matter?  I think it will matter if trains are very closely spaced.  It also lacks signalling for the second half; block signals before the X make the 2 bridges after the X just one block, which can't be right.  If you replace the screenshot, please don't use electric rails, they're confusing to look at. [[User:Eekee|Eekee]] ([[User talk:Eekee|talk]]) 19:49, 13 March 2019 (UTC)&lt;br /&gt;
&lt;br /&gt;
:It is synced; the different straight lengths do not matter. However it is also not signals so of course it would not work at all. You'd need path signals where the current two signals are because (as you mentioned) they are the same block. Or you could shorten the bridge to fit in block signals before the bridges. And of course it needs block signals filling in the empty spaces on both ends. [[User:Hazzard|Hazzard]] ([[User talk:Hazzard|talk]]) 06:46, 16 April 2019 (UTC)&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:PSG291.png&amp;diff=27930</id>
		<title>File:PSG291.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:PSG291.png&amp;diff=27930"/>
				<updated>2015-01-19T22:56:59Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: BBH 01&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;BBH 01&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_291_-_300&amp;diff=27929</id>
		<title>PublicServer:Archive - Games 291 - 300</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_291_-_300&amp;diff=27929"/>
				<updated>2015-01-19T22:56:06Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: Created page with &amp;quot;{{PublicServerArchiveMenu}}  {{Archive PublicServer |id=291 |date=13.12.14-19.01.15 |players={{User|V453000}}, {{User|Sylf}}, {{User|bio}}, {{User|Jam35}}, {{User|Hazzard}}, {{Us...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PublicServerArchiveMenu}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=291&lt;br /&gt;
|date=13.12.14-19.01.15&lt;br /&gt;
|players={{User|V453000}}, {{User|Sylf}}, {{User|bio}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|britboy3456}}, {{User|StarLite}}, {{User|mfb}}, {{User|glevans2}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL7&lt;br /&gt;
|mapsize=512 x 256 Sub-Artic&lt;br /&gt;
|version=r27018 [[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=A mountainous game with the default industries and TL7 slugs.&lt;br /&gt;
|imagedescription=BBH 01}}&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Template:PublicServerArchiveMenu&amp;diff=27928</id>
		<title>Template:PublicServerArchiveMenu</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Template:PublicServerArchiveMenu&amp;diff=27928"/>
				<updated>2015-01-19T22:48:32Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|class=&amp;quot;gamearchive_menu&amp;quot; cellpadding=&amp;quot;0&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive|Public Server Archive]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive|II]]'''&lt;br /&gt;
&amp;lt;!--|-&lt;br /&gt;
![[PublicServer:Archive_-_All_Games|List all Games]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_All_Games|II]]'''--&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Hall_of_Fame|Hall of Fame]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Hall_of_Fame|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_291_-_300|Games 291 - 300]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_291_-_300|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_281_-_290|Games 281 - 290]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_281_-_290|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_271_-_280|Games 271 - 280]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_271_-_280|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_261_-_270|Games 261 - 270]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_261_-_270|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_251_-_260|Games 251 - 260]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_251_-_260|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_241_-_250|Games 241 - 250]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_241_-_250|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_231_-_240|Games 231 - 240]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_231_-_240|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_221_-_230|Games 221 - 230]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_221_-_230|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_211_-_220|Games 211 - 220]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_211_-_220|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_201_-_210|Games 201 - 210]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_201_-_210|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_191_-_200|Games 191 - 200]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_191_-_200|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_181_-_190|Games 181 - 190]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_181_-_190|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_171_-_180|Games 171 - 180]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_171_-_180|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_161_-_170|Games 161 - 170]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_161_-_170|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_151_-_160|Games 151 - 160]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_151_-_160|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_141_-_150|Games 141 - 150]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_141_-_150|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_131_-_140|Games 131 - 140]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_131_-_140|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_121_-_130|Games 121 - 130]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_121_-_130|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_111_-_120|Games 111 - 120]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_111_-_120|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_101_-_110|Games 101 - 110]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_101_-_110|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_91_-_100|Games 091 - 100]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_91_-_100|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_81_-_90|Games 081 - 090]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_81_-_90|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_71_-_80|Games 071 - 080]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_71_-_80|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_61_-_70|Games 061 - 070]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_61_-_70|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_51_-_60|Games 051 - 060]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_51_-_60|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_41_-_50|Games 041 - 050]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_41_-_50|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_31_-_40|Games 031 - 040]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_31_-_40|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_21_-_30|Games 021 - 030]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_21_-_30|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_11_-_20|Games 011 - 020]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_11_-_20|II]]'''&lt;br /&gt;
|-&lt;br /&gt;
![[PublicServer:Archive_-_Games_01_-_10|Games 001 - 010]]&lt;br /&gt;
|width=&amp;quot;4px&amp;quot;|'''[[PublicServer:Archive_-_Games_01_-_10|II]]'''&lt;br /&gt;
|}&amp;lt;includeonly&amp;gt;[[Category:PublicServerArchive]]&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- Put it in the template Category !--&amp;gt;&lt;br /&gt;
[[Category:Templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_281_-_290&amp;diff=27927</id>
		<title>PublicServer:Archive - Games 281 - 290</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_281_-_290&amp;diff=27927"/>
				<updated>2015-01-19T22:45:55Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PublicServerArchiveMenu}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=290&lt;br /&gt;
|date=22.11.2014-13.12.14&lt;br /&gt;
|players={{User|Sylf}}, {{User|o11c}}, {{User|damalix}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|Maraxus}}, {{User|britboy3456}}, {{User|Vinnie}}, {{User|StarLite}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL3 (Cargo) &amp;amp; TL5 (PAX)&lt;br /&gt;
|mapsize=512 x 512 Sub-Tropical&lt;br /&gt;
|version=r27018[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=A game to try the new YETI, involving a chaos cargo network and single loop PAX network.&lt;br /&gt;
|imagedescription=The food factory drop &amp;amp; pickup}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=289&lt;br /&gt;
|date=9.11.2014-22.11.2014&lt;br /&gt;
|players={{User|Sylf}}, {{User|o11c}}, {{User|damalix}}, {{User|V435000}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|Maraxus}}, {{User|britboy3456}}, {{User|ChingMeiLee}}, {{User|Vinnie}}, {{User|StarLite}}, {{User|Djanxy}}&lt;br /&gt;
|type=PAX&lt;br /&gt;
|TL=TL5&lt;br /&gt;
|mapsize=512 x 512 Sub-Arctic&lt;br /&gt;
|version=r27018[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=This was supposed to be a quick passenger game to kill some time until the release of the next version of YETI, which we will use in PSG 290.  The game plan had two 1-way loops, both running in the same direction, connected at 4 locations.  If you thought this sounds like a very innocent plan, wait until you look at the game save.  This is the power of coop game style - we can make any simple game plan into a big fun.&lt;br /&gt;
|imagedescription=Insert screen shot here}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=288&lt;br /&gt;
|date=14.10.2014-9.11.2014&lt;br /&gt;
|players={{User|o11c}}, {{User|Sylf}}, {{User|V435000}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|bio}}, {{User|Maraxus}}, {{User|fleet75}}, {{User|damalix}}, {{User|Ivan_M}}, {{User|mfb}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL3&lt;br /&gt;
|mapsize=256 x 512 Sub-Arctic&lt;br /&gt;
|version=r27018[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=We tried the extra height levels in this map.  This game did not attract very many players.  The map is still far from being full at this point.&lt;br /&gt;
|imagedescription=Mount Hacks}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=287&lt;br /&gt;
|date=26.9.2014-14.10.2014&lt;br /&gt;
|players={{User|Sylf}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|bio}}, {{User|Maraxus}}, {{User|John}}, {{User|scshunt}}, {{User|Saladan0}}, {{User|Kernigh}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL3&lt;br /&gt;
|mapsize=512 x 512 Sub-Arctic&lt;br /&gt;
|version=r26830[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=This was a simple SRNW game with one twist.  The map was divided into six sections, servicing different cargo.  Overflow also worked as refit area.  The game did not pickup much interest from the users.  The game was abandoned after having about 1400 trains.&lt;br /&gt;
|imagedescription=New SRNW station with PBS based release mechanism}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=286&lt;br /&gt;
|date=15.9.2014-26.9.2014&lt;br /&gt;
|players={{User|Jam35}}, {{User|Sylf}}, {{User|Hazzard}}, {{User|V453000}}, {{User|bio}}, {{User|Maraxus}}, {{User|Djanxy}}, {{User|BallC}}, {{User|John}}, {{User|scshunt}}, {{User|o11c}}, {{User|Saladan0}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL3 &amp;amp; TL6&lt;br /&gt;
|mapsize=512 x 256 Sub-Arctic&lt;br /&gt;
|version=r26830[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=We started with a map with 8 large islands.  Using this landscape, we built two separate networks.  One is on the land, running TL3 trains, connecting the islands with bridges.  Second network was built with wet trains, built on the water, running TL6 boat trains.  With a mountainous nature of this map, it became difficult to expand quickly, so we ended the game quickly too.  We still ended the game with nearly 1100 running trains.&lt;br /&gt;
|imagedescription=Combined view of BBH 01 and BBH03.  After massive upgrades made by players, these hubs look quite impressive compared to their original constructions.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=285&lt;br /&gt;
|date=30.8.2014-15.9.2014&lt;br /&gt;
|players={{User|Sylf}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|bio}}, {{User|Maraxus}}, {{User|Djanxy}}, {{User|BallC}}, {{User|John}}, {{User|Chaz}}, {{User|scshunt}}, {{User|verm}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL4&lt;br /&gt;
|mapsize=512 x 256 Sub-Tropic&lt;br /&gt;
|version=r26720[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=This was a classic cargo game.  Simple network plan with innocent starting point of LL_RR mainlines.  What was not so innocent is the players' willingness to stretch the coop style playing.  When we finished the game, almost all of the mainlines were upgraded to LLL_RRR, supporting about 1050 trains.  This was a quite fun game.&lt;br /&gt;
|imagedescription=A view of SLH08, one of the spots that were painfully upgraded to LLL_RRR.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=284&lt;br /&gt;
|date=6.8.2014-30.8.2014&lt;br /&gt;
|players={{User|V453000}}, {{User|Jam35}}, {{User|Sylf}}, {{User|Hazzard}}, {{User|bio}}, {{User|Maraxus}}, {{User|Generalcamo}}, {{User|avdg}}, {{User|mfb}}, {{User|Vinnie}}, {{User|Sassafrass}}&lt;br /&gt;
|type=Cargo (YETI)&lt;br /&gt;
|TL=TL14&lt;br /&gt;
|mapsize=512 x 512 Toyland&lt;br /&gt;
|version=r26720[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=This game was played on toyland map, but that wasn't the point of this game.  This was a YETI game, with refit, and with 14 tile long trains!  Combine that with starting ML of LLL_RRR, we had some monster hubs from the start of the game.  Those monster hubs made it difficult to upgrade the MLs, but there still were some nice stuff to look at on this map.&lt;br /&gt;
|imagedescription=An excellent example of an invisible hub. A whole host of complex stuff is made invisible by these bridges.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=283&lt;br /&gt;
|date=29.7.2014-6.8.2014&lt;br /&gt;
|players={{User|V453000}}, {{User|Jam35}}, {{User|Sylf}}, {{User|Hazzard}}, {{User|bio}}, {{User|nicfer}}, {{User|Maraxus}}, {{User|Syl59}}, {{User|Abacus}}, {{User|Generalcamo}}, {{User|LoPo}}, {{User|XeryusTC}}&lt;br /&gt;
|type=Pax&lt;br /&gt;
|TL=TL10&lt;br /&gt;
|mapsize=512 x 512 Temperate&lt;br /&gt;
|version=r26720[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=We started this game, wanting to test the NUTS monorail intercity trains that got new stats recently.  Having only 4 main stations on the map, SBahns for all those files grew quite large.  We have some nice looking towns on this map.  In the end, we learned that the new monorail intercities are too powerful compared to the rest of the trains in the set.&lt;br /&gt;
|imagedescription=A typical main station on this map.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=282&lt;br /&gt;
|date=21.7.2014-29.7.2014&lt;br /&gt;
|players={{User|V453000}}, {{User|Jam35}}, {{User|Sylf}}, {{User|Hazzard}}, {{User|bio}}, {{User|nicfer}}, {{User|Maraxus}}, {{User|Syl59}}&lt;br /&gt;
|type=Cargo (YETI)&lt;br /&gt;
|TL=TL4 ML, mixed local&lt;br /&gt;
|mapsize=512 x 256 Temperate&lt;br /&gt;
|version=r26650[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=With YETI Extended Towns and Industries set maturing fast, we tried a new game with this set.  We played a nice and quick, but fully developed game.&lt;br /&gt;
|imagedescription=YETI mayhem area#1 - SLH01.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=281&lt;br /&gt;
|date=5.7.2014-13.7.2014&lt;br /&gt;
|players={{User|V453000}}, {{User|Jam35}}, {{User|Sylf}}, {{User|Absolutis}}, {{User|Hazzard}}, {{User|bio}}, {{User|Intexon}}, {{User|LoPo}}, {{User|Mark}}, {{User|Maraxus}}, {{User|Yhag}}, {{User|nicfer}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL5&lt;br /&gt;
|mapsize=512 x 512 Temperate&lt;br /&gt;
|version=r26650[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=A quick that started in 1900, upgrading the engines as we played, with a goal of ending the game with Brainmelters everywhere.&lt;br /&gt;
|imagedescription=A WTF coal drop station by V453000}}&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_281_-_290&amp;diff=27926</id>
		<title>PublicServer:Archive - Games 281 - 290</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=PublicServer:Archive_-_Games_281_-_290&amp;diff=27926"/>
				<updated>2015-01-19T22:45:06Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{PublicServerArchiveMenu}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=290&lt;br /&gt;
|date=22.11.2014-13.12.14&lt;br /&gt;
|players={{User|Sylf}}, {{User|o11c}}, {{User|damalix}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|Maraxus}}, {{User|britboy3456}}, {{User|Vinnie}}, {{User|StarLite}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL3 (Cargo) &amp;amp; TL5 (PAX)&lt;br /&gt;
|mapsize=512 x 512 Sub-Tropical&lt;br /&gt;
|version=r27018[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=A game to try the new YETI, involving a chaos cargo network and single loop PAX network.&lt;br /&gt;
|imagedescription=Insert screen shot here}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=289&lt;br /&gt;
|date=9.11.2014-22.11.2014&lt;br /&gt;
|players={{User|Sylf}}, {{User|o11c}}, {{User|damalix}}, {{User|V435000}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|Maraxus}}, {{User|britboy3456}}, {{User|ChingMeiLee}}, {{User|Vinnie}}, {{User|StarLite}}, {{User|Djanxy}}&lt;br /&gt;
|type=PAX&lt;br /&gt;
|TL=TL5&lt;br /&gt;
|mapsize=512 x 512 Sub-Arctic&lt;br /&gt;
|version=r27018[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=This was supposed to be a quick passenger game to kill some time until the release of the next version of YETI, which we will use in PSG 290.  The game plan had two 1-way loops, both running in the same direction, connected at 4 locations.  If you thought this sounds like a very innocent plan, wait until you look at the game save.  This is the power of coop game style - we can make any simple game plan into a big fun.&lt;br /&gt;
|imagedescription=Insert screen shot here}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=288&lt;br /&gt;
|date=14.10.2014-9.11.2014&lt;br /&gt;
|players={{User|o11c}}, {{User|Sylf}}, {{User|V435000}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|bio}}, {{User|Maraxus}}, {{User|fleet75}}, {{User|damalix}}, {{User|Ivan_M}}, {{User|mfb}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL3&lt;br /&gt;
|mapsize=256 x 512 Sub-Arctic&lt;br /&gt;
|version=r27018[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=We tried the extra height levels in this map.  This game did not attract very many players.  The map is still far from being full at this point.&lt;br /&gt;
|imagedescription=Mount Hacks}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=287&lt;br /&gt;
|date=26.9.2014-14.10.2014&lt;br /&gt;
|players={{User|Sylf}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|bio}}, {{User|Maraxus}}, {{User|John}}, {{User|scshunt}}, {{User|Saladan0}}, {{User|Kernigh}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL3&lt;br /&gt;
|mapsize=512 x 512 Sub-Arctic&lt;br /&gt;
|version=r26830[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=This was a simple SRNW game with one twist.  The map was divided into six sections, servicing different cargo.  Overflow also worked as refit area.  The game did not pickup much interest from the users.  The game was abandoned after having about 1400 trains.&lt;br /&gt;
|imagedescription=New SRNW station with PBS based release mechanism}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=286&lt;br /&gt;
|date=15.9.2014-26.9.2014&lt;br /&gt;
|players={{User|Jam35}}, {{User|Sylf}}, {{User|Hazzard}}, {{User|V453000}}, {{User|bio}}, {{User|Maraxus}}, {{User|Djanxy}}, {{User|BallC}}, {{User|John}}, {{User|scshunt}}, {{User|o11c}}, {{User|Saladan0}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL3 &amp;amp; TL6&lt;br /&gt;
|mapsize=512 x 256 Sub-Arctic&lt;br /&gt;
|version=r26830[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=We started with a map with 8 large islands.  Using this landscape, we built two separate networks.  One is on the land, running TL3 trains, connecting the islands with bridges.  Second network was built with wet trains, built on the water, running TL6 boat trains.  With a mountainous nature of this map, it became difficult to expand quickly, so we ended the game quickly too.  We still ended the game with nearly 1100 running trains.&lt;br /&gt;
|imagedescription=Combined view of BBH 01 and BBH03.  After massive upgrades made by players, these hubs look quite impressive compared to their original constructions.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=285&lt;br /&gt;
|date=30.8.2014-15.9.2014&lt;br /&gt;
|players={{User|Sylf}}, {{User|Jam35}}, {{User|Hazzard}}, {{User|bio}}, {{User|Maraxus}}, {{User|Djanxy}}, {{User|BallC}}, {{User|John}}, {{User|Chaz}}, {{User|scshunt}}, {{User|verm}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL4&lt;br /&gt;
|mapsize=512 x 256 Sub-Tropic&lt;br /&gt;
|version=r26720[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=This was a classic cargo game.  Simple network plan with innocent starting point of LL_RR mainlines.  What was not so innocent is the players' willingness to stretch the coop style playing.  When we finished the game, almost all of the mainlines were upgraded to LLL_RRR, supporting about 1050 trains.  This was a quite fun game.&lt;br /&gt;
|imagedescription=A view of SLH08, one of the spots that were painfully upgraded to LLL_RRR.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=284&lt;br /&gt;
|date=6.8.2014-30.8.2014&lt;br /&gt;
|players={{User|V453000}}, {{User|Jam35}}, {{User|Sylf}}, {{User|Hazzard}}, {{User|bio}}, {{User|Maraxus}}, {{User|Generalcamo}}, {{User|avdg}}, {{User|mfb}}, {{User|Vinnie}}, {{User|Sassafrass}}&lt;br /&gt;
|type=Cargo (YETI)&lt;br /&gt;
|TL=TL14&lt;br /&gt;
|mapsize=512 x 512 Toyland&lt;br /&gt;
|version=r26720[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=This game was played on toyland map, but that wasn't the point of this game.  This was a YETI game, with refit, and with 14 tile long trains!  Combine that with starting ML of LLL_RRR, we had some monster hubs from the start of the game.  Those monster hubs made it difficult to upgrade the MLs, but there still were some nice stuff to look at on this map.&lt;br /&gt;
|imagedescription=An excellent example of an invisible hub. A whole host of complex stuff is made invisible by these bridges.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=283&lt;br /&gt;
|date=29.7.2014-6.8.2014&lt;br /&gt;
|players={{User|V453000}}, {{User|Jam35}}, {{User|Sylf}}, {{User|Hazzard}}, {{User|bio}}, {{User|nicfer}}, {{User|Maraxus}}, {{User|Syl59}}, {{User|Abacus}}, {{User|Generalcamo}}, {{User|LoPo}}, {{User|XeryusTC}}&lt;br /&gt;
|type=Pax&lt;br /&gt;
|TL=TL10&lt;br /&gt;
|mapsize=512 x 512 Temperate&lt;br /&gt;
|version=r26720[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=We started this game, wanting to test the NUTS monorail intercity trains that got new stats recently.  Having only 4 main stations on the map, SBahns for all those files grew quite large.  We have some nice looking towns on this map.  In the end, we learned that the new monorail intercities are too powerful compared to the rest of the trains in the set.&lt;br /&gt;
|imagedescription=A typical main station on this map.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=282&lt;br /&gt;
|date=21.7.2014-29.7.2014&lt;br /&gt;
|players={{User|V453000}}, {{User|Jam35}}, {{User|Sylf}}, {{User|Hazzard}}, {{User|bio}}, {{User|nicfer}}, {{User|Maraxus}}, {{User|Syl59}}&lt;br /&gt;
|type=Cargo (YETI)&lt;br /&gt;
|TL=TL4 ML, mixed local&lt;br /&gt;
|mapsize=512 x 256 Temperate&lt;br /&gt;
|version=r26650[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=With YETI Extended Towns and Industries set maturing fast, we tried a new game with this set.  We played a nice and quick, but fully developed game.&lt;br /&gt;
|imagedescription=YETI mayhem area#1 - SLH01.}}&lt;br /&gt;
&lt;br /&gt;
{{Archive PublicServer&lt;br /&gt;
|id=281&lt;br /&gt;
|date=5.7.2014-13.7.2014&lt;br /&gt;
|players={{User|V453000}}, {{User|Jam35}}, {{User|Sylf}}, {{User|Absolutis}}, {{User|Hazzard}}, {{User|bio}}, {{User|Intexon}}, {{User|LoPo}}, {{User|Mark}}, {{User|Maraxus}}, {{User|Yhag}}, {{User|nicfer}}&lt;br /&gt;
|type=Cargo&lt;br /&gt;
|TL=TL5&lt;br /&gt;
|mapsize=512 x 512 Temperate&lt;br /&gt;
|version=r26650[[GRF|#openttdcoop-GRF-Pack 8.0]]&lt;br /&gt;
|description=A quick that started in 1900, upgrading the engines as we played, with a goal of ending the game with Brainmelters everywhere.&lt;br /&gt;
|imagedescription=A WTF coal drop station by V453000}}&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=File:PSG290.png&amp;diff=27925</id>
		<title>File:PSG290.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=File:PSG290.png&amp;diff=27925"/>
				<updated>2015-01-19T22:42:32Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: The food station in PSG 290&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The food station in PSG 290&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Wiki/Server_Administration&amp;diff=27913</id>
		<title>Wiki/Server Administration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Wiki/Server_Administration&amp;diff=27913"/>
				<updated>2014-10-30T04:53:29Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{obsolete}}&lt;br /&gt;
{{Merge |Server Administration}}&lt;br /&gt;
&lt;br /&gt;
Updating the PS or PZ is actually quite straight forward. You just need ssh access and then execute a short list of commands (mind to call screen so that things are communicated):&lt;br /&gt;
 ssh &amp;lt;server&amp;gt;&lt;br /&gt;
 screen -x&lt;br /&gt;
 cd &amp;lt;dir&amp;gt; &lt;br /&gt;
 ./update -w&lt;br /&gt;
 cp -Rf bundle/* autopilot&lt;br /&gt;
where &amp;lt;dir&amp;gt; = [ svn-public | svn-prozone ] and &amp;lt;server&amp;gt; the server's IP&lt;br /&gt;
&lt;br /&gt;
Now change to the autopilot tab and close the server:&lt;br /&gt;
 save&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Restart the server:&lt;br /&gt;
 . /autopilot.tcl load | tee -a logs/&amp;lt;psgnr&amp;gt;&lt;br /&gt;
where &amp;lt;psgnr&amp;gt; is the number of the currently running or to-be-started game.&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	<entry>
		<id>https://wiki.openttdcoop.org/index.php?title=Server_Administration&amp;diff=27912</id>
		<title>Server Administration</title>
		<link rel="alternate" type="text/html" href="https://wiki.openttdcoop.org/index.php?title=Server_Administration&amp;diff=27912"/>
				<updated>2014-10-30T04:53:17Z</updated>
		
		<summary type="html">&lt;p&gt;Hazzard: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{obsolete}}&lt;br /&gt;
{{Merge |Wiki/Server Administration}}&lt;br /&gt;
&lt;br /&gt;
On this page all the needed commands are shown to administrate a Server via SSH and especially those for administrating the #openttdcoop Servers&lt;br /&gt;
&lt;br /&gt;
=== Servers / Directories ===&lt;br /&gt;
====ps.openttdcoop.org====&lt;br /&gt;
* 3979 - [[Public Server]]: '''~/svn-publicserver/autopilot/'''&lt;br /&gt;
* 0000 - [[Special Server]]: '''~/svn-special/autopilot''' (inactive)&lt;br /&gt;
* 0000 - [[Pro Dev Server]]: '''~/svn-dev/autopilot/''' (inactive)&lt;br /&gt;
* 3982 - [[ProZone]]: '''~/svn-prozone/autopilot/'''&lt;br /&gt;
* 3999 - [[StableServer]] '''~/svn-stable/autopilot/'''&lt;br /&gt;
&lt;br /&gt;
====mz.openttdcoop.org====&lt;br /&gt;
* 3979 - [[WWOTTDGD]]: '''~/svn-wwottdgd/autopilot/''' (inactive)&lt;br /&gt;
* 3979 - [[YACD]]: ''' ~/svn-yacd/autopilot/'''&lt;br /&gt;
* 3980 - [[Member Zone]]: '''~/svn-member/autopilot/''' (inactive)&lt;br /&gt;
* 3981 - [[dev server]]: '''~/svn-play-is/autopilot/'''&lt;br /&gt;
* 3982 - [[coopetition server]]: '''~/svn-h2h/autopilot/'''&lt;br /&gt;
* 3999 - [[StableServer]] '''~/svn-stable/autopilot/'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Check internal member board for access infos.&lt;br /&gt;
&lt;br /&gt;
=== Connecting to the server ===&lt;br /&gt;
* Connect to the server with ssh&lt;br /&gt;
* Issue command screen -x &lt;br /&gt;
* Issue quit -&amp;gt; ends game without saving&lt;br /&gt;
* Issue exit -&amp;gt; ends game with save&lt;br /&gt;
&lt;br /&gt;
=== Starting the Server (via autopilot) ===&lt;br /&gt;
* Start a new game: ./autopilot.tcl new | tee logs/&amp;lt;gamenr&amp;gt;.log&lt;br /&gt;
* Load the default savegame (save/game.sav): ./autopilot.tcl load | tee logs/&amp;lt;gamenr&amp;gt;.log&lt;br /&gt;
* Load another savegame: ./autopilot.tcl load save/game/path.sav | tee logs/&amp;lt;gamenr&amp;gt;.log&lt;br /&gt;
&lt;br /&gt;
=== Reloading the Server (via console) ===&lt;br /&gt;
* configure settings with Progman's Config Tool&lt;br /&gt;
* save current game with '''save game$Number''' (Recommend to add a number, so you can find it better for archiving.)&lt;br /&gt;
* Reload server: '''newgame'''&lt;br /&gt;
&lt;br /&gt;
=== Editing the openttd.cfg ===&lt;br /&gt;
'''Common things should be edited with the Configuration Tool: http://openttdcoop.org/config/'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: xx-small;&amp;quot;&amp;gt;Before you start a new game, the config file has to be edited. Map-Size, diff_custom, [[GRF template for Administrators|NewGrfs]] and need to be set.&lt;br /&gt;
* To edit openttd.cfg via SSH you should use vim: '''vi openttd.cfg'''&lt;br /&gt;
* To search for a string change to search-mode with '''?''' and type your search string, with '''n''' you can jump to next result.&lt;br /&gt;
* To edit a value you have to change to the insert mode with '''i''', then you can edit the values&lt;br /&gt;
* To save and leave vim, leave any mode first with '''ESC''', and type ''':wq''' (: = command mode)&lt;br /&gt;
* To leave without saving type ''':q!'''&lt;br /&gt;
* Some values are a bit confusing, i.e. diff_custom, you can find details about this value on the [[openttd:Diff_custom|openttd.org wiki page]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To upload a file to the publicserver (usually a .sav), use http://ps.openttdcoop.org/public/config/files.php&lt;br /&gt;
&lt;br /&gt;
=== Updating the server ===&lt;br /&gt;
&lt;br /&gt;
Easy way via script (updates automatically to the last nightly):&lt;br /&gt;
* ./update&lt;br /&gt;
Patch the server, if needed (see below for details). Make sure the patches apply cleanly. Otherwise fix them or skip them.&lt;br /&gt;
* patch -p0 &amp;lt; nomod.diff&lt;br /&gt;
* patch -p0 &amp;lt; bb2.diff&lt;br /&gt;
* patch -p0 &amp;lt; magic_bulldozer.diff&lt;br /&gt;
* patch -p1 &amp;lt; patches/keepBlitterForDedicated.p1.diff&lt;br /&gt;
* make bundle&lt;br /&gt;
Did the compile work? If so, copy the files:&lt;br /&gt;
* cp -Rf bundle/* autopilot&lt;br /&gt;
* cd autopilot&lt;br /&gt;
* ./autopilot.tcl load | tee -a logs/&amp;lt;gamenr&amp;gt;.log&lt;br /&gt;
&lt;br /&gt;
====Manual update====&lt;br /&gt;
&lt;br /&gt;
* svn up rREV&lt;br /&gt;
check, if all files have updated without conflicts (prefix &amp;quot;C&amp;quot;), if there are lines with &amp;quot;C&amp;quot;:&lt;br /&gt;
* svn revert . -R and reapply the patches&lt;br /&gt;
on manual update, you need write the finger manually:&lt;br /&gt;
* ./update -w&lt;br /&gt;
&lt;br /&gt;
====Patching Server====&lt;br /&gt;
The update script did revert the server build to clean trunk, but maybe we need to patch our server:&lt;br /&gt;
the patches need to be multiplayer safe, no information can be saved in the savegame.  We store the patches in subfolder patches.&lt;br /&gt;
* nomod.diff: it does tell openttd to compile without adding &amp;quot;M&amp;quot; to the version&lt;br /&gt;
* bb2.diff: logging the docommands &lt;br /&gt;
* magic_bulldozer.diff: enables switch with rcon&lt;br /&gt;
&lt;br /&gt;
First, you apply one patch ('''patch -p0 &amp;lt; patch.diff'''), if there are no errors, you take the next, if there are errors, you revert the apply with -R ('''patch -Rp0 &amp;lt; patch.diff''') and ask the patch creator to update or try self. If all patches are applied, you need to remake: '''make bundle''' (no configure).&lt;br /&gt;
copy the bundle to autopilot: '''cp -Rf bundle/ autopilot/'''&lt;br /&gt;
&lt;br /&gt;
====Support for [[Autostart]] and other tools====&lt;br /&gt;
To support other tools to update client or homepage with current used revision etc., we need to have the following tags on our server:&lt;br /&gt;
* '''rev''': currently used SVN trunk revision&lt;br /&gt;
* '''grfversion''': currently used #openttdcoop NewGRF package version&lt;br /&gt;
* '''patch.url''': currently used patch (mostly for dev server, link to TT-Forums)&lt;br /&gt;
* '''$OS.url''': link to the binary (if it isn't a nightly)&lt;br /&gt;
&lt;br /&gt;
Those &amp;quot;Tags&amp;quot; are located in http://&amp;lt;server&amp;gt;/&amp;lt;port&amp;gt;/&lt;br /&gt;
They can be configured over the webconfigurator: config/urls.php&lt;br /&gt;
&lt;br /&gt;
=== Using rcon ===&lt;br /&gt;
Some values have to be change in runtime, you can do this really easy with Remote Connection in-game. If you are connected to the Server toggle the Console with '''^''' and use commands:&lt;br /&gt;
* To pause/unpause the game: '''rcon password pause/unpause'''&lt;br /&gt;
* To change a patch setting: '''rcon password &amp;quot;patch patch_setting value&amp;quot;''' (don't forget the quotation marks)&lt;br /&gt;
** To view a value of a setting: '''rcon password &amp;quot;patch patch_setting&amp;quot;'''&lt;br /&gt;
** Some settings use namespaces: i.e. '''&amp;quot;patch yapf.rail_use_yapf&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
=== Archiving a PublicServer Game===&lt;br /&gt;
If a game is done do the following step via IRC: !transfer &amp;lt;num&amp;gt; localsave.sav (might be game.sav)&lt;br /&gt;
then add a Report to the Wiki (if you don't have time, add at least the date and the used revision!)&lt;br /&gt;
&lt;br /&gt;
== Custom Server Commands ==&lt;br /&gt;
&lt;br /&gt;
===!content===&lt;br /&gt;
&lt;br /&gt;
Update the BaNaNaS content, needs !restart after to load the new NewGRFs&lt;br /&gt;
&lt;br /&gt;
===!gamenr===&lt;br /&gt;
&lt;br /&gt;
Sets the gamenr, needed for the logs and topic, run this before !restart&lt;br /&gt;
&lt;br /&gt;
===!restart===&lt;br /&gt;
&lt;br /&gt;
Restarts the server after update or for newgame&lt;br /&gt;
&lt;br /&gt;
[[Category:Guides]]&lt;/div&gt;</summary>
		<author><name>Hazzard</name></author>	</entry>

	</feed>