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

Started by
24 comments, last by emileej 20 years, 4 months ago
What features would YOU like to see in a game scripting engine? How should the syntax be like? Should the scripts be translated to bytecode? Throw in your thoughts on the subject. "On a long enough timeline the survival rate of everyone drops to zero" - Fight Club
Emil Johansen- SMMOG AI designerhttp://smmog.com
Advertisement
Bytecode could be good to obtain more speed then on the fly analyses of the script text. But the best way to do it is to convert your script into a C++ dll project and then compile it with an actual c++ compiler. But off course that''s not an easy thing to do.

Also make sure you allow object oriented script programming, because it gives a lot more power to the scripting language. Especially because it''s meanth for a whole engine, I would certainly use OO scripting. If you only use it for e.g. the rendering loop, it wouldn''t be necessary imho.

"My basic needs in life are food, love and a C++ compiler"
[Project AlterNova] [Novanet]
[www.LifeIsDigital.net - My open source projects and articles.
I think general gamescripting languages aren''t the way to go, surely a specific game or engine will have it''s own specific language, if you aremaking one for general use, ensure it''s extensible, easy to learn and easy to use. Speed should be considered, the bytecode option would probably be best; ie: Your script compiles to a set of bytecode instructions, probably using a virtual stack of some sort. When I get round to making a scripting language for Manta-X, I''ll be making the script language akin to basic, covering only the main functions of the game.

It should ideally allow users to specify functions and set aside specific events that the game uses.

eg:

Event KeyPress(k)
if k = ''a''
call some_function
end if
End Event
I am thinking genral use - as a dll. It should definently be oop if you ask of my opinion. One of my ideas is that the programmer of the game should be able to create objects and functions in the script enviroment from his C++ code or whatever language he/she is using. IE you use a script to create a bot and the bot interacts with the game using functions defined by the game programmer in his/her game code.
Emil Johansen- SMMOG AI designerhttp://smmog.com
So you essentially "expose" your classes to the script? You''d have to declare each member as some form of functor / variable hook.

quote:Original post by downgraded
I think general gamescripting languages aren''t the way to go, surely a specific game or engine will have it''s own specific language, if you aremaking one for general use, ensure it''s extensible, easy to learn and easy to use. Speed should be considered, the bytecode option would probably be best; ie: Your script compiles to a set of bytecode instructions, probably using a virtual stack of some sort. When I get round to making a scripting language for Manta-X, I''ll be making the script language akin to basic, covering only the main functions of the game.

It should ideally allow users to specify functions and set aside specific events that the game uses.

eg:

Event KeyPress(k)
if k = ''a''
call some_function
end if
End Event


Odd that you should metion that. Sierra made all their award winning games using the same scripting language...



[Cyberdrek | the last true sorcerer | Spirit Mage - mutedfaith.com][ Administrator & WebMaster GuLSE]
[Cyberdrek | ]
quote:
So you essentially "expose" your classes to the script? You''d have to declare each member as some form of functor / variable hook.

I would do something like this:
//C++:script->AddFunction([void function(void) pointer],"name");//my script:import name;name();


"Stop trying to hit me and hit me!"
Emil Johansen- SMMOG AI designerhttp://smmog.com
It should look just like Python
I believe that scripting languages should be simple. No Object oriented or whatsoever. What is the use of it then? Why don''t you just use c/c++ and link it?
I must be honest that scripting is number 4 on my to do list so I haven''t looked all too much into it.

Look at all the pretty colours!
Look at all the pretty colours!
quote:I believe that scripting languages should be simple. No Object oriented or whatsoever. What is the use of it then? Why don''t you just use c/c++ and link it?


I would disagree - it would be better to have object based scripting for exactly the reasons that object coding gives (ie. collecting variables together into a relevant namespace).

This is how I work when doing simulations - expose objects rather than variables - because then the user knows exactly what belongs to what.




"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan
"Absorb what is useful, reject what is useless, and add what is specifically your own." - Lee Jun Fan

This topic is closed to new replies.

Advertisement