On Fri, Dec 07, 2001 at 05:05:06PM +1100, James Cameron wrote:
> On Thu, Dec 06, 2001 at 07:18:50PM -0800, Tom Holub wrote:
> > What I'm saying is that I think it could have an effect on human players.
> > If there are two base defenders and a base trying to phaserlock cloakers,
> > they are going to react differently if they're all getting the same 
> > incorrect position, compared to if they're all getting different incorrect
> > positions.
> Yeah, okay, I agree.  I withdraw it.

The galaxy is 100,000 units (GWIDTH) wide and tall. The cloaker
position is given as up to +/- 1,000 of the actual location. The
"size" of the "strategic and tactical windows" (GWINSIDE/TWINSIDE) is
500 pixels. As far as I am aware, a Netrek distance 'unit' is exactly
one tactical window pixel size. Clients without 'enhancements' only
show cloakers on the galactic. (if the cloaking phase is not complete,
the information is not yet restricted)

The standard code in map.c has always used the equation:

      dx = j->p_x * GWINSIDE / GWIDTH;
      dy = j->p_y * GWINSIDE / GWIDTH;

to draw the players.

The cloaker code currently generater adds -1000..999 to both p_x and p_y.

This leaves -1000, -500, 0, 500 offsets to show on each axis in the
galactic.  4 possible pixels for each axis, with the 3rd pixel being
the most accurate choice.

It may be desirable to choose one of the 16 (4x4) possible rounded
locations, instead of a any position within the grid. I suspect that
even this could be taken advantage of, however, so don't add it to
your list just yet. :-)

One thing of note... was anybody else aware that cloakers have a 25%
greater chance of appearing above the actual location of the player,
and a 25% greater chance of appearing to the left of the player? To me,
this seems a little wrong. I suspect the code in genspkt.c should not
read:

                cpl->x=htonl(pl->p_x+(random() % 2000)-1000);
                cpl->y=htonl(pl->p_y+(random() % 2000)-1000);

But rather, should allow a 1/8 chance that it shows up 2 to the left,
and a 1/8 chance that it shows up 2 to the right, instead of 1/4 chance
that it shows 2 to the left. (Same for up/down):

                cpl->x=htonl(pl->p_x+(random() % 1999)-750);
                cpl->y=htonl(pl->p_y+(random() % 1999)-750);

This actually 'fixes' it for users, not for bots. Now, I'm certain that
this won't be 'fixed', as all those people that phasered at that certain
place on the '??' after realizing that they usually missed when aiming
straight at its center, have learned that it isn't the center you should
aim for... therefore game behaviour would change... (also, there may be
something strange about fonts that cause '??' to be an even-number set of
pixels wide and/or tall, that might cause rounding during the rendering
process to minimize the effect)

But this is just another one of my "off by 1" complaints against the
original Netrek code. Nothing major... :-)

mark

-- 
mark at mielke.cc/markm at ncf.ca/markm at nortelnetworks.com __________________________
.  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Neighbourhood Coder
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | 
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
                       and in the darkness bind them...

                           http://mark.mielke.cc/