Play Now

1.3.0 - Scripting Revamp & Performance

1.3.0 - Scripting Revamp & Performance

It has been a little while... again. I took a 5 month break but we are back! There's been a lot of changes across the board since then so this is going to be a quick-fire round with all the changes over the past half year.

Content

General stores across the map and diango's toy store
Pick-pocketing to start the thieving skill off
The Restless Ghost and Druidic ritual was contributed by Jarry


|



The quest intro interfaces their info for all quests



Canoe traveling - A mixed effort by myself and jarry (thanks suic for some anim help)


Gnome, barbarian and wilderness agility courses including the Barcrawl miniquest and all bartenders

|


And lots of small bits like sheep shearing, bush picking, etc...
Gradually increasing test coverage now at 35% overall
Refactor of all scripts to a more consistent syntax and format
Repackaged all content into an organised structure


And of course a bucket load of bug fixes.

Engine

Rewrite of how settings are handled and tidy up of all settings with comments
Improvements to commands adding an interface to list them all with descriptions and usages
Updated the logging syntax to make it a bit prettier and include some colour into the console

Change to how script events are setup making it less confusing to write interactions
Changes and fixes to how delays are handled and prioritise use them instead of queues and pauses (thanks Kris)
Server start-up performance improvements for the slowest parts

Specifically I revisited BZIP2 cache compression which I've talked about before but shortly after had to revert due to it causing some issues crashing clients, this time I figured out that it's the native DLL libraries in particular which need to be kept as BZIP2 (for reasons I care not to investigate further). After converting all the other cache indexes and files to Gzip was successful I ran a test which uncompressed the whole cache which before took an average of 1550ms to run, now takes only 750ms, and even cache indexing is 80ms down from 115ms.

Script loading was next with the highest usage taking a full second to load. Half of it was the scripts themselves being loaded, the other half was ClassGraph searching for them, while trying different ways of optimising I realised that all I really needed was a list of package names which could be done with a simple file tree traversal which could even be pre-computed done at build time. Knocking off the full 600ms, with a minor 75ms increase to build time. That leaves the script loading stage now running at ~425ms.

And finally I streamlined the code for map loading, which is now the largest contributor towards start-up time but the small tweaks did compound with the BZIP2 changes.

Void has two run modes: Live and Dev. Live decompresses the entire cache into memory, taking longer to start-up but being more stable over all. Dev loads cache files on demand having a faster start-up but at the cost of slower processing. Below I've tested before and after the performance changed by taking the average of 5 startup runs for each targeted section:


Dev mode

Load Section | Before | After | Improvement
Cache | 114ms | 84ms | +26.3%
Maps | 464.2ms | 350.8ms | +24.4%
Scripts | 1007.8ms | 415ms | +58.8%
Total Start-up | 2725.2ms | 1815.4ms | +33.4%



Live mode

Load Section | Before | After | Improvement
Cache | 1575.8ms | 751ms | +52.3%
Maps | 328.4ms | 207.4ms | +36.8%
Scripts | 1006.4ms | 433.2ms | +56.9%
Total Start-up | 3853.4ms | 2306.8ms | +40.1%


So some very solid numbers for what were some relatively minor changes. I'm happy with the consistent sub 2 second start-up time and although there's a few more things I can think of improving I doubt there's much more room for improvement the closer to 1 second it gets. Scripting especially was the best improvement almost 60% decrease across the board which just goes to show: the fastest code is always the code that never runs!

« Back to Dev Blog