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 9: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: 173
Joined: Thu Nov 29, 2007 11:32 pm
Location: france
Callsign: jano
Version: git
OS: debian SID

Re: mp-patch introduction, development

Postby Tomaskom » Wed Jun 10, 2015 4: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 8:03 pm
Location: Czech Republic
Callsign: OK-TomK
Version: git
OS: openSUSE (Linux)

Re: mp-patch introduction, development

Postby jano » Sat Jun 13, 2015 9: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: 173
Joined: Thu Nov 29, 2007 11:32 pm
Location: france
Callsign: jano
Version: git
OS: debian SID

Re: mp-patch introduction, development

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

jano wrote in Sat Jun 13, 2015 9: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 8:03 pm
Location: Czech Republic
Callsign: OK-TomK
Version: git
OS: openSUSE (Linux)

Re: mp-patch introduction, development

Postby Necolatis » Tue Jun 16, 2015 9: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


Hangar: https://sites.google.com/site/fghangar/
User avatar
Necolatis
 
Posts: 1831
Joined: Mon Oct 29, 2012 12:40 am
Location: EKOD
Callsign: Leto
IRC name: Neco
Version: 2018.1.1
OS: Windows 10 Pro

Re: mp-patch introduction, development

Postby wkitty42 » Tue Jun 16, 2015 10: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: 4397
Joined: Fri Feb 20, 2015 3:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 14.04.5

Re: mp-patch introduction, development

Postby jano » Fri Jun 24, 2016 10: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: 173
Joined: Thu Nov 29, 2007 11:32 pm
Location: france
Callsign: jano
Version: git
OS: debian SID

Re: mp-patch introduction, development

Postby jano » Mon Jul 04, 2016 11:08 am

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: 173
Joined: Thu Nov 29, 2007 11:32 pm
Location: france
Callsign: jano
Version: git
OS: debian SID

Re: mp-patch introduction, development

Postby pommesschranke » Mon Oct 03, 2016 7: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: 1098
Joined: Sat Apr 27, 2013 7:58 pm
Location: EDLM & LJCE
Callsign: d-laser
IRC name: laserman
Version: git
OS: Linux Lubuntu 18.04

Re: mp-patch introduction, development

Postby jano » Sun Jan 14, 2018 8: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: 173
Joined: Thu Nov 29, 2007 11:32 pm
Location: france
Callsign: jano
Version: git
OS: debian SID

Previous

Return to New features

Who is online

Users browsing this forum: No registered users and 2 guests