Vanilla List Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

some mods to make netrek more accurate



This is for Vanilla-2.9pl5.


First, there is this place in ntserv/genspkt.c on line 366:

-- CUT --
        /* S_P2 */
        if ( send_short < 2
#ifdef OBSERVERS
             || pobserv
#endif
             || pl->p_no > 31
             || pl->p_flags & PFROBOT
             || pstatus->status != PALIVE
             || pstatus->status != PEXPLODE
             || pstatus->status != PDEAD)

/* WTF?  This if always tests true??? */

            sendClientPacket(pstatus);
-- CUT --

Well, just to explain the WTF, if you say:

        a != 1 || a != 2

Pick any value for 'a' and it will always be true.

I'm having trouble trying to guess what the expression should be
in the first place though, so I'll leave that to somebody else.

Second, there are places throughout the code where it seems the
position of a player is restricted to 0..GWIDTH instead of
0..GWIDTH-1. This is wrong.

Places like in daemonII.c around line 997:

                    } else if (j->p_y > GWIDTH) {
                        if (!wrap_galaxy) {
                            ...;
                        } else 
                            j->p_y -= GWIDTH;
                    }

That > GWIDTH, should be >= GWIDTH. Nobody really notices, but that's
because nobody really cared before. I cared several years ago when I
made many of these changes because I made the modifications necessary
to netrek to have galaxy wrap implemented completely. This includes
torpedoes blowing up on one side of the border to hurt somebody else
on the other side to keep them from playing around on the border.

If the galaxy wrap stuff is implemented fully and completely, we get
a really nice effect where clients with the knowhow can actually display
players on the other side of the border and really the only difference
from the perspective of the user is that a border + is drawn, and
even that is unnecessary. Tractor beams, phasers, and even locks know
don't need to know anything about borders, they just have to normalize
their targets before considering their distance.

I'd like these changes to be incorporated into the vanilla source. They
have only bare minimum effect if wrap_galaxy == 0.

Other changes include that a tractor beam will vary it's strength and
cost if the ship is close enough that we would otherwise get a
wobbling effect (quite quite close). If the target of the tractor beam
should not wobble over 0, it should approach 0 and at 0 not have any
effect on the position of either ships. Before anybody argues that this
would affect INL games or something horribly, realize that the strength
will never become more than it currently is... just if the victim is
2 away, and you tractor him towards you, there would be no point in him
moving 40 towards you putting him 38 behind you... rather any real ship
would just use less power, and therefore less fuel such that that 2
moves to 0. Once at zero, the tractor beam would not actually be moving
anything, so it would therefore take up significantly less fuel, and
approach some base "to have the tractor beam active" cost.

Another change is to have a .sysdef option for whether planets can be
orbitted in two directions. The thing here, would be that when a person
approaches a planet, the angle at which they approach it when they
engage the orbitting mechanism determines the smoothest path for
orbitting. This has to be optional as it does affect game play, especially
for LPS, as the cloaker can be a little smart about which way he/she
wishes to orbit the planet.

I'll have more... those are just the ones I put a few hours into
reimplementing today... it's been about 5 years since I had those
changes in and it's sorta fun getting back into it.

Also, several miscellaneous optimizations throughout the code as
I pass ugly sections.

Thoughts?

Have a good day people,
mark

-- 
mark@mielke.cc/markm@ncf.ca/markm@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/