Announcement

Collapse
No announcement yet.

WebSocket support?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    WebSocket support?

    How does UE4 handle networking under HTML5 builds? Are websockets supported?

    #2
    https://forums.unrealengine.com/show...L5-Multiplayer

    Here's an experimental networking plugin that uses websockets, I think.

    Comment


      #3
      I have made a naive implementation via https://github.com/kanaka/websockify, but this is far from good: a good native implementation would be much better.

      Comment


        #4
        HTML5 Multiplayer is supported via the plugin Experimenta\HTML5Networking. ( https://github.com/EpicGames/UnrealE...TML5Networking ) Readme.md in the same directory explains how to set that plugin. Discovery eg, Beacons are not supported out of the box.

        Emscripten supports websockets out of the box via the BSD socket api. HTML5 networking plugin on the client side uses it and on the server side uses libwebsocket.org. this plugin is also cross platform - if non html5 clients want to talk to the same server ( the one which HTML5 platform connects), they can use the same plugin.

        libwebsockets.org lib is also used for Cook-on-the-fly feature for HTML5 platform. (although that is only done via http requests).

        This plugin is a "native implementaiton" and allows Unreal Servers to understand websockets. This was used by mozilla to demo ShooterGame+Networking (HTML5 clients playing against themselves and win64 clients) at GDC.

        Websockify is not necessary with this plugin.

        Comment


          #5
          Would it be possible to run the Shooter Game project along with this plugin, without modifications to the Shooter Game code? Or are any kind of fixes needed? Is this for 4.6 or 4.7?

          Comment


            #6
            You should be able to run Shooter Game without modification ( although its not technically supported on html5 yet- there might be some graphical glitches on html5 with stock github ue distribution). Networked gameplay should work without any changes.

            Server discovery won't work though - you would have to use the server ip on the html5 command line ( edit the generated html5 file for that).

            if You are trying to get your feet wet - it would be easier to get a handle on things with smaller projects eg - ContentExamples ( networking features map ) or the Shootout networking tutorial.

            In its current state it is for 4.8, although making it work for 4.7 is straightforward too.
            Last edited by [Ankitkk]; 04-13-2015, 02:46 PM.

            Comment


              #7
              Tuning down the graphics and/or tweaking the shaders to mobile-friendly would probably make it run without problems on HTML5, maybe?

              Comment


                #8
                yes - to get around most graphical issues in html5 ( and ShooterGame) you can relax es2 sampler limits. you can locally change GetFeatureLevelMaxTextureSamplers to return always return 16. ( HTML5 is a "High End" es2 device). Engine\Source\Runtime\RHI\Public\RHIDefinitions.h line ~725. And then cook content.

                Comment

                Working...
                X