Author Topic: Ultimate effort to fix multiplayer (in progress)  (Read 541 times)

0 Members and 1 Guest are viewing this topic.

Offline ksotar

  • 26
Ultimate effort to fix multiplayer (in progress)
It is common knowledge, that multiplayer (MP) in FSO is not in ideal state. For some mods and standalones it is plane unplayable (SWOT, Diaspora). The main problem is, that you can hardly score a hit. I will refer to this problem as Network Miss (NM). Other problems may also persist, but we will address them later.

Now, there is a small team of willing and, the most important, able people to deal with that problem. This thread will describe the current state of events and problems we face. Ideas and offers of assistance are welcomed.

Please note that posts about how multiplayer is not needed and that we should put our efforts to something else will be considered offtopic here and I’ll kindly ask moderators to remove those.

I.    What we know so far.
To solve a problem one need to comprehend it first. And here just some empirical notion like “it seems hard to hit anyone in MP” is not enough. We need some hard evidences that are documented and are measurable. And we have some, and will obtain more. Their proofs and techniques we use to document them are gathered here. This section can be extended with your help.
    A) What can be seen ingame:
        1) There is a significant offset of a player’s ship position as it seen on the server and on the client itself, both during the flight and in a static situation (latter is proven in Diaspora, but not on FS).
        2) On the client it may seem like hits being scored: projectiles hit enemy ships, damage sfx are in use, enemy could even “catch smoke and fire”. But on the target’s monitor it is seen that hull percent only flashes while "damaged", but don’t go down.
        3) In the end the “primaries hit” percent number (accuracy) is lower, and disagrees with what player saw on his client.
        4) With certain mods NM problem gets worse, and accuracy against enemy fighter may go as low as to 0-1%, with only few hits actually score. General rule - the further mod is from original FS (in terms of ships, their speed as well as projectiles speed), the worse is the problem.
        5) There are lags and jumps of the ships even if ‘Object update’ setting in Multiplayer options is set to LAN. In fact, jumps can become even more noticeable with this setting.

    B) What we know from code:
        1) Game uses Bezier splines to approximate client’s ship trajectory. Those are not even pass through the points that client reports to the server. This could possibly be the root of position problem.
        2) ‘Object update’ determines the rate with which client state is synchronised with the server.

   II.   What is the main hypothesis.
For now I think that the main problem is NM. If it will be fixed, MP will be mostly playable, especially in Diaspora and other non-FS based mods. And it is very likely, that we can leave for now the network layer itself and how packets do actually fly, because nowadays network throughput is very forgiving. So we can try not to touch network layer (hard part) and to fix the math (easy part) first.
   Others can correct me if I’m wrong on this.

   III.   What we do.
    1) First, we need some tools, that could help us to illustrate and debug the problem. This likely includes:
Mod and missions, which are specially prepared to debug the problem (for now we have one).
    2) Automated tool that will allow us to test MP quality in terms of NM problem (80% is ready, I’ll post later).
    3) Tools that are using Debug console to show various network parameters (for example local and server positions of the client’s ship, etc), allows network Debug (without server disconnection). (10% ready - as there were some usefull commands in Debug console already).
    4) And finally, we need to fix NM problem.


Also, if someone sees some wierd English senteses here, please, let me know - I'm trying to improve my English.
« Last Edit: October 26, 2018, 05:27:16 pm by ksotar »

 

Offline ksotar

  • 26
Re: Ultimate effort to fix multiplayer (in progress)
Documented problems.

Dynamic.
In case someone missed. Here is the video, that pretty much illustrates all aspects of NM. Youtube has a nice feature - frame-by-frame skipping. You can use "<" and ">" buttons for it.


To see this difference yourself you can switch view on server ship to "From" client ship.

Static.
I found this problem in Diaspora. It is MP mission Asteroid dogfight. After some flying client's ship position has notable offset. Here is the picture from a non-moving client: aimpont is at true server ship location (set by viewing from server and in that positions hits by client are registered). And where client thinks server ship is, you can see yourself.



Autoaim is not active. If you start carefully flying straight ahead to server ship, there will be no offset: you need to maneuver a bit beforehand. I know that it is position, not direction vector, since client can collide with "server ship", but from server's view it is like if client's ship hit an invisible wall, and bounced off.

AndI was unable to reproduce the situation with FS itself: whatever maneuvers led to no notable static offset.
« Last Edit: October 27, 2018, 04:12:52 am by ksotar »

 

Offline ksotar

  • 26
Re: Ultimate effort to fix multiplayer (in progress)
Automated test for MP quality estimation.

The idea is to have primary shots hit % as a metric, how close MP experience is to SP (single player).
Obviously, we need large amount of flight test here, and therefore it is better to automate the process. For SP we have a convenient SEXP called 'player_use_ai'. We only need to make it work for MP. And I almost had it done, for now I use some dirty hacks in the code to make it work, but I'll refine that later.

And we need to make AI to fly like 50 missions in a row, without human interference. This also could be done from inside the engine, but I didn't want too much unnecessary changes. So I picked up Sikuli Script automation tool, it is Python-like language to automate all button clicks for repetitive tasks (see attachments for script example).

Also I made changes to the code, that stores mission stats to .csv file to analyze later.

I use a mission with unarmed AI ships for our player ship (under control of another AI) to hunt. I attached it, but if someone interested to use it too, I'd better share a mod for this metter (it uses BP AI, and there maybe will be some other changes as well).

Here what we got for now:

TakesTimePrim.firedPrim %Min %Max %
SP5001:2716652%43%60%
MP Server4903:3526331%20%43%

Original data is in this google sheet.

And here is the distribution (not exactly useful now, but who knows):


« Last Edit: October 26, 2018, 04:48:53 pm by ksotar »

 

Offline ksotar

  • 26
Re: Ultimate effort to fix multiplayer (in progress)
Reserved 3

 

Offline Cyborg17

  • 29
  • A-1 Supar
Re: Ultimate effort to fix multiplayer (in progress)
I don't know if this is helpful, but I have two quick ideas about what is causing things to be worse on TC's.   

Do the TC's rely a lot on aim assist? (I can't remember the real term but it has to do with adjusting the angle of player shots)  If the client side is doing aim assist using its approximations of positions, then it would explain why you can't hit anything at all. The assist would all be based on bogus data from a poor approximation.  I am pretty sure that Diaspora uses it, not at all sure about FotG.

My second, probably less helpful idea is that perhaps there is something about the math that relies on the relative speeds native to normal FSO, without looking at the code, I could not point to anything specific. 

 

Offline ksotar

  • 26
Re: Ultimate effort to fix multiplayer (in progress)
Sorry, what is TC?

Yes, I should've mention it. But it depends on difficulty level, for example in Diaspora autoaim is active only on Very Easy. But I have an impression, that it don't make situation any worse. That could be logical enough - both the player and autoaimm aiming at non-existant position. We could find out more, then I'll have autotests run in full power.

As for speeds - yes that could be one of the reasons, as well as ship sizes. But I have very bad results or static situations as well, so it maybe not necessarily the case.

 

Offline ksotar

  • 26
Re: Ultimate effort to fix multiplayer (in progress)
I have updated the automated test section.

And there we have a problem:
when testing with MP server it has lower performance right away, while network issues shouldn't be in effect yet, since we're running server only for now, there is no clients. Does someone have ideas about that?
« Last Edit: October 24, 2018, 03:53:15 pm by ksotar »

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Ultimate effort to fix multiplayer (in progress)
I don't have anything useful to contribute, but I just want to say that working co-op would be amazing.

 

Offline Cyborg17

  • 29
  • A-1 Supar
Re: Ultimate effort to fix multiplayer (in progress)
And there we have a problem:
when testing with MP server it has lower performance right away, while network issues shouldn't be in effect yet, since we're running server only for now, there is no clients. Does someone have ideas about that?

This is a FPS slowdown or "network" choppiness?

 

Offline ksotar

  • 26
Re: Ultimate effort to fix multiplayer (in progress)
I just want to say that working co-op would be amazing.

Thanks, that's good to know that there are people who are interested.

Quote
This is a FPS slowdown or "network" choppiness? 
No, it is not slowdown of any kind, but I'd say it is like AI getting "dumber".

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Ultimate effort to fix multiplayer (in progress)
This has been needed (IMHO / In My Humble Opinion) for a long time.  Single player is great, but communities grow better with multiplayer, I think.  Regardless, it's one more feature to attract new players, whether the community grows a lot or only a modest amount.  So, cheers!

Also, TC stands for Total Conversion, which means a mod that does not require the original game to function (aka / also known as a Stand Alone game / mod).  Diaspora, FotG, and TBP (The Babylong Project), and Starfox are TCs, it does not require assets from original FreeSpace to function.

Not sure if I can help much, but if you need a player to try something and I happen to be available, I can try to set up.

You're on the HLP Discord, right ksotar?  I'll message you there.

 

Offline ksotar

  • 26
Re: Ultimate effort to fix multiplayer (in progress)
Thanks for explanation, just found you on Discord.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Ultimate effort to fix multiplayer (in progress)
As far as I know FotG is the only TC using any aim assist, and isn't released yet, so all real world experience with TCs and multi would be from those using standard FS2 aiming.  That means every firepoint goes straight ahead, always.  At some point I had just concluded FotG could never have multiplayer with the aim assist, if at all, because it would only make the situation even worse, as you wouldn't even be able to attempt to lead the target and manually compensate for the lag, since the autoaim would just put the shots behind where you know you would want to be shooting.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: Ultimate effort to fix multiplayer (in progress)
As far as I know FotG is the only TC using any aim assist, and isn't released yet, so all real world experience with TCs and multi would be from those using standard FS2 aiming.  That means every firepoint goes straight ahead, always.  At some point I had just concluded FotG could never have multiplayer with the aim assist, if at all, because it would only make the situation even worse, as you wouldn't even be able to attempt to lead the target and manually compensate for the lag, since the autoaim would just put the shots behind where you know you would want to be shooting.

What bout Diaspora, I thought that had aim assist?

 

Offline PIe

  • 27
  • GTVA POLICE
    • freespace3.com
Re: Ultimate effort to fix multiplayer (in progress)
As far as I know FotG is the only TC using any aim assist, and isn't released yet, so all real world experience with TCs and multi would be from those using standard FS2 aiming.  That means every firepoint goes straight ahead, always.  At some point I had just concluded FotG could never have multiplayer with the aim assist, if at all, because it would only make the situation even worse, as you wouldn't even be able to attempt to lead the target and manually compensate for the lag, since the autoaim would just put the shots behind where you know you would want to be shooting.

What bout Diaspora, I thought that had aim assist?
It has autoaim for Very Easy and Easy.
[6:23 PM] PIe: why do I have the feeling that I shouldn't be able to give orders to 22nd armored hq
[6:24 PM] Axem: 22nd armored hq, i order you to get me a cup of coffee
[6:24 PM] PIe: and donuts
[6:24 PM] PIe: BECAUSE THIS IS THE GTVA POLICE
[6:25 PM] Axem: :O
[6:25 PM] Axem: am i under arrest
[6:26 PM] [`_`]/: no, just please step out of the myrmidon
[6:26 PM] [`_`]/: you have so much to fred for

 

Offline Admiral Nelson

  • Resurrecter of Campaigns
  • 211
  • The GTA expects that every man will do his duty.
Re: Ultimate effort to fix multiplayer (in progress)
WC Saga's Excalibur fighter uses it also.
If a man consults whether he is to fight, when he has the power in his own hands, it is certain that his opinion is against fighting.

 

Offline ksotar

  • 26
Re: Ultimate effort to fix multiplayer (in progress)
So, no versions on why AI acts worse in MP?

Updated post with static position offset description. It would be interesting if someone could reproduce this. Also your thoughts on this are welcomed.

UPD looks like some pics are not showing, I'll try to fix it later.

UPD2 pics are back.
« Last Edit: October 27, 2018, 02:19:38 am by ksotar »