From: mcn@cwru.edu (Michael C. Neuman)
Subject: Re: Borg and Robot algorithms
Reply-To: mcn@b62103.student.cwru.edu
Organization: Case Western Reserve University, Cleveland, Ohio, (USA)
Date: Thu, 16 Apr 92 13:35:59 GMT

In article <74232@netnews.upenn.edu> paulsen@eniac.seas.upenn.edu (Commodore  
FreeKill) writes:
>I was thinking about how to improve borg and robot algorithms for army  
beaming.
>The popular (and easy) way to handle it is if the PFBEAM flag is set for a
>player, he is beaming up armies.  

  On line 323-324 of socket.c in ntserv.dist from Terence's bronco release, the  
lines:
/* #define FLAGMASK  
(PFSHIELD|PFBOMB|PFORBIT|PFCLOAK|PFROBOT|PFBEAMUP|PFBEAMDOWN
|PFPRACTR|PFDOCK|PFTRACT|PFPRESS|PFDOCKOK) aieee, too much.  7/27/91 TC */
#define FLAGMASK  
(PFSHIELD|PFBOMB|PFORBIT|PFCLOAK|PFROBOT|PFPRACTR|PFDOCK|PFTRAC
T|PFPRESS|PFDOCKOK)

  Appear... According to this, socket does not report the PFBEAM* flags to the  
client any more. Since there will be some inconsistancies (the original  
apparently did, and places like harvard won't have installed the bronco  
version), the only way that will work everywhere is by scanning each of the  
planets for # of army changes. 

>However, if there is no one orbiting (that we can see), would it make sense to
>find out who we can see, exclude them from being possible beaming suspects,
>and exclude those without kills.  The remaining people are then suspected of
>being army carriers.

  PFORBIT flags are reported to the client, therefore if you detect a beamup,  
and all you can see is nonorbiting players, none of them are beaming--they must  
be cloaked. If you were really that intent on finding out who had just beamed,  
you can search through the playerlist for everyone with their x&y coordinates  
about the same as the planets, who have the PFORBIT flag set, and who have  
kills. If it's simply a matter of a hidden player, there's no way to tell. If  
I'm playing a human, I usually wait to see who's making an aggressive move  
towards one of my planets, and if they have kills.

>The problem with this algorithm is that if a lot of people aren't showing on
>the map, then many people may be charged with having the armies.  Ideally, the
>number of people suspected of having armies would be one.  Suspecting two of
>carrying armies may not be too bad, but more would start to be annoying.

  True. A big problem with sunborg (and assumedly others) is that it will  
report multiple people beaming up armies if they're orbiting a planet. There is  
no decisive way to tell who exactly beamed up, the human can make a guess by  
just looking at who has taken more planets recently, and then assume it's that  
player. A statistical way of doing it (for a robot) might be something like:

   (# of planets taken this game * planet rating)  + planet rating
    This makes the # of planets taken the most important factor, and then it  
considers if they've just entered the game, their rating should count for  
something..

  The higher this (fairly arbitrary) number, the better of a chance they will  
be making an attempt at taking a planet. This doesn't mean you can eliminate  
the other player as a possibility for having beamed up armies, just that you  
can (or the robot can) make a fairly decent heuristic based guess at who is  
carrying armies.

>Basically, how do people decide who is an army carrier when they watch armies
>being beamed up?  Please try to be as descriptive as possible.  This makes it
>much easier to program.

  When I'm playing as a human, and see several people on a planet and the  
number of armies shrinking, I look for
1) Who has kills
2) Who has taken the most planets recently
3) Who has the highest rank

  In that order. If you're programming a robot, skip rank, since it precludes  
ensign guests from carrying a lot, but instead, take a look at planet  
ratings...

--
Mike Neuman                mcn@b62103.student.cwru.edu
			   NeXTmail accepted!!!
"To make a machine that will be proud of us." - Thinking Machine's motto
Newsgroups: rec.games.netrek