Sign in to follow this  

Scripting language appropriate for AI?

This topic is 3871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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 :)

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Well, if it's beeing used in commercial games, then it will most likely be the right choice. Thanks for the help :)

Share this post


Link to post
Share on other sites
Sign in to follow this