A good game scripting language - how should it look like?

Started by
24 comments, last by emileej 20 years, 4 months ago
quote:Original post by emileej
I am making a scripting engine for games. Since I will not be doing all the scripting I would like to get some input from people interested in game development so that the scripting may be suited for them and the job they are doing. If youre gonna do something - why not do it good?

Without specifying what kind of game you want to use it for, I can''t give you a good answer.

If your answer is ''any game'', then I''d just say ''Python'' or ''Lua''. These are optimised languages for generic scripting and can do pretty much anything well.

If you have a particular type of game in mind, then my answer might change. For example, if it was purely for AI then I might want a language with inbuilt state-machines like UnrealScript. A language designed for scheduling periodical future events might require good multithreading with automatic synchronised access to data structures. It might also use generators to store state across subsequent calls instead of having to temporarily associate arbitrary data with the object.

Whether the scripter thinks it should be compiled to bytecode or not is irrelevant though. As the language developer, you need to decide whether that step is necessary or not.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
Advertisement
May have been said, but access to all your c++ code (functions and classes varibles etc)
quote:Original post by Anonymous Poster
It should look just like Python


Agreed.

I really think that any scripting engine used in a game should compile the scripts to bytecode. That''s a must for me. When it comes to syntax, I like the semi-procedural / semi-OO approach. The engine should be small and concise, and bloat-free (kind of rules python out, I guess).
I''m knocking a small script engine together now, it compiles to a VM byte-code on a stack-based machine with predeclared variables. Each script has it''s own execution stack, etc. Variables can be shared from one script to another (or they will be, eventuually).

It''s fairly nice to only have a few set types to worry about (here I have strings, floats and longs).

When adding callback functors to game functions, would you allow the game code to have direct access to the variables, or would you pass them by value to the game, requiring that if they need to change them, they have to call a script->SetVar() function. I suppose this way, it makes things a little safter, stopping games accidentally destroying the script and it''s stacks
It should look and behave exactly as Scheme.
Check out DM. www.byond.com. My ideal scripting language for a specific engine would be just like that. It is OO and has objects for game characters, objects, areas, etc.

This topic is closed to new replies.

Advertisement