Special Feature: Competitor Acquisition
Relevant source files
The following files were used as context for generating this wiki page:
The Competitor Acquisition feature is a specialized module within Trans AI designed to handle interactions with other transport companies in the OpenTTD environment. Its primary purpose is to allow the AI to expand its infrastructure and market share by acquiring or merging with competing companies that are offered for sale or merger.
This feature aligns with the project's goal of acting as a comprehensive in-game AI opponent that utilizes all available vehicle types and strategies to dominate cargo transport. By acquiring competitors, Trans AI can consolidate routes and attempt to turn failing or negative-income operations into profitable components of its own network.
Sources: README.md:1-10, ROADMAP.md:32-37
Acquisition Logic and Lifecycle
The acquisition process is divided into two main stages: the acceptance of a merger and the subsequent management of the acquired assets. Currently, Trans AI focuses on the reactive capability of accepting offers presented within the game environment.
Merger Acceptance
Trans AI is programmed with the ability to detect and accept merger offers from competitor companies. This allows the AI to immediately take control of the competitor's existing vehicles, stations, and routes.
Post-Acquisition Management
Once a company is acquired, the AI faces the challenge of financial stabilization. The system is designed to evaluate the inherited infrastructure and attempt to convert negative income streams into profitable ones. Failure to successfully optimize these acquired routes can lead to the bankruptcy of the AI company due to the drain on resources from inefficient operations.
Sources: ROADMAP.md:33-36
The following flowchart illustrates the high-level logic for handling competitor acquisitions:
The diagram shows the decision path from receiving a merger offer to the optimization of acquired assets to prevent bankruptcy.
Sources: ROADMAP.md:33-37
Technical Implementation Context
While the specific Squirrel code logic for acquisition is distributed across the AI's internal modules, the feature is supported by the project's infrastructure and external dependencies.
Dependencies
The acquisition logic, like other AI functions, relies on standard OpenTTD AI libraries. These libraries provide the necessary API hooks to interact with company management and financial data.
| Library | Purpose |
|---|---|
| AI Library - Common | Core AI functions and utilities |
| AI Library - List | Managing lists of acquired vehicles or stations |
| AI Library - String | Processing company names and interface notifications |
Sources: README.md:37-41
Versioning and Releases
The Competitor Acquisition feature is subject to the project's rolling release model. Development builds include the latest optimizations for asset management, which are versioned based on the commit date (YYMMDD).
| Component | Detail |
|---|---|
| Versioning Format | YYMMDD (e.g., 250610) |
| Deployment | Automated via GitHub Actions |
| Development ID | info.nut uses a future date to prioritize local builds |
Sources: README.md:43-52, .github/workflows/rolling-release.yml
Feature Status and Roadmap
The acquisition feature is currently in an active state of development, with core merger acceptance implemented and optimization logic planned for further refinement.
| Feature Component | Status | Description |
|---|---|---|
| Merger Acceptance | Implemented | Ability to accept offers from competitors. |
| Profit Optimization | In Progress | Converting negative income assets into profitable ones. |
| Bankruptcy Prevention | Planned | Logic to discard terminal assets to save the parent company. |
Sources: ROADMAP.md:33-37
Conclusion
The Competitor Acquisition feature represents a strategic layer of Trans AI, moving beyond simple route building into corporate management. By integrating competitor assets, Trans AI seeks to fulfill its mandate of using all available vehicle types and cargo concepts to maintain a dominant transport network. Success in this module is critical for long-term survival in competitive game modes where industrial chains are heavily contested.
Sources: README.md:3-8, ROADMAP.md:33-37