Discord Discord

GitLab GitLab

Engine Updates

New & Recent Engine Updates

Sat Jun 24 2023

Game engine updates tend to get thrown to the wayside and no one even knows the difference. Many people still think Darkan is just Matrix with no content! How this became unchanging knowledge is a mystery. 

Game Engine Improvements

Here are some of the new things which make this framework the most powerful/lightweight high revision RSPS source in the world.

Different memory schemas for different performance metrics
There are now two memory schemas. I may have to be corrected but this is the way I think it works. Basically you can toggle whether or not to load the entire world map into the RAM or load them dynamically upon entry.

One is about pure performance and the other is about reducing memory. With a lower player count reduced memory is the way to go. You need less than 1GB of RAM and there is extremely little CPU usage.

With the reduced memory function you can run a Darkan server on a really crappy computer and it will perform well. It performs with less computation than a vanilla Minecraft server on this low memory mode.

However, with more players you begin to do memory writes more often, taxing the servers more in the reduced memory mode. I may have to edit this based on Trent's feedback but, if you use the high memory mode, everything is saved on the RAM. 

I believe it requires 5GB of RAM just to start in this mode, but it is extremely light on the CPU. You will have seen this GIF:

Basically you can have 2k players with no lag on the world in this mode. Although I think the same can be done with the low memory mode, it requires more CPU usage.

Instanced Controllers
Controllers are a key component to Runescape. They dictate a changed behavior to a player due to some cause/event. Now instanced controllers allow for automatic instance management. This is very powerful. In the past we needed to create an instance and a controller and juggle two parts of the framework separately. 

Now we just implement a class and go.

Cutscene Framework
Cutscenes in the past were done with near packet level code, very low. Now there is a very strong abstraction layer which makes making cutscenes a joke. It is so easy and clean its insane. This new part of the framework is highly underestimated, I cant sell this enough.

It is as simple as making dialogues once you get used to it. In addition you can include them in any part of the code, controllers, instances, instanced controllers, quests etc.

Reduction of plugin boilerplate
I swear this reduced a few thousands of lines from the Darkan source. Basically plugins are a lot smaller and cleaner. No features are lost and you can no longer cause memory leaks quite so easily as a beginner.

This update refactored the entire source and broke a few things. But its worth it for its super clean look. Easy fixes if we find them.

Improved region/chunk & pathfinding algorithms
The code sources have been written and rewritten many times in search of being more clean and performant. At this point the profiling complexity is the smallest its ever been, the smallest in the rsps community, especially for a high revision.

The algorithms are concise, easy to read and require little computation. The region and chunk finding algorithms also required a massive refactor of the source which also led to a memory schema…

Want to contribute?
You can choose to make a custom tool, implement an app using our public API, contribute to the website, server, client, public API. There is a variety of places to contribute and learn how to code. The world servers even allow Kotlin, ;). 

Click here to start contributing to Darkan.