Scripting language for extensible AI

Dd9bc2f896eddef399ece682874cb0fa
0
KoalaBear33 101 Aug 22, 2003 at 05:29

Does anyone have any recommendations for a scripting language for extensible AI? Anyone done anything like that before?

In case you are not familiar, extensible AI simply refers to AI that can be extended by others (end-users). In other words, you implement an AI system in a scripting language so that the users/gamers can create their own AI and use it. A lot of games do that nowadays. Traditionally, people have created their own scripting language for the game. Nowadays, that is a waste and people use existing scripting languages.

So far, I have narrowed it down to Lua vs Python. Anyone use any of these? Lua is small, fast, and C-like, while Python is more easy to program (apparently) and has a lot of libraries.

KoalaBear33

19 Replies

Please log in or register to post a reply.

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Aug 22, 2003 at 05:41

i’m not very involved in this..

i know lua works great, a friend of mine uses it and likes it..

on the other hand, python is known to work great, too..

test wich language you like more..

python is possibly more .. “mature” .. as it is a full shell scripting language in linux, or so.. dunno.. linuxfreaks out there, is that true? :D

Dd9bc2f896eddef399ece682874cb0fa
0
KoalaBear33 101 Aug 22, 2003 at 05:54

That isn’t much help..you basically endorsed both of them ;) I’m actually running Linux but don’t know much about Python. It is actually platform-independent (the game I’m working on is an opens-ource platform-independent one too). Since none of what I do is critical, I can try implementing both :) From what I understand LUA is around 5x to 10x faster (of course, depends on tasks) but I’m not sure how easy it is to write AI code using it.

KoalaBear33

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Aug 22, 2003 at 06:16

problem is, there cannot be much help. both are successfully used yet in games as far as know. both are simple languages. both integrate well into apis.

yeah, lua is possibly more fast.. then again, i don’t know that by myself..

choose the one you like more..

F4c5cc867a73ee7eb1fd0b0caa5571c1
0
hanzac 101 Aug 22, 2003 at 09:13

Python is easy to be embedded.
& the point is that Python-dev is active now.

btw: ruby is also a wonderful one.

Dd9bc2f896eddef399ece682874cb0fa
0
KoalaBear33 101 Aug 24, 2003 at 17:33

@hanzac

Python is easy to be embedded.
& the point is that Python-dev is active now. btw: ruby is also a wonderful one.

Ruby seems a bit slower…although it isn’t that much slower than Python compared to C/C++. Ruby is supposed to be more object oriented but is new and hence probably has less libraries. I’m just wondering if Python will have more useful libraries. It is going to be used for AI so if Python has some AI related stuff it would save a lot of time…

KoalaBear33

9275cef0ad2f15ec1813d63b0c5b0fad
0
rogerdv 101 Aug 25, 2003 at 12:57

Lua is fast and easy. The problem is the very annoying manual, but there is a very active mailing list with lots of gurus which helps when you need.
About integration, take a look at my very simple test apps.
There is a nice small AI there in the /userdata directory (each entity will try to kill another or defend itself using the adequate method according to its class).

Dd9bc2f896eddef399ece682874cb0fa
0
KoalaBear33 101 Aug 26, 2003 at 01:09

@rogerdv

Lua is fast and easy. The problem is the very annoying manual, but there is a very active mailing list with lots of gurus which helps when you need.
About integration, take a look at my very simple test apps.
There is a nice small AI there in the /userdata directory (each entity will try to kill another or defend itself using the adequate method according to its class).

Initially, after evaluating the scripting languages (including javascript, VBScript, etc), I was going to go with Lua for sure. Not only is the speed amazing (compared to the competition), it is C-like and hence easy for me. But the thing is that I want the users to program the AI. So I need something easy for the user. This is one reason I’m leaning towards Python.

I’ll check out your stuff in the future. I’m not exactly at the point where I can embed the language yet. I need to work on some other stuff :(

BTW, why did you go with Lua? Is it because of the speed and small size?

If you want some performance figures, check this out:

http://www.bagley.org/\~doug/shootout/

It is only theoretical tests but it gives a rough idea of the performance.

KoalaBear33

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Aug 26, 2003 at 07:16

is lua garbage collected? if not, i’d go for phyton (wich is, isn’t it?)

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Aug 26, 2003 at 10:35

it is

F4c5cc867a73ee7eb1fd0b0caa5571c1
0
hanzac 101 Aug 26, 2003 at 11:02

Python is one of my favourite interpreting & script language.
So I will continue to use it…
I just like it.

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Aug 26, 2003 at 11:52

@anubis

it is

uhm.. lua, or phyton, or both? :D sorry.. not clear from the answer:D

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Aug 26, 2003 at 13:31

don’t know about python but lua definetly is

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Aug 26, 2003 at 13:56

okay.. thanks. as far as i know, phyton is, too..

E813ba6ba564e1f10bc2bc5c9b757561
0
farmerTom 101 May 28, 2004 at 06:20

From what little I understand .lua is a list language and is very good for carring user configs. It is also a good one for lightweight functions, and moniker like function for c++ .dlls.

If your really in it for a attachment to your primary engine just for passing and storing config data, lua……its free and a lot of other engines are using it.

Far Cry is one.

94fcc7177244e3a8f503aa4bfd4b184b
0
spydaz 101 Aug 03, 2004 at 08:08

@KoalaBear33

Does anyone have any recommendations for a scripting language for extensible AI? Anyone done anything like that before?

In case you are not familiar, extensible AI simply refers to AI that can be extended by others (end-users). In other words, you implement an AI system in a scripting language so that the users/gamers can create their own AI and use it. A lot of games do that nowadays. Traditionally, people have created their own scripting language for the game. Nowadays, that is a waste and people use existing scripting languages.

So far, I have narrowed it down to Lua vs Python. Anyone use any of these? Lua is small, fast, and C-like, while Python is more easy to program (apparently) and has a lot of libraries.

KoalaBear33

[snapback]4164[/snapback]

I have started to build an AI >>> in visual basic>>> http://www.spydazweb.gotdns.com/ftpspydaz/top secret/
the source and executables….

any IDEAS?

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Aug 03, 2004 at 08:20

why are you posting in this old thread ? asking for opinions on your AI belongs in it’s own one…

anyway… probably you could give a short description of your AI before people start to play with it ?

9e3db73e103f3497d0a9a13ace3a3bec
0
Eul0gy 101 Sep 10, 2004 at 22:39

hey
have a look at angel script Angel Script

Its an up and comming script and seems to be gear to game dev , also there is a dedicated forum on the gamedev.net forums.

It gets updates regularly and u can ask for features straight to the developer on the forum .

And from what i hear it is quite easy to implement into C or C++ code .

Regards
Eul0gy

F7a4a748ecf664f189bb704a660b3573
0
anubis 101 Sep 10, 2004 at 22:59

we really need to implement the lock for old threads… this is becoming a drag

Eul0gy : nothing against you :) just don’t post into threads that are well over a year old

6ad5f8c742f1e8ec61000e2b0900fc76
0
davepermen 101 Sep 12, 2004 at 19:25

woah devmaster is getting old.. :D