Go into the folder, data4.x/accounts.
This holds "test1.save" and "test2.save".
Open these up, and change the last three numbers to change the starting position of the two players.
Next, look at vegastrike.config.
If you want each player's cockpit to print out your position and where it thinks the target is:
In the "hud" subsection of "graphics", add:
Code: Select all
<var name="debug_position" value="true" />
Now, go to the "player" section:
change the "callsign" variable to "test1" or "test2".
Make the "password" variable the same as callsign.
everything else should be fine as it is.
Compiling the source:
It should all compile nicely from CVS without any extra...
Please tell me if there are any compile errors.
Where things are:
In accountserver.cpp and vegaserver.cpp in the toplevel src directory:
These initialize the time and the classes.
The setNewTime(time()) was to make sure that all clients are on a pretty close time. We need a good algorithm to get clients' time to be really close to the server time, and right now it doesn't transfer any time to the clients, so I did this to get them the synced up.
In the networking folder:
The lowlevel stuff is not too important to modify -- most of it is UDP/TCP packet sending code and other lowlevel netwroking stuff.
In the main networking folder, the files likely of interest are:
Client-Side:
netclient.cpp (Packet handling function)
netclient_clients.cpp (position updates)
Server-Side:
netserver.cpp (Packet handling function)
netserver_clients.cpp (position updates)
Interpolation: This still needs some work.
prediction.cpp (CubicPrediction and LinearPredition)
-- Initialized at top of client.cpp.
-- We want to use MixedPrediction (Linear for turning -- Cubic spline wrongly does no turning interpolation at all, which is definitely wrong!)
-- The LinearPrediction appears to work, but changing this to Mixed causes strange moving around sometimes.
cubicspines.cpp
-- Algorithm (defined in cubicsplines.h): Set to SPLINE_METHOD2.
Now, on to debugging code:
I recomend running two copies at once on one computer (unllss you have a good graphics card, I recommend lowest settings for graphics (and definitely turn off full-screen).
Also, I recommend pre-defining the resolution in the config file rather than resizing which makes things slower the more you resize. I tend to use long horizontally, but skinny vertically, windows so that I can have two windows on the same screen.
To run two copies at once, you have to change the username/password back and forth from test1 to test2 between starting up each instance, because two copies can't run off only one network player. (VS Reads the config file pretty early in the loading cycle, so by the time it opens a wihndow it definitely has read the config.) I just leave the config file open so I can change the username.
Urgent issues:
- Cubic-spline Interpolation doesn't work all the time
- Firing guns
- What happens when someone dies
- Increase position update time (right now, it updates irregularly)
- Make it work better or at all on windows.
I might put some of my ideas on multiplayer implementaion-related stuff on a wiki page.