Page 1 of 2

AI directory changes

Posted: 25 Aug 2006, 00:28
by jcnossen
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)

Posted: 25 Aug 2006, 10:15
by Tobi
Multiple data directories support for AIs

(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 */
}
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".

Posted: 24 Jan 2007, 14:24
by george1234
jcnossen sais :
(This in relation to TASClient which already calls the global AIs "Bots")



Now i understand what Bots means

Posted: 24 Jan 2007, 22:17
by AF
I always thought we should have kept to Skirmish AIs and Helper AIs versus bot libs and helper libs. Much friendlier to people who arent tech saavy.

Posted: 25 Jan 2007, 13:03
by Triaxx2
I thought Bots were for people to play games without actually playing them.

This forum could be much improved with a Quick Reply. I wish you'd quit playing with the releases. Every time I get close to something to release, you change versions.

Posted: 25 Jan 2007, 15:26
by Kloot
"Bot" is more of an FPS term than an RTS one, yeah. "Skirmish AI" just says a lot more in this context.

Posted: 25 Jan 2007, 22:30
by AF
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.

Re: AI directory changes

Posted: 18 Jan 2008, 22:55
by Icekiller
Every time i try to get ai i cant get it some one help me

Re:

Posted: 19 Jan 2008, 00:12
by SinbadEV
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.
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.

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

Posted: 19 Jan 2008, 00:28
by SinbadEV
Icekiller wrote:Every time i try to get ai i cant get it some one help me
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.

Re: AI directory changes

Posted: 20 Jan 2008, 14:55
by AF
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.

Re: AI directory changes

Posted: 21 Jan 2008, 17:31
by Felix the Cat
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

Posted: 21 Jan 2008, 19:45
by AF
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

Posted: 21 Jan 2008, 20:54
by jcnossen
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.

Re: AI directory changes

Posted: 21 Jan 2008, 20:58
by AF
I didn't realize you took it to heart so deeply jelmer, too much caffeine?

Re: AI directory changes

Posted: 21 Jan 2008, 21:02
by tombom
AF wrote:I didn't realize you took it to heart so deeply jelmer, too much caffeine?
You have a tendency to complain about other people being nasty but you never seem to notice that you're a huge duck.

Re: AI directory changes

Posted: 21 Jan 2008, 21:04
by AF
Ducks are pretty, but don't misinterpret every quack as a satanic ritual.

Re: AI directory changes

Posted: 21 Jan 2008, 21:05
by Peet
AF wrote:Ducks are pretty, and most importantly they're rarely nasty!
They're also tasty with orange sauce.

Re: AI directory changes

Posted: 21 Jan 2008, 21:06
by AF
and now we get an analogy too.

Re: AI directory changes

Posted: 22 Jan 2008, 21:26
by jcnossen
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.