Chopper - Helicopter AI

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

User avatar
Marbs
Engineer
Engineer
Posts: 14
Joined: 22 Aug 2006 16:19
Location: Garden of England

Chopper - Helicopter AI

Post by Marbs »

Image

Introduction
Chopper is an AI for OTTD which uses only helicopters. Chopper can transport all types of cargo, so use GRFs such as AV8 to allow him to do so. Chopper has many options enabling you to configure how he plays. You can alter how fast he builds, whether he will attempt subsidies, and even whether he is allowed to build at a town you've built at. Chopper can play well competitively with helicopters alone, so don't underestimate your rival!

AI Parameters
Image
(1) Parameter all AIs have;
(2) Minimum town size;
(3) You can alter how Chopper is feeling, which in turn affects his speed;
(4) Whether Chopper should choose station locations randomly or cleverly;
(5) Chopper likes subsidies, but with this you can stop him stealing them all;
(6) Change the min distance between town stations;
(7) Change the max distance between town stations;
(8) Change the min distance between industry stations;
(9) Change the max distance between industry stations;
(10) Limit how many loading stations Chopper can have per industry;
(11) When this is enabled, the max distance between stations will be increased depending on the plane speed factor;
(12) Stop Chopper from being competitive with you;
(13) Stop Chopper clogging up towns with airports;
(14) Stop Chopper from building intercity routes;
(15) Show debug signs...unless you are me you will almost certainly want this off;
(15) Show more stuff in the log.

Notable features
-Works with grfs, use AV8 to allow Chopper to do more cargos;
-Transports mail and passengers;
-Attempts subsidies (r17425 and above);
-Visits oilrigs to transport those poor passengers who no one bothers to help;
-Supports saving/loading;
-Autoreplaces vehicles;
-Transports cargo if you use an appropriate grf;
-Loves plane speed factor 1/1. :wink:

Known bugs
none!

To play with Chopper
Download from BaNaNaS, or from the bottom of this topic.

Lastly...(Important information)
If you enable Chopper before the things he requires are available, he will repay his loan and sit and wait until he can start (usually 1976). During this time he will just display "Zzzz...". Chopper requires the helidepot and heliport to be available, and for there to be at least one helicopter available.

Thankyou to all the Devs who made the NoAI framework and WrightAI, and please have fun testing and playing with Chopper! :D
Attachments
Chopper.7.tar
(102 KiB) Downloaded 1534 times
Last edited by Marbs on 22 Aug 2011 19:06, edited 10 times in total.
User avatar
lawton27
Tycoon
Tycoon
Posts: 1418
Joined: 03 Aug 2009 14:29
Location: Manchester

Re: Chopper - The helicopter loving AI

Post by lawton27 »

Did I mention I love helicopters, this ai is a must-have for me, planes are boring, this would work well with AV8, I shall test this now I hope to see more releases of this ai. :mrgreen:
User avatar
Marbs
Engineer
Engineer
Posts: 14
Joined: 22 Aug 2006 16:19
Location: Garden of England

Re: Chopper - The helicopter loving AI

Post by Marbs »

This is just the right AI for you if you like helicopters then! I have tested Chopper with AV8, and he performed well, though took a little while to get a decent profit due to the higher start up costs. There will almost certainly be more releases in the next few days or weeks, since I have quite a bit of spare time. :D
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Chopper - The helicopter loving AI

Post by petert »

Could you upload it to Bananas?

Also, one suggestion for settings. Could you make a setting so that it doesn't build in towns that the player has built in?
User avatar
Marbs
Engineer
Engineer
Posts: 14
Joined: 22 Aug 2006 16:19
Location: Garden of England

Re: Chopper - The helicopter loving AI

Post by Marbs »

Okay, Chopper is now available from BaNaNaS, so you don't even need to bother download from this topic. :)

That's a good suggestion, I'll add it to my todo list!
User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Chopper - The helicopter loving AI

Post by Dustin »

Welcome to the AI developer club!
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Chopper - The helicopter loving AI

Post by Zuu »

Looks like you found yourself a nice specialty for your AI. :-) Which could be good to have some boundaries set and make it stable within those boundaries instead of aiming to do everything.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
User avatar
1009
Engineer
Engineer
Posts: 81
Joined: 22 Mar 2009 07:24
Location: Haarlem, The Netherlands
Contact:

Re: Chopper - The helicopter loving AI

Post by 1009 »

I chuckled. Lovely idea for a new AI, I'll give it a try soon.
User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 338
Joined: 13 Jul 2008 00:57
Contact:

Re: Chopper - The helicopter loving AI

Post by Michiel »

Neat idea :D
Good luck with the (very satisfying) time sink of AI development ;)
User avatar
Marbs
Engineer
Engineer
Posts: 14
Joined: 22 Aug 2006 16:19
Location: Garden of England

Re: Chopper AI - Now stopping at Oilrigs!

Post by Marbs »

Thankyou for the replies everyone! I got a lot of progress done today:
-Fixed bug #00001;
-Added feature request "make a setting so that it doesn't build in towns that the player has built in";
-Vastly improved Chopper's log;
-Added more parameters (attitude, intercity, debug);
-And best of all, Chopper now uses oilrigs! (see picture below)

Image

I have also just noticied that the AV8 set has helicopters that refit to any cargo, so tomorrow I will try and get some industrial helicopter links working, and we'll have helicopters transporting oil and terrified livestock in no time! :lol:

Unfortunately at the moment Chopper does not do so well with AV8, due to the massive start up costs involved, but I'm going to run a test now to see if he can keep a profit and expand over time, since it would be really great to have him working well with AV8.

One thing that I should improve soon is how Chopper chooses what to build. Currently it's just by chance, 2/3rd chance of building town to town route, 1/3rd chance of building town to oilrig. It works for now, but is not the most economic method. :P
User avatar
CommanderZ
Tycoon
Tycoon
Posts: 1872
Joined: 07 Apr 2008 18:29
Location: Czech Republic
Contact:

Re: Chopper AI - Now stopping at Oilrigs!

Post by CommanderZ »

One thing that I should improve soon is how Chopper chooses what to build. Currently it's just by chance, 2/3rd chance of building town to town route, 1/3rd chance of building town to oilrig. It works for now, but is not the most economic method.
It should be fairly simple to calculate an expected income/loss for a heli route
petert
Tycoon
Tycoon
Posts: 3008
Joined: 02 Apr 2009 22:43
Location: Massachusetts, USA

Re: Chopper AI - Now stopping at Oilrigs!

Post by petert »

Haha, I like the AI Paramaters, "I'd be a fool not to". Anyway, does chopper AI stop at heliports for cargo? E.g. I produce goods at good factory, Chopper picks them up by heli.
User avatar
Marbs
Engineer
Engineer
Posts: 14
Joined: 22 Aug 2006 16:19
Location: Garden of England

Re: Chopper AI - Now stopping at Oilrigs!

Post by Marbs »

Chopper doesn't do goods yet, but I'm working on that for the next version. Though I will add a setting to turn it off, in case you don't like him leeching off of your industries. :P

Also, in time Chopper will also do other freight cargos, but of course you will have to have a suitable GRF enabled (probably AV8), since the default helicopters can only be refitted to passengers, mail, valuables and goods.

I'm glad you like the parameters, I tried to make Chopper seem a bit more life like through them, using phrases rather than numbers. :D

[edit]
I've just redone Chopper's airport placement, so he now picks the best spot possible, and actually modifies the land in order to build the airport, whereas before he just tried to find an empty flat space :P

I decided to test this, and ran a 512*512 tropical game for him to play on his own for a while. Unfortunately, just after 2 years Chopper had used up all 200 of the aircraft limit, as can be seen in the graph below where the line suddenly flattens.

The reasons Chopper performed this well are:
-Initial town size multiplier was set to 10, number of towns set to High;
-Plane speed factor was set to 1/1;
-Town controlled noise levels was on (meaning Chopper can build many more stations per town, I counted 17 airports in one town);
-There was no competition from other players;
-Chopper's attitude setting was set to "Caffeine high";
-Chopper's concern setting was set to "Economics" (this is a new feature I'm adding, the other setting is "Aesthetics").

Now I know though that in a best case scenario, Chopper can do quite well :)
Attachments
Chopper reaches the limit of 200 aircraft in just over 2 years.
Chopper reaches the limit of 200 aircraft in just over 2 years.
Chopper aircraft limit.PNG (17.81 KiB) Viewed 21760 times
An example showing that Chopper now knows how to modify the land, and so has a much better chance of placing a helistation right next to the town center. You can see the brown dirt from where Chopper excavated to make space!
An example showing that Chopper now knows how to modify the land, and so has a much better chance of placing a helistation right next to the town center. You can see the brown dirt from where Chopper excavated to make space!
Chopper better station placement.PNG (206.71 KiB) Viewed 21724 times
Last edited by Marbs on 11 Sep 2009 00:20, edited 3 times in total.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Chopper AI - Now stopping at Oilrigs!

Post by frosch »

Marbs wrote:I have also just noticied that the AV8 set has helicopters that refit to any cargo, so tomorrow I will try and get some industrial helicopter links working, and we'll have helicopters transporting oil and terrified livestock in no time! :lol:
Oh, I expected Chopper AI to prefer industries producing wood or lumber :p
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Chopper AI - Now stopping at Oilrigs!

Post by Zuu »

I just want to thank you for this nice AI. I just ran it along with PAXLink to add some more to my otherwise solo test games. Actually I was interested how they compares. Currently PAXLink has the tendency to go bankrupt from time to time.

After 20 years (starting 1975 with default vehicles) Chopper AI had a steady profit of about 100 thousands a year. PAXLink wobbles up and down around 360 thousands a year. Considering that Chopper AI is limited to only helicopters I think that is a really good result. Just checked and Chopper AI has 36 helicopters and 53 stations. PAXLink has 53 aircrafts, 67 buses and 43 stations.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Chopper AI - Now stopping at Oilrigs!

Post by Terkhen »

I love the idea of this AI. Thanks to FISH I'm currently playing games with a lot of islands, so once that Chopper can restart after loading a game I will give it a try :D
User avatar
Marbs
Engineer
Engineer
Posts: 14
Joined: 22 Aug 2006 16:19
Location: Garden of England

Re: Chopper AI - Now serving all cargos!

Post by Marbs »

Image
Version 7 of Chopper is out! You can download it from BaNaNaS, or the bottom of my first post,

If you are interested, here is the list of the main improvements I can think of in version 7:
-Chopper now transports all cargo types, not just passengers and mail! (use AV8 or some other helicopter grf);
-Saving/Loading now works! Well, nothing need be saved or loaded any more, I changed it so that it is all read off the map (which is even better, because if for whatever reason Chopper crashes, you can save and then reload straight away and it will continue to work);
-Old vehicles are replaced;
-Land is flattened for airports instead of simply trying to find an empty space;
-Stations are reused. Instead of building a new station every time there is a new route, Chopper first checks for existing stations and will use them instead, unless they are too crowded of course;
-If a station is built, but no helicopter can be afforded, the station isn't deleted. It is left in case it can be reused later. If it is left unused for a long time, it is eventually deleted;
-Goods are transported to towns, this is the only new cargo that will work without a GRF, since all the default helicopters support goods.

There shouldn't be any bugs. Chopper works better on 0.7.3 or the nightly, because that has extra functions, however Chopper will work on 0.7.2 as well, he will just perform ever so slightly worse.

Please test and have fun :D
Terkhen
OpenTTD Developer
OpenTTD Developer
Posts: 1034
Joined: 11 Sep 2008 07:32
Location: Spain

Re: Chopper AI - Now serving all cargos!

Post by Terkhen »

Marbs wrote:Version 7 of Chopper is out!
Great :D
Marbs wrote:Please test and have fun :D
Will do ;)
Swansea Stu
Engineer
Engineer
Posts: 72
Joined: 21 Jan 2009 12:24

Re: Chopper AI - Now serving all cargos!

Post by Swansea Stu »

Marbs wrote:
Lastly...(Important information)
If you enable Chopper before the things he requires are available, he will repay his loan and sit and wait until he can start (usually 1976). During this time he will just display "Zzzz...". Chopper requires the helidepot and heliport to be available, and for there to be at least one helicopter available.
Looks great so far, but is the above set in stone or could there possibly be the option of using small airports and airships until better aircraft and heliports/depots are available?
User avatar
Marbs
Engineer
Engineer
Posts: 14
Joined: 22 Aug 2006 16:19
Location: Garden of England

Re: Chopper AI - Now serving all cargos!

Post by Marbs »

Image
Swansea Stu wrote:
Marbs wrote:
Lastly...(Important information)
If you enable Chopper before the things he requires are available, he will repay his loan and sit and wait until he can start (usually 1976). During this time he will just display "Zzzz...". Chopper requires the helidepot and heliport to be available, and for there to be at least one helicopter available.
Looks great so far, but is the above set in stone or could there possibly be the option of using small airports and airships until better aircraft and heliports/depots are available?
That's a good idea, I'm not sure why I didn't think of it earlier! Attached here is a new version of Chopper that will use small airports and large (city) airports if no heli type airports are available. This means that Chopper can start back as far as 1920 (using AV8, that is when the airships are introduced). The downside is that these airships cost a lot, and are very slow so do not make much profit, even on plane speed factor 1/1.

I have not released this on BaNaNaS yet, because it is not 100% complete. I want to make it so that when the helidepot and helistation become available, Chopper destroys his small/large airports and replaces them. However I am not entirely sure how I will go about this yet.

To destroy an airport there have to be no helicopters at it, so Chopper would either have to send the helicopters to another depot to get them out the way, or sell the helicopters. It would be useful to have some kind of "close airport" option to make helicopters simply circle above until the airport is reopened. The airport could then be demolished and replaced, however there is a small chance this could fail (someone else building in the way really fast or building an airport nearby that raises the noise level). If it failed Chopper might have lost a valuable spot.

I could always just let the small and large airports stay for the rest of the game, however they make a lot of noise compared to the heli airports, and so will stop Chopper making as much money. They also take up a lot of space, which might be annoying for other players.

Anyway, thank you all for trying out Chopper and keep the suggestions coming! :D
Attachments
Chopper.8.tar
Chopper uses small and large (city) airports. Not released on BaNaNaS yet.
(105.5 KiB) Downloaded 505 times
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 7 guests