This isn't necessarilly for Smaug (although I may use it with Smaug), but it's been bugging me for a while. I've been designing an object system and the framework for a mud for awhile, and in each case, I realized that I need a way to uniquely identify each object. Initially I wanted to do so by the pointers to each object, since they're pretty unique, but they won't be persistent, since I can't load them from a file and end up with them having the same address. I could give them a long int identifier and randomly generate a number for each, or maybe just assign them sequentially, but the idea of being limited to 4 billion objects or whatever bugs me (presumably for some sort of philosophical reason, 4 billion should be enough for anyone (See also: 64k/640k should be enough for anybody))
Also, I'm pretty ignorant on a lot of the more complex data structures and techniques, since you tend to have to know their names to look them up. (For example, I learned about binary searches digging through Smaug)
Anyway, I've toyed with various ideas, such as randomly generated strings and so on (since you could theoretically have any number of differing strings), but in the case of generating strings or numbers randomly, I could end up generating the same numbers, then having to retry (which seems like a waste of processor time), and if I do them sequentially, I end up with holes when objects are deleted. Tracking those holes seems like a lot of overhead, and trying to fill them randomly seems like it would take many, many attempts.
This has pretty much been a "design decision" that's kept me from working on this particular project for several months (I think I re-downloaded Smaug to have something to do while I thought about it), but I'm pretty much totally out of ideas.
Whatever I end up with, it needs to generate Unique, Persistent IDs and ideally shouldn't waste a lot of processor time or memory in doing so.
I think at one point I decided on doing it sequentially and tracking the number of holes, and if the number of holes was something like 50% of the highest number generated, it'd try to randomly fill a hole, or, failing that, just add another to the top. That seems kind of meh too, and I have a feeling I'm overlooking a much more elegant solution.