project-navigation
Personal tools

Author Topic: Are the LUA AI scripts being used?  (Read 8063 times)

Offline caelum

  • Rookie
  • ***
  • Posts: 13
    • View Profile
Are the LUA AI scripts being used?
« 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.


Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Are the LUA AI scripts being used?
« Reply #1 on: November 26, 2009, 01:45:26 am »
Afaik LUAai is NOT activated by default. Not sure though.

Offline Kildor

  • Project Artist
  • Captain
  • ***
  • Posts: 757
  • Project mapper and some other stuff`er
    • View Profile
    • http://ufoai.nx0.ru
Re: Are the LUA AI scripts being used?
« Reply #2 on: November 26, 2009, 04:03:16 am »
You are need to enable cvar to activate LUA. Not sure about name of cvar though.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Are the LUA AI scripts being used?
« Reply #3 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.

Offline caelum

  • Rookie
  • ***
  • Posts: 13
    • View Profile
Re: Are the LUA AI scripts being used?
« Reply #4 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?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Are the LUA AI scripts being used?
« Reply #5 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

Offline caelum

  • Rookie
  • ***
  • Posts: 13
    • View Profile
Re: Are the LUA AI scripts being used?
« Reply #6 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?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Are the LUA AI scripts being used?
« Reply #7 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.

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Are the LUA AI scripts being used?
« Reply #8 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 !?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Are the LUA AI scripts being used?
« Reply #9 on: November 27, 2009, 12:11:48 pm »
it uses the game lib callbacks like the c ai, too - yes

Offline caelum

  • Rookie
  • ***
  • Posts: 13
    • View Profile
Re: Are the LUA AI scripts being used?
« Reply #10 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.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Are the LUA AI scripts being used?
« Reply #11 on: December 03, 2009, 07:56:45 am »
i think we all would welcome help on this front.

Offline caelum

  • Rookie
  • ***
  • Posts: 13
    • View Profile
Re: Are the LUA AI scripts being used?
« Reply #12 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?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Are the LUA AI scripts being used?
« Reply #13 on: December 07, 2009, 07:29:10 am »
yes, please post your question and suggestions here or join our irc channel.