100 years solo AIs openttd.exe CPU time benchmark

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

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

100 years solo AIs openttd.exe CPU time benchmark

Post by Samu »

Hi. Is there a benchmark topic about this? I was looking for an AI I could run 15 times. I'd just like to observe the computers playing on a 2048x2048 map, but my CPU is quite old, AMD Athlon XP 1800+

changing topic title:

I'm on another comp atm, and I think I won't be able to do a fair measure if I am to leave this place, which will happen in a few days. This comp is a Intel Pentium IV 2400 (mom's comp). My comp is the AMD Athlon XP 1800+
Last edited by Samu on 25 Jun 2010 13:59, edited 1 time in total.

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

Re: Which AI is the least CPU intensive?

Post by planetmaker »

Samu wrote:Hi. Is there a benchmark topic about this? I was looking for an AI I could run 15 times. I'd just like to observe the computers playing on a 2048x2048 map, but my CPU is quite old, AMD Athlon XP 1800+
I guess that very much depends upon how they perform in that particular game. Which in turn depends upon many settings (difficulty, landscape, newgrfs,some adv. settings). The CPU usage then depends effectively much more on the amount of vehicle the AI build than what they actually do themselves as OpenTTD gives them anyway only a certain amount of time to do their business.

You could of course try to do some profiling yourself, it'd make for interesting reading. There's no such comparison you ask for that I know of.

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1506
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: Which AI is the least CPU intensive?

Post by SirkoZ »

Samu wrote:Hi. Is there a benchmark topic about this? I was looking for an AI I could run 15 times. I'd just like to observe the computers playing on a 2048x2048 map, but my CPU is quite old, AMD Athlon XP 1800+
SimpleAI. :wink:

Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Which AI is the least CPU intensive?

Post by Kogut »

AIAI :wink:
I tried to stop CPU eating when building is impossible (lack of industries/cities/fund/vehicle limit).
On the other hand sometimes moving 500 vehicles consume more CPU than executing AI code.

And I think that only few AIs are prepared to be run in multiple instances (ChooChoo - CPU nightmare and maybe SimpleAi).
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Which AI is the least CPU intensive?

Post by Zuu »

2048*2048 is extremely large. A problem with a such map is that with high amount of towns and normal amount of industries you can have 17000 nodes. Where each node is a combination of a cargo and a town or an industry.

AI's that has not been designed to very early filter out a large part of the many possibilities with that amount of nodes will get problems on such a big map. If you want to have a broader selection of AI's, I would recommend up to 512x512 (or 1024x256 or 2048x128) as map size. 1024x512 would probably also work.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Blustuff
Engineer
Engineer
Posts: 112
Joined: 21 Aug 2008 09:37
Location: France

Re: Which AI is the least CPU intensive?

Post by Blustuff »

You can decrease the number of operations executed each tick by the Squirrel Virtual Machine. Most AI use intensive computation when they start. This causes very slow game at beginnings or loadings.

Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Which AI is the least CPU intensive?

Post by Kogut »

And later slow game is caused by hordes of vehicles :P
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

User avatar
Dustin
Transport Coordinator
Transport Coordinator
Posts: 272
Joined: 07 Dec 2005 19:22

Re: Which AI is the least CPU intensive?

Post by Dustin »

Denver & Rio Grande is made to run multiple instances (even picks different historical names for each) and uses hueristics on large maps to keep from iterating every node. It looks for good solutions rather than best solutions. It's always pathfinding though, so might chew up a lot of processor. However, even huge maps won't cause it to enter analysis paralysis. More from a lazy programming model than any intentional design though!

User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 13 Jul 2008 00:57
Contact:

Re: Which AI is the least CPU intensive?

Post by Michiel »

Current versions of ChooChoo aren't too bad. It still needs to spend time pathfinding, but the size of the map doesn't matter since it only looks at the map locally. Once the map is full, it's still a little eager in trying to find spots to start new networks, which might chew up some cycles.

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: Which AI is the least CPU intensive?

Post by Samu »

Hi. I've been trying some AIs for this, but haven't really took much time into testing it. Here's some I can notice right away. NoCAB is terribly heavy!!! PathZilla is heavy all the time! Denver & Rio Grande doesn't do anything at all, yet it still slows the computer. AIAI renames itself to Suicide AI, only one of it can run at a time, it's wasting a random AI slot, couldn't it automatically close down itself? SimpleAI slows the comp down a little bit when it says it's pathfinding. If it's only one, it's okay, but when there's multiple of them, it really makes it slow.

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: Which AI is the least CPU intensive?

Post by Samu »

Blustuff wrote:You can decrease the number of operations executed each tick by the Squirrel Virtual Machine. Most AI use intensive computation when they start. This causes very slow game at beginnings or loadings.
How do I do this? Is it the #op codes thing in the advanced game settings?

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Which AI is the least CPU intensive?

Post by Zuu »

Advanced options - Competitors/Opponents - # op codes

(IIRC)

Samu wrote:Denver & Rio Grande doesn't do anything at all, yet it still slows the computer.
Are you sure it does nothing? It is possible analyzing the map which is also needed in order to figure out what to build. Or did you think that AIs had CPU-free thinking? Keep in mind that apart from various lists over all industries, towns etc. the AI can only examine a single tile at the time. The only way to find where opponent vehicles/buildings are is to examine tile by tile.
Samu wrote:it's wasting a random AI slot, couldn't it automatically close down itself?
No, that's not possible. The only thing an AI could do is to try to go bankrupt quickly by spending their money on blowing up water or buying things that cost in maintenance.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Kogut
Tycoon
Tycoon
Posts: 2493
Joined: 26 Aug 2009 06:33
Location: Poland

Re: Which AI is the least CPU intensive?

Post by Kogut »

Samu wrote:AIAI renames itself to Suicide AI, only one of it can run at a time, it's wasting a random AI slot, couldn't it automatically close down itself?
OK, I think it can find water somewhere and clear it.
EDIT: In new version company will be closed below one year after starting (water destroying & tree planting).
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD

User avatar
Michiel
Transport Coordinator
Transport Coordinator
Posts: 313
Joined: 13 Jul 2008 00:57
Contact:

Re: Which AI is the least CPU intensive?

Post by Michiel »

Kogut wrote:EDIT: In new version company will be closed below one year after starting (water destroying & tree planting).
Even suicide goes green these days :P

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: 100 years solo AIs openttd.exe CPU time benchmark

Post by Samu »

Changed topic title. I made 2 tests already. I'll call it the empty world in fast forward:
- original_windows: 19m19s
- openGFX 0.2.4: 19m17s

Was just trying to find out if there was a real difference between either graphic sets.

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: 100 years solo AIs openttd.exe CPU time benchmark

Post by Zuu »

Thank you for spending your time on benchmarking the AIs. I'm looking forward to the CPU benchmark results, through I don't think CluelessPlus will win that competition. :-p
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: 100 years solo AIs openttd.exe CPU time benchmark

Post by Samu »

This is my openttd.cfg settings, and my typical save game screen position.
Attachments
openttd.cfg
(8.78 KiB) Downloaded 63 times
Benchmark.sav
(92.85 KiB) Downloaded 63 times

Samu
Traffic Manager
Traffic Manager
Posts: 236
Joined: 17 Apr 2007 14:28

Re: 100 years solo AIs openttd.exe CPU time benchmark

Post by Samu »

Hi. I know I said I'd do a 100 year benchmark, but I've been feeling ill with nauseas, vomits, etc... it doesn't interest you for this matter.

I did something different. I took the time the game needed to complete 100 years in an empty world in fast forward and used that same time to see how much years has the game progressed.

I tested with OpenTTD 1.0.3RC-1, 256x256, easy them custom, 1111111111 seed. I also noticed the AIs differs each start and that these results are not always the same should I repeat the test.

empty world in fast forward - 19:45 (all AI tests took 19:45 CPU time, then the game is paused and the current in-game date is the one that counts. Fast AI - closer to 2050, Slow AI - closer to 1950)

Admiral AI 22 - 06-09-1973
AIAI 15 - 29-04-1961
ChooChoo 361 - 18-06-1966
Chopper 7 - 15-11-2022 (after Bankrupt)
Clueless Plus 21 - 30-11-1968
Convoy 11 - 19-11-1973
Denver & Rio Grande 1 - 25-02-1990
MogulAI 5857 - 31-12-1995 (after Bankrupt)
NoCAB 495 - 16-03-1970
OtviAI 312 - 30-06-1979
PathZilla 6 - 09-08-1975
PAXLink 14 - 24-02-1975 (after Bankrupt)

User avatar
fanioz
Transport Coordinator
Transport Coordinator
Posts: 320
Joined: 19 Dec 2008 05:03
Location: Indonesia
Contact:

Re: 100 years solo AIs openttd.exe CPU time benchmark

Post by fanioz »

errrr.... I didn't found Trans, or is that you have not done yet with it ? :lol:
Correct me If I am wrong - PM me if my English was bad :D

**[OpenTTD AI]** Image
***[NewGRF] *** Image

User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2366
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: 100 years solo AIs openttd.exe CPU time benchmark

Post by Lord Aro »

Or mine for that matter, although its only just out so i'll let you off :mrgreen:
see sig
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests