Best scripting language

Started by
15 comments, last by MickeyMouse 20 years, 6 months ago
My only question is what scripting language would you recommend for a big game engine that could be used for any action, adventure or RPG game. I''m interested in what are most popular scripting languages among game developers and why?
Maciej Sawitus
my blog | my games
Advertisement
python and lua are the big ones right now. Python is a somewhat more complex and featureful language, with a large runtime; Lua has a more lightweight syntax, and relies on customizable "metatables" to emulate things like OOP. Google is your friend.

How appropriate. You fight like a cow.
Personally I use Lua for my little game engine. It''s very easy to setup and handle from Delphi or C/C++. Also the syntax is rather easy to learn (depends how you design the functions etc., of course).
Another plus, at least for me, is the size. The compiled Lua interpreter and toolkit DLLs are hardly 100k in size, where the Python DLL(s) are some 800k.
I also read somewhere that Lua was faster than Python.
Lua is 3 times faster than python(benchmarked) and even if doesn''t support classes you can manage to do some nice OOP programming.The bigger problem is the garbage collector that is freakin'' slow.

Python is too big and slow for a realtime app I wouldn''t suggest it.Maybe for a RTS.

I''m personally developing a open source language that has many aspects of lua; is smaller has C-like syntax is as fast and IMO solves some real-time related issues I had with lua. Is still in alpha but is already stable(I''m just tring to make it rock solid )

already a couple of commecial engines are using it(one company hired me ) take a look here : http://squirrel.sourceforge.net

if not i''d go for lua.

Alberto
-----------------------------The programming language Squirrelhttp://www.squirrel-lang.org
i used lua in a realtime 3d engine and got performance problems with the garbage collector.
when i write scripts that are called once per frame and has some local variables the game pauses regularly for about 1/10s when gargabe is collected. not very nice...
quote:Original post by fagiano
already a couple of commecial engines are using it(one company hired me ) take a look here : http://squirrel.sourceforge.net


Ahh so you''re the squirrel guy, I saw your screenshot on FlipCode.



James Simmons
MindEngine Development
http://medev.sourceforge.net
quote:
i used lua in a realtime 3d engine and got performance problems with the garbage collector.


I had the same experience in my past project.
That''s why I''ve started working on squirrel.

Alberto
-----------------------------The programming language Squirrelhttp://www.squirrel-lang.org
i currently have written a rtD, a runtime D compiler, wich allows me to compile code written in D into dll''s at runtime, and use those dll''s then.. works like a charm so far..:D

and yes, i use d for the maincode, too, and now even for scripting, i can stay with d. nice, not?:D



If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentia

davepermen.net
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

quote:Original post by cody
i used lua in a realtime 3d engine and got performance problems with the garbage collector.
when i write scripts that are called once per frame and has some local variables the game pauses regularly for about 1/10s when gargabe is collected. not very nice...



It is possible to disable the gc by setting the threshold to something very high. Then you can call the gc manually at a convenient time. And don''t run scripts every frame; load them once and then call functions each frame. It''s faster.
SpiffGQ
oh i didnt mean that i load the script every frame, i call lua functions every frame i wanted to say.

i tried different settings for the garbage collector but nothing really solved the problem.
there is no time to run a huge gc process in a fast game. it is better to collect often but fast, but this didnt work for lua either.
so i removed local variables and added them to the class scope.
i will try that squirrel thing now.

This topic is closed to new replies.

Advertisement