Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon May 21, 2018 7:17 am

All times are UTC




Post new topic  Reply to topic  [ 97 posts ]  Go to page Previous 1 2 3 4 5 Next
Author Message
 Post subject: Re: DictatorAI
PostPosted: Sat Aug 06, 2011 1:10 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
Here's a new version for ones that like to test before release.
This is version 106, HIGHLY in an unstable state !!! Many things change in the code but it's mostly code handling and optimizing, so don't expect too much new features.

But you can test the new tasks handling function, the ai find jobs in a more smooth way and plan better next job to do.
I have highly optimize it to run on big maps too, the ai now can start working 10 times faster (and it's a bare minimum, really expect big improvment here).
More optimizations to the building functions should also higher ai incomes (still need more testing, but first results are promising vs older versions).
I took care of not busy too much the squierrel VM, other ai will like it.
Also add terraforming functions, for now only used by airports functions, but this will ease trains (still plan to add them, but for that big task i prefer waiting until my free time is higher)

I've done few stability tests, but really too few, and as i'm planning others stuffs, they nearly cannot end. So this version is more an alpha than anything else. Please submit bugs you might found (specially crashs). I cannot promise a quick fix, but it will be done asap.


Top
   
 Post subject: Re: DictatorAI
PostPosted: Sun Aug 07, 2011 10:52 am 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 880
Good news that this AI is still being developed :)
I'm running a test right now, no crash so far. The only problem is that it still eats my CPU :(


Top
   
 Post subject: Re: DictatorAI
PostPosted: Sun Aug 07, 2011 6:28 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
can't do much more, even i could save some cpu cycle, i just cannot saved all cpu cycles, or no, in fact i could, but i would then rename it to idlemore++

i think you should give up with the zx81 and buy a real computer brumi :)
here's what that save game (see file attach, it's one of you i think no?) do here in fast forward:


edit: i've update to 106b (not b as beta, but b as more recent and need another name) the file so you can test with an even newer version (same as the one i've use for that screenshot), correct some bugs (one when loading that scenario ^^ and a few others)


Attachments:
Toyland test after 75 years.sav [1.85 MiB]
Downloaded 111 times
Capture-2.png [666.86 KiB]
Downloaded 1 time
Top
   
 Post subject: Re: DictatorAI
PostPosted: Sun Aug 07, 2011 6:55 pm 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 880
I have a 3.01 GHz AMD Athlon II X2 250 :P
Have you tried putting some AIController.Sleep(1)'s into the code where some serious calculation is going on?


Top
   
 Post subject: Re: DictatorAI
PostPosted: Mon Aug 08, 2011 12:16 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
Code:
grep -R Sleep * | wc -l
56


That's not a proof i've put them in the right place, and i might have forget some somewhere, but i have put plenty and take care to put them where it's need (mostly, big loop, so the VM have a chance to take back the hand).
It's working fine here, i have some hipcup sometimes, but my desktop is no more less responsive, vlc doesn't even miss a picture...
I have few newGRF only, and never really use them :P but i suppose it could make a big difference.
My cpu is a i7 950 and ttd can only busy a core fully (sometimes 98%, but more near 90% average) but on that big map with many vehicles and running it fastforward.

Here's another one with the same savegame and another openttd and some applications and my full desktop.
See, nothing really that bad, you must have something on your computer that take your cpu down.


Attachments:
Capture-3.png [1.02 MiB]
Downloaded 1 time
Top
   
 Post subject: Re: DictatorAI
PostPosted: Mon Aug 08, 2011 9:00 am 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 880
Hmm... Sorry, 'it eats my CPU' doesn't describe the problem precisely, as OpenTTD on normal speed with DictatorAI only consumes about 10% of my computing capacity (and I tend to take care not to run unneccessary background tasks). But it is certainly true that OpenTTD lags visibly when your AI is running, especially on fast forward. The construction speed of competitors is set to 'very fast' when I'm testing AIs, which further increases the load.
So sorry, my wording was not correct...


Top
   
 Post subject: Re: DictatorAI
PostPosted: Mon Aug 08, 2011 9:07 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9025
Location: Sol d
Brumi wrote:
But it is certainly true that OpenTTD lags visibly when your AI is running, especially on fast forward.


Fast forward means "run as fast as you can". A lag is quite what can be expected then...

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
 Post subject: Re: DictatorAI
PostPosted: Sat Sep 03, 2011 9:40 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
I think i found your issue brumi, i have a big loop (with sleep) that call a test function that itself valuate engine type to find multi-answer... (that's for the story)
now for the problem: if the list of engines avaiable is big, that function is time consuming by itself (well, i can't do anything against that, you just have many engines and i must play with that), but i'll work to find a way to cache that result or another solution, because as-is the function is doing nearly nothing with default engine, but with a huge list of engine this indeed exhibit a noticeable slowdown. Must be why you were having trouble and i wasn't.
I'll work on that, and see in corners to improve it. I'll look for other functions that might be affect as well.


Top
   
 Post subject: Re: DictatorAI
PostPosted: Tue Nov 01, 2011 6:40 am 
Offline
Tycoon
Tycoon

Joined: Wed Aug 26, 2009 6:33 am
Posts: 2493
Location: Poland
viewtopic.php?f=31&t=57221&p=978171#p978171 - user reported freezes caused by this AI

_________________
Correct me If I am wrong - PM me if my English is bad
AIAI - AI for OpenTTD


Top
   
 Post subject: Re: DictatorAI
PostPosted: Mon Nov 28, 2011 12:53 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
This is my current work, for now trains aren't still enable and savegame isn't working (well it is, but i didn't check if it need an update).
So it's just a work in progress release, i might upload that version to bananna once i fix bugs, savegame and some others things i need to do, but not as it is right now, so you could only grab it from here (see first post)


Top
   
 Post subject: Re: DictatorAI
PostPosted: Mon Feb 27, 2012 12:05 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
So, i finally found a long standing bug that was crashing openttd, so faith is back...

Here's the latest version i've made, maybe not yet totally stable, but should work ok.
I change and improve many things, specially for big maps. The AI should handle huge 2048x2048 maps easy.


Top
   
 Post subject: Re: DictatorAI
PostPosted: Tue Mar 13, 2012 12:25 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
I've stabilize my AI to version 1.53 you should be able to get it thru download content or from first page.

I'm still not releasing it with trains as i need some more work, but it's close to be end.

Savegame format has change, so please use this version if you need to convert an old savegame to the newer format, as next version should use newer API functions that will drop old savegame support.

Thank you for trying it and reporting bugs


Top
   
 Post subject: Re: DictatorAI
PostPosted: Sat Mar 17, 2012 12:29 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
Another update, correct some bugs, add few functionalities (allow terraforming for road station now, try to solve a lost vehicle...)


Top
   
 Post subject: Re: DictatorAI
PostPosted: Wed Mar 21, 2012 12:43 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
For ones curious to see, here's version 155 in progress, this is the first version with trains enable :D
(this imply be nice with the handling as it's still early and don't expect 0 crash...)

Anyway, if you're in mood to help, try it and report bugs, thank you.


Top
   
 Post subject: Re: DictatorAI
PostPosted: Wed Mar 21, 2012 8:05 pm 
Offline
Chairman
Chairman

Joined: Sat Jul 18, 2009 5:54 pm
Posts: 880
Good to see that there is another AI coming which uses both trains and road vehicles, gladly testing it now :)

I've seen a crash with the ECS vectors and some vehicle sets loaded (probably UKRS/NARS, eGRVTS, Aviators, FISH, but I don't remember...), I don't know if it's because of these NewGRFs or not:
Attachment:
crash.png
crash.png [ 16.59 KiB | Viewed 4017 times ]


Otherwise it's working well so far in the vanilia edition :)

EDIT: Not anymore...
Attachment:
crash2.png
crash2.png [ 35 KiB | Viewed 4015 times ]


EDIT2:
I noticed that there is a single locomotive running on rail line which is already being used by another train. This locomotive has no orders.
Attachment:
trains.png
trains.png [ 95.95 KiB | Viewed 4012 times ]


Top
   
 Post subject: Re: DictatorAI
PostPosted: Thu Mar 22, 2012 12:22 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
thank you brumi for trying and reporting those errors

- error 1 was already found and fix, a stupid one
- error 2 is more problematic and need more handling to fully correct the "why it happen", for now i already fix the "don't crash if it happen" anyway i've add a check to try to order a vehicle to goes to a "null" homedepot.
- error 3 worry me a bit more, as the no order solve depend on the error 2 (no order, trying to set new ones), but the train running alone is a bit more sad, as i have already think it could happen (running low on money after building the train and 0 cash to pay the wagons), and the AI should have catch it, and instead of starting that empty train, should have sell it. I suppose i didn't do it as good as i think :)


For the newgrf, i didn't test every grf that exist, but i have test some of them, and you could see the AI should handle them pretty well (the ones i test, like eGRVTS).
For the Aviators, if it's av8 something, my AI and all AIs i've saw, and even for human player, it looks impossible to make money with the costs and running costs those aircrafts have, i really like the drawing and the details of the aircrafts, but the settings ruin totally the fun of this grf (for me at least). I'm not sure how i should handle this one, except my generic handling of newgrf engine doesn't work with it, but i think it comes more from the newgrf maker than a "poor" handling of my AI.
In fact, the only one that bug me seriously was the Ikarus Set that report articulated vehicle as non-articulated ones.
Anyway i could confirm none of the errors you report comes from newgrf usage as you could get them too without them.

I didn't test yet non engine newgrf (stations or industry stuff like that).

Here's an update version with many fix and the error 2 (half-fix), that should run a bit better before crashing
I named it 155a, not as alpha, even it could fit nice, but just as i need a different name so people catch it's an update one.


Top
   
 Post subject: Re: DictatorAI
PostPosted: Sat Mar 31, 2012 7:33 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
Here's another "update" of the work in progress with trains, the AI mostly remain the same, even some little change as been made to economy, some bug fixes that were affecting the AI (nothing related to trains)
A real lot of bug fixes for the trains part (the brumi's bug with trains going without wagons attach was a b**** to fix, but it's properly fix now). The ai now build its rails and plan its path in short interleaves and pause /resume the task later, so the ai isn't stuck for years waiting an answer from pathfinder with big distances.
The ai also now can retry when it fail building its route, stepping back a bit to replan a new path to avoid the error. This was originally in the AI (because of brumi's function to retry on failure) but it's now extend to calling itself the pathfinder as a subtask of the first goal and take a farer distance to replan the path.
I didn't add those functions to road pathfinding, as road pathfinding distances are always short and the ai always try to find its way from A to B using existing routes instead of pathfinding a good way to reach B. But i'll think about that later as it was a huge improvment to handling pathfinding and building big/long routes with troubles that might appears because you took a lot of time to pathfind and build a path and the world as change while you were doing that.

I still need some more work, but the ai is working ok "more or less" with trains now.

So you can grab the 155b (still not as beta) and give it a try.

Didn't think it would be that hard to handle trains at first, but cost of engine (putting a huge bill to build a route and so a huge risk for the AI safety), and also the API make it a great challenge, but it's funny to see the ai "trying" to play with trains, i just like trains a lot :P


Top
   
 Post subject: Re: DictatorAI
PostPosted: Sat Mar 31, 2012 9:46 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Mon Jun 09, 2003 6:21 pm
Posts: 4535
Location: /home/sweden
Sounds great with the pathfinder tricks you have implemented and the ability to do other tasks from time to time.

_________________
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)


Top
   
 Post subject: Re: DictatorAI
PostPosted: Sun Apr 01, 2012 9:34 am 
Offline
Transport Coordinator
Transport Coordinator

Joined: Wed Dec 29, 2010 7:36 pm
Posts: 336
And it work great, i could share it with superlib, might need a lot of change to be handle by a lib, but i have already think i could ask a callback function to "build route"... even i'm not using superlib, you know i really like the idea of a "glibc" for noai :P


Top
   
 Post subject: Re: DictatorAI
PostPosted: Mon Apr 16, 2012 2:08 pm 
Offline
Engineer
Engineer

Joined: Wed Dec 14, 2011 12:55 am
Posts: 28
I seen a prodren since AI crashes due AL_ET_TOWN_FOUNDED does not exist.

First 2 ai crashes after its places a train station. and last pink ai crashes after building 2rd line


Attachments:
Unnamed, 29th Oct 1961.png [257.32 KiB]
Downloaded 2 times
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 97 posts ]  Go to page Previous 1 2 3 4 5 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.