Programmer Challenge: create an OpenTTD AI

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

User avatar
Corniel
Engineer
Engineer
Posts: 17
Joined: 01 Feb 2008 14:06
Location: Leiden - Netherlands
Contact:

Programmer Challenge: create an OpenTTD AI

Post by Corniel »

The Dutch software company I'm working for (Tjip) is planning it's second Programmer Challenge. Last year the participants had to make an awale engine. This year we were searching for something different. One of the ideas is writing an AI for OpenTTD.

Ofcourse I did some research: read some stuff at this forum, downloaded the source code (also the NoAI branch), read the wiki, built the application. Furthermore, I played the game for a while. :D

Anyway, there are some issues who have to been solved:
  • Possibility to run different AI's at the same time;
  • Possibility to configure different AI's;
  • Graphics. We don't have problems with buying the original (for every participant, for $4,99 each) but its more practical to give some downloadable binaries (and not are redone at the moment?!);
  • Not all stuff is implemented yet in NoAI;
  • Issues because all AI's have to run on the same machine (CPU, memory, etc.).
My questions are (ofcourse): Are here people who want to help solve some of the problems? Do you think it can be done anyway? And last but not least, are There people who want to compete?

Code: Select all

while(Me.Alive()){
    Me.KickAss();
    try{
        Me.LearnLanguage(Language.EN);
        Me.dyslectic = false;
    }
    catch{ /*nice try :( */}
}
User avatar
CMircea
Chairman
Chairman
Posts: 887
Joined: 29 Dec 2006 14:05

Re: Programmer Challenge: create an OpenTTD AI

Post by CMircea »

Yes it can be done, but we there are more important things than an AI. Many people don't use the AI and play online instead. How about making a PBS system, based on the new proposed one, that will be good to be included in trunk? I bet that TONS of players will love that over a competent AI.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Programmer Challenge: create an OpenTTD AI

Post by Rubidium »

Desolator: there is no "whom's PBS is best" contest that can be hold. It either works or it does not work.

NoAI can run different AIs at the same time, it's just that it either randomly starts ones or you force it to be a single AI via the command line. So it's basically the same AI configuration problem.

The graphics is not something I can really talk about; primarily because I have no idea how it's going (do not have time to follow that).

What do you mean with "not all stuff is implemented in NoAI"? The goal of NoAI was to get a useable framework as soon as possible and then extend it further. Ships and aircraft would be too simple for AIs, whereas trains would take too much time to develop a framework for 'just' to test stuff. Now there is a working system that allows one to create a road vehicle AI (without tunnels and bridges though). Implementing the rest is not hard, it just takes a lot of time.

The reason that NoAI is currently stalled is that the devs (TrueBrain and myself) that worked on it have no time to continue it at the moment. For both real-life things that are more important (by far the biggest cause) and the fact that we would really want to get 0.6.0 released too.

The AIs running on the same machine shouldn't be much of a problem. There can only be one AI that is running at a time. However, the AI will have to 'hand' the control back to OpenTTD when it is done with the stuff it wants to do. This can be either by using a 'sleep' command or by the fact that every action that changes the game state explicitly returns the control to OpenTTD and it will then only return the control once the command has been executed, which is at least in the next game tick.

I would love to help with the problems, but as I said before I have some real-life stuff that will take virtually *all* my time the next two months to the extend that it's likely that I will be unreachable for most parts of the next two months.

Competing AIs is something that has been thought about before as way to get some good AIs for OpenTTD, but we never actually had a contest because there are only a few AIs. Whether the number of AIs will grow when the challenge starts is something I cannot tell anything meaningful about.
User avatar
Corniel
Engineer
Engineer
Posts: 17
Joined: 01 Feb 2008 14:06
Location: Leiden - Netherlands
Contact:

Post by Corniel »

Rubidium wrote:NoAI can run different AIs at the same time, it's just that it either randomly starts ones or you force it to be a single AI via the command line. So it's basically the same AI configuration problem.
Well I supose it's not that hard to fix. I Just need to find out how it can be done best.
The graphics is not something I can really talk about; primarily because I have no idea how it's going (do not have time to follow that).
No wories. It's no big deal, it was just a 'beside' question.
What do you mean with "not all stuff is implemented in NoAI"? The goal of NoAI was to get a useable framework (..)
Well I did read what was implemented. Ofcourse, planes and ships are 'to easy', but espacialy planes can be realy profitable. I didn't had the time yet to test some stuff myself (I try to this weekend) but I'll try to do this weekend.
The reason that NoAI is currently stalled is that the devs (..) that worked on it have no time to continue it at the moment.
Fair enough ofcourse. But before I give an advise to my company, I have to be sure, that we can do our challenge whithout the risk of going over budget (too far), and that depands ofcourse mostly on what still has to be done. Futhermore, I hope you (the OpenTTD comunity) can help me/us with some details.

I hope that I'm still a 'fan' after a weekend trying to run an engine myself. :D

Code: Select all

while(Me.Alive()){
    Me.KickAss();
    try{
        Me.LearnLanguage(Language.EN);
        Me.dyslectic = false;
    }
    catch{ /*nice try :( */}
}
Noldo
Engineer
Engineer
Posts: 75
Joined: 16 Jun 2005 13:17
Location: Lappeenranta, Finland

Re: Programmer Challenge: create an OpenTTD AI

Post by Noldo »

BTW, Where did you find that price for buying the game.

I googled and found only used ones on amazon.
User avatar
Corniel
Engineer
Engineer
Posts: 17
Joined: 01 Feb 2008 14:06
Location: Leiden - Netherlands
Contact:

Re: Programmer Challenge: create an OpenTTD AI

Post by Corniel »

Noldo wrote:BTW, Where did you find that price for buying the game.
www.classicgamingpresents.com

Code: Select all

while(Me.Alive()){
    Me.KickAss();
    try{
        Me.LearnLanguage(Language.EN);
        Me.dyslectic = false;
    }
    catch{ /*nice try :( */}
}
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1729
Joined: 30 Mar 2005 09:43

Re: Programmer Challenge: create an OpenTTD AI

Post by peter1138 »

Sorry, that site is not a legitimate place to purchase:
http://www.classicgamingpresents.com/Terms.htm wrote:Disclaimer:


What does CGPT Ltd Offer? We offer our customers an Installer which patches various
old classic games to make them work on newer versions of Windows (XP & Vista). We
do not in anyway sell the actual games, we only give them away for free as abandonware..
He's like, some kind of OpenTTD developer.
User avatar
Corniel
Engineer
Engineer
Posts: 17
Joined: 01 Feb 2008 14:06
Location: Leiden - Netherlands
Contact:

Purchase TTD

Post by Corniel »

peter1138 wrote:Sorry, that site is not a legitimate place to purchase (..)
Tanx for poiting that out. I missed that. In that case http://www.tycoongames.net, and the games costs uit $12.95. Not as cheap as $4.99, but still not the problem.

Code: Select all

while(Me.Alive()){
    Me.KickAss();
    try{
        Me.LearnLanguage(Language.EN);
        Me.dyslectic = false;
    }
    catch{ /*nice try :( */}
}
User avatar
Korenn
Tycoon
Tycoon
Posts: 1735
Joined: 26 Mar 2004 01:27
Location: Netherlands
Contact:

Re: Programmer Challenge: create an OpenTTD AI

Post by Korenn »

The graphics replacement project that allows playing of ottd without a copy of TTD is still being developed, the intermediate results can be seen in the graphics forum. It's going at a steady pace currently, but it depends solely on the time invested by a group of volunteering artists, so there is no guarantee that it will be finished by any predictable date.

I think this initiative is great, and if the framework for an AI contest is created and released (which you would have to do, it is an open source project ;) ) this can be used to hold more such competitions to get to better and better AIs.

It's even more interesting to create AIs that aren't just going for the maximum profit, but if some would for instance also try to sabotage other players, or act as a convincing human player, or even build realistic looking railways like the people in the screenshot forum.
User avatar
Corniel
Engineer
Engineer
Posts: 17
Joined: 01 Feb 2008 14:06
Location: Leiden - Netherlands
Contact:

Re: Programmer Challenge: create an OpenTTD AI

Post by Corniel »

Well some interesting movement. My colleague (Morloth) have made some changes/adds at the NoAI branch. Great stuff, as far as I can see. Furthermore, another colleague is working on a module who allows to configurative which AI’s should play at the same time.

As Morloth pointed out elsewhere, at the moment we are planning only to allow cars, because of the complexity, and the support. Maybe we will allow the others (planes, ships, trains) as well, we will see.

When we have more information, we let you know.

Code: Select all

while(Me.Alive()){
    Me.KickAss();
    try{
        Me.LearnLanguage(Language.EN);
        Me.dyslectic = false;
    }
    catch{ /*nice try :( */}
}
User avatar
Corniel
Engineer
Engineer
Posts: 17
Joined: 01 Feb 2008 14:06
Location: Leiden - Netherlands
Contact:

Re: Programmer Challenge: create an OpenTTD AI

Post by Corniel »

Corniel wrote:
  • Graphics. We don't have problems with buying the original (for every participant, for $4,99 each) but its more practical to give some downloadable binaries (and not are redone at the moment?!); (..)
Korenn wrote:The graphics replacement project that allows playing of ottd without a copy of TTD is still being developed, the intermediate results can be seen in the graphics forum. It's going at a steady pace currently, but it depends solely on the time invested by a group of volunteering artists, so there is no guarantee that it will be finished by any predictable date. (..)
There is good news from the graphics part of the Challenge. Atari - current owner of the rights of TTD – officially allows us to use and distribute the graphics and sound binaries, free of charge. So this problem is solved. 8)

Code: Select all

while(Me.Alive()){
    Me.KickAss();
    try{
        Me.LearnLanguage(Language.EN);
        Me.dyslectic = false;
    }
    catch{ /*nice try :( */}
}
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1729
Joined: 30 Mar 2005 09:43

Re: Programmer Challenge: create an OpenTTD AI

Post by peter1138 »

Corniel wrote:There is good news from the graphics part of the Challenge. Atari - current owner of the rights of TTD – officially allows us to use and distribute the graphics and sound binaries, free of charge. So this problem is solved. 8)
*BLINK* Pardon? Cite?
He's like, some kind of OpenTTD developer.
nautre125
Engineer
Engineer
Posts: 74
Joined: 04 Feb 2008 10:58
Location: Strasbourg, France

Re: Programmer Challenge: create an OpenTTD AI

Post by nautre125 »

This will have interresting consequences.
User avatar
Corniel
Engineer
Engineer
Posts: 17
Joined: 01 Feb 2008 14:06
Location: Leiden - Netherlands
Contact:

Re: Programmer Challenge: create an OpenTTD AI

Post by Corniel »

peter1138 wrote:*BLINK* Pardon? Cite?
Yes, well read... :roll: :D :roll:
nautre125 wrote:This will have interresting consequences.
I think so. We had contact with somebody from Atari Benelux (Belgium, The Netherlands and Luxembourgh). I have no reason to believe this should only apply to those countries.

Code: Select all

while(Me.Alive()){
    Me.KickAss();
    try{
        Me.LearnLanguage(Language.EN);
        Me.dyslectic = false;
    }
    catch{ /*nice try :( */}
}
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Re: Programmer Challenge: create an OpenTTD AI

Post by XeryusTC »

Corniel wrote:
peter1138 wrote:*BLINK* Pardon? Cite?
Yes, well read... :roll: :D :roll:
I think that he means that you should cite the text in which Atari allows it. Just some random person on a forum saying it is possible isn't really official and could get the devs into trouble.
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
User avatar
Corniel
Engineer
Engineer
Posts: 17
Joined: 01 Feb 2008 14:06
Location: Leiden - Netherlands
Contact:

Re: Programmer Challenge: create an OpenTTD AI

Post by Corniel »

XeryusTC wrote:I think that he means that you should cite the text in which Atari allows it. Just some random person on a forum saying it is possible isn't really official and could get the devs into trouble.
Good point. Unfortunately there are two problems:
  1. There email disclaimer says that it is confidential so I’m not sure, if I am allowed to cite;
  2. It’s in Dutch. Most people here wouldn’t be able to read it.
I’ll discus this with my project manager, and hope to be able to inform you on this, as soon as possible.

Code: Select all

while(Me.Alive()){
    Me.KickAss();
    try{
        Me.LearnLanguage(Language.EN);
        Me.dyslectic = false;
    }
    catch{ /*nice try :( */}
}
Noldo
Engineer
Engineer
Posts: 75
Joined: 16 Jun 2005 13:17
Location: Lappeenranta, Finland

Re: Programmer Challenge: create an OpenTTD AI

Post by Noldo »

So they are giving permission to something but don't want others to know what is it that they are giving the permission for.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Programmer Challenge: create an OpenTTD AI

Post by planetmaker »

Corniel wrote:
XeryusTC wrote:I think that he means that you should cite the text in which Atari allows it. Just some random person on a forum saying it is possible isn't really official and could get the devs into trouble.
Good point. Unfortunately there are two problems:
  1. There email disclaimer says that it is confidential so I’m not sure, if I am allowed to cite;
  2. It’s in Dutch. Most people here wouldn’t be able to read it.
I’ll discus this with my project manager, and hope to be able to inform you on this, as soon as possible.
I'm neither a lawer nor am I'm familiar with the Dutch laws. But to my knowledge - at least in German regulations - these standard disclaimers you find usually under business e-mails have no legal effect. But of course it might affect your relation to them, should they not like your behaviour or the disclosure should give rise to compensation claims. Both things I doubt in this case, though.
jdevreede
Engineer
Engineer
Posts: 1
Joined: 21 Feb 2008 13:02

Re: Programmer Challenge: create an OpenTTD AI

Post by jdevreede »

Me being that project manager Corniel refers to. Let me add my bit.

I have asked permision to Atari for the specific purpose of making copies for participants in our programmer challenge. They gave us that permision.

I would not co as far as claiming the gave broad permision to make copies to everyone; it's just for our specific goal.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1729
Joined: 30 Mar 2005 09:43

Re: Programmer Challenge: create an OpenTTD AI

Post by peter1138 »

Indeed not. However, any of our (the community's) previous attempts to contact Atari have failed, usually with confusion over whether Atari actually have the rights...

I understand that Redboss' Train Tycoon has rights to use the TTD graphics from Chris Sawyer (or his Agency) directly. (Although looking at their website the graphics do not look like the originals.)
He's like, some kind of OpenTTD developer.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 10 guests