[GS] MagicGS : Connects cities and towns by road
Posted: 15 Jul 2020 16:45
Hello,
I pressent you MagicGS, my first attempt of Game Script.
It will start at game start, and connect towns using this behaviour:
Step 1: Connect all city together.
Step 2: Connect each town to the nearest city.
Step 3: Connect each town to the nearest neighbor towns.
Parameters allow fine tune:
- Enable or disable each of the 3 steps
- Maximum distance and speed for city to city road
- Maximum distance and speed for city to town road
- Maximum distance and speed for town to town road, and maximum neighbor to connect
Known issues:
- RoadPathFinder from SuperLib is really really slow. I don't know much if I do something wrong, but even on a small map the towns takes several minutes to connect (on a big map, this cas spent several hours!). Good news, you can still play while the GS connects roads.
- RoadPathFinder from SuperLib produces many strange bridges when they are useless. I don't know how to fix that.
Why this GS?
I used to play with City Connector AI, but it has at least two drawbacks:
- it never stops. So after some decades, it builds again and again new roads between the same towns, producing a big mess. This GS will connect town only one time for all, whatever the road is buldozed.
- it is an AI. As a result, the roads belongs to a company... and this company won't let you building over its roads. This is very annoying when you are planning a new rail network and everything goes bad when some highway is built just where you planned to build you rails. With a GS, roads do not belong to anyone, so you can buldoze it as much as you want.
Change log:
Version 1
- Fix: When a connection is impossible, try to connect the next town in the destination list. This fix the problem when the nearest city/town is not reacheable (island, etc.)
- Add: Store already connected town, so don't try to connect them again (speed up connection time as it won't try to reconnect already connected town. Thus this is needed for save/load support)
- Add: Support for save/load and resume connection where it stopped
- Fix: For step 2 and step 3 we need complete list of destinations while for step 1 we reduce the destinations as we don't need to connect cities in the opposite direction
Version 2
- Add many parameters
- GS now use available roads (including NRT newgrf) according to the company "0" (first player in game)
- When a new town is founded it will connect it
- Fix: proper use of return value from path finder
I pressent you MagicGS, my first attempt of Game Script.
It will start at game start, and connect towns using this behaviour:
Step 1: Connect all city together.
Step 2: Connect each town to the nearest city.
Step 3: Connect each town to the nearest neighbor towns.
Parameters allow fine tune:
- Enable or disable each of the 3 steps
- Maximum distance and speed for city to city road
- Maximum distance and speed for city to town road
- Maximum distance and speed for town to town road, and maximum neighbor to connect
Known issues:
- RoadPathFinder from SuperLib is really really slow. I don't know much if I do something wrong, but even on a small map the towns takes several minutes to connect (on a big map, this cas spent several hours!). Good news, you can still play while the GS connects roads.
- RoadPathFinder from SuperLib produces many strange bridges when they are useless. I don't know how to fix that.
Why this GS?
I used to play with City Connector AI, but it has at least two drawbacks:
- it never stops. So after some decades, it builds again and again new roads between the same towns, producing a big mess. This GS will connect town only one time for all, whatever the road is buldozed.
- it is an AI. As a result, the roads belongs to a company... and this company won't let you building over its roads. This is very annoying when you are planning a new rail network and everything goes bad when some highway is built just where you planned to build you rails. With a GS, roads do not belong to anyone, so you can buldoze it as much as you want.
Change log:
Version 1
- Fix: When a connection is impossible, try to connect the next town in the destination list. This fix the problem when the nearest city/town is not reacheable (island, etc.)
- Add: Store already connected town, so don't try to connect them again (speed up connection time as it won't try to reconnect already connected town. Thus this is needed for save/load support)
- Add: Support for save/load and resume connection where it stopped
- Fix: For step 2 and step 3 we need complete list of destinations while for step 1 we reduce the destinations as we don't need to connect cities in the opposite direction
Version 2
- Add many parameters
- GS now use available roads (including NRT newgrf) according to the company "0" (first player in game)
- When a new town is founded it will connect it
- Fix: proper use of return value from path finder