A few updates

An update on current projects being worked on, but not yet imped - to allow for player suggestions on said projects, and some transparancy on what's going in.

Moderator: Builders

Post Reply
User avatar
Maxim
Site Admin
Posts: 143
Joined: Sat May 09, 2009 2:16 pm

A few updates

Post by Maxim »

For the past year or longer I've spent a lot of time trying to eliminate these weird little crash bugs everywhere that I could find them. I think to myself, self, you must have gotten rid of most of them by now. And then I find another. ;) But I think that the majority of the truly evil crash bugs have been eliminated. That leaves time for more interesting projects!

So a couple of thoughts in that vein:
  • Changing mobile activity from a function that cycles through every mobile in the game every 10s, to something with a little more randomness involved.
  • Fixing up/completing the questing system that Talion originally added, to make it easier for builders to make quests for their zones.
  • Eliminating the need for the trie for the scripting system.
Some more info on that last thought: Right now the MUD stands at about 156,000 loaded items and 20,000 loaded mobiles. When the scripting system has to look for a thing or person by name, it wanted to cycle through all of those items/mobiles until it found something whose keywords matched the name. Similarly for looking up things by ID#, it used to do a loop through the entire character list and object list until it found a match. Ages ago this caused bursts of lag that made the mud unbearably slow.

After that, for the ID# searches we implemented an AVL tree (self-balancing binary search tree). For the roughly 176,000 objects in memory it takes only 18 comparisons to find the ID#. Even if we get all the way to 4,294,967,296 objects in memory, it'll still only take 32 comparisons!

For the name searches... we put in something similar: a trie. That's a dictionary based tree. For every letter in the alphabet we have a branch off the tree. Of course, some names have numbers or punctuation in them too. So in total I think we have 38 branches for every letter deeper we go in the tree. Each one of those branches has its own set of branches, and two lists (items and characters). The good thing about this is that if you're looking for the Amyrlin seat by the name 'Amyrlin', you're likely to find her after only digging down 7 letters through the tree, instead of searching through 20,000 mobiles in the character list. The trade off of course is the amount of memory that the trie uses. In the current stats, that's roughly 325MB of RAM, or about a third of the MUD's total memory.

Without it, I'm tempted to say we'd be lagging madly again in bursts, but I added a couple of logging statements to check how often we wind up looking for things in the trie. It turns out there are only a handful of scripts that are active that rely on it:
  • Player driven boats
  • Criminal activity notifications
  • The Ajah eyes and ears
And I think it's possible to keep these scripts objectives intact while eliminating the reliance on the trie.

But that's not fun and exciting for most players I think.

Anyway, those are the few things I've got in mind as things to fix/do in the near future. Eliminating more crash bugs as they come up as well. If anyone has any other requests, especially if you've asked me previously and I've forgotten them, let me know.

Thanks!
Post Reply