NoAI Branch - An AI Framework
Moderator: OpenTTD Developers
Re: NoAI Branch - An AI Framework
@truelight
I copied this comment from order_cmd.cpp. I thought it would be a good thing if the comments were consistent over all the code, but I must admit that I also had some problems to understand what it wanted me to tell I now changed it and hope that it is a bit more understandable.
For the LowerRaiseTile patch I defined all SLOPE_* in squirrel.
And finally I used svn diff instead of the linux diff command.
@ac84 and @saint
When those functions finally exists that might be a good idea. But when I think about it I come to another question. Where do we want to integrate further intelligence, like finding a suitable place for an airport or pathfinding. If we build this in C(++) it would be real fast and powerfull, but if we build this in squirrel people could more easily change it and they would include it as library into their ai.
If this question is cleared I could create a function that finds a suitable place for building. So an ai-programmer doesn't have to search for it himself. If I remember right there also was a pathfinder available.
EDIT:
I changed LowerRaise.patch to include the enumeration of SLOPE_*. This way it is included in the noai doxygen docu and it will be automatically copied to the squirrel files.
I copied this comment from order_cmd.cpp. I thought it would be a good thing if the comments were consistent over all the code, but I must admit that I also had some problems to understand what it wanted me to tell I now changed it and hope that it is a bit more understandable.
For the LowerRaiseTile patch I defined all SLOPE_* in squirrel.
And finally I used svn diff instead of the linux diff command.
@ac84 and @saint
When those functions finally exists that might be a good idea. But when I think about it I come to another question. Where do we want to integrate further intelligence, like finding a suitable place for an airport or pathfinding. If we build this in C(++) it would be real fast and powerfull, but if we build this in squirrel people could more easily change it and they would include it as library into their ai.
If this question is cleared I could create a function that finds a suitable place for building. So an ai-programmer doesn't have to search for it himself. If I remember right there also was a pathfinder available.
EDIT:
I changed LowerRaise.patch to include the enumeration of SLOPE_*. This way it is included in the noai doxygen docu and it will be automatically copied to the squirrel files.
- Attachments
-
- MoveOrder.patch
- (2.65 KiB) Downloaded 54 times
-
- LowerRaiseTile.patch
- (7.95 KiB) Downloaded 57 times
Last edited by dynaxo on 14 Oct 2007 17:49, edited 1 time in total.
As you may presently yourself be fully made aware of, my grammar sucks
Re: NoAI Branch - An AI Framework
Thanks for the nice words about Clueless.saint wrote: If/when I do continue (which I would like to ), it seems that a reasonable framework/helpers to do the basics such as in Clueless (impressive work Zuu!) is a must in all AI's, adding to the work we need to do to ensure the rest of the AI is easier to code.
Though Clueless was written just after NoAI was made public. Back then tile lists and other neat features that your AI will benefit from where not available in the NoAI branch.
Good luck with your AI when you continue.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
-
- Engineer
- Posts: 72
- Joined: 23 Sep 2007 09:57
Re: NoAI Branch - An AI Framework
what programing language are we useing
Re: NoAI Branch - An AI Framework
OpenTTD is programmed in C/C++ while the ai's get programmed in squirrelrabbit67890 wrote:what programing language are we useing
As you may presently yourself be fully made aware of, my grammar sucks
-
- Engineer
- Posts: 72
- Joined: 23 Sep 2007 09:57
Re: NoAI Branch - An AI Framework
can i build a ai in c++
Re: NoAI Branch - An AI Framework
dynaxo wrote:OpenTTD is programmed in C/C++ while the ai's get programmed in squirrelrabbit67890 wrote:what programing language are we useing
As a second option you can also make your AIs using pure C++, though the API development is mainly targeted to squirrel, even if it is accessible from C++ AIs too.rabbit67890 wrote:can i build a ai in c++
Some links that might be of interest:
- Squirrel website - the website of the squirrel language.
- NoAI main wiki page
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
-
- Engineer
- Posts: 72
- Joined: 23 Sep 2007 09:57
Re: NoAI Branch - An AI Framework
how do i install squirrelZuu wrote:dynaxo wrote:OpenTTD is programmed in C/C++ while the ai's get programmed in squirrelrabbit67890 wrote:what programing language are we useingAs a second option you can also make your AIs using pure C++, though the API development is mainly targeted to squirrel, even if it is accessible from C++ AIs too.rabbit67890 wrote:can i build a ai in c++
Some links that might be of interest:
- Squirrel website - the website of the squirrel language.
- NoAI main wiki page
Re: NoAI Branch - An AI Framework
Squirrel is integrated in OpenTTD.rabbit67890 wrote:how do i install squirrel
Please read the wiki to get started and then if something is unclear I'd like to recommend the OpenTTD IRC channel #openttd on irc.oftc.net. Or ask here, but please take you some time and read the stuff on the wiki, it is not more than a few pages to get though but it will get you started.
[Edit: changed IRC network to the correct one. - The network name is in my fingers only when I'm in a IRC client, not in my head.. - Thanks for reminding me glx! ]
Last edited by Zuu on 14 Oct 2007 06:06, edited 2 times in total.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
-
- Engineer
- Posts: 72
- Joined: 23 Sep 2007 09:57
Re: NoAI Branch - An AI Framework
EDIT
zip file made
ANOTHER EDIT
i made it with c++
zip file made
ANOTHER EDIT
i made it with c++
- Attachments
-
- rabbits ai.zip
- my new ai
- (3.14 KiB) Downloaded 82 times
Last edited by rabbit67890 on 13 Oct 2007 21:57, edited 1 time in total.
Re: NoAI Branch - An AI Framework
The channel is not on quakenet, it's on oftc.netZuu wrote:I'd like to recommend the OpenTTD IRC channel #openttd on quakenet.
Re: NoAI Branch - An AI Framework
Although C++ really isn't a problem to make your AI in, it is harder for people to try out your AI. They need to compile OpenTTD them self, which most users simply can't. As SQ (Squirrel) looks very similar to C++, I really do advise you to take a look at it. The benefit of it is that you can share your AI with many people, by simply putting the files in the right directory.rabbit67890 wrote:EDIT
zip file made
ANOTHER EDIT
i made it with c++
The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoAI Branch - An AI Framework
Yes, but with C++ you can use existing libraries (like for neural networks or such stuff) - re-implementing NN in squirrell may be quite lengthy work. Also, while it may not be tryable by others without recompiling, it may be some candidate for new default AI in trunk ...TrueLight wrote: Although C++ really isn't a problem to make your AI in, it is harder for people to try out your AI. They need to compile OpenTTD them self, which most users simply can't. As SQ (Squirrel) looks very similar to C++, I really do advise you to take a look at it. The benefit of it is that you can share your AI with many people, by simply putting the files in the right directory.
There is some set of functioins exported to squirrell, so you can also use these directly from C++
Both approaches (C++ and Squirrell) have its advantages and disadvantages...
If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
Re: NoAI Branch - An AI Framework
Sorry about the delay, but finally added in SVN. Nice job, and thanks a lotdynaxo wrote:@truelight
I copied this comment from order_cmd.cpp. I thought it would be a good thing if the comments were consistent over all the code, but I must admit that I also had some problems to understand what it wanted me to tell I now changed it and hope that it is a bit more understandable.
For the LowerRaiseTile patch I defined all SLOPE_* in squirrel.
And finally I used svn diff instead of the linux diff command.
The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoAI Branch - An AI Framework
Hi, AI people.
I see work halted from May'07... too bad if project dies like this -(
We need at least "AIRail" class similar to AIRoad to be able build AI that use trains (most AI new developers wants this)...
Please do it, thanks.
I'll publish my AI, that beats yours then -)
I see work halted from May'07... too bad if project dies like this -(
We need at least "AIRail" class similar to AIRoad to be able build AI that use trains (most AI new developers wants this)...
Please do it, thanks.
I'll publish my AI, that beats yours then -)
Re: NoAI Branch - An AI Framework
Why don't you publish your AI first? That way people have something look at encourage them to try to beat it.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: NoAI Branch - An AI Framework
I'm working on it. I found that AI API haven't necessary functions even for trucksDaleStan wrote:Why don't you publish your AI first? That way people have something look at encourage them to try to beat it.
How can I get list of industries which accepts particular cargo?
How can I get Vehicle capacity, speed, reliabilty?
It need to be done before new people like me can write an AI.
Re: NoAI Branch - An AI Framework
I think we need some more:
new AIEngine class with functions like this:
char * GetEngineName (EngineID engine_id)
cargo_id GetEngineCargo (EngineID engine_id)
uint32 GetEngineCapacity (EngineID engine_id)
uint32 GetEngineReliability (EngineID engine_id)
uint32 GetEngineMaxSpeed (EngineID engine_id)
bool IsValidEngine (EngineID engine_id)
add to AIIndustry class:
bool IsAcceptingCargo (IndustryID industru_id, CargoID cargo_id)
new valuator:
AIIndustryListAccept (CargoID cargo_id)
new AIEngine class with functions like this:
char * GetEngineName (EngineID engine_id)
cargo_id GetEngineCargo (EngineID engine_id)
uint32 GetEngineCapacity (EngineID engine_id)
uint32 GetEngineReliability (EngineID engine_id)
uint32 GetEngineMaxSpeed (EngineID engine_id)
bool IsValidEngine (EngineID engine_id)
add to AIIndustry class:
bool IsAcceptingCargo (IndustryID industru_id, CargoID cargo_id)
new valuator:
AIIndustryListAccept (CargoID cargo_id)
Re: NoAI Branch - An AI Framework
Most of those functions are already handled via AIVehicle::FindBestVehicle. IsValidEngine is already in AIVehicle. Nevertheless, I see no problem in adding some more functions, and list-valuators, to allow easy finding the best engine.Kilinich wrote:I think we need some more:
new AIEngine class with functions like this:
char * GetEngineName (EngineID engine_id)
cargo_id GetEngineCargo (EngineID engine_id)
uint32 GetEngineCapacity (EngineID engine_id)
uint32 GetEngineReliability (EngineID engine_id)
uint32 GetEngineMaxSpeed (EngineID engine_id)
bool IsValidEngine (EngineID engine_id)
add to AIIndustry class:
bool IsAcceptingCargo (IndustryID industru_id, CargoID cargo_id)
new valuator:
AIIndustryListAccept (CargoID cargo_id)
The only thing necessary for the triumph of evil is for good men to do nothing.
Re: NoAI Branch - An AI Framework
My pleasure. My next patch will introduce two events for vehicles that are waiting at a station and that are entering a station. There will also be a function to get the count of waiting vehicles at a station.TrueLight wrote:Sorry about the delay, but finally added in SVN. Nice job, and thanks a lot
As you may presently yourself be fully made aware of, my grammar sucks
Re: NoAI Branch - An AI Framework
Sounds awesome I created a catagory on FlySpray for NoAI patches, please post them there (http://bugs.openttd.org, post as Patch, under NoAI).dynaxo wrote:My pleasure. My next patch will introduce two events for vehicles that are waiting at a station and that are entering a station. There will also be a function to get the count of waiting vehicles at a station.TrueLight wrote:Sorry about the delay, but finally added in SVN. Nice job, and thanks a lot
The only thing necessary for the triumph of evil is for good men to do nothing.
Who is online
Users browsing this forum: No registered users and 4 guests