Crawl
JSMPEG-VNC and my experience with online multiplayer, help&testing wanted
Introduction

I grabbed the game today because it looked like great fun for games-night, and I hoped when purchasing it that I could overcome the netplay barrier using a remote desktop solution. I have successfully played a match with one player online with some limitations and caveats, but overall success. I'm probably missing something that a more-knowledgeable user can solve, so I'll post my experience here and hope that it's helpful to someone.

JSMPEG-VNC

Before grabbing Crawl, I surveyed the available VNC and similar remote-desktop solutions and settled upon a quiet, little-known project called JSMPEG-VNC (Photoslab. https://github.com/phoboslab/jsmpeg-vnc ), which stood out from the others as an efficient, lightweight, and free option. Installation is a straightforward extract-to-folder but the program is command-line, which may turn off some viewers. Don't fret though, it's pretty much automated once it's running. I run the program from a batch file so that I don't need to open command prompt and type out the program path and parameters every time.

Preparation and Installation

First-off came a simple security measure: hiding my IP address. There are a plethora of reasons to hide one's IP, especially when you have friends who stream. I made a NoIP account and grabbed their updater. Free, easy-peasy. I also made sure that my router was properly configured to forward a few ports and tested them.

After downloading and extracting the latest version of JSMPEG-VNC, I created a batch file in the executable's directory and opened it for editing in Notepad. My current command-line parameters are:

-i 1 -s 960x540 -b 1500 -f 30 "Crawl"

Using fullscreen+full-bitrate transmission is impractically slow for online play. I halved the resolution dimensions and framerate in order to reduce encoding, transmission, and decoding latency.

If you're unfamiliar with writing a batch file, please find an article somewhere else: lots of more-experienced users have written better articles on it than I could.

With my IP masked, ports forwarded, and game running (windowed, as minimizing the window = 0×0 pixel window = JSMPEG-VNC freaks out), I started up JSMPEG-VNC with Administator rights and immediately saw it dropping frames. I remedied this by opening Task Manager, showing tasks from all users, and elevating JSMPEG-VNC to, "Above Normal,"-priority. Easy fix. JSMPEG-VNC was capturing and encoding frames with a total latency of 10-15ms.

Experience and Limitations

I messaged a friend in Discord and shot him the NoIP domain with port. He reported easy browser access to the MPEG stream, crisp and smooth visual fidelity, and acceptable control response. After configuring the controls, we started a game with no bots and tested the responsiveness and limitations in the kill room.

First-off, connected clients get no sound. I could probably stream an AAC or similar capture to make up for this: no biggie. My understanding of what discussion I have read is that decoding MPEG1 audio streams is inefficient for browsers.

Secondly, there are a couple of control issues. I have not found a way to allow connected clients to move the cursor in-game. Moving it on my desktop works fine, and left- and right-clicks function normally in-game or on my desktop. I also lack the knowledge to determine whether this is due to an error or mere lack of support, but remote joysticks/controllers cannot provide input.

THAT BEING SAID, the game was just dandy. His controls were sufficiently quick so as to provide a challenge, and I experienced no problems or slowdowns on my end. After we finished our game, I got to trying to troubleshoot the mouse-control problem.

Going From Here

It shouldn't be too hard for me to find a way to broadcast audio as a separate stream, though synchronization may introduce a new problem. I think that meting out the control issues is a greater priority.

I have had zero success with any combination of Administrator Priveleges (game, batch, client browser, JSMPEG-VNC), window modes, or program-startup properties.

So far, I think that the best solution might be for the host to use a mouse or controller and for clients to each use separate keyboard bindings. Until a better solution is found, I'll be trying something like:

(WASD+F/G, ARROWS+N/M, NUMPAD1235+NUM*/NUM-). This means that remote players get weird controls, but it should work. I might get around to testing it tomorrow.

If other people want to try it out, let me know how it works for you. If you think that you have a solution or a better method to do this, then post about it here – we'd all love a way to play this with more people.

Edit #1: I might add a line to the client-side input or decoder java, so as to disable right-click context menus, if I can get the mouse control working. I know that 99% of the time it's rude and irritating to do this, but nobody wants a context menu popping up whenever they use magic.

Edit #2: FYI, this method allows other connecting players to join using nothing more than a modern web browser. As long as their CPU can handle decoding the stream, it should work. It also allows them potentially-disastrous control over your system as though they were in the room but you couldn't punch them. Post your server with discretion and take the right safety precautions!
Dernière modification de Yes Indeed!; 22 avr. 2017 à 23h16
< >
Affichage des commentaires 1 à 6 sur 6
Update #1: I tried a round with two friends, one in the same NA city and another in Ireland. The game was utterly impossible for the Irish player due to 150ms+ of input lag and another 150ms+ of display lag. The game was barely playable for the nearby player due to 30ms+ of input lag and another 30ms+ of display lag. Sound-sharing was achieved using SWYH and synchronization with the MPEG1 stream was a non-issue. Future experiments will involve permutations of nearby players.
Dernière modification de Yes Indeed!; 26 avr. 2017 à 23h21
Quite interesting reads. But i guess considering latency a built in solution would always run better or optimal? With arrows and such lag is bad D:

Hmm maybe they do it with crawl2 ? lol nobody knows :/

But your experimenting sounds fun nevertheless, even if its just research ^^
I've been trying to do this, was getting issues with the websockets not working properly.
When I seemed to have fixed that by assigning the IP of the ws directly, seems that friends weren't getting any video.

Did you have any problems with that?
Syn a écrit :
I've been trying to do this, was getting issues with the websockets not working properly.
When I seemed to have fixed that by assigning the IP of the ws directly, seems that friends weren't getting any video.

Did you have any problems with that?

I had no issue with client connectivity. The main problem impeding playability was input lag and input/video desynchronization: hard to play a game like this with three full seconds of latency between pressing a key and seeing an action. The problem grows more pronounced as multiple users connect and becomes utterly intolerable if a single high-ping (ie., international) user connects.

I might or might not be able to resolve the latency using a dedicated serverbox, though I suspect (and my knowledge on the topic is very limited) that the VNC netcode is inherently ill-suited to this application.

I would be elated to be disproven.
if youve got an nvidia card you might want to try this option as well http://moonlight-stream.com/
Ashintar a écrit :
if youve got an nvidia card you might want to try this option as well http://moonlight-stream.com/

Yeah, it looks pretty neat. I've heard of latency and responsiveness issues from some users, but it overall sounds slick.

Two issues:

-it only handles up to one additional player;
-no nVidia card.
< >
Affichage des commentaires 1 à 6 sur 6
Par page : 1530 50

Posté le 22 avr. 2017 à 23h00
Messages : 6