
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.
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
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!