On Sun, 9 Nov 1997, --Ben Horner-- wrote: ->On many muds were two different races are used often "good" and "evils", ->the evils cant see the goods name and goods cant see evils eg: ->if a troll sees a human he sees "human stands here" instead of jack ->stands here. . . etc etc. Aren't most of these MUDs extinct, now? They were wannabe MUME's that got a serious influx for a long time, but then the original developer crew split, and problems started, and eventually they just slipped underground. Not to imply anything about the mentioned feature, I was just curious. ->Now the only way I can think of to accomplish this is to add a list of ->names to each player that he has been introduced to, and over time this ->could reach as high as say 100 or 200 names. Why names? I'm not concerned about memory or disk space myself, but doing 100 or 200 string compares is costly. And having people forget certain others after so long is unrealistic (I remember the name of people I haven't seen in over 6 years). For those of you that have had reunions of some sort recently where there were people you haven't seen in a long time, chances are you know their name. I can remember the name of my good friends in grade-school for Christ's sakes. Names just don't leave. I would just have the id number of the remembered player saved. And, even further, I would allow for the possibility that a person has introduced himself under a false name. ->Thus if a human saw another human character it would search through this ->list to see if he has been introduced if he has then show name if not ->show "human". Uhmm...wait, so a human couldn't know an elf's name? ->My question is will this lag the mud having to continually run through a ->for loop of up to say 200 names? Doing anything a lot will take up time. The worst case scenario is that we go through all 200 names. So, worst case for the 5 humans walking into a room with 10 humans is: 200 * 15 * 14 = 42000 searches This is because each of the 15 players will have to do a look-up on the other 14. This is the worst-case. The best case is that they'll find each player within the first 15. And that's still a pretty high number (I think it'd be the sum of the first consecutive 14 integers multiplied by 15, which is something like 1500 [estimated]). Unless my logic is wrong here...? But, unless you're going to have 200 players online at all times, I don't think you need to have the array loaded in with 200 people at all times. You should only need to load into the array the people that are online, so with only 50 people online and with the additional knowledge that either someone online will be in there or we don't ever need to check, we've cut down the worst case and the best case dramatically. There's also hash tables. daniel koepke / dkoepke@california.com +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/08/00 PST