Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

emileej

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

This topic is 5293 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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!"

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It should look just like Python

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!