Scripting language appropriate for AI?

Started by
2 comments, last by SiS-Shadowman 16 years, 10 months ago
I'm searching for a scripting language, that will be able to handle the AI in my game. On the one hand, it must be powerfull, on the other hand simple enough. I'm wondering if Lua would be a language that could be used to handle the AI properly. Since I've never worked with scripting languages in another application beforce, I have no idea wich ones are capable of doing this. The language should be able to call c++ functions from the script inside, and process the data, returned from these functions. Just as an example: Every NPC executes a script that will determine, what it should do. The script will call some c++ function, that returns a list of other NPCs around itself and will then decide, based on this data, what to do. Maybe the script will then call another function like MoveTo (also a c++ function) that will make the NPC walk to another one. Is Lua capable of doing this? Is this language the "right" one, or is there a better one, that was specially designed for this job? Another question would be speed. The only thing I know is, that a scripting language will never be as fast as compiled code, because it has to be interpreted. But is Lua fast enough for this job? If lua ist not the best choice, can you name another language, that is? (Would be great if it were freeware or opensource) I'm thankful for every answer I get :)
Advertisement
I'm not experienced with this, but I'm pretty sure that Far Cry used LUA to script the AI for each mission.

Speed doesnt matter that much here, because you're probably not going to be running that much LUA code per frame. All the processor intensive stuff (e.g. pathfinding) should be in your c++ code somwehere (and LUA will use these C++ functions).
LUA is definitely a good choice if you want to script your AI.

-me
Well, if it's beeing used in commercial games, then it will most likely be the right choice. Thanks for the help :)

This topic is closed to new replies.

Advertisement