UFO:Alien Invasion

Development => Newbie Coding => Topic started by: caelum on November 25, 2009, 11:59:54 pm

Title: Are the LUA AI scripts being used?
Post by: caelum on November 25, 2009, 11:59:54 pm
Are civilian.lua and alien.lua the full extent of the AI? or is the c code still doing some of it?

Now that I have compiled the dev version I was going to play around with the AI, I managed to get one of my soldiers stuck between two civilians last time I played it.

Title: Re: Are the LUA AI scripts being used?
Post by: Duke on November 26, 2009, 01:45:26 am
Afaik LUAai is NOT activated by default. Not sure though.
Title: Re: Are the LUA AI scripts being used?
Post by: Kildor on November 26, 2009, 04:03:16 am
You are need to enable cvar to activate LUA. Not sure about name of cvar though.
Title: Re: Are the LUA AI scripts being used?
Post by: Mattn on November 26, 2009, 07:22:09 am
the cvar is g_ailua - but be warned, it's not very performant right now (at least if you don't also activate sv_threads - which is still not 100% working)

if you want to work on the lua scripts, help is more than welcome on this side.
Title: Re: Are the LUA AI scripts being used?
Post by: caelum on November 26, 2009, 10:14:42 am
I am happy to work on the LUA scripts. It won't be until after I have finished struggling with the Blender import/export scripts though :).

Is the idea to implement something like what the ai diagram that is in SVN currently outlines?
Title: Re: Are the LUA AI scripts being used?
Post by: Mattn on November 26, 2009, 10:47:19 am
yes - something like that - if you have improvements or other ideas. feel free to discuss them in the wiki
Title: Re: Are the LUA AI scripts being used?
Post by: caelum on November 27, 2009, 04:30:03 am
So is there any ability for civilians to carry weapons yet? I am assuming no at the moment, but thought I would ask :).

I think I can live with the slowness as I test out the scripts, it will no doubt be easier if bugs from the sv_threads are not thrown into the mix.

Do you know why it performs so badly?
Title: Re: Are the LUA AI scripts being used?
Post by: Mattn on November 27, 2009, 07:52:04 am
civilians with weapons are not yet implemented in the c ai code nor in the lua scripts

it performs so bad because it looks like it does way to much traces (see gi.trace calls - maybe caching some of them for one frame would increase the speed already to an acceptable level) - the traces are mainly used to get to the next possible walkable position and to search for potential victims or hide spots.
Title: Re: Are the LUA AI scripts being used?
Post by: Duke on November 27, 2009, 10:27:56 am
... - the traces are mainly used to get to the next possible walkable position ...
I hope the LUAai does NOT do it's own pathfinding, but uses the routing table instead !?
Title: Re: Are the LUA AI scripts being used?
Post by: Mattn on November 27, 2009, 12:11:48 pm
it uses the game lib callbacks like the c ai, too - yes
Title: Re: Are the LUA AI scripts being used?
Post by: caelum on November 30, 2009, 12:55:06 am
Sounds like I should look through it and see if I can increase the performance a bit before worrying about improving the AI. LUA looks easy enough to learn that if the speed of using it is acceptable then there will probably be a few people willing to play with them.
Title: Re: Are the LUA AI scripts being used?
Post by: Mattn on December 03, 2009, 07:56:45 am
i think we all would welcome help on this front.
Title: Re: Are the LUA AI scripts being used?
Post by: caelum on December 06, 2009, 11:30:50 pm
Can't say how fast I will be able to look at it, otherwise I would be volunteering more :), but I will see what I can do as I get spare time.

I will just keep posting on this thread as I need help or want to discuss something about it?
Title: Re: Are the LUA AI scripts being used?
Post by: Mattn on December 07, 2009, 07:29:10 am
yes, please post your question and suggestions here or join our irc channel.