Allow railroad loops (#1274)

## Description:

This change enables loop formation in the station network, allowing for
enhanced connectivity. However, it can sometimes result in clustered
areas as a trade-off. To mitigate excessive clustering, loops are only
permitted when there are at least 5 intermediary stations between the
source and destination stations.


![image](https://github.com/user-attachments/assets/720fa4f9-a634-49e8-8027-fe4e244d5ae5)

Also a few fixes for `.dev` players.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [x] I have added relevant tests to the test directory
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors
This commit is contained in:
DevelopingTom
2025-06-27 22:00:11 +02:00
committed by GitHub
parent f905e29ec6
commit c1bf01d3ba
4 changed files with 54 additions and 6 deletions
+4 -1
View File
@@ -302,7 +302,7 @@ export class DefaultConfig implements Config {
return Math.min(50, Math.round(10 * Math.pow(numberOfPorts, 0.6)));
}
trainSpawnRate(numberOfStations: number): number {
return Math.round(50 * Math.pow(numberOfStations, 0.8));
return Math.min(1400, Math.round(60 * Math.pow(numberOfStations, 0.8)));
}
trainGold(): Gold {
return BigInt(10_000);
@@ -363,6 +363,7 @@ export class DefaultConfig implements Config {
territoryBound: true,
constructionDuration: this.instantBuild() ? 0 : 2 * 10,
upgradable: true,
canBuildTrainStation: true,
};
case UnitType.AtomBomb:
return {
@@ -452,6 +453,7 @@ export class DefaultConfig implements Config {
territoryBound: true,
constructionDuration: this.instantBuild() ? 0 : 2 * 10,
upgradable: true,
canBuildTrainStation: true,
};
case UnitType.Factory:
return {
@@ -466,6 +468,7 @@ export class DefaultConfig implements Config {
),
territoryBound: true,
constructionDuration: this.instantBuild() ? 0 : 2 * 10,
canBuildTrainStation: true,
};
case UnitType.Construction:
return {