Compeditor AI progress?

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
User avatar
Thalass
Traffic Manager
Traffic Manager
Posts: 200
Joined: 02 Jul 2004 13:29
Location: Ontario, Canada

Compeditor AI progress?

Post by Thalass »

I've searched around these forums, and the wiki, but I can't find anything on the new compeditor AI? According to my install it's still in Alpha. Who is working on it?

I guess it won't be included untill 0.5 or something. But a progress update reporty thing would be nice. :)
sc79
Director
Director
Posts: 586
Joined: 22 Feb 2005 09:51

Post by sc79 »

Well, its been 'in Alpha' on the patch configuration page since atleast r1313 (dec '04. no specific reason i picked that revision). Maybe some work has been done on it since then, but I dont recall any threads etc.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

Last I knew was that a whole new API was being designed (and coded) to allow user-created scripts to hook into and control the AI. Look for info about the GPMI. Its certainly not going to make 0.5.0.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

richk67 wrote:Last I knew was that a whole new API was being designed (and coded) to allow user-created scripts to hook into and control the AI. Look for info about the GPMI. Its certainly not going to make 0.5.0.
I have been fiddling around with openttd.gpmi a bit, it is actually meant to make OTTD fully modular but now it is just for creating AI scripts. But the AI is still as smart as it's programmer (trust me, I know ;)).
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
Finaldeath
Engineer
Engineer
Posts: 72
Joined: 09 Apr 2006 23:49
Location: UK
Contact:

Post by Finaldeath »

Hmm, my first post. Been playing some OpenTTD recently.

I'm dead interested in this update on the AI, just had to post. Will be looking into the AI if user-made scripts can be easily used with it, or if the AI is modular so its easy to edit.

Interesting stuff, I hope work is going well on it, wether ot not updates will be available sooner or later, I'll be hanging around on and off and checking up on this aspect ;)
Finaldeath
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

About OpenTTD with GPMI enabled AIs (road only, sorry ;)):

http://www.libgpmi.org/docs/gpmi_openttd/index.htm

To comment on richk67: it is 100% ready and tested, so in fact it could be merged to the current trunk. Only I refuse to do it, and no other dev seems interesting in doing the job. The patch for it is freely available via the URL above.

For the rest: the ingame NewAI is dead. The source-file clearly states that ;) It is impossible to make a good AI in the current OpenTTD-source-code. The amount of helper-functions exceeds the amount of real AI lines. Therefor this GPMI enabled AI version is created, AIs dropped from 5000+ lines to just 300, and still do the same ;)

An other important note: OpenTTD with GPMI enabled AIs is also on a hold. Currently we are rewriting OpenTTD from scratch with a small group, but this time GPMI enabled, meaning it will be very modular and compact. But, that is an other story... :)
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Post by richk67 »

TrueLight wrote:To comment on richk67: it is 100% ready and tested, so in fact it could be merged to the current trunk. Only I refuse to do it, and no other dev seems interesting in doing the job. The patch for it is freely available via the URL above.
OK thanks for the info. I was hoping that I could build a new rail AI with it.
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

I finished the first part of my AI :D, it does the following:
1. It searches for a town with a population of 1500 or bigger.
2. It searches for empty tiles, deletes tiles if they're too close together and builds stations on it.
3. It marks that there is a depot needed in the town. This is done so we don't build a complete network in one day.
4. It marks that there are vehicles needed in that town. Same reason as 3.
5. It builds a depot when the AI feels like it (that is every month).
6. It builds the vehicles when there is a depot in the town. It builds the same amount of vehicles as there are stations in the town.
7. It gives out orders to the vehicles and starts them.
8. It repeats this process, the time between two laps is 3 months.

It might be that I need to balance the times a bit more but I will take a look at that later.

Things that my AI doesn't do, but what will be added later (probably):
* Repaying loan. This will probably be done at the end of each year and when the amount of money is bigger than 300 000 credits. It will repay about the half of this 300 000 credits (150 000 credits :P).
* Build roads between two towns if they're close enough to each other, this will need some good thinking.
* Buy more vehicles if the stations aren't serviced good enough.

I added some screenshots of my AI (with prove that I didn't build it myself :P). More screenshots can be found here, I request that you won't take a look here because I upload the most important screenshots.

If you're interested in my AI I could PM you the files, if you have OpenTTD.GPMI (download here or here) that is. The AI isn't very optimised now (OpenTTD doesn't respond for a few seconds when the AI decides to build) but it will be when I finish it.

[Edit TrueLight] Fixed URLs [/Edit]
Attachments
Another screenshot, this is a smaller town and it is the first town my AI started building in.
Another screenshot, this is a smaller town and it is the first town my AI started building in.
006.png (97.37 KiB) Viewed 353 times
Here you can see what the AI has done. This is the largest city on my test map and is the last city that where was being build by my AI.
Here you can see what the AI has done. This is the largest city on my test map and is the last city that where was being build by my AI.
005.png (123.8 KiB) Viewed 362 times
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
Finaldeath
Engineer
Engineer
Posts: 72
Joined: 09 Apr 2006 23:49
Location: UK
Contact:

Post by Finaldeath »

The second OpenTTD.gpmi link is broken, but neat going :)

Also, oddly enough, the second screenshot shows the AI building within a town < 1500 population ;)
Finaldeath
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Post by XeryusTC »

Finaldeath wrote:Also, oddly enough, the second screenshot shows the AI building within a town < 1500 population ;)
That town had a population of 1537 at the beginning of the game so there's nothing wrong with it :).
This is where you can download gpmi (I got it right now :)).

[Edit TrueLight] Fixed URL ;) [/Edit]
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
Finaldeath
Engineer
Engineer
Posts: 72
Joined: 09 Apr 2006 23:49
Location: UK
Contact:

Post by Finaldeath »

Sorry, meant to reply before, but thats great. If you need an AI tester I may well have time to put in, I do like how LUA can be used for it since I've had the oppotunity to use it (in Dawn of War, which uses it for its user and AI scripting, heh).

Still, nice progress. Getting the basics is key, especially if the system and its calls, from what I have read, are extendable up to the more complex :)
Finaldeath
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Bing [Bot] and 28 guests