Board index FlightGear Development New features

mp-patch introduction, development

Discussion and requests for new features. Please note that FlightGear developers are volunteers and may or may not be able to consider these requests.

Re: mp-patch introduction, development

Postby jano » Mon Jun 08, 2015 10:03 pm

Hi, Tomaskom, and thanks for the testing :)

i found the cause of the double message, and put some changes on the nasal file to address what Necolatis reported, but as i don't have regained the commit right yet, it should take some time to reach next.

i will put your change in an other merge request later, and yes once we got the basic version clean, testing will be welcome (a mp tanker and 2 planes refueling for exemple).

jean
jano
 
Posts: 221
Joined: Fri Nov 30, 2007 12:32 am
Location: france
Callsign: jano
Version: git
OS: debian SID

Re: mp-patch introduction, development

Postby Tomaskom » Wed Jun 10, 2015 5:50 pm

I just found one severe problem:
When I crash (YASim) aircraft at higher speed and have the correction enabled, from the multiplayer perspective it starts severely jumping around the crashed position.

The cause is probably the fact that when an aircraft is crashed, the last position, speed etc values just before the crash are transmitted, instead of zero speed what one might expect.
The crashed property is not transmitted over MP which will make fixing this more complicated (a severe problem in my opinion, I always transmit the crashed condition via generic int in my aircraft instead). But you could eg. store the last lat/lon/alt info and if it doesn't change in the next few iterations, detected via unchanged series counter, just stop all predictions and put it where it really is.
The "symptoms" of crash are basically the same as of disconnected or heavily lagged aircraft, except for that it doesn't disappear.

Or maybe another better solution can be found, I didn't study your code.
"There are no problems in the air. The only problem is hitting the ground"

Get my L-159 ALCA from the FGUK hangar. If you crash it, things gonna go boom!
User avatar
Tomaskom
 
Posts: 132
Joined: Sun Dec 02, 2012 9:03 pm
Location: Czech Republic
Callsign: OK-TomK
Version: git
OS: openSUSE (Linux)

Re: mp-patch introduction, development

Postby jano » Sat Jun 13, 2015 10:31 am

for your information, i just filled a merge request with a nul speed when crashed, still allowing the position to be sent, if eg you want to make the plane dive in water with nasal :)
this is fine with yasim, but jsbsim sometimes don't set the crashed property right away.
i prefer doing this in the sending side, this way you will know the pilots using an old fg version :D
next in the todo list are things like making timestamp part of the fdm state, and sending the acceleration (disabled for now), yasim is done here but jsbsim need to be done in their code so i think this will wait for after the freeze.

jano
jano
 
Posts: 221
Joined: Fri Nov 30, 2007 12:32 am
Location: france
Callsign: jano
Version: git
OS: debian SID

Re: mp-patch introduction, development

Postby Tomaskom » Sat Jun 13, 2015 3:44 pm

jano wrote in Sat Jun 13, 2015 10:31 am:for your information, i just filled a merge request with a nul speed when crashed, still allowing the position to be sent, if eg you want to make the plane dive in water with nasal :)


That is not the solution I was hoping for, kills my calculations of impact severity for the L-159 disintegration (which reads the speed). I guess I could change it to velocities/[u,v,w]Body-fps if that didn't get killed to zero too...
"There are no problems in the air. The only problem is hitting the ground"

Get my L-159 ALCA from the FGUK hangar. If you crash it, things gonna go boom!
User avatar
Tomaskom
 
Posts: 132
Joined: Sun Dec 02, 2012 9:03 pm
Location: Czech Republic
Callsign: OK-TomK
Version: git
OS: openSUSE (Linux)

Re: mp-patch introduction, development

Postby Necolatis » Tue Jun 16, 2015 10:07 pm

I just downloaded a new nightly and updated fgdata. I get this when starting up the sim:

Nasal runtime error: removelistener() with invalid listener id
at d:/ProgramFiles/Development/Git/fgdata/Nasal/io.nas, line 391
called from: d:/ProgramFiles/Development/Git/fgdata/Nasal/lag_adjust.nas, line 67
called from: d:/ProgramFiles/Development/Git/fgdata/Nasal/lag_adjust.nas, line 92
called from: d:/ProgramFiles/Development/Git/fgdata/Nasal/globals.nas, line 119
"Airplane travel is nature's way of making you look like your passport photo."
— Al Gore
User avatar
Necolatis
 
Posts: 2232
Joined: Mon Oct 29, 2012 1:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2020.3.19
OS: Windows 10

Re: mp-patch introduction, development

Postby wkitty42 » Tue Jun 16, 2015 11:08 pm

@Necolatis: this has been reported in the tracker so the devs will be sure to see it... 1770 Nasal runtime error: removelistener() with invalid listener id
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9123
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: mp-patch introduction, development

Postby jano » Fri Jun 24, 2016 11:05 am

just to say that the code is included in the recent fg release, so you can try it ...

we started to train in close formation flight and that is fun :)

if there are comment or questions, feel free to post here ...
jano
 
Posts: 221
Joined: Fri Nov 30, 2007 12:32 am
Location: france
Callsign: jano
Version: git
OS: debian SID

Re: mp-patch introduction, development

Postby jano » Mon Jul 04, 2016 12:08 pm

before i got something done to have it tunes automaticaly someday, the lag setting can be done this way:

- start fg with 127.0.0.1 as mpserver (--multiplay=out,10,127.0.0.1,5000), you'll see your plane, and the same as mp player (better disable mp collision :D )
- be sure you have checked the master switch and apply to close mp switch in the lag settings
- fly at high speed on autopilot, go external view, then go in the properties to /sim/multiplay/lag/offset, and adjust it to have the planes in sync.

keep this value in mind (beware atm it depend a bit on framerate, so depending fg load, the planes will be more or less in sync).

here i get 0.004 or 0.005 for the offset


next, ping the mp server you want to use eg (on linux):

Code: Select all
 for i in mpserver{01,02,03,04,14}.flightgear.org; do echo $i; ping -c4 $i | grep rtt; echo; done

mpserver01.flightgear.org
rtt min/avg/max/mdev = 45.499/46.003/47.129/0.688 ms

mpserver02.flightgear.org
rtt min/avg/max/mdev = 169.278/170.512/171.639/1.099 ms

mpserver03.flightgear.org
rtt min/avg/max/mdev = 45.872/45.928/45.988/0.218 ms

mpserver04.flightgear.org
rtt min/avg/max/mdev = 49.517/51.228/54.890/2.161 ms

mpserver14.flightgear.org
rtt min/avg/max/mdev = 62.930/63.021/63.107/0.194 ms


add the ping converted in seconds with the offset found in the first step, and put this for the offset, using the property is more precise than the slider, and allow you higher values.
here i've got 3 mpservers with nearly the same ping (01,03, 04) wich will be used preferably, but you have to consider all the pilots in case of a formation flight. (and you need to be on the same mpserver, i don't have a way to add interserver lag compensation for now)

last, try and report if that work well this way :) , the mpserver choice is something critical, if you want to avoid some pilots to have a huge ping.

jano
jano
 
Posts: 221
Joined: Fri Nov 30, 2007 12:32 am
Location: france
Callsign: jano
Version: git
OS: debian SID

Re: mp-patch introduction, development

Postby pommesschranke » Mon Oct 03, 2016 8:27 am

Thank you for your work!

I tried it with the UFO and F-16C.
loopback lag: 0.01 + ping(19.88ms) = 0.029

In the local loopback test, I noticed a flicker of the mp aircraft: Is was rapidly jumping between 2 distance offsets.
With the UFO FDM that effect was much stronger than with the F-16C

Friends did report a similar jumping between 2 distance offsets while flying formation over mp-server.
I will ask them later if they had the compensation enabled and if they were on the same server.
pommesschranke
 
Posts: 1117
Joined: Sat Apr 27, 2013 8:58 pm
Location: EDLM & LJCE
Callsign: d-laser
IRC name: laserman
Version: git
OS: Linux Kubuntu 22.04

Re: mp-patch introduction, development

Postby jano » Sun Jan 14, 2018 9:30 am

About the ufo jumping, that's normal, the ufo doesn't send velocity value so only make jumps between mp positions, if you try to see it in the future. for other plane it's a side effect inavoidable, the guess for the future can be a bit wrong, and the plane jump when a new position arrive (specialy when accelerating or taking high turns)


We're back on the topic:

Image

Here i'm following a mp tanker, and the refuel mat is animated from the tanker, looks in the good position :)
This time we are syncing the time between us in FG, and the lag correction don't need to be guessed by try and error.

the WIP is in my fg fork on sourceforge
the simgear mp branch there is needed too ...


jano
jano
 
Posts: 221
Joined: Fri Nov 30, 2007 12:32 am
Location: france
Callsign: jano
Version: git
OS: debian SID

Re: mp-patch introduction, development

Postby jano » Tue Jan 14, 2020 11:57 pm

Some news for the pilots wanting to do close formation flight, the "real-time" patch went in next today ,as it's the few weeks of the year i come back to the fg world :) and sorry for the delay .

if the player's pc clocks are reasonably in sync, the same time is used to display the main and mp aircrafts, allowing a zero lag experience (but as it predict the position in the futur, planes can jump a bit depending the maneuvers).

Pilot list got a dedicaced page (click on the unit to access it) wich display the pps (packet per seconds) to see if the mp link is good (bad mpserver, or bad cross server links) and the lag for the mp plane, in ms. here it's in the 60ms range.

We got very good PC horloge sync by using ntp services (ntp on linux, there's something similar for windows and mac) but you can tune your clock offset if you're off, in the lag menu.

To get it working, you need a very recent flightgear and fgdata, and to turn on the master switch and apply to close switch in lag settings
if the lag is less than 300ms, you'll be in real time mode with the mp plane.

i usually set the value "sim/time/max-simtime-per-frame" in the 5 seconds range to allow some large 3d loading time, without pausing the plane in the air (but it's dangerous in terrain following flight :D ), and the property is accessible in the lag settings ...

Image
jano
 
Posts: 221
Joined: Fri Nov 30, 2007 12:32 am
Location: france
Callsign: jano
Version: git
OS: debian SID

Previous

Return to New features

Who is online

Users browsing this forum: despe and 2 guests