Best Scripting Language

Ok, so the better term would be "Dynamic Programming Language"… but most people know what I mean.

I'm just wondering what people think on this. Not trying to start any kind of flame war, and I already know a bunch of people's answers, "whatever is right for the job". But would like subjective answers, "It just represents what I'm trying to express best."


What are the benefits to using a scripting language apart from straight Java?

There are a few advantages, two of the main ones being:

  • For things that are frequently added or changed, your turn around time could be a lot shorter with scripting than Java. For example, scripted events in a shooter, quests in a MMORPG.
  • You may be able to get members of your team who are not 3GL programmers to use a scripting language. This cuts down the programmer's workload and gives (say) the quest designers more freedom.
  • Things that are scripted can (hopefully) be changed without rebuilding your codebase.
  • Sometimes I think scripting language functions are exposed to users, eg. to customize the UI.

This upcoming year is going to be my third year programming Java. Last year, to gain experience, I assisted in the development of a private World of Warcraft server which used MANGOS, a program written in C++.

One of my assignments was to script a dungeon with behaviors similar to the real game. At that point, I didn't know a lick of C++. All I had to do was look up Kel'Thuzad's script, and I figured it out instantly.

People learn by example very, very fast. There's no need to do a non-java scripting language to help other people learn it, just demonstrate what you want them to do and they'll figure it out on their own.

darkfrog said:

What are the benefits to using a scripting language apart from straight Java?

Much faster testing cycles.

But really, my favorite... you have places where scripting would just simply be cooler. For a true inversion of control system, wouldn't you really want to make the 'what' operations be totally decoupled from the 'how'? What better way than storing scripts.

Example: You have an annotated object that represents a node within the JME scene graph. Now, the controller is a script. Within a running system you could have a web based or other user interface to modify that script. Instant results and modification of node controller. No more, stop... modifiy... compile... re-run... click... click.... click... etc...

I really believe that if IOC and Scripting is coupled correctly you have the best means of expressing what a programmer is trying to express without getting in the way of how.

The biggest problem I have with scripting is that you get no code-time / compile-time error checking.  Even if you go so far as to say people can write their code in some IDE that provides something like JavaScript validation you still don't get validation on the game-specific API features that you're making visible to the scripting.

I still believe providing a small API jar that allows people to create their own Java compiled code and they could then create their own jar that can be hot-deployed (or un-deployed) very similar to the way a Servlet container works provides the best scenario.  You then get complete compile-time error checking, you can use your favorite IDE to develop, you can write the code in Java, you get byte-code versus scripts, and you still get the advantages of a hot-deploy concept.

I've been debating this one with myself for a while if I'd like to support scripting, but I keep coming back to lack of reasons to support it.

I think that choosing not to use a scripting language is an entirely valid design choice.

I suppose it comes down to an assessment of the particular game, the individuals that will be working on it and those who might be able to mod it.

I agree with darkfrog. With java there is not much need for a cripting language anymore. At designtime, you have hot code replacement in the debugger, and at runtime you can always reload a jar file. Of course you have the compile/jar cycle, but that's just a small ant script.

On the other side, if you have some LUA (or put your favorite her) experts in the team, using a scripting engine can be a good decision

I think that depends on how you view skripting languages.

For me skripting languages are more like dsls (domain specific languages).

Most of them are very well suited for certain tasks.

If I have to convert a file from format a to format b then ruby is my weapon of choice.

For rapid prototyping ruby on rails or python are just awesome.

Also reduced complexity is a big point.

Blizzard is using lua for UI-skripting as it is just simpler as other candidates (no need for oo-design).