Moderator: OpenTTD Developers
I present you with an AI that uses only trucks, lots of them.
- works with NewGRF cargos
- automatically adjusts vehicle numbers (buying and selling)
- supports save and load
- tries to be competitive
Download from BaNaNaS: http://binaries.openttd.org/bananas/ai/ ... I-2.tar.gz
v2: Fixed AI not working when packed in .tar archive, which was the case for BaNaNaS.
v1: Initial version
I note that your AI never builds anything a recent nightly, although it works fine in 1.9. Could be something to do with roadtypes perhaps.
Also, as some general advice; renaming stations with codes is great for testing, but doesn't look nice from a player's point of view; and adding some randomness to the route selection can be good so if there are multiple instances of your AI running, they won't constantly build on top of each other.
I've found a few issues that I'd like to report.
Sometimes it builds 2 or even 3 pickup stations at a single place even though there's only one product to pickup. It does tend to clutter the map when it does that, as well as blocking access for other players (or perhaps that's a deliberate action!).
I use the SPI industry set when can be set to have industries close down after a time (running out of resources or bankruptcy). Kraken can't deal with this as it doesn't appear to recognise that the industry has disappeared. Trucks simply remain in place and generate losses. I have managed to change the code a little bit to cope with this and trucks now run off and sell themselves when this happens. Unfortunately I haven't brought those code changes with me...but I can let you know what they were when I'm next on the internet (next week). It was only 2-3 lines.
Also, Kraken had a service at a coal mine. I added 2 competing services that gained all the coal produced. Krakens two trucks then sat there for 30+ years with a zero chance of ever getting any coal. They constantly lost money but had no way of closing down the service.
However, it's quite a nice AI and I shall continue to use it.
Oh, I also made a couple of changes to try and have trucks share orders. It makes it MUCH easier if/when I take over the company. It's not 100% right as the first 1 or 2 trucks are not sharing orders, but all other trucks of that service do manage to share orders.
Finally for now, when a truck group has no trucks remaining it isn't deleted, so the group list for that AI can be filled with empty groups.
There's also the company naming code I wrote for SimpleAI. I can have a look at adding that to this code which might be preferable to calling each company Kraken#n. If I can do this, you are welcome to include it should you wish.
Users browsing this forum: No registered users and 3 guests