CivilAI

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

openttdfan2020
Engineer
Engineer
Posts: 19
Joined: 31 May 2019 21:26

Re: CivilAI

Post by openttdfan2020 »

Mr Pikka,
I just wishing there's new Freight and Passenger Train AI.
Can you make a Passenger And Freight Train AI and name it "Freight&PassengerAI"
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: CivilAI

Post by PikkaBird »

Version 33:
Bug fixes:
Ships:
- Fixed crash when checking for ferry route but no ferries are available (reported by 2TallTyler and Timberwolf)

Version 34:
Features:
Trains & Road Network:
- Pre-surveying of routes added, to avoid wasting time trying to path routes which are too long, hilly or wet.
Road Network:
- Building the intercity road network has been re-enabled, with the pre-survey feature.
kcl504sandboxgamer
Engineer
Engineer
Posts: 24
Joined: 11 Aug 2021 16:29

AI script error

Post by kcl504sandboxgamer »

Screenshot_2021-08-14-08-48-39-156_org.openttd.sdl.jpg
I didn't understand the bug
(772.95 KiB) Not downloaded yet
One day when I started a game with CivilAI, NoNoCAB and NotPerfectAI on Android, and I absolutely build nothing to just observe their activities, and an error message shown up, though the game remained functional and didn't crash.
Droideka30
Engineer
Engineer
Posts: 9
Joined: 04 Aug 2021 03:06

Re: CivilAI

Post by Droideka30 »

I'm observing the same bug, "Couldn't find library 'Pathfinder.CRoad' with version 4".
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: CivilAI

Post by PikkaBird »

You'll have to find the missing library and download it too.

If you use the ingame content download, it should download it automatically with the AI, but that may not be a thing on Android.
rodie9k
Engineer
Engineer
Posts: 1
Joined: 24 Aug 2021 10:25

AI won't fund industry

Post by rodie9k »

I'm trying to get CivilAI v34 to fund new industries on a blank map, but the AI does nothing after the game starts.

I've adjusted the following settings:
- competitor difficulty is hard
- maximum loan $4 billion
- primary industry construction is "as other industries."
- industry density is funding only

what else to try so the AI funds industries? is there a game script or other AI that would work? sorry if this is a repost, search gave no solutions
Wormnest
Engineer
Engineer
Posts: 117
Joined: 14 Jul 2013 12:33
Location: Netherlands

Re: AI won't fund industry

Post by Wormnest »

First of all, questions about a specific AI are usually noticed faster if you post them in the thread about that AI.

In general: I don't know about CivilAI but most AI's probably don't handle funding industries. As far as I can remember my AI's WormAI and NoNoCAB don't. Most probably expect relevant industries to be present at game start.

There might be some other AI's that do funding, but I don't think there is a list available which do or don't, so you will have to try that yourself.
User avatar
kamnet
Moderator
Moderator
Posts: 8705
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: AI won't fund industry

Post by kamnet »

Wormnest wrote: 10 Sep 2021 15:46 First of all, questions about a specific AI are usually noticed faster if you post them in the thread about that AI.
Topic is now moved ;)
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: CivilAI

Post by PikkaBird »

The question was answered on Discord back when it was asked, ie, it is not possible for CivilAI or any other AI to fund new industries.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: CivilAI

Post by PikkaBird »

v36 adds New Road Types support. Let me know if it works and if I broke anything.
Unnamed, 1940-05-13.png
Unnamed, 1940-05-13.png (116.33 KiB) Viewed 15891 times
Version 36:
Features:
Road Network:
- Added New Road Types compatibility.
- AI can now build NRT roads.
- AI will upgrade older NRT roads when building routes.

- Various other bug fixes and tweaks.

Version 35:
Bug fixes:
Trains:
- Fixed crash when trying to remove track owned by another player.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: CivilAI

Post by PikkaBird »

Version 37:
Tweaks:
Road Network:
- AI will avoid building vehicles and roads incompatible with default town roads (eg trolleybuses).
- AI will only upgrade roads which it owns.
openttdfan2020
Engineer
Engineer
Posts: 19
Joined: 31 May 2019 21:26

Re: CivilAI

Post by openttdfan2020 »

Maybe this Newgrf will simulate this old abandoned tracks.

When Company's Railway tracks having major problems, cannot to be solved. It will replace the tracks with disused tracks. Just like simulation of abandonment/disusement of railroad grade.

viewtopic.php?t=61595
xarick
Transport Coordinator
Transport Coordinator
Posts: 351
Joined: 26 Feb 2015 00:52

Re: CivilAI

Post by xarick »

Got a weird crash, the error log doesn't fit.

EDIT: After looking at the code, seems to be an issue detecting a junction. It's walking the maglev tiles which are from another company. In the screenshot, Pink is FastPTPAI, Pale Green is CivilAI with electrified railway.
Attachments
screenshot#19.png
(559.74 KiB) Not downloaded yet
screenshot#21.png
(524.92 KiB) Not downloaded yet
screenshot#23.png
screenshot#23.png (219.82 KiB) Viewed 10648 times
Formerly known as Samu
McBorer
Engineer
Engineer
Posts: 7
Joined: 12 Mar 2022 10:18

Re: CivilAI

Post by McBorer »

Great 'city growing' AI. I often play with RVG game script with one can create pax/cargo subsidies for served towns. Can you add some kind 'fulfilling/getting subsidies' to it? Please, please, please.
Habu
Engineer
Engineer
Posts: 5
Joined: 28 Aug 2024 07:46

Re: CivilAI

Post by Habu »

Crash report.
Regards,
Habu
Attachments
openttd_civilai.png
(153.97 KiB) Not downloaded yet
joehtosis
Engineer
Engineer
Posts: 4
Joined: 25 Nov 2024 04:44

Re: CivilAI

Post by joehtosis »

Habu wrote: 12 Oct 2024 09:07 Crash report.
Regards,
Habu
Had the same issue, nearly identical log so I won't bother posting it, unless it's helpful. I'm just guessing from observation of my own save, but it looks like it culls routes and then tries buying a new train set from a deleted depot in a route that it cut off.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: CivilAI

Post by PikkaBird »

Thanks for the reports everyone, but CivilAI is very much dead; if I were to return to AI coding, I think I would start from scratch.
User avatar
Redirect Left
Tycoon
Tycoon
Posts: 7431
Joined: 22 Jan 2005 19:31
Location: Wakefield, West Yorkshire

Re: CivilAI

Post by Redirect Left »

PikkaBird wrote: 15 Dec 2024 23:22 Thanks for the reports everyone, but CivilAI is very much dead; if I were to return to AI coding, I think I would start from scratch.
Thank you for being so open & honest with that. It makes my job of tracking AI's a lot simpler, and better for end users to know definitively. If only all authors were this honest.

I wonder if its worth setting up some programme for GRFs where easily resolved errors are done by me, and released somewhere, just so all AIs (or ones that were good to start with) remain usable until I finally give up on OTTD.

You made a decent AI, PikkaBird, I hope one day you do return and make another one, the more the merrier!
Image
Need some good tested AI? - Unofficial AI Tester, list of good stuff & thread is here.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1795
Joined: 30 Mar 2005 09:43

Re: CivilAI

Post by peter1138 »

This AI crashes if MAIL is not present (and probably also PASS but that's less readily not present than MAIL...)

In `buyvehicle.nut`, the function `CivilAI::IdentifyBus(silent, intercity, cargo)` is called with `cargo`as `null` if a cargo type is not present. The simplest fix is to just to add `if (cargo == null) return null;` early in the function. With that fix in place the AI will then run fine.
He's like, some kind of OpenTTD developer.
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 4 guests