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

xarick
Transport Coordinator
Transport Coordinator
Posts: 283
Joined: 26 Feb 2015 00:52

Re: CivilAI

Post by xarick »

CivilAI-25 has a bug function GetVersion() { return 24; }
Formerly known as Samu

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5462
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: CivilAI

Post by PikkaBird »

Whoops. :roll:

I also took the opportunity to fix some logic which was largely preventing the AI building new cargo trains once it had a passenger network.

Version 29:
Bug fixes:
Trains
- Fix AI getting stuck trying to build a junction on a station tile.

Version 28:
Tweaks:
Road Network:
- Unified and revised the road depot building code, removing the old concept of "Home Depot."

Version 27:
Bug fixes:
Trains:
- Fixed AI getting stuck building wagons if it fails to build a locomotive.

Version 26:
Bug fixes:
- Correctly updated version number in-game.
Trains:
- Fixed AI not building new rail lines if it has existing termini with available connections but no supplying industries.

User avatar
andythenorth
Tycoon
Tycoon
Posts: 5115
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: CivilAI

Post by andythenorth »

Hurrah! More trains! :D

Found something weird in v29, got a train with only one order. It's plugged up that route. :twisted:
Attachments
Civil29.png
Civil29.png (605.8 KiB) Viewed 1385 times

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5462
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: CivilAI

Post by PikkaBird »

That's odd. I'll look out for that. In the meantime, I guess it will sell such trains after 2 years when they fail to make any income. :)

Version 30:
Bug fixes:
- Fixed crash when loading a savegame (due to the changes in v28, oops!).
Trains
- Fixed crash when AI attempts to electrify tracks of another company (reported by andythenorth).

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5462
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: CivilAI

Post by PikkaBird »

I really do enjoy Civi's naming + the "Silly" toyland townnames. :D
Image3.png
Image3.png (63.62 KiB) Viewed 1215 times

User avatar
Darthrafael
Engineer
Engineer
Posts: 78
Joined: 03 Aug 2011 14:10
Location: Yes

Re: CivilAI

Post by Darthrafael »

I've found a bug that's likely to do with the vehicle GRFs I use, but I thought it would be a good idea to bring this to your attention.

It bought a Metro Cammell EMU, then decided it wanted carriages, and proceeded to buy 827.7 tiles worth of carriages it could not attach to the train, for a total of about 2000-ish carriages?
uhm.PNG
uhm.PNG (1.54 KiB) Viewed 1183 times
Hi~

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5462
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: CivilAI

Post by PikkaBird »

Thanks! Yep, clearly a problem with the wagons not being able to attach to the loco. Damn NewGRF authors and their BAD FEATURES. ;)

Which newgrf is it? I'll experiment and see what I can come up with. :)

User avatar
Darthrafael
Engineer
Engineer
Posts: 78
Joined: 03 Aug 2011 14:10
Location: Yes

Re: CivilAI

Post by Darthrafael »

PikkaBird wrote:
15 Jan 2020 01:15
Thanks! Yep, clearly a problem with the wagons not being able to attach to the loco. Damn NewGRF authors and their BAD FEATURES. ;)

Which newgrf is it? I'll experiment and see what I can come up with. :)
It's a NewGRF that goes by the name of UKRS2, you might have heard of it? :)
The carriages are from RUKTS, meanwhile, so the issue might be purely because of NewGRF mixing? Still, maybe it's fixable?
Hi~

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5462
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: CivilAI

Post by PikkaBird »

Darthrafael wrote:
15 Jan 2020 05:37
Still, maybe it's fixable?
I'm sure it is. I'll try out the GRF combination, thanks. :)

User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5462
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: CivilAI

Post by PikkaBird »

I figure I've got enough bug fixes and tweaks to release another version. :) I really need to focus on the new pathfinder for v32 though, as the route building is what's really slowing the AI down now.

Version 31:
Features:
Trains:
- AI can now build stations and trains of varying lengths, instead of always 3 tiles.
- AI will build additional freight trains to meet demand.
Road Network:
-Building the intercity road network has been disabled.
Tweaks:
- AI will now avoid planting trees on farm fields.
- Most parameters (max buses, minimum air route distance etc) have been removed from the player-adjustable AI options.
- If you're an advanced user and really want to change these numbers, you'll find them at the end of saveload.nut.
Trains:
- Made avoiding double-connecting industries more reliable.
- Tinkered with locomotive selection to avoid using high-speed locomotives for freight.
Aircraft:
- AI can now buy a cheaper aircraft if its ideal aircraft is too expensive.
Bug fixes:
Trains:
- Fixed wagon selection bug that was preventing electrified freight trains from renewing.
- Disallowed PBS-locked track loops at station entrances.
- Fixed AI ripping up newly built routes because it couldn't quite afford the locomotive yet.
- Added code to handle NewGRF wagons not being attachable (thanks Darthrafael).
Goods Trucks:
- Fixed the AI repeatedly trying to build goods pickup routes to unroutable factories.
- Fixed the AI buying lots of goods trucks if the dropoff station stops accepting goods.
- Fixed the AI building a goods pickup depot when it cannot afford the trucks.


User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5462
Joined: 13 Sep 2004 13:21
Location: The Moon
Contact:

Re: CivilAI

Post by PikkaBird »

Excellent. Fun fact: this bug did not manifest before v31 because of a typo that was causing it to build a passenger car if it couldn't find a mail van. Fix a bug, make a bug. :)

Version 32:
Bug fixes:
Trains:
- Fixed crash when there is no appropriate mail van available for a new passenger train (reported by andythenorth).

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 3 guests