Multiplayer Lite

OHM Multiplayer Lite 0.3

nbcfrosty

Active member
Joined
Jun 16, 2023
Messages
173
Reaction score
202
Points
43
Location
US
Actually I'd be very grateful if you could help me test this update. Animations should now be synced and you should be able to add other vessels of your own.
 

Attachments

  • multiplayer-lite-websocket-animation-sync.zip
    418.3 KB · Views: 0

NorbertWoller

Donator
Donator
Joined
Apr 11, 2016
Messages
45
Reaction score
55
Points
18
Actually I'd be very grateful if you could help me test this update. Animations should now be synced and you should be able to add other vessels of your own.
Will be my plesure to help you testing
 

nbcfrosty

Active member
Joined
Jun 16, 2023
Messages
173
Reaction score
202
Points
43
Location
US
Great! now it works. I'm docked :D

Hmm according to the server you are not online, I only see my 2 vessels. You might have docked with a local vessel.
 

NorbertWoller

Donator
Donator
Joined
Apr 11, 2016
Messages
45
Reaction score
55
Points
18
But when I try Shift + P, enter your GL or ISS, and press enter, I get a CTD
 

NorbertWoller

Donator
Donator
Joined
Apr 11, 2016
Messages
45
Reaction score
55
Points
18
Sorry, I have to leave. Feel free to write me a PM. Then we can arrange a new meeting. Will be my plesure!
 

nbcfrosty

Active member
Joined
Jun 16, 2023
Messages
173
Reaction score
202
Points
43
Location
US
This is extremely bizzarre, trying to wrap my head around it...according to the server you are not there at all.... Thank you for testing!

edit:

I think I understand what's happening... fix coming soon.

edit2:

Fix attached with better connection management.
 

Attachments

  • multiplayer-lite-websocket-animation-sync.zip
    418.4 KB · Views: 1
Last edited:

nbcfrosty

Active member
Joined
Jun 16, 2023
Messages
173
Reaction score
202
Points
43
Location
US
Since it seems to be stable, might be time to update the main download on the addons page.
that's the old link, recent post has the client with animation sync, could use a bit more testing.
 

WingC3

Donator
Donator
Joined
Feb 10, 2022
Messages
106
Reaction score
35
Points
28
Location
UK
that's the old link, recent post has the client with animation sync, could use a bit more testing.
Will be happy to test tonight, if you're around. Have a Dark Energy spaceplane to re-enter and land first, so ping me if you want to test.
 

WingC3

Donator
Donator
Joined
Feb 10, 2022
Messages
106
Reaction score
35
Points
28
Location
UK
that's the old link, recent post has the client with animation sync, could use a bit more testing.
So, activated the newest version, and we have a problem: This new version causes Orbiter to hang every 5 seconds for a brief moment. It recovers, but it's very annoying. Disabling the module and reloading the same scenario removes the issue. Do you have something running on a roughly 5 second loop in your code? If so, it's hanging the main thread.
 

nbcfrosty

Active member
Joined
Jun 16, 2023
Messages
173
Reaction score
202
Points
43
Location
US
So, activated the newest version, and we have a problem: This new version causes Orbiter to hang every 5 seconds for a brief moment. It recovers, but it's very annoying. Disabling the module and reloading the same scenario removes the issue. Do you have something running on a roughly 5 second loop in your code? If so, it's hanging the main thread.

Hey WingC3. Thanks for testing it! This is a problem and I am wondering how to approach this. You must have a lot of scenario files in your scenario folder.
Turns out that when Orbiter saves state, it's currently scanning the entire scenario directory, and if you have a lot of files in there, it causes a slight stutter everytime oapiSaveState is called (currently every 5 seconds).

This problem is fixed in Open Orbiter... so that's the good news. If you move the scenario files out of the Scenarios folder, it "fixes" the stutter.
What do you think would be a good compromise? No animations for Orbiter 2016? I can have it automatically move the scenario files out of the
Scenarios folder and then move all of them back when you're done but that seems crude.
 

WingC3

Donator
Donator
Joined
Feb 10, 2022
Messages
106
Reaction score
35
Points
28
Location
UK
Hey WingC3. Thanks for testing it! This is a problem and I am wondering how to approach this. You must have a lot of scenario files in your scenario folder.
Turns out that when Orbiter saves state, it's currently scanning the entire scenario directory, and if you have a lot of files in there, it causes a slight stutter everytime oapiSaveState is called (currently every 5 seconds).

This problem is fixed in Open Orbiter... so that's the good news. If you move the scenario files out of the Scenarios folder, it "fixes" the stutter.
What do you think would be a good compromise? No animations for Orbiter 2016? I can have it automatically move the scenario files out of the
Scenarios folder and then move all of them back when you're done but that seems crude.
I'm slightly confused: I understand what you're saying about api calls by Orbiter to save its state, and yes, I have lots of scenario files.
What I'm not understanding is how this is interacting with your plugin.
Your answer implies that you are calling this state saving function in a way that it isn't normally used (since I don't have the stutter normally) in order to gain information about the other vessels in the scenario.
1. Is that the only way to get that information?
2. If that is indeed what you're using it for, does it need to be called multiple times or only on client connect? Players don't usually change the craft in their scenario whilst in flight. They can, but they generally don't. For Orbiter2016, this might mitigate the issue. For OOx86, you could leave it as is if it doesn't have the same impact.

I wouldn't start moving people's scenario files around. It only has to go wrong once for someone, and you'll have some very unhappy users.
 

Face

Well-known member
Orbiter Contributor
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,403
Reaction score
581
Points
153
Location
Vienna
Usually the scenario saving callback is used as a trick to gather internal vessel information. This information is then transferred to the other client and applied by means of using the loading callback. If done in the render loop thread, it will often cause Orbiter to stutter. Best practice here is to decouple it from the render loop, but this is no silver bullet, either.
 
Top