1997Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]  Finding Space -->
<!--X-From-R13: @nguna Kbfcr <lbfcrNunjnvv.rqh> -->
<!--X-Date: Mon, 18 Aug 1997 07:48:30 +0000 -->
<!--X-Message-Id: Pine.GSO.3.95q.970817213842.16831B&#45;100000@uhunix2 -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 33F46159.4AD97D09#sparta,mainstream.net -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev]  Finding Space</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:yospe#hawaii,edu">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00652.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00654.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00654.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00656.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00653">Author</A>
&nbsp;|&nbsp;<A HREF="#00653">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00653">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev]  Finding Space</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: MUD-Dev &lt;<A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A>&gt;</LI>
<LI><em>Subject</em>: Re: [MUD-Dev]  Finding Space</LI>
<LI><em>From</em>: Nathan Yospe &lt;<A HREF="mailto:yospe#hawaii,edu">yospe#hawaii,edu</A>&gt;</LI>
<LI><em>Date</em>: Sun, 17 Aug 1997 21:48:05 -1000</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Fri, 15 Aug 1997, Michael Hohensee wrote:

:I've been working up a system in which objects take up space in a
:co-ordinate based world, and I seem to have hit a stumbling block.  I
:know that others have probably solved this problem (Physmud++ *must*
:have had to solve this ;), so maybe someone can help me.

Yes and no. Same as collision detection... exactly the same, in fact, as
this is a big part of what I consider collision detection. I use spheres
around the center of volume (not to be confused with the center of mass)
of a group of objects, single composite object, individual components...
and then I assume that the particulate (smallest tracked) components are
spherical. This reduces any "will I fit?" problem to a series of fast
comparisons that only get ugly when a collision is immenent (and since I
track in four dimensions, the fourth being a minute projection forward in
time, I have a chance to prepare for collisions.)

:Here's how it works:

:We are representing a three dimensional space, but in this example we'll
:restrict it to two dimensions.

:4-----------------------------
:3------******--------**-------
:2------******-----**-**--*****
:1----*-******-----**-**-------
:0-----------------------------
: 0 2 4 6 8 1012
:  1 3 5 7 9 11
:'-' = empty space, '*' = space taken up by an object.

:For simplicity, all objects take up a cubical volume of space (square,
:in this case).  Objects are held in a tree or linked list of structs
:which contain the origin point of the object, and the dimensions of the
:object.  For example, the big square in the picture above would be
:Location=6,1 -- Dimensions=6,3.

First off, spheres are simpler in 3D than cubes. Little bit of advice from
a graphical engine hand. MUCH simpler.

:I can store anything to any location I want, but I want to avoid
:overlapping objects onto each other (it's bad), so I need to be able to
:find empty space between objects.  I can't just try to place an object
:in every location, since there isn't any granularity to this space (I
:use floats instead of ints).

And thus the reason for spheres. Use a transform and a single calculation
gives you the shortest distance between two points. Then just check to
make sure that's more than the radius of both spheres summed.

:A friend of mine glanced at this problem and said, "Oh, that's a
:bin-stuffing problem."  Of course, he didn't remember anything else
:about the problem, so here I am. :)

Um. Bin stuffing would have been ints and a grid of locations.

:Does anyone have the answer? :)

Well, if mine made any sense...

"You? We can't take you," said the Dean, glaring at the Librarian.
"You don't know a thing about guerilla warfare." - Reaper Man,
Nathan F. Yospe  Registered Looney                   by Terry Pratchett
yospe#hawaii,edu   <A  HREF="http://www2.hawaii.edu/~yospe">http://www2.hawaii.edu/~yospe</A>           Meow


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00656" HREF="msg00656.html">Re: [MUD-Dev]  Finding Space</A></strong>
<ul compact><li><em>From:</em> Michael Hohensee &lt;michael#sparta,mainstream.net&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00603" HREF="msg00603.html">Finding Space</A></STRONG>
<UL><LI><EM>From:</EM> Michael Hohensee &lt;michael#sparta,mainstream.net&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00652.html">Re: [MUD-Dev]  legal mumbo jumbo</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00654.html">Re: [MUD-Dev]  Finding Space</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00654.html">Re: [MUD-Dev]  Finding Space</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00656.html">Re: [MUD-Dev]  Finding Space</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00653"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00653"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] Finding Space</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00625" HREF="msg00625.html">Re: [MUD-Dev] Finding Space</A></strong>, 
Ned Lovely <a href="mailto:njl#NEDS,PLACE.ORG">njl#NEDS,PLACE.ORG</a>, Sat 16 Aug 1997, 20:53 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00603" HREF="msg00603.html">Finding Space</A></strong>, 
Michael Hohensee <a href="mailto:michael#sparta,mainstream.net">michael#sparta,mainstream.net</a>, Fri 15 Aug 1997, 14:03 GMT
<UL>
<LI><strong><A NAME="00607" HREF="msg00607.html">Re: [MUD-Dev]  Finding Space</A></strong>, 
Shawn Halpenny <a href="mailto:malachai#iname,com">malachai#iname,com</a>, Fri 15 Aug 1997, 18:12 GMT
<UL>
<LI><strong><A NAME="00654" HREF="msg00654.html">Re: [MUD-Dev]  Finding Space</A></strong>, 
Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Mon 18 Aug 1997, 08:01 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00653" HREF="msg00653.html">Re: [MUD-Dev]  Finding Space</A></strong>, 
Nathan Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Mon 18 Aug 1997, 07:48 GMT
<UL>
<LI><strong><A NAME="00656" HREF="msg00656.html">Re: [MUD-Dev]  Finding Space</A></strong>, 
Michael Hohensee <a href="mailto:michael#sparta,mainstream.net">michael#sparta,mainstream.net</a>, Mon 18 Aug 1997, 19:22 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00657" HREF="msg00657.html">Re: [MUD-Dev]  Finding Space</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Tue 19 Aug 1997, 00:21 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00556" HREF="msg00556.html">[MUD-Dev]  Spellcaster, or Waving Hands</A></strong>, 
Cynbe ru Taren <a href="mailto:cynbe#laurel,actlab.utexas.edu">cynbe#laurel,actlab.utexas.edu</a>, Thu 14 Aug 1997, 17:50 GMT
<UL>
<LI><strong><A NAME="00583" HREF="msg00583.html">Re: [MUD-Dev]  Spellcaster, or Waving Hands</A></strong>, 
clawrenc <a href="mailto:clawrenc#cup,hp.com">clawrenc#cup,hp.com</a>, Thu 14 Aug 1997, 22:21 GMT
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>