Networking code testing and development

Development directions, tasks, and features being actively implemented or pursued by the development team.

Networking code testing and development

Postby ace123 » Tue Sep 06, 2005 11:30 pm

To set up the networking:
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" />


In order to be able to log in to the account server:
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.


Please tell me your experiences with using networking version, or if you need help finding your way around the code). I would be glad to help anyone on coding multiplayer.

I might put some of my ideas on multiplayer implementaion-related stuff on a wiki page.
ace123
Lead Network Developer
Lead Network Developer
 
Posts: 2560
Topics: 32
Joined: Sun Jan 12, 2003 2:13 am
Location: Palo Alto CA

Share On:

Share on Facebook Facebook Share on Twitter Twitter Share on Digg Digg

Re: Networking code testng and development

Postby klauss » Wed Sep 07, 2005 8:09 am

ace123 wrote:I might put some of my ideas on multiplayer implementaion-related stuff on a wiki page.

On comments, please.
I do it often, and it worked great on commands.cpp: choose a header to fill up with architectural/implementation comments, usage examples, etc.

If I find the time, I'll test in on Windows. I did quite some network programming on windows, and I tell you, it sucks big time (the sockets don't behave as they were documented - suckers). So, if it's lowlevel networking code where you're having trouble, perhaps I can help. If it's another thing, we'll see.

Oh... and I noticed strange moving in single player at times too, so perhaps it's not a multiplayer issue. Perhaps it's not quite noticeable with linear interpolation, but it's there as well. I'm trying to fix it, but can't find the reason for that odd behavior: things go back and forth, as if the interpolation factor was getting off the [0,1] range and warping around - but it shouldn't do that in any case, as it gets clipped to that range. So it makes no sense. It started happening with the new physics queue.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Postby hurleybird » Wed Sep 07, 2005 1:06 pm

Cool, nice to see progress is being made on the network side.
hurleybird
Elite
Elite
 
Posts: 1671
Topics: 64
Joined: Thu Jan 02, 2003 5:46 pm
Location: Earth, Sol system.

Postby v29a » Fri Oct 07, 2005 5:04 pm

does that mean we are finally going mp? wohoo :)
keep it up 8)
v29a
Star Pilot
Star Pilot
 
Posts: 4
Joined: Sat Feb 19, 2005 7:39 am

Postby zbyszanna » Wed Oct 12, 2005 4:27 am

Few questions.

1. What is vsserver?
2. What is vsacctserver?
3. Which is a mulitplayer game server? Both?
4. How exactly do you run multiplayer? Do you need to launch 1. or 2. and then the game will automatically connect to the server?

5. Can anyone post valid project file for 1. or 2.? I use Code Blocks that can import VStudio projects, but vega-vc7 projects are outdated and have many unexisting dependencies. Guessing which files are missing reading "unresolved external symbol" messages is rather tedious work.

6. vegastrike in Data4x doesn't work well. VS 0.4.3 works fine and Data4x version doesn't like higher than low quality effects (Radeon 9200 - will try newer drivers, but 0.4.3 works fine with the same drivers)
User avatar
zbyszanna
Hunter
Hunter
 
Posts: 83
Topics: 10
Joined: Tue Sep 13, 2005 8:49 am
Location: Poland

Postby hellcatv » Thu Oct 13, 2005 1:55 am

I think it's only been tested in linux so far...
you'd need to modify the windows projects to link in all the networking files as I remember--should work once that is done--- I think the VC6 project has some of the networking projects---I'll have to ask ace123
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
User avatar
hellcatv
Developer
Developer
 
Posts: 3980
Topics: 86
Joined: Thu Jan 02, 2003 9:53 pm
Location: Stanford, CA

Postby klauss » Thu Oct 13, 2005 7:45 am

What I do when projects are outdated, is to start dropping in the files listed in makefile.am. That works, although it's quite some work. I would go makefile by makefile looking at the list, and if anyone is missing, include it. You only have to do it once, after all.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
User avatar
klauss
Elite
Elite
 
Posts: 7243
Topics: 55
Joined: Mon Apr 18, 2005 7:40 am
Location: LS87, Buenos Aires, República Argentina

Postby zbyszanna » Fri Oct 14, 2005 4:43 am

Compiling this code under windows outside cygwin needs rather drastical code reorganization (no fork, waitpid, mkstemp, mktemp and so on). Is current version of vsserver going to be final? I mean is there any plan to reorganize it, or will it just be developed as it is?

EDIT: Aaaaargh!
User avatar
zbyszanna
Hunter
Hunter
 
Posts: 83
Topics: 10
Joined: Tue Sep 13, 2005 8:49 am
Location: Poland

Postby legine » Mon Aug 07, 2006 10:16 am

Uhh, do I understand it right that the networkcode runs on Linux only? :?

Can't we try to, hmm, move to a develop method that basicly runs almost out of the box for all OSes we support? Dont want to blame just suggesting what I think is the only way to develop on a complex game like VS is getting (or is already)
legine
Bounty Hunter
Bounty Hunter
 
Posts: 139
Topics: 19
Joined: Mon Sep 27, 2004 1:40 am
Location: Germany

Postby ace123 » Thu Aug 10, 2006 3:51 am

Networking support does in fact work in windows. (That last post was back in October 2005)

However I would be very interested if you can compile it on windows with a standard checkout (I always hack at things to get them to compile so I never know if it works out of the box).

I have gotten the game to run on windows, but I don't think anyone else has.

If you want to be the first one to test it except me, look at this wiki page:
http://vegastrike.sourceforge.net/wiki/ ... rk:Testing

I would be glad to hear your step-by-step progress on getting this working. If you run into any sort of error, please post somewhere (in this thread or in a new thread) or Private Message me and I will look at the problem.

It does in fact run on Mac as well, last I tested about a year ago, and so it should still work there since most of the code is cross-platform.

However there is one long-term problem -- the build script for linux depends on OpenGL, and links the server to it, so I will have to look at making it not require GL/SDL. Shouldn't be too hard since Windows doesn't require OpenGL and SDL for the server.
This shouldn't be a problem for most people, but if we intend on getting VS running on an actual Linux server (without a GUI) then this would help.

Anyway I would be really interested in seeing how getting network running works out!
ace123
Lead Network Developer
Lead Network Developer
 
Posts: 2560
Topics: 32
Joined: Sun Jan 12, 2003 2:13 am
Location: Palo Alto CA

Postby legine » Thu Aug 10, 2006 5:45 am

Hmm will put it on my List for things I want to do.
Ontop of things I want to do is Piarmada for Linux, followed by some research about optimizing compiletimes by only compiling necessary code instead the hole app over and over again. (In an automated fashion).

Afterwards I gladly see if I get the code compiled on Windows, well hope it compiles on wine. Thats the best working Windows I own. :D
legine
Bounty Hunter
Bounty Hunter
 
Posts: 139
Topics: 19
Joined: Mon Sep 27, 2004 1:40 am
Location: Germany

Postby wirser » Tue Sep 05, 2006 9:34 pm

well I got it working and froze it up when I tried to jump in th astroid feild. I only had one player running at time
there seem to be a bug in radar , the only thing I could get was astroid feild even thoughh radar showed other "bogies"
TecKnoledge available
Practical Wisdom for above TecKnoledge / back-ordered , lead time unknown
UPDATE: above shipment of Practical Wisdom for
TecKnoledge was lost in either luddite or kilrathie space - reward if found
wirser
Bounty Hunter
Bounty Hunter
 
Posts: 148
Topics: 21
Joined: Wed Dec 01, 2004 1:06 pm
Location: not where i want to be

Postby Halleck » Tue Jul 10, 2007 7:03 am

Just reporting that I got this working with ace123 and jackS.

Here's what I had to do:

  1. Register an account as described in this thread. (scroll down)
  2. Compile vegaserver.
  3. Edit the "accountsrv" entry in vegaserver.config so it reads:
    Code: Select all
    <var name="accountsrv" value="http://vegastrike.sourceforge.net/cgi-bin/accountserver.py"/>

    (Unless you want to run under a 'mod' by appending ?modname to the URL, in which case you have to register under one as well by doing the same to register.py. Currently, I think 'test' is the only mod.)
  4. Use part or all of the config it generates for you (I used the whole thing with almost no problems.) Make sure that server_ip is set to "127.0.0.1" (localhost) if you want to play on your own vegaserver. If a second player wants to connect to your machine and it is configured as a server (with an external IP, or behind a NAT set up with port forwarding), have them put your IP address in this field.
  5. Start vegaserver on the host machine. It should connect to the accountserver running on sourceforge.net, although it's possible to compile and run your own (I haven't tried this successfully yet.)
  6. Start up your clients like so:
    Code: Select all
    vegastrike --net

If all goes well, that should work!

(Also, I updated units.csv on the accountserver so people using it should be able to play with current units.)

UPDATE: Wikified these instructions at Development:Network:Testing#Playing with the Sourceforge Account Server
User avatar
Halleck
Elite
Elite
 
Posts: 1832
Topics: 38
Joined: Sat Jan 15, 2005 3:21 pm
Location: State of Denial

Re: Networking code testing and development

Postby Mets » Thu Feb 04, 2010 10:34 pm

Is there any work still happening on this area of the game?
Mets
Mercenary
Mercenary
 
Posts: 115
Topics: 9
Joined: Mon Jun 09, 2008 5:52 pm

Re: Networking code testing and development

Postby chuck_starchaser » Fri Feb 05, 2010 11:16 am

Nope.
The original developers moved on to another project (Sirikata), an the few of us trying to keep this project alive have other priorities (graphics, sound, ai and code clean-up/refactoring).
User avatar
chuck_starchaser
Elite
Elite
 
Posts: 8014
Topics: 195
Joined: Thu Sep 04, 2003 9:03 pm
Location: Montreal

Re: Networking code testing and development

Postby ezee » Sat Feb 22, 2014 9:37 am

Hi !

I just want to share a link to OpenNetGame lib :
http://www.opennetgame.org/index.php/Getting_Started
What Does OpenNetGame Do?

When a player wants to play a game with other players on the internet or on the local network, they must connect to a remote peer. Be it a server or just another player hosting a game. The availability of a networked game needs to be advertised to all potential players. Once the player has a selected a remote peer to connect to, the game must connect to the host serving the game and additionally, in the case of pee-to-peer communication, other players. NetGameTrack takes care of advertising the availability of servers hosting a game. NetGameConnect takes care of connecting players to the host and to each other.


May be an alternative for future dev ?
I already played with their tutorial , functionnal :
NetGameConnect_Tutorial

online doc :
http://www.opennetgame.org/api/NetGameTrack/
http://www.opennetgame.org/api/NetGameConnect/
Code: Select all
 if (!track.HasWeapons())
            {
                // So what are you going to threaten me with? Exhaustion gas?
                return ThreatLevel::None;
            }

Vegastrike evolved
DEV YOUTUBE CHANNEL
Vegastrike evolved wiki
ezee
Intrepid Venturer
Intrepid Venturer
 
Posts: 703
Topics: 65
Joined: Mon Feb 10, 2014 5:47 pm
Location: FRANCE



Return to Engine Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron