Adjust train gold refill time and modify fare calculation logic

- Reduced the train gold refill time from 600 to 300 ticks for faster resource replenishment.
- Updated fare calculation to use a base length bonus and adjusted congestion fare logic, ensuring that only the net congestion premium is added to the fare.
This commit is contained in:
scamiv
2025-11-22 22:14:25 +01:00
parent ed67c0647d
commit 1907c61fb4
2 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -371,7 +371,7 @@ export class DefaultConfig implements Config {
}
trainGoldRefillTime(): Tick {
// Baseline: full refill in x ticks
return 600;
return 300;
}
trainStationMinRange(): number {
+5 -4
View File
@@ -167,14 +167,15 @@ export class Railroad {
}
getFare(): bigint {
const baseLengthFare = 10;
const baseCongestionFare = BigInt(2000);
const lengthFare = BigInt(this.getLength() * baseLengthFare); // Base fare proportional to length
const baseLengthBonus = 10;
const baseCongestionFare = BigInt(1000);
const lengthFare = BigInt(this.getLength() * baseLengthBonus); // Base fare proportional to length
// Busy railroads should be more expensive: each train adds a congestion premium
const effectiveCongestion = Math.max(0, Math.round(this.congestionEma));
const congestionFactor = BigInt(1 + effectiveCongestion); // 1,2,3,...
const congestionFare = baseCongestionFare * congestionFactor;
return lengthFare + congestionFare;
const net = congestionFare > lengthFare ? congestionFare - lengthFare : 0n;
return net;
}
setRailTiles(tiles: RailTile[]) {