Mod Ash just posted some RuneScape source code

“See why I don’t like legacy code - this is from the @OldSchoolRS keyring choosing what to show on its screen:”

He’s done this a lot. This is RuneScript.

It’s unfortunate they’re in a situation where they’ve got proprietary scripting languages, but there wasn’t much choice back in the day when RuneScript was created.

Nowadays you’d be better off implementing resumable game scripts in Java using the Quasar fibers/actors library.

How long ago was this? Didn’t they have lua/python etc back then as choices too? Implementing your own language for that kind of stuff is TERRIBLE.

Lua in Java apps sucks. Each lua coroutine is a full fledged Java thread, rather than some kind of cooperative mechanism.

If I’m not mistaken Speljohan implemented a Lua interpreter for something he needed quite easily.
I imagine they could’ve easily done the same

You don’t even really need that.

I’m pretty sure they used Runescript because Andrew felt he could do better than the libraries that had been available at the time. The issue at hand is when andrew left the company he basically left his work to others and those people are probably not nearly as intellectual when it comes to compression and memory saving, What runescape did for its time when andrew was on board was a real tech feat. However now with the advancement of technologies and languages most of what he did would be considered redundant and unnecessary. The issue at hand is you have a mountain of code and asking the team to rewrite it for another language would be painful. Yes it could be done but it probably would take them more time than they really want to put into it. What I am surprised they are not doing is not using a scripting language of choice for new content then they can simply run both code and when they go and work on old content they can convert it over to the new content.

A lot of what made the Runescript derivative special doesn’t exist in other languages in the sense that a lot of scripts are domain driven and have embedded access to fields/data/hooks that you’d have to specially design into the language compiler OR hack in. I think it works well for Runescape and I don’t think they really desire to shift from that paradigm probably considering their server engine (and game engine too) are built from that. Closest thing I can think of being able to achieve some of what they had access to is Lua, fenv function.

As a side note though it is a slight pain in the ass to work with.

You can embed something like LuaJava easily enough. My point is that some
of the things you might like to use, such as coroutines, ultimately wind up
in their own exclusive threads instead of being scheduled using a
cooperative approach.
It’s kind of similar to the old approach to sockets programming, where one
client connection consumes one thread. That’s what I’m not fond of.