Ashley's Forum Posts

    • Post link icon

    Is beta3 any different? (Available here: https://www.scirra.com/nwjs)

    That includes "Fix: nwjs Helper process not closed (#4118)" which sounds like it may be related. I want to get a stable release out soon and I'm pretty sure this is a NW.js issue, and we can update NW.js independently of C2 releases. So I may go ahead and do a stable update despite this issue, and hopefully the next version or two of NW.js will fix it.

  • Intel GPUs are really weak, I don't know if they will run anything well

    If you have any issues I'd encourage you to post to the Bugs forum following all the guidelines. It would be strange if the game starts up in NW.js but not Chrome - they're both based on the same Chromium browser engine!

  • Is that using the .capx you posted? I tested it on both an iPad Air 2 and Chrome on a Nexus 9, neither had any issues.

  • The main reason it's not supported is because it's incredibly complicated. If the connection to the host drops without warning, then the clients may be missing important state information that only the host had, so cannot take over as host. To mitigate that you'd need to continually sync data from the host to other peers so that they can take over if need be, but since this is all game-specific data the multiplayer engine can't handle that for you - you'd have to do an awful lot of events for ongoing synchronisation and then a tricky transition from peer-state to host-state while hoping all the peer reconnections work (and at that point some of them could fail, e.g. if the peer who is becoming host is behind a NAT that only allows them to act as peer and not host, so then nobody can connect and the game fails anyway).

    One way of solving this would be to run the host on a dedicated server instead.

  • Yeah, that sounds about right - almost instantaneous, no lag at all!

  • You should probably just completely ignore the power-of-two sizes thing. It's more likely to cause problems than help anything.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley

    I'm just guessing at that number - what do you mulitply the Multiplayer.Latency by to get the exact number of milliseconds?

    Nothing - it's already in milliseconds!

  • Yeah, from r217 onwards you can only use NW.js 0.13+.

  • Have you actually made a measurement or are you guessing it's 500ms? People have guessed wrong before, assuming what is really a ~50ms delay is actually much longer. The multiplayer engine adds a short delay (80ms IIRC) for buffering purposes so maybe you're just seeing that?

  • Even if you occasionally send the position, you're still missing 90% of the multiplayer object's features. It can do things like smoothly correct the position over time so you never see the object jump if a correction is made.

    I'm not sure why two tabs would have such a high latency between them - are both tabs open as their own windows or are you leaving one in the background? If you background a tab, it will basically go to sleep and stop responding to messages, which could explain the ~1s latency. All local testing should be done with both windows open.

    • Post link icon

    - please provide a minimal repro if you can - see the FAQ for info on how to get there if you can't reproduce in a new project.

  • ome6a1717's method won't work: both the runtime and network latency are non-deterministic, so only sending inputs will cause the games to diverge until both sides are seeing something completely different. Multiplayer programming is exceptionally difficult, you should really use the built-in syncing features, which have carefully tuned redundancy and compensation features that can adaptively handle things like changing average latency and latency variance, high packet loss and packets arriving in the wrong order, while keeping synced object movement smooth and very close to the position on the host. If you think you can just send a few messages and get a similar system, you are severely underestimating the technology behind the Multiplayer plugin.

    If you run two tabs on the same machine, you should easily see <5ms latency between them. A poor quality long distance link from e.g. UK to Australia could be around ~500ms. So if you're seeing 600ms+ on the same machine, that indicates some kind of fault. The latency is 100% to do with the network connection, WebRTC won't add more than a few milliseconds. I did extensive testing of the feature at the time, and even long-distance games worked well with the multiplayer engine's features for compensating poor quality connections.

    • Post link icon

    I can't reproduce this in either the Steam or standalone versions of C2 when previewing with NW.js: it appears to close down just fine, even with Steam open and running in the background. So if I understand right, this only happens when you've published an app to Steam and are running it from Steam, right? Are you sure you have not configured some special command line parameters or launch options that Steam might be applying and breaking it? Perhaps it's related to the Steam overlay, does it help if you disable that? (It's caused some problems in the past before IIRC)

  • Closing as not a bug, zenox98 is right that you're playing sound every tick. It also does not follow the bug report guidelines so we wouldn't have investigated it anyway.

  • Closing, .capx missing and screenshots make it clear it's not a minimal .capx as per the bug report requirements anyway.