Page 1 of 1

[AI] CoronaAI Fix

Posted: 05 May 2024 09:55
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

Re: [AI] CoronaAI Fix

Posted: 11 May 2024 15:30
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.

Re: [AI] CoronaAI Fix

Posted: 17 Jun 2024 13:06
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.

Re: [AI] CoronaAI Fix

Posted: 08 Sep 2024 07:25
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