AI directory changes
Moderators: hoijui, Moderators
AI directory changes
There have been a few changes in the AI directory structure for the next spring:
* Group AI dll's now located in aidll are moved to AI/Helper-libs
* Global AI dll's now located in aidll/globalai are moved to AI/Bot-libs (This in relation to TASClient which already calls the global AIs "Bots")
The idea is that AI/<AIname> can be used for AI data.
(AAI in svn is now AI/AAI for config files, NTAI is using AI/NTAI)
* Group AI dll's now located in aidll are moved to AI/Helper-libs
* Global AI dll's now located in aidll/globalai are moved to AI/Bot-libs (This in relation to TASClient which already calls the global AIs "Bots")
The idea is that AI/<AIname> can be used for AI data.
(AAI in svn is now AI/AAI for config files, NTAI is using AI/NTAI)
Last edited by jcnossen on 25 Aug 2006, 12:57, edited 1 time in total.
Multiple data directories support for AIs
(Assume cb is of type IAICallback *)
For the impatient
it works like this:
For saving, replace AIVAL_LOCATE_FILE_R with AIVAL_LOCATE_FILE_W.
In depth explanation
You pass it (the cb->GetValue(AIVAL_LOCATE_FILE_*, ...) call) the filename (in a char buffer).
On Windows, it basically returns immediately and does nothing.
On Linux however, if you use AIVAL_LOCATE_FILE_R it looks for the file in all specified data directories, and prepends the datadir path (where it finds the file) to the filename in the buffer (so the call turns the path from relative to current working directory into an absolute path).
If you use AIVAL_LOCATE_FILE_W it prepends the path of the (only) writable data directory. Also it creates any directories in the filename you specify in case they don't exist yet.
Also it fixes slashes (turns them all into forward slash on linux, backward slash on windows), but that's a minor thing.
e.g. you pass it "AI/NTAI/foo" in the buffer, on windows you get back "AI\NTAI\foo", on linux you may get back something like "/home/user/.spring/AI/NTAI/foo".
(Assume cb is of type IAICallback *)
For the impatient
it works like this:
Code: Select all
void example_load_file(std::string filename) {
char buffer[1000];
strcpy(buffer, filename.c_str());
cb->GetValue(AIVAL_LOCATE_FILE_R, buffer);
std::ifstream ifs(buffer);
/* read file */
}
In depth explanation
You pass it (the cb->GetValue(AIVAL_LOCATE_FILE_*, ...) call) the filename (in a char buffer).
On Windows, it basically returns immediately and does nothing.
On Linux however, if you use AIVAL_LOCATE_FILE_R it looks for the file in all specified data directories, and prepends the datadir path (where it finds the file) to the filename in the buffer (so the call turns the path from relative to current working directory into an absolute path).
If you use AIVAL_LOCATE_FILE_W it prepends the path of the (only) writable data directory. Also it creates any directories in the filename you specify in case they don't exist yet.
Also it fixes slashes (turns them all into forward slash on linux, backward slash on windows), but that's a minor thing.
e.g. you pass it "AI/NTAI/foo" in the buffer, on windows you get back "AI\NTAI\foo", on linux you may get back something like "/home/user/.spring/AI/NTAI/foo".
- george1234
- Posts: 17
- Joined: 16 Jan 2007, 09:27
Its a completely unnecessary term imo, as it has no benefit and confuses noobs and is counter intuitive. Uusally noobs see stuff like "Add bot" in the battle window and dont realize it means add AI player and they get confused and ask in #main howto add AIs to games. Or they'll try to install an AI and get confused and put it in the wrong directory or give up.
The odd thing is that I originally added the folders "HelperAI" and "SkirmishAI" to the AI folder, but they where deleted and replaced by "Helper-libs" and "Bot-libs" by jelmer.
Maybe I should start a poll.
The odd thing is that I originally added the folders "HelperAI" and "SkirmishAI" to the AI folder, but they where deleted and replaced by "Helper-libs" and "Bot-libs" by jelmer.
Maybe I should start a poll.
Re: AI directory changes
Every time i try to get ai i cant get it some one help me
Re:
People are going to be stupid no matter what you call it, having folders with meaningful names that have the same names as they are referenced in game/lobby can only help... perhaps it's the client that needs changing.AF wrote:Uusally noobs see stuff like "Add bot" in the battle window and dont realize it means add AI player and they get confused and ask in #main howto add AIs to games. Or they'll try to install an AI and get confused and put it in the wrong directory or give up.
Also Why Not Call them "ComputerPlayerAIs" and then instead of an add bot button have an "Add Computer Player"... make sure you make Mods called "Content Modules" while we're at it OK?
I'm too tired and burnt out from working all day to know if I'm being serious or sarcastic so assume I'm saying whatever I said in the way that least offends you.
Re: AI directory changes
Also this is offtopic you probably won't get a response, I'd suggest you post in the "Help" forum or under the release topic of whichever AI you are specifically trying to use.Icekiller wrote:Every time i try to get ai i cant get it some one help me
Re: AI directory changes
Sinbad, that's what happened in AFLobby. Satirik and betlord simply ignored me and I dont know about spring lobby.
Suffice to say every single RTS engine I have ever tried has used the 'AI' terminology except spring. Only FPS and other nonRTS games have used the 'bot' terminology outside of spring, its totally counter intuitive for the end user, a gigantic user design flaw in my opinion.
What's even worse is that the spring engine uses the AI terminology internally, whereas it uses the bot terminology for the folders.
Infact the AI terminology was propose and used, then for no reason jelmer changed it from AI to bot in the svn, and that was it since he was lead at the time.
Suffice to say every single RTS engine I have ever tried has used the 'AI' terminology except spring. Only FPS and other nonRTS games have used the 'bot' terminology outside of spring, its totally counter intuitive for the end user, a gigantic user design flaw in my opinion.
What's even worse is that the spring engine uses the AI terminology internally, whereas it uses the bot terminology for the folders.
Infact the AI terminology was propose and used, then for no reason jelmer changed it from AI to bot in the svn, and that was it since he was lead at the time.
- Felix the Cat
- Posts: 2383
- Joined: 15 Jun 2005, 17:30
Re: AI directory changes
I think that the "bot or AI" terminology is a bit confusing, but isn't "gigantic design flaw" a bit melodramatic?
Re: AI directory changes
Hardly, I have at least 30 more extreme descriptions to use including horrific negligence, collosal boob, and most idiotic mistake of the century.
Re: AI directory changes
For a moment I thought you got over being a drama queen, but unfortunately you still are.
Bot or AI is a matter of opinion, it is certainly better than the global AI that it was called back then. IMO a bot is an AI component that actually represents a person playing, whereas a helper AI is a component that justs helps. That was the reasoning, maybe you can stop crying about it now.
Bot or AI is a matter of opinion, it is certainly better than the global AI that it was called back then. IMO a bot is an AI component that actually represents a person playing, whereas a helper AI is a component that justs helps. That was the reasoning, maybe you can stop crying about it now.
Re: AI directory changes
I didn't realize you took it to heart so deeply jelmer, too much caffeine?
Re: AI directory changes
You have a tendency to complain about other people being nasty but you never seem to notice that you're a huge duck.AF wrote:I didn't realize you took it to heart so deeply jelmer, too much caffeine?
Re: AI directory changes
Ducks are pretty, but don't misinterpret every quack as a satanic ritual.
Last edited by AF on 21 Jan 2008, 21:05, edited 1 time in total.
Re: AI directory changes
They're also tasty with orange sauce.AF wrote:Ducks are pretty, and most importantly they're rarely nasty!
Re: AI directory changes
and now we get an analogy too.
Re: AI directory changes
i admit i had been drinking a lot of fake red bull, but i still think you were the one taking it too heart too deeply. oh well i dont care actually.