Expansion Strategies? - How do you make SOOOO much money!

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

Post Reply
User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Expansion Strategies? - How do you make SOOOO much money!

Post by Zutty » 18 Jun 2008 13:04

Hi all,

I'm nearing a first release of my AI but I have a few finishing touches to add (and I want to try to tweak it so I don't lose the tournament!!! ;) )! At the moment it builds a nice bus network and can make quite a tidy profit, but...
  • A - It tries to build EVERYTHING straight away. It the first 3-4 months it burns through its entire maximum loan and builds every possible road and bus service until it runs out of cash.
  • B - Once it has built everything or maxed out its loan it does nothing to follow up or maintain its services. It doesn't attempt to build any additional routes past the ones it starts with.
  • C - It doesn't make NEARLY as much profit as RalphsAI, Convoy, or Jinjaba. I attribute this to point B, but I think there might be more to it than that.
On a good 256x256 map with a low number of towns it can reach a company value of between £800k - £1.2m within ten years. On harder maps I've seen it struggle to break £400k, but I won't stress about that! So after that, seeing ConvoyLib make about £4m in the tournament makes me want to cry!! I haven't tried it with a higher number of towns, but then that would probably be bad idea with the current code as it would not be able to finish a full network, even with a £500k loan!

So I could do with some tips. I would like your advice on the following...
  • What's a good way to "ration out" construction and development? I don't want to build everything at once, but at the same time I don't want it to go too slow either.
  • How much load can you put on a town? At present there my AI builds one stop per town, but I'm wondering if that's a mistake.
  • How do you know if a town has more to give? I am trying to think of a way to judge whether or not more services can be added to a town. I was thinking of basing it on how much there is waiting at a station, but then I noticed that the number of waiting passengers says nothing about the RATE at which they are productted.
  • Is it more profitable to spam short range services, or to carefully choose services between the best towns regardless of range?
  • How do you strike a balance between enhancing existing services and adding new ones?
If you don't want to give away your trade secrets then I'll understand, but any tips you can give would be most helpful.

Thanks very mush guys. :)
PathZilla - A networking AI - Now with tram support.

wilco_moerman
Engineer
Engineer
Posts: 70
Joined: 05 Jun 2008 15:51

Re: Expansion Strategies? - How do you make SOOOO much money!

Post by wilco_moerman » 18 Jun 2008 13:29

I guess the best way to figure out the balance between all those choices, is just to play the game often. Just try out all the different strategies yourself and compare them.
Nunc dimittis servum tuum Domine secundum verbum tuum in pace

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9278
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Expansion Strategies? - How do you make SOOOO much money!

Post by planetmaker » 18 Jun 2008 14:00

Zutty wrote: [*]B - Once it has built everything or maxed out its loan it does nothing to follow up or maintain its services. It doesn't attempt to build any additional routes past the ones it starts with.
Paying off your loan might be an idea, if you can afford it. It saves money. Also: maybe don't max your loan completely for building. Keep something available for emergencies like before the first cash comes...
Road tend to be not the most profitable vehicle anyway. Planes are way faster than them --> more profit. You can probably only beat them, if you build also airports and make bus services to increase the amount of people waiting at them. If you have cash, use it to continue building :). You'll have easy enough more cash than you can spend - but I never play for company value or cash, so I may be a bad advisor here.
[*]What's a good way to "ration out" construction and development? I don't want to build everything at once, but at the same time I don't want it to go too slow either.
If I build a route, I make sure that I provide a service level of 66% or more, 50% at least. Otherwise local authorities won't like me in the future. That's a point I keep coming back to from time to time.
[*]How much load can you put on a town? At present there my AI builds one stop per town, but I'm wondering if that's a mistake.
[*]How do you know if a town has more to give? I am trying to think of a way to judge whether or not more services can be added to a town. I was thinking of basing it on how much there is waiting at a station, but then I noticed that the number of waiting passengers says nothing about the RATE at which they are productted.
There should be info available for a town how many passengers of a maximum passengers the town could supply are transported. At least this info is available for human players in the town info dialogue.
[*]Is it more profitable to spam short range services, or to carefully choose services between the best towns regardless of range?
That depends upon speed and distance. For busses probably there's a optimal distance. A rough guestimate for early busses is like 100 tiles(?)
[*]How do you strike a balance between enhancing existing services and adding new ones?[/list]
It's always a good idea to keep up a service level at existing routes. For minimal extra costs (no or nearly no additional infrastructure) you gain additional profit and a better standing with the authorities --> even more things to transport :).
Besides all what I said: playing yourself a few games, helps a lot indeed :)

reylas
Engineer
Engineer
Posts: 52
Joined: 22 Dec 2007 01:04

Re: Expansion Strategies? - How do you make SOOOO much money!

Post by reylas » 18 Jun 2008 14:03

See this goes back to a concern that I have with the way AI's were going. The AI that I have written so far, is almost a carbon copy of the way I like to play. I want to finish with an AI that I would enjoy playing. Not some robotic super-computer that takes over the entire map instantly.

Not that there is anything wrong with that, and I have used the AI's to enhance my own, but my AI actually tries to avoid me. It actually tries to work far away from me. That is what I wanted cause the current AI destroys any beauty that I have created in my road/rail networks by connecting strange road shapes to far out places.

My AI is not going to win any tournament or come even close. I am going for a "human" type AI that will build into something that I have to deal with later. I am not really trying to max company value after 10 years. I want to watch an Ant farm on my computer screen. Actually, since writing my AI, I have yet to play one single game of OpenTTD. I just let the game run in the background and check it every now and then to see what my peeps are up to.

Maybe my AI will someday be good enough to be included as the "easy" AI. I know convoy would be tough to beat so maybe it will be the "expert" level AI. Again, not flaming anyone as those AIs (and coding skills) are far superior to my own. But being solvent to me is more important than how much money they can make.

I have been thinking about submitting my AI for the tournament just to see how bad it would be, but it would have to be done privately. Not because I want to protect secrets, but because my code is so wacky that I would be ashamed of anyone seeing it. TrueLight would get a real laugh out of it I am sure :).

I think these things can get too smart.

MarkS

Finaldeath
Engineer
Engineer
Posts: 72
Joined: 09 Apr 2006 23:49
Location: UK
Contact:

Re: Expansion Strategies? - How do you make SOOOO much money!

Post by Finaldeath » 18 Jun 2008 14:17

reylas, I have that opinion too. I'm going to find the time this weekend I hope to finish my Astar algorithm for boats of all things ;)

"Professional AI which wants to win" would basically use 95% rail and almost nothing else. You can make the AI do really b****** things if you so wanted too, but having it do that is really unprofessional. There is some honour among thieves (or in this case, Tycoons ;) ).

Zutty; in your loop, do what WrightAI does and have functions to:

- Improve existing routes (ie; if there is capacity available - not too many buses per station, and tons of passengers, add a few buses to a route).
- Build more routes (of course :) ).
- Pay of loan (obvious - the loan interest can be a killer early in a companies career even at 2%, since it'd have less money overall and expensive routes - like planes - would be out of the question)
Finaldeath

User avatar
Ralph
Engineer
Engineer
Posts: 87
Joined: 21 Jun 2004 15:25

Re: Expansion Strategies? - How do you make SOOOO much money!

Post by Ralph » 18 Jun 2008 14:22

Losing the tournament is good fun :D , and I wish I has answers for some of your questions myself.

On Point B, once you have spent your initial money, check how much you have now and again and add more routes when you have enough, also try to repay your loan, the exact balance between repaying and construction is still something I am experimenting with.

When choosing new routes, my AI decides based on a combination of the distance between the towns, the population and the number of routes already serving the town.

I make sure to reuse the bus stop in each town, this is probably more efficient early on, but when they have grown a bit bigger you may want more bus stops for better coverage.

User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Expansion Strategies? - How do you make SOOOO much money!

Post by Zutty » 20 Jun 2008 10:59

Thanks for the suggestions guys. I think you're right in particular on A) play the game more often! and B) keep service ratings high.

I have set up a basic scenario with tow large cities in it to test how many bus stops is optimal. I was working under the assumption that my AI was struggling because of poor coverage.

The AI builds 70 buses (the most it can afford) and they go to randomly selected pairs of stops in both cities. I found that with just 2 stops (one in each town) the queues were very long and the company valued suffered hugely from this, managing less than £100k after 10 years!!

With an extremely dense scheme using over 40 stops in total the company value after 10 years soared to £1.7m for the SAME number of vehicles. Interestingly though I found that every time I reduced the number of stops the value increased even further. I gave up (read: went to sleep) at 17 stops which yielded a company value of £2.3m! I expect this trend to continue even further when I get more time to test it.

This would seem to suggest that the barrier to profitability is not coverage but volume of traffic. I think that the extra performance was simply because more buses could turn over in the same amount of time. The extra capacity from having better coverage was being largely wasted. Even with 17 stops and 69 vehicles the average station rating was rather poor. I reckon I could get the same performance with one or maybe two stops, if they were made more efficient (i.e. using multi-stops). I already use DTRSs (where possible) but the policy for building these is rather weak. To be able to build proper RoRo bus stations would be a HUGE challenge that I am certainly not ready for yet!!

Hypothetically though, I think if a town was fully covered by highly efficient stations it might be possible to squeeze profits in the order of hundreds of thousands out of a single city with buses alone, though it would take hundreds or even thousands of them in a single route!! I think I'll need to start looking at NewGRFs to extend this study, so I can use larger buses. Zephyris' generic set looks promising to me.

Finally I completely agree with the suggestion that its better to build a human like AI than a hardcore tournament winning one. However its early days yet and I think even a low-skilled human player could beat the best of our AIs at this stage! Plus I'd like to find the upper limit of my AI so that I can tailor difficulty levels.
PathZilla - A networking AI - Now with tram support.

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9278
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Expansion Strategies? - How do you make SOOOO much money!

Post by planetmaker » 20 Jun 2008 11:20

Zutty wrote:This would seem to suggest that the barrier to profitability is not coverage but volume of traffic.
it's volume times transportation speed.

User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Expansion Strategies? - How do you make SOOOO much money!

Post by Zutty » 20 Jun 2008 11:37

planetmaker wrote:
Zutty wrote:This would seem to suggest that the barrier to profitability is not coverage but volume of traffic.
it's volume times transportation speed.
Ah yes good point.
PathZilla - A networking AI - Now with tram support.

Yexo
Tycoon
Tycoon
Posts: 3653
Joined: 20 Dec 2007 12:49

Re: Expansion Strategies? - How do you make SOOOO much money!

Post by Yexo » 20 Jun 2008 11:49

Zutty wrote:Thanks for the suggestions guys. I think you're right in particular on A) play the game more often! and B) keep service ratings high.
I'm not so sure whether or not keeping service ratings high is important.
Hypothetically though, I think if a town was fully covered by highly efficient stations it might be possible to squeeze profits in the order of hundreds of thousands out of a single city with buses alone, though it would take hundreds or even thousands of them in a single route!!
It'd be nice to see an AI exploiting only a single town as far as possible. However, it'd be better to do that without newgrfs so we can compare you AI to other AIs. On another node, have you tried building trams instead of busses? As the generic tram set is considered standard, you could use that one.
Finally I completely agree with the suggestion that its better to build a human like AI than a hardcore tournament winning one.
I think neither of them is better, it are just two different approaches. I for one like to build an AI that makes a much money as possible. However, I wouldn't want to play against such an AI. So I guess it are just different types of AIs.
However its early days yet and I think even a low-skilled human player could beat the best of our AIs at this stage! Plus I'd like to find the upper limit of my AI so that I can tailor difficulty levels.
Then I challenge you to defeat wrightai using only planes or admiralai using only busses/trucks :) I think you'll find that quite hard. Without cheating like deleting some town-owned roads of course.

User avatar
Zutty
Director
Director
Posts: 565
Joined: 22 Jan 2008 16:33

Re: Expansion Strategies? - How do you make SOOOO much money!

Post by Zutty » 20 Jun 2008 13:56

Yexo wrote:I'm not so sure whether or not keeping service ratings high is important.
Its not necessarily the rating im interested in but how efficiently a station is serviced. I'm using the station rating as an analogue for this.
It'd be nice to see an AI exploiting only a single town as far as possible. However, it'd be better to do that without newgrfs so we can compare you AI to other AIs.
I'd like to add NewGRF support, but I wouldn't have it rely on them for the reasons you state.
On another node, have you tried building trams instead of busses? As the generic tram set is considered standard, you could use that one.
Oooh, I didn't know that. Good tip, cheers.
I think neither of them is better, it are just two different approaches. I for one like to build an AI that makes a much money as possible. However, I wouldn't want to play against such an AI. So I guess it are just different types of AIs.
Yeah I think your right. Its just a matter of opinion I think. I think one of the joys of NoAI will be to see all the different ways people have of dong things. Hopefully as AIs advance their differing strategies will become more apparent.
Then I challenge you to defeat wrightai using only planes or admiralai using only busses/trucks :) I think you'll find that quite hard. Without cheating like deleting some town-owned roads of course.
Ahem... Dammit! ;) Let me re-phrase that then...

I think a skilled human player who isn't bound by the restrictions on our AIs (i.e. planes, buses only) could beat our them. I think a well crafted rail network carrying coal and such could probably beat aviatorai or admiralai, though I can't prove it right here and now!!!

What I'm trying to say is that I'd like to be able to make an AI that can challenge a human player, and to be able to do that I have to know what is it capable of at its best.
PathZilla - A networking AI - Now with tram support.

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests