this - gelignAIte - is both my try to write an AI and to get familiar with Squirrel. I didn't take that much care of highly performed source code (so you may find things which might be done more efficient) but just wrote the AI I had imagined - a small AI that tinkers around on the map while not really competing with me so I'll win even on difficult level. Description:
Small, simple and non-competitive AI, that will build 1 passenger-service (2 buses) and 1 mail-service (4 trucks). The passenger-service is constructed in the biggest town on the map right after starting the AI. The mail-service will be build only if the following preconditions are fulfilled:
- Loan is less or equal than 20 % of maximum loan and
- the town to build the service in (the biggest town on the map at that point of time) has >= 9k inhabitants
- Updating stations (moving outwards (from town center) in dependency of count of inhabitants) every five years after inauguration to a max distance of 16 tiles
- Renew aged vehicles
- Replace crashed/lost vehicles
- Replace/Upgrade vehicles by newer models/engines
- Funds managing: Take loan where required, repay where possible.Download:
It is available via http://bananas.openttd.org/en/ai/
- I didn't yet figure why but it may occur that the AI crashes on loading. I encountered that a few times but couldn't reproduce it. If someone encounters it and knows what's going on, I'd be pleased to hear from you.
Have fun with it.
I wrote the AI on a default installation and tested it only on that "default", "snow" and "desert" type of map. (What is the correct naming of those?) The AI shouldn't work on the "toyland" type as there seems to be no "PASS"enger service available. I didn't play that to verify because I don't like that type. As I have a default installation I couldn't test whether there are problems with other GRFs. Let me know if there's something wrong and I'll see what I can do.