[MUD-Dev] Senses & geographical events
clawrenc at cup.hp.com
clawrenc at cup.hp.com
Wed Jul 2 15:33:50 CEST 1997
In <Pine.SOL.3.94.970630191350.3527G-100000 at eduserv1.rug.ac.be>, on
06/30/97
at 11:29 AM, Wout Mertens <Wout.Mertens at rug.ac.be> said:
>Yo!
Man!
>You have a certain signal (auditory, visual, magical, ...), and a
>space in which an event concerning this signal happens. Call it for
>example the sensory plane. For the rest of the discussion, let's
>assume it's 2D, 3D is easily derived from it. The mapping of real
>world to the plane (or space) is left as an exercise for the reader,
>what with all those private coordinate spaces rooms get.
>Now, I assume we're working with discrete senses (floating point is
>discrete, assume that I mean the smallest possible number when I say
>unit), and that at a certain point the signal strength is 0.
>(otherwise, don't bother with this system, right?) The signal
>strength versus distance function can be any function, as long as it
>goes 0 starting from some distance.
Problem:
The sensory abilities of different creatures are different.
Thus a human will, say, not be able to see a mouse a mile distant, but
will if he's using binoculars. Similar is true for mouse vs rabbit vs
wolf vs human vs giant, let alone the infra-red vs UV vs visible ligt.
>Cover the plane with squares with sidelength 2R, centered around the
>location of the objects in that plane. Then all the squares that are
>overlapped by the square 2r around the source, are likely receivers,
>and you only have to check those for the r+R rule.
>The last problem is: How to efficiently represent such a plane?
>I propose that all the objects that can sense that signal, are put in
>sorted lists:
>One list for the leftmost x-coordinate of the squares and one for the
>rightmost x-coordinate.
>Each entry contains a list for topmost y-coord and a list for
>bottommost y-coord, and of course those entries refer to an object.
>To find the aforementioned squares, get all the entries for which
>((minx <= leftx <= maxx) OR (minx <= rightx <= maxx)) AND ((miny <=
>topy <= maxx) OR (minx <= boty <= maxx))
>To do this in a way that you get a unique list of candidates, maybe
>use a tag field and tag the entries you visited with a timestamp (so
>you don't have to keep clearing the tags)
Problem:
You've just recreated an object scanning loop.
Its increasingly expensive as the number of objects in the world
grows. Its great for a world with a few hundred objects. Its piss
poor for a world with a few million (remember those mosquitoes?) Now
you could attempt to order the list with morton codes -- but that
merely slows the unscalability: it doesn't cure it.
--
J C Lawrence Internet: claw at null.net
(Contractor) Internet: coder at ibm.net
---------------(*) Internet: clawrenc at cup.hp.com
...Honorary Member Clan McFUD -- Teamer's Avenging Monolith...
More information about the mud-dev-archive
mailing list