PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Scripting resources?

Greetings;

I'm starting development on my first ppc project. I'm finding that a number of tasks would lend themselves well to a scripting solution, such as python or somesuch.

Do script interpreters currently exist on the PPC? I'd rather not write my own if I don't have to :)

Thanks!
There's always http://www.rainer-keuchel.de/wince/perlce.html
Our very own PPL might be suited too
LUA. Easiest to use/integrate. Does the job. Nice runtime performances (memory footprint and execution speed).

http://www.lua.org/
Thierry wrote:LUA. Easiest to use/integrate. Does the job. Nice runtime performances (memory footprint and execution speed).

http://www.lua.org/


Very interesting.

Since it is compiled into bytecodes it should be pretty fast. Has anyone evaluated this for real-time execution within a game engine? I had considered javascript, but it was too slow for real-time usage in a graphically intensive engine.

Dan East
Stuntman Evolution uses Lua.
Hyperspace Delivery Boy (by Monkeystone) uses Lua as well.

- Erick
More and more games use LUA. It is that good. We used it in Homeworld 2 and are currently using it in Warhammer 40K + all our other unannounced products (whatever that means).

I haven't tried it on WinCE, but I was told it was straighforward to port. It is actually quite straightforward to port to any platform as it is purely standard "C".
What's with the sudden surge of popularity on the PC side? I remember Far Cry making extensive use of it, seems like you're hearing about it everywhere now.
LUA is popular for the following things:

1) Fast (it uses a simple bytecode processor)
2) Can load text scripts or compiled ones (bytecode)
3) It is as easy as it get be to integrate with C and C++. You can bind whole classes and call LUA from C++ and the other way around, easily.
4) It has a very small memory footprint.
5) There is tons of librairies to extend it... Even visual debuggers that integrate with VC.
6) It's cross-platform. It works everywhere with little or no modifications.
7) It's free.
8) The community is big.


I am sure there is more, but in a nutshell, that's it. It's simply the best there is.
It seems like it came out of nowhere overnight, to be included in all these big name games, although from my limited experience, it's obvious why. That PPC standalone interpeter might give me a reason to start learning LUA a bit moer.
Oh it's been around for a long time... It is simply that more and more people know about it.
Thierry or someone else, can you explain briefly, as if to a child, what scripting does within a game. What would I use it for?
In Stuntman Evolution, it handles all the missions, and vehicles. Far Cry also has scripts done in LUA, and configs, etc. Basically, if you add a scripting language for any part of your game, you can open it up to easy modding by the end-user, instead of hard-coding it in your language of choice.
It seems to have become the norm for games to use a system where designers can set up and balance the enemy, weapon, and other game behaviors exactly as they need them, without involving a programmer. Many games now include scripting languages which, though relatively simple, allow for complex entity creation without requiring the game engine itself to be recompiled. These scripting languages provide many benefits to game development. Probably most important is that they encourage the creation of more unique behaviors in the game, whether these are reusable in-game entities such as NPCs or unique behaviors and events for different levels, such as NPCs carrying on a particular conversation while the player watches, ala Half-Life.


...

Of course one of the great advantages of scripts is that they greatly simplify the balancing of gameplay. Instead of a programmer tweaking a number in the code and then waiting for the game to recompile, a designer can adjust a value in a script and just run the game.



From (requires login, but every game programmer should read gamasutra anyway):
http://www.gamasutra.com/features/20000323/rouse_03.htm
PPL compiles to bytecodes too, ARM and INTEL! :D It's made for the PocketPC.

http://ppl.arwen.com

Regards,
Kornalius
As fast as LUA is (especially relative to other scripting languages), it is still roughly 10 times slower than C according to people on the LUA mailing list.

I can't advise calling any script for every object per frame, but if your object count is small probably it'l work fast enough. Generally Lua is ten times slower than C code (which is good for scripting language), but probably you will need to benchmark your scripts yourself.


Dan East
Dan East wrote:As fast as LUA is (especially relative to other scripting languages), it is still roughly 10 times slower than C according to people on the LUA mailing list.


That's actually pretty good for scripting... no? If you use LUA mostly for configuration and initialization (and that's what we do), then it doesn't matter.

Single-player missions have scripted rules (they are written by the designers and not programmers). They never show up on the profiler... Or if they do, we can always go whack said designers.

Multi-player missions also have scripted rules, but they are so basic... Things like:

if (all ships destroyed)
player_lost()
else if (number player == 1)
player_win()

And that runs like 10 times per second.

So to say that LUA is 10 times slower then "C" is not doing justice to LUA (or any other scripting language). LUA is not meant to replace "C" code.