• Advertisement
Sign in to follow this  

Game specific scripting language

This topic is 3910 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

Hello people, am currently working on my final year project. The topic I've choosen is the development of a game scripting engine. I'm going to conduct research into python,lua and ruby. However, I'd be greatful if I could get suggestions about scripting languages that are specifically made for game development. What I mean is, am trying to develop a scritping language that has BUILT in constructs that are relevant to games e.g states,objects/entities,NPC,TRIGGER etc I'd appreciate any ideas about constructs that could be useful to game developers and links to the website for scripting languages that are game specific. Thank you for your responses.

Share this post


Link to post
Share on other sites
Advertisement
Events and triggers, state machines, classes, inheritance and high execution speed are a few topics that I can think of for game scripting development.

Try having a squiz at GameMonkey Script, UnrealScript, and AngelScript to name a few.

Share this post


Link to post
Share on other sites
Quote:
Original post by evolutional
www.somedude.net/gamemonkey

Yes! I've recently started a project that needs a real scripting engine for in-game behavior. I downloaded GameMonkey after reading the tutorials in the articles section here on GameDev, and I'm happy with my choice. Writing C++ functions in my game that can be called from scripts is shockingly easy, and writing scripted functions that can be called from C++ is almost as easy. That was really my main requirement in a scripting language, so hats off to the guys who created GameMonkey.

Share this post


Link to post
Share on other sites
Look at something that has built in support for fibers/co-execution, so you could write something like this:

GoTo(SpotX);
TalkTo(Foobar);
If (Answer == "Yo, dude!")
{

} else
{

}

For most scripting languages you end up with callbacks or events, which is a lot less logical for designers and other non-programmers.

Odin

Share this post


Link to post
Share on other sites
To elaborate on Odins post, those are also known as latent functions. What it means is simply that when called, the script suspends until the action, which may take several seconds, is completed.

Share this post


Link to post
Share on other sites
Another thing you might want to look into is Erlang style message passing, where you have a lot of processes (typically not OS processes though) that communicate asynchrously by sending messages to each other. It leads to painless parralel and/or distributed scripting. For example, you could have one process for each npc.

Share this post


Link to post
Share on other sites
Lua is made for games, but it makes no assumptions about the structure and content of the game. Take a look at Renderware Studio. That is probably more along the lines of what you are thinking of. It is not a scripting language, but it has much of the functionality you find in a scipting language.

Share this post


Link to post
Share on other sites
Lua is not made for games. It just so happens to be most used in the game industry.

Share this post


Link to post
Share on other sites
I recommend Game Monkey Script as well. Its native support for threads(microthreads/fibers, not real OS threads) is ideally suited for many aspects of gaming, and infinitely better than lua coroutines. GM threads are what GM is built on, much like the main point of stackless python. Writing asyncronous top down executing scripts becomes very easy and simplifies alot of game logic. Stuff like __ODIN__ mentioned become trivial game scripts, easy to debug and easy to write.

Further, if you're interested, I'm near ready to release my Game Monkey script remote debugger, so you can connect to your game or whatever and debug your scripts while it runs. I'll probably be posting it up on source forge or something. More info here

Edit: before someone calls me a lua basher, as has happened before, I'd like to say that Lua is a pretty old, very mature, and very good performing scripting language, and has a strong foothold as the scripting language of choice for the game industry due to that maturity. With some work, you can emulate GM threads with lua's coroutines. Personally I prefer the syntax of GM, the native thread and state support, and the incredible easy of binding functions compared to lua. To each their own though.

Share this post


Link to post
Share on other sites
GameMonkey actually seems to contain very little that is game-specific, just a lot of implementation choices that make it suitable for games, if you see what I mean.

Personally I think it's also a shame that it has the C-like syntax, and that it lacks some higher level features that you get in languages like Python.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kylotan
GameMonkey actually seems to contain very little that is game-specific, just a lot of implementation choices that make it suitable for games, if you see what I mean.

QFE. How the heck would someone make a language's syntax game-specific? Add an orc declaration block? What a scripting language needs to be useful for games is to be efficient, easy to use, and easy to extend. And that's true for scripting in pretty much any domain. There's various little issues to think about regarding memory use and reentrancy, but they aren't major considerations.

Share this post


Link to post
Share on other sites
Well, I do actually think it's possible to have some 'Almost Game Specific' functionality built into the language. UnrealScript's state machine is one example of that (although it feels ugly to me), in that while not being at all game-specific, the way that the state machine is built into the class and co-exists with event handling is quite a good way of representing non-player characters in games.

Another one would be a system allowing for reliable communication across co-routines that might be sharing references to a character. It would be good to have some sort of standard exception or null object that notifies one script that the object in question has 'gone away' as a result of another script.

I could also imagine a language having fuzzy logic operators, and a syntax to declare fuzzy rules in terms of other variables.

Or an engine biased towards persistent games like MMOs that created all classes as SQLite tables, treated every instance as a table row, and considered each event handler attached to that instance as a transaction, committing all data changes when you return.

Even at a very basic level, just as javascript is growing an XML type, it would be nice to have some basic types in game scripting that are commonly used. 2D and 3D vectors and various matrices are the obvious contenders. Spheres, rectangles, and cuboids would be nice too, in both oriented and axis-aligned varieties where appropriate. A little 'higher' up could be Actors, or Sprites. Even if you only defined an interface rather than an implementation, it would still allow for some nice generic algorithms to be implemented.

I think a bit of lateral thinking could turn up quite a few ideas that would work well for games.

Share this post


Link to post
Share on other sites
Did you look into the book "Game Scripting Mastery" I heard that it's implemented scripting environment is a little buggy but it seems that the content of the book itself is a nice startup into this topic.

Share this post


Link to post
Share on other sites
I immediately had UnrealScript come to mind, myself. I thik it works wonderfully. The syntax is VERY Java-ish and incredible easy to use. A game scripting language should make things easy for a programmer; it should not be even remotely esoteric.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement