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

Re: [VANILLA-CLIENTS:104] netrek developer newbie



On Mon, Aug 09, 1999 at 10:44:07AM -0700, Eugene Polonsky wrote:
> 
> Second, I'm developing a Win-only version of Netrek, using MFC and OpenGL.

There are two clients that already work under Win32: COW and Netrek1999
(same code base, I believe).  Netrek: the Next Generation is (I think)
a complete redesign using Java, in addition to the JTrek client.
Some more info is available at www.netrek.org/developer.html

I don't know what you are interested in, but helping with the existing code
may be easier than doing something completely on your own.

> don't have the inkling of a clue regarding the netrek client-server
> communications format, or even the overall framework of the game.

Take a look at the Vanilla server's networking code and the client's
counterpart to that code.  The protocol, though not really documented
separately, is fairly straightforward.

> instance -- do redraws happen on a packet-received basis, or on a timer
> basis?

Redraws are done in a sequence at each update cycle (usually 10 per second).
All info received between the last update and the current update are
included in the redraw sequence.

> Who keeps track of torp locations -- client or server? That sort of

Both.  Essentially, both the server and client keep track of the global
state of the game.  For efficiency and game mechanics, the client keeps
track of a more local arena (i.e. if the client's ship is on one side
of the galaxy, it won't receive info about torps on the other side).

It is the server which handles all the mechanics (e.g. calculates ship
and torp positions, phaser hits, ship status, player stats).  The client
merely receives updated information from the server on a "read-only"
basis and displays it on the screen.  Command sent by the client (e.g.
change ship direction, fire torps) must be processed and acknowledged
by the server, and no assumption is made about the delivery of those
commands.  In other words, if you press the torp key, the client will not
create a torp and move it along on the screen.  The server must send
the update packets for that torp for it to be displayed by the client.

> stuff.) I could go dig this stuff up in the code .... but .... and no
> offense.... that code isn't exactly the most readable piece of software I've
> ever seen, and certainly not the most documented. Plus, if a FAQ explaining
> all this stuff already exists, it'd save me quite a bit of work. So, anyone
> know if there's a spec document for Netrek in existence, or is the source
> code the only source of info about this?

No FAQ's, sorry.  But feel free to ask specific questions on this list
after looking at the source.

-- 
Dave Ahn <ahn@vec.wfubmc.edu>        |  "When you were born, you cried and the
                                     |  world rejoiced.  Try to live your life
Virtual Endoscopy Center             |  so that when you die, you will rejoice
Wake Forest Univ. School of Medicine |  and the world will cry."  -1/2 jj^2