malachai at iname.com
Tue Apr 8 13:44:07 New Zealand Standard Time 1997
On Apr 6, 8:23am, coder at ibm.net wrote:
[ stuff about JCL's DB snipped ]
> This is probably better understood from the inside oot, rather than trying
> to look at the server side:
> Everything is an object.
> Objects are defined in a database.
> Objects have Unique IDs.
I've been kicking this unique ID/object around as well, and was
wondering about how you generate them? I haven't been able to find
any algorithms that would generate a unique ID given an object (or a
request to do so) without having to search the list of ID's already
generated. I don't know for sure if that last bit is possible, but I
want things to still be speedy when the number of objects is large
(2^31). I had an idea to keep track of the next available ID, and
each time an object was created, assign it that value, then bump the
value. Whenever an object is destroyed, keep track of the last 'n'
(where n is something fairly small and manageable like 100) now-free
IDs and if you wrap your next-ID counter, pull them out of the list of
freed IDs. If the list runs empty, you have to search, though.
There's optimization to be done in that, but that's the gist.
Any magical algorithms? :)
[ more DB stuff and jar-sex snipped ]
> Ahh, minus the update pulses (mine is a totally event driven server) I
> pretty much do the same here with my mana flows (mana flows about the land
> much like a liquid (actually more like a gas)). An area I'd really like
> to crack is liquid flow such that free liquids would puddle, flow in
> streams, form rivers etc.
Now I really like that mana-flow idea. It fits in with what I'm
shooting for, I just haven't begun to think of how I wanted to do it.
Is that a room-based value? ie. there is some amount of mana in a
room and using mana while there causes that value to drop? And when
it drops, draw mana from adjacent rooms that handle it the same way,
and so on? A sort of chained, source-sink model, I suppose? Do
players have a mana count of their own as well, or some value
measuring how adept they are at using the flow around them?
> J C Lawrence Internet: claw at null.net
> ----------(*) Internet: coder at ibm.net
> ..Honourary Member of Clan McFud -- Teamer's Avenging Monolith...
More information about the MUD-Dev