Common AI problem; insufficient tractive effort

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
Moriarty
Tycoon
Tycoon
Posts: 1395
Joined: 12 Jun 2004 00:37
Location: United Kingdom of Great Britain and Northern Ireland
Contact:

Common AI problem; insufficient tractive effort

Post by Moriarty »

I'm playing a game with one of each of the train AI's. The game is extremely hilly.

One thing I'm noticing is that quite a few of the AI's are completely failing to build an appropriate engine for their trains when there are hills en-route.

I don't have any NewGRF's affecting this, all the settings that are applicable are standard OpenTTD things. My values are the [square bracket] ones.
- Train acceleration mode: Realistic/original. [Realistic]
- Slope steepness for trains (0-10%) [3%]
- Weight multiplier for freight to simulate heavy trains (0-255) [4x].

I don't know if this is something that should be in the API, (or maybe is already) or left for the AI devs to work out themselves, but currently they're generally quite worthless. I bunches of AI trains completely failing to get up hills and the companies promptly go bankrupt.

In my mind I imagine there would be some API calls to calculate required power; the api dealing with the above settings; this would make this simpler for the AI devs; again, maybe they exist and are rarely used.

FastPTPAI, AdmiralAI, and SimpleAI.


AIAI seems to be the only one that handles the situation correctly, choosing to add more engines if appropriate (though it seems to prefer using multiple less-powerful locos rather than a single high-power one, even though the later would be cheaper to run).
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Common AI problem; insufficient tractive effort

Post by frosch »

The problem is that the API has absolutely no concept of weight. We tried some years ago, but did not figure out a sane way due to the complex game mechanics. It has to account for:
* Slope settings for RV and trains.
* Vehicle weight when empty.
* Vehicle weight when loaded.
* Should the API use weight or rather slope resistance?
* With the freight weight setting cargo may weight more on trains than on other vehicles.
* I am sure I am missing more details.... :p
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Brumi
President
President
Posts: 920
Joined: 18 Jul 2009 17:54

Re: Common AI problem; insufficient tractive effort

Post by Brumi »

Hmm, as far as I remember, SimpleAI does consider tractive effort, only to avoid this problem :P
Maybe it does not consider the weight multiplier. I'll need to look into it...
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Common AI problem; insufficient tractive effort

Post by PikkaBird »

AIs which don't just drive railways straight up mountains would go a long way to mitigate this problem. :)
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Common AI problem; insufficient tractive effort

Post by krinn »

Not only that pikkabird, if you add penalty from climbing in the pathfinder the calc gets horrible ; A* really gets poor when something is in the way as it must try all neightbors to find the solve.
So not only your train endup making a big turn to mitigate this, but all your pathfinding search gets really slow, and when you take years to build one railway, it get odd :)
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: Semrush [Bot] and 42 guests