Mud Scripting, Alternative to Lua.. GameMonkey

Posted by Altered on Fri 30 Jan 2009 07:12 AM — 6 posts, 27,560 views.

USA #0
Hello,

I didn't really care much for Lua as a scripting language years ago but I followed the author of GameMonkey from the very beginning. Some of the concepts are based on Lua and can do the same thing it seems from in game scripting.

If you are thinking about Lua but wondering if there are any alternatives, check out GameMonkey.

http://www.somedude.net/gamemonkey/

Example from Homepage;
---

OnDoorTriggerEnter = function(door, objEntering)
{
  if(objEntering == player && !door.IsOpen())
  {
    door.Open();
    return true;
  }
  return false;
};



---

Chris
Australia Forum Administrator #1
Quote:

I didn't really care much for Lua as a scripting language years ago ...


Why? It has evolved somewhat since a few years ago. It is easy to integrate into C or C++ programs (like MUSHclient). Also various mainstream games use it (like Blizzard's World of Warcraft).

See here for a great success story and rave review (by Aylorian):

http://www.gammon.com.au/forum/?id=8306

Let me quote him, if I may:

Quote:

Performance has been fantastic. With literally millions of prog executions per day, hundreds of paused couroutine threads running at any given time (pauses in game progs), 3,500 old "mobprog" style progs converted to Lua plus around a thousand more since it was added, we experience no lag from GC whatsoever and the debug lib is reporting just under 10M usage at time of writing with a peak around 16M during the night.

...

Bottom line, if you're wondering whether it is worth the work to convert to Lua, it absolutely is. Our builders love it and even mention side benefits like being able to put a "real" programming language on their resume. They are just now starting to realize they can create arbitrary commands in a single room only using lua, and even override game commands.

It is fast, stable, and mainstream. We've had several people who know MUDs convinced we took an LPMud and gave it a "diku-style" look and feel after going through our starting area -- that is always a compliment. Hope this isn't coming over as trying to "show off", that isn't the point. This stuff is exciting and I just can't rave enough about how great Lua has been for the MUD and the potential it opens up if you can find people creative enough to use it well.


In scripting language comparisons it tends to come out one of the fastest, but has a very small footprint to download.

Your example code looks like Lua. ;)
Amended on Fri 30 Jan 2009 07:53 AM by Nick Gammon
USA #2
Hell Nick,

The main reason back then was probably because I was still a bit new to c. I see now though that some of the more popular muds like Aardwolf use lua in thier new custom codebase and have some developer examples on the site.

After seeing what Aardwolf has done, it does seem like a really nice system when you get to see it up close.

http://www.aardwolf.com/lua.html

I may have to check Lua out again. I there are various posts on these forums about lua. Looks like a nice place to start.

Chris
USA #3
Nick already said it but it's worth repeating: Lua has changed a lot over the years. For example, coroutines might not have existed when you previously looked into Lua, but coroutines are a very powerful tool.

Judging just from the example you gave, it looks like GameMonkey is kind of like Lua but with Cish syntax.
Australia Forum Administrator #4
Quote:

Nick:

Your example code looks like Lua. ;)

David:

it looks like GameMonkey is kind of like Lua but with Cish syntax.


You are right David, of course. The && instead of "and" is a giveaway. However the function declaration looked like Lua.
USA #5
Oh, sorry, I meant to be agreeing with you. :-) What I meant to say was that it probably is a form of Lua under the hood, just with a different parser.