Sunday, November 15, 2009

Scripting Integration

What is the difference between scripting and programming? Well, that is much more simple than it sounds. A script is a file containing instructions that are executed by another program. There are many types of scripting languages, from python to windows shell scripts, and one of the more prevalent uses of them is to be embeded within another program. This is actually the main goal of many scripting languges including Lua, which was developed recently.

I have started to embed Lua in a game engine that I am developing. I plan on using Lua scripts for a GUI, AI, Dynamic Maps, and some in game scripted events. The advantage of using a scripting language instead of hard coding it is that you can rapidly prototype your application without a recompile. The hardest part of integrating scripting is developing an API. The scripting API is the interface between the scripts an the objects in the executable. For large problems such as these, there is a program called tolua++. This can take classes and methods and make an interface for lua scripts to access it. This can greatly reduce the amount of time required to integrate a language. Similar programs exist for other scripting languages as well.

So, now that I have extensively ranted on about scripting integration, Its time for you to go see for yourself if this could help simplify your development process.

In conclusion, scripts:
- Allow rapid prototyping
- Do not require a recompile
- Cab have interfaces developed by programs such as tolua++
- Allow modular code

No comments:

Post a Comment