Infrastructure Maintenance Handling
Relevant source files
The following files were used as context for generating this wiki page:
Infrastructure Maintenance Handling is a specialized logic module within Trans AI designed to ensure the AI remains financially viable and operationally efficient when the game's infrastructure maintenance costs are enabled. This feature allows the AI to detect the specific game environment settings and adjust its expansion and asset management strategies accordingly to prevent bankruptcy due to high overhead costs.
Sources: ROADMAP.md:46-48, README.md:5-9
Maintenance Logic and Detection
Trans AI monitors the OpenTTD game settings to determine if infrastructure maintenance is active. When enabled, the AI modifies its behavior to be more conservative with infrastructure placement, particularly concerning air routes, to avoid the financial drain of maintaining unused or underperforming transit assets.
Operational Flow
The following diagram illustrates how the AI integrates maintenance checks into its decision-making process:
The AI continuously evaluates whether its infrastructure is generating enough profit to cover maintenance fees.
Sources: ROADMAP.md:42-48, README.md:12-15
Asset Specific Handling
Infrastructure maintenance handling is primarily prioritized for the Air Route, as airports and aircraft represent significant capital and maintenance investments.
Air Route Strategy
- Detection: The AI detects if infrastructure maintenance settings are toggled.
- Adaptive Behavior: The AI adjusts the frequency and scale of airport construction.
- Route Optimization: Focuses on high-capacity transport from town to town to ensure revenue exceeds maintenance costs.
Sources: ROADMAP.md:6-8, ROADMAP.md:46-48
Financial Risk Management
A critical component of maintenance handling is the AI's ability to manage negative income streams, particularly when acquiring other companies or expanding rapidly.
| Feature | Description | Status |
|---|---|---|
| Maintenance Detection | Detects if the game setting for infrastructure maintenance is ON. | Implemented |
| Negative Income Handling | Attempting to turn negative income into profit to avoid bankruptcy. | In Progress |
| Merger Acceptance | Ability to accept merger offers from competitors. | Implemented |
Sources: ROADMAP.md:41-48
Bankruptcy Prevention Sequence
When the AI detects a financial decline attributed to infrastructure costs, it initiates a recovery sequence:
This sequence ensures that the AI does not blindly build infrastructure that it cannot afford to maintain over long periods.
Sources: ROADMAP.md:41-44, README.md:5-9
Licensing and Distribution
The Infrastructure Maintenance Handling module, like the rest of the Trans AI project, is licensed under the GNU General Public License version 2.0. This ensures that any modifications or improvements to the maintenance logic remain open-source.
Sources: license.txt:1-15, README.md:64-68
Summary
Infrastructure Maintenance Handling is a vital survival mechanism for Trans AI. By detecting game-wide maintenance settings and auditing the financial performance of its routes—especially for aircraft—the AI attempts to balance expansion with fiscal responsibility. This module directly supports the AI's goal of long-term operational stability and bankruptcy avoidance.