From: lonachon@anu.edu.au (andrew longhorn )
Newsgroups: sci.virtual-worlds
Subject: re: TECH: My standard is better than your standard
Date: 24 Jul 92 00:24:46 GMT
Organization: Australian National University
Originator: hlab@milton.u.washington.edu



OK, previously I posted a note on the (vague) mutterings of "logging"
into objects, BLAH, BLAH, etc.

I thought about this more last night and came to this:

It seems the common veiw held at the moment is that the virtual-worlds
exist as platforms on which processes run, talking to each other and
offering descriptions of appearance to each other. so that object
descriptions are held BELOW or INSIDE participating objects in the
world.

   _____________________________________
  (                                     )
 (            VIRTUAL - WORLD            )
  (_____________________________________)
       |                        |
       |                        |
   non-user objects         user objects
    ^^^^                       ^^^
   contains or points to        contains or points to
   "physical" descriptions      "physical" appearances of users

I proposed that this sort of approach would complicate some matters
like allowing the controlling procedure of one object to override the
controlling procedure of another. Bernie (and others) replied by
saying that a similar effect would be obtained by changing your own
appearance properties. I see that this would achieve almost the same
effect, EXCEPT that this would prossibly bring a few complications in
to play. (Time or status modifying object appearances, users keeping
"libraries" of commonly used "appearances" meaning massive description
duplication possibilities)

I thought that, although this is not a PROBLEM per-say (if that's how
you spell it) but I think a more elegant standard would abstract the
object interactions in a different way. If you think about the
real-world for a minute (I agree it has little bearing on how to model
a virtual world), you can see that the world exists as a platform on
which "physical" objects interact. Their responses are then handled by
their background "processors". Visual information is passed TO my
thinking process FROM the visual processes built into my body after
some conversion (by parts of the brain) into a format I can interpret
(or have been trained to understand). My reactionary movements (or
whatever) are then passed from my thinking process through some
conversions to messages my physical body can interpret. Taking this
SPIRITUAL OBSERVER outlook on life changes the way you may think about
V-Ws.

If you apply this to the idea of virtual-worlds, The decomposition of
communicating OBJECTS could be represented as:

   _____________________________________
  (                                     )
 (            VIRTUAL - WORLD            )
  (_____________________________________)
                     |
                     |
     ALL objects with their characteristics
   (time altering "physical" properties, etc)
        |                            |
        |                            |
   NPC processes                 user object
  controlling any               (the "spirit" of the user that interprets
   non-player object             messages from the "physical" object)

This may (or may not) have any advantages or disadvantages over the
common views, I just bring it up for consideration.

In this way you have more control to either metamorph your current
physical "container" object (by changing parameters, or whatever), to
IMITATE an object all ready in the world, or you can decouple your
links with one object after requesting to TAKE-OVER parts of a
different object, then you are actually being that object..

The sort of background structures I see are (forgive the C++ look):


/***  base class type for interacting objects in the V-W ***/

class physical_object {
   private:
     thinker                  *controller;
     take_over_handler_method *ask_ok
   // any ESSENTIAL variables;

   public:
     virtual boolean takeover_bid(thinker *new_controller,
                                  take_over_handler_method *new_ask) {
       if (ask_ok = NIL) {
         controller = new_controller;
         ask_ok = new_ask;
         return(true);
       }
       else if (*(ask_ok)(new_controller)) {
         controller = new_controller;
         ask_ok = new_ask;
         return(true);
       }
       else
         return(false);
     }
   // other methods..
     virtual method_descriptions feedback_to(); // Returns all the
input methods the
                                                 // object can
re-direct to the
                                                 // controller.
     virtual method_descriptions controls_are(); // Returns a
description of methods
                                                 // the controller can
call to control
                                                 // this object.  }



/*** base class for controlling objects ***/

class thinker {
   private:
       // probably not much here

   public:      // this contains some standard IO methods to OVERRRIDE.
                // except I can't think of any at the moment.
}


This provides then, a skeletal structure to work from.


example usage:
--------------

class human_object : public physical_object {
   private:
   // variables to keep track of objects to send feedback to.

   public:
     method_descriptions feedback_to(); // Overridden to also return
methods provided
                                         // by this object.
     method_descriptions controls_are(); // Overridden to also return
methods provided
                                         // by this object.

   // feedback methods
     virtual boolean set_eyes_feedback(thinker *who,
eye_feedback_method *eyes_out);
     virtual boolean set_ears_feedback(thinker *who,
ear_feedback_method *ears_out);
     virtual boolean set_tactile_feedback(thinker *who,
                                          tactile_feedback_method *touch_out);

   // control methods:
     swivel_hips(thinker *who, float angle);
     rotate_head(thinker *who, float angle);
     bend_left_index_finger(thinker *who, float angle);
   // etc....
}


NOTE how the methods all have "thinker *who" as the first arguement, a
simple comparison of pointers here stops unauthorised control by
non-controlling objects.


class my_spirit : public thinker {
   private:
   // my variables

   public:
     void sight(parameters needed for eye_feedback_method);
     void sound(    "        "     "  ear_    "      "   );
     etc...

     void handle_my_controlling_of_objects();
}

human_object human1;
my_spirit    me;


Then, to take over the human_object I can ask it to allow me too.
{
...
   if (human1.takeover_bid(&me, &(me.asker))) {
     set_eyes_feedback(&me, &(me.sight));
     set_ears_feedback(&me, &(me.sound));
     set_tactile_feedback(   .....);
     etc....
     // detach myself from previous object, or control both at once?
     // mix the visual and sound?
   }
}

--------------------

This way if takeover is denied, then I shouldn't even attempt to take
over control of any parts of the object.  This can be generalised to
work across all objects (not just that case).

It can also be changed to work on packets over the network, rather
than procedure calls. Or maybe RPC's would work?

Also, I see a better way to handle linking controls in a dynamic,
user-definable way.
Newsgroups: sci.virtual-worlds