About game scripting language

Started by
17 comments, last by Bu6mAn 21 years, 2 months ago
Why not just use normal C/C++ language and place what normally would be scripts in a DLL. The only advantage the scripting language gives you (especially if it''s interpreted at runtime rather than compiled into a psuedo-assembly code) is the ability to alter the script at runtime and have it execute the new code without having to restart the game.

I was thinking of writing my own scripting language at one point. I even took some compiler classes at Drexel U. But after a bit of research and seeing the pros and cons of a scripting language, I opted for the DLL approach.


Dino M. Gambone
Good judgement is gained through experience. Experience, however, is gained through bad judgement.

Dino M. Gambone
Good judgment is gained through experience. Experience, however, is gained through bad judgment.

Currently working on Rise of Praxis MUD: http://www.riseofpraxis.net/

Advertisement
quote:Original post by Dino
Why not just use normal C/C++ language and place what normally would be scripts in a DLL.[...]
I agree that using a DLL for logic is a good idea for many games (as Half-Life did), but for many other types of games, its not as great.

A good example of where a dll wouldn't work so well is warcraft 3. If each map included a dll with all the code in it, going on battle.net and playing a map made by somebody else could be a bad thing for your computer. You would have no way of knowing if they put the code to delete every file on your hard drive in there, but you would find out fast when you download the map the first time and the "ShowMiniMap" function is called to let you preview the map while you wait for the game to fill up. It wouldn't be pretty.

When the scripting language controls the logic of the entire game, it might be a good idea to use a dll instead, but if it controls per-level things, it is probably better to make it a scripting language.

[edited by - Extrarius on January 30, 2003 9:28:49 AM]
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Jaco: Care to share a demo of your scripting language? I''m sure many people would be interested in seeing it.

Thanks
---------------------http://www.stodge.net
I would like to implement Python in my Engine, Any resources???
I already read the gamasutra article, I would like something with some examples and some more technical stuff
www.python.org
www.boost.org
www.swig.org
---------------------http://www.stodge.net
Is LUA suitable, for developing a VirtualMachine like scripting system? Using opcodes for instance, like the old Lucas Arts SCUMM Engine did? Or in that case is it better to develop my own?

Greets, Alan //
quote:Original post by crackingod
I would like to implement Python in my Engine, Any resources???
I already read the gamasutra article, I would like something with some examples and some more technical stuff


Extending and Embedding the Python Interpreter
Extending and Embedding Hints.


[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
quote:Original post by Bu6mAn
Is LUA suitable, for developing a VirtualMachine like scripting system? Using opcodes for instance, like the old Lucas Arts SCUMM Engine did? Or in that case is it better to develop my own?


You''re better off directly interfacing with Lua than using it to write a bytecode interpreter.

[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
quote:Original post by stodge
Jaco: Care to share a demo of your scripting language? I''m sure many people would be interested in seeing it.

Thanks


I''ve got a couple of things to sort out still, but will definately release a little demo soon.
<$1,000,000 signature goes here>
quote:Original post by Fruny
You're better off directly interfacing with Lua than using it to write a bytecode interpreter.


Thought so, but i'm not sure yet which implementation (Pure Interpreter or VM) is better for my engine project. The approach that Lucasarts used was the VM, but we should keep in mind that machines were pretty slow in those times (actually it first was developed for the C64).

I've read that the pure interpreter is one of the slowest imlpementations for a scripting system, and the Virtual Machine would be much better, but will keep on researching. Any thougts?

I'm currently reading this series (http://www.gamedev.net/reference/articles/article1633.asp) to understand the VM implementation, i would like to have the pure interpreter approach too, so if anyone knows some tutorials or articles worth reading..let me know.

Thanks again //

[edited by - Bu6mAn on January 31, 2003 10:40:07 AM]

[edited by - Bu6mAn on January 31, 2003 10:41:36 AM]

This topic is closed to new replies.

Advertisement