[AI] CoronaAI Fix

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
User avatar
ssmit132
Engineer
Engineer
Posts: 62
Joined: 09 Jul 2005 07:31
Location: Queensland, Austraila.

[AI] CoronaAI Fix

Post by ssmit132 »

CoronaAI is a small AI that puts a bus service in every town, a simple way to help them expand. However, it had a couple of issues - understandable since libik made it in a couple of days to keep him occupied! - and I decided to look into fixing them, which led me to making more modifications, etc...

So here is my first addon for OpenTTD after who knows how many years playing: CoronaAI Fix. It's a version of CoronaAI that preserves the simple original behaviour for the most part, while fixing some issues. It is available for download on Bananas, separate from the original AI.

A full list of important changes can be found on the Git repository - which is available under an MIT license like the original - but the main changes are:
  • Should work with more (but not all) combinations of NewGRF road vehicles and road types. Most notably, and the original problem I wanted to fix, it shouldn't fail to build anything when there are trams available.
  • More robust construction of infrastructure in towns, so it shouldn't only build half a service or build unconnected stations that don't work.
  • Support for loading it in existing saves; while it doesn't save anything, it detects what it's built before and doesn't repeat it.
  • Will continuously go through all towns with a year delay to (re)build in towns with no service, if they meet the conditions.
Thanks to libik for making the original CoronaAI. This was an enjoyable little project and I hope to make more contributions at some point in the future. :)

Image
Attachments
Preview.png
Preview of the AI's progress after 50 years in a vanilla 1024x1024 game.
(1.01 MiB) Not downloaded yet
User avatar
ssmit132
Engineer
Engineer
Posts: 62
Joined: 09 Jul 2005 07:31
Location: Queensland, Austraila.

Re: [AI] CoronaAI Fix

Post by ssmit132 »

CoronaAI Fix updated to version 2.

Changes:
  • Will not take out a loan at game start if not needed (i.e. when loading a game and it's already repaid the loan).
  • Multiple instances will have a numbered company name.
  • If a service is removed because it was unprofitable, will not attempt to rebuild the service for at least five years.
  • Will not attempt to clone buses if low on money.
User avatar
ssmit132
Engineer
Engineer
Posts: 62
Joined: 09 Jul 2005 07:31
Location: Queensland, Austraila.

Re: [AI] CoronaAI Fix

Post by ssmit132 »

CoronaAI Fix updated to version 3.

Changes:
  • Added four parameters to control how often the AI does things, as well as to change criteria for picking vehicles.
  • Time gaps between building/checking town infrastructure should be more consistent.
  • Picks a random secondary colour when starting the company for some more colour with 2cc NewGRFs.
Attachments
New parameters
New parameters
Preview_parameters.png (11.38 KiB) Viewed 2101 times
User avatar
ssmit132
Engineer
Engineer
Posts: 62
Joined: 09 Jul 2005 07:31
Location: Queensland, Austraila.

Re: [AI] CoronaAI Fix

Post by ssmit132 »

CoronaAI Fix updated to version 4.

Changes:
  • Now supports saving and loading. The next scheduled check on town infrastructure, and the data on towns will be saved.
This was more to see if I could add save/load support, rather than this being required for (what was) a simple AI. Since it does work, I may as well upload it. :P
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest