Author Topic: How does soldats networking work?  (Read 2006 times)

0 Members and 1 Guest are viewing this topic.

Offline sofakng

  • Major(1)
  • Posts: 2
How does soldats networking work?
« on: January 15, 2009, 07:21:00 pm »
I'm looking to develop a simple 2D game with player movement similar to Soldat and I'd love to know a little bit of information on how it's networking works.

For example, what information is sent from the client to the server?  Just the keyboard/mouse inputs?  What information does the server send back to the client and how often?

I was hoping to send player position from client --> server every xx milliseconds but apparantly this isn't feasible and instead you should only send keyboard/mouse states to the server and allow the server to determine your position, etc, etc.  However it seems to get a little complicated from there and I don't understand all that much about it... (and I've read several articles including gaffers.org, etc)

Thanks for any help!

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: How does soldats networking work?
« Reply #1 on: January 15, 2009, 07:47:00 pm »
All I know is that it sends packets via UDP (i think).
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: How does soldats networking work?
« Reply #2 on: January 15, 2009, 08:16:27 pm »
All I know is that it sends packets via UDP (i think).
Yes, it does.

The information you're looking for can't be entirely revealed, I'm sorry to say, because Soldat is a closed source application and releasing the network protocol would allow loads of people to crack with it.
There are other worlds than these

Offline a fool

  • Major
  • *
  • Posts: 98
  • Wait, what?
Re: How does soldats networking work?
« Reply #3 on: January 15, 2009, 08:38:37 pm »
all I can guess is that it sends the player's position, animation, what team (if needed), is it speaking?, wth is it doing it? (Shooting, walking etc...), does it generate other particles that requires more packets?... well I'm just pretty much guessing in the wild now. But you can probably go on there.
Verily!

Offline ZomgProniss

  • Camper
  • ***
  • Posts: 318
  • Known ingame as Proniss
Re: How does soldats networking work?
« Reply #4 on: January 15, 2009, 08:40:04 pm »
ow my head hurts.... thats complicated

Offline sofakng

  • Major(1)
  • Posts: 2
Re: How does soldats networking work?
« Reply #5 on: January 15, 2009, 09:08:31 pm »
All I know is that it sends packets via UDP (i think).
Yes, it does.

The information you're looking for can't be entirely revealed, I'm sorry to say, because Soldat is a closed source application and releasing the network protocol would allow loads of people to crack with it.
No problem... I understand completely and was actually thinking about that as I was writing my questions.

However, could you give me any information even if it's not pertaining the Soldat explicitly?  (eg. how to synchronize player movement in general)  I don't need (or want) any specifics regarding Soldat and it's protocols but just in general some help with the basic concepts.

Also, I was amazed to find out that Soldat was written in Delphi.  Before I was employed by the government (for programming) I was an insurance software developer and we used Delphi 6 before migrating to Delphi 2005 (if I remember correctly).

Thanks,
John

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: How does soldats networking work?
« Reply #6 on: January 15, 2009, 10:58:33 pm »
If I was going to do what you are trying to do, the first thing i would try would be sending the packets which contain a timestamp of some sort to sync the players, X,Y positions, X,Y velocity, where they are aiming, ammo, health etc, etc, then the server would parse it, and send all the information to the players in the same way.
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: How does soldats networking work?
« Reply #7 on: January 15, 2009, 11:17:16 pm »
(eg. how to synchronize player movement in general)
You'd probably have to make your packets small and fast. To handle the player movement efficiently, you'd have to develop an algorithm to properly account for packet latency on the fly, based on connection speed and average packet loss [if any] between the server and client, to avoid stuff like warping due to lag. Same applies to bullets, grenades, polygons, kits, and other ingame objects.

If you're striving to develop an online multiplayer shooter, I suggest you don't do it in Delphi; use C++ instead. Don't go with DirectX, go with OpenGL and make it cross platform so us Linux users are happy.
There are other worlds than these

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1904
Re: How does soldats networking work?
« Reply #8 on: January 16, 2009, 12:36:29 am »
I was hoping to send player position from client --> server every xx milliseconds but apparantly this isn't feasible and instead you should only send keyboard/mouse states to the server and allow the server to determine your position, etc, etc.
Might be terribly mistaken, but I think your original method is exactly how Soldat does it (well - to a certain extent). Not entirely certain why'd you'd want to draw inspiration from Soldat's network code either, but whatever floats your boat, I suppose. But yes, you should send state changes, even if developing a reliable method for handling that might be somewhat harder.

This could be an itsy bit of help - the packet time intervals are in ticks (60 ticks = 1 second, in case you didn't know).

Oh. and extra/interpolate data, too.
« Last Edit: January 16, 2009, 12:41:20 am by Toumaz »

Offline -Major-

  • Veteran
  • *****
  • Posts: 1419
Re: How does soldats networking work?
« Reply #9 on: January 16, 2009, 02:24:54 am »
well, I guess you would want to check inputs and then compare it to a current position. and when you got both you'll need some algorithims to calculate the positions, and what will happen untill next packet arrives.