Live data from Hacker News

Show HN: Multiplayer NES Server in 77 Lines of Go

github.com

11–20 of 21 posts

Re: Show HN: Multiplayer NES Server in 77 Lines of Go

#12
post #9
post #6

Earlier quoted context omitted.

Also the NES emulation is done in Javascript, making the 77 lines a little less impressive. It's "just" server for handling multiplayer part.

Indeed, the title is a bit misleading.

I didn't expect anything but a multiplayer proxy. If it was truly an emulator in 77 lines it must be horribly obfuscated.

Re: Show HN: Multiplayer NES Server in 77 Lines of Go

#15
post #14

I don't get the difference between github.com/gorilla/websocket & github.com/olahol/melody. Does someone have a clue ?

It's a higher level framework built on top of github.com/gorilla/websocket . Some features include

* Clear and easy interface similar to net/http or Gin with event handlers.

* A simple way to broadcast to all or selected connected sessions.

* Message buffers making concurrent writing safe.

* Automatic handling of ping/pong and session timeouts.

Re: Show HN: Multiplayer NES Server in 77 Lines of Go

#17

It would be nice to see state-synchronization using rewinding like GGPO, instead of just sending the inputs which introduces a lot of latency.

I think that would be a beyond the scope of this project which is to demo Go websockets, I wanted to keep it as simple as possible and not hack the JSNES source code.

Although it would be a cool thing to make a production ready web hosted multiplayer NES.

Re: Show HN: Multiplayer NES Server in 77 Lines of Go

#19
post #5

Is there any documentation around? I have no idea how any of this code works, and it doesn't seem to similar to the web apps that I have seen before. Haven't worked with melody before either...

The server works by using HTML5 Websockets ( https://developer.mozilla.org/en-US/docs/WebSockets ) which allows browsers to do full duplex communication with the servers (they can push and receive messages without having to poll). The implementation of the multiplayer itself is very simple and consists of these steps: * Pair up players using a map from one session to another. * Start an instance of https://github.com…

That's really neat - forgive my ignorance on the subject, but how possible is something like this for local multiplayer games in general (outside of NES)? With all the streaming options we've seen recently, I'm surprised something like this hasn't been developed.

Re: Show HN: Multiplayer NES Server in 77 Lines of Go

#20
post #5

Is there any documentation around? I have no idea how any of this code works, and it doesn't seem to similar to the web apps that I have seen before. Haven't worked with melody before either...

The server works by using HTML5 Websockets ( https://developer.mozilla.org/en-US/docs/WebSockets ) which allows browsers to do full duplex communication with the servers (they can push and receive messages without having to poll). The implementation of the multiplayer itself is very simple and consists of these steps: * Pair up players using a map from one session to another. * Start an instance of https://github.com…

Thanks for explanation.
Post reply on HN