Page 1 of 3

Chopper - Helicopter AI

Posted: 08 Sep 2009 19:42
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

Re: Chopper - The helicopter loving AI

Posted: 08 Sep 2009 19:48
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:

Re: Chopper - The helicopter loving AI

Posted: 08 Sep 2009 19:52
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

Re: Chopper - The helicopter loving AI

Posted: 08 Sep 2009 19:54
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?

Re: Chopper - The helicopter loving AI

Posted: 08 Sep 2009 20:17
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!

Re: Chopper - The helicopter loving AI

Posted: 08 Sep 2009 20:25
by Dustin
Welcome to the AI developer club!

Re: Chopper - The helicopter loving AI

Posted: 08 Sep 2009 21:30
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.

Re: Chopper - The helicopter loving AI

Posted: 08 Sep 2009 21:38
by 1009
I chuckled. Lovely idea for a new AI, I'll give it a try soon.

Re: Chopper - The helicopter loving AI

Posted: 09 Sep 2009 00:21
by Michiel
Neat idea :D
Good luck with the (very satisfying) time sink of AI development ;)

Re: Chopper AI - Now stopping at Oilrigs!

Posted: 09 Sep 2009 23:10
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

Re: Chopper AI - Now stopping at Oilrigs!

Posted: 10 Sep 2009 07:47
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

Re: Chopper AI - Now stopping at Oilrigs!

Posted: 10 Sep 2009 10:49
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.

Re: Chopper AI - Now stopping at Oilrigs!

Posted: 10 Sep 2009 15:50
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 :)

Re: Chopper AI - Now stopping at Oilrigs!

Posted: 10 Sep 2009 21:20
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

Re: Chopper AI - Now stopping at Oilrigs!

Posted: 11 Sep 2009 19:25
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.

Re: Chopper AI - Now stopping at Oilrigs!

Posted: 14 Sep 2009 10:33
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

Re: Chopper AI - Now serving all cargos!

Posted: 15 Sep 2009 21:31
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

Re: Chopper AI - Now serving all cargos!

Posted: 16 Sep 2009 09:10
by Terkhen
Marbs wrote:Version 7 of Chopper is out!
Great :D
Marbs wrote:Please test and have fun :D
Will do ;)

Re: Chopper AI - Now serving all cargos!

Posted: 17 Sep 2009 18:21
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?

Re: Chopper AI - Now serving all cargos!

Posted: 19 Sep 2009 17:15
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