Live data from Hacker News

Show HN: I Built Multiplayer Deathmatch Joust

joust.life

91–100 of 107 posts

Re: Show HN: I Built Multiplayer Deathmatch Joust

#94

Holy volume warnings. My dog left the room.

You know I've been playing this for a week now, and until reading your comment it had never occurred to me to put a volumeNode in the middle of the webaudio path.

I just thought I had my speakers too loud :)

Re: Show HN: I Built Multiplayer Deathmatch Joust

#95

Great work on the 'feel' of the movement. Would love to know how the gravity/jumping works. I'm a little disappointed the sound effects of the feet are missing - that was one of my favorite things about Joust.

Gravity is just a constant acceleration downward, so nothing special there.

I have the footstep sounds ready to go, but I found that I really needed to limit what sounds I played because they get overwhelming pretty quickly. There's now a pretty tight radius to the player for what gets played.

First cut was to have all 200 players' flapping sounds audible to everybody. That was suboptimal...

Re: Show HN: I Built Multiplayer Deathmatch Joust

#96
post #23

All I get, no matter how many times I reload is, Error -- We encountered an error when trying to load your application and your page could not be served. Check the logs for your application in the App Platform dashboard.

Yeah, shame I wasn't around when this got popular (I actually submitted it on Tuesday, but HN must have automatically resurrected it for a second try).

The whole thing is running on a $5 Digital Ocean Apps server (well, two actually, one in New York, one in Frankfurt so that I can get low latency here in France), so it's amazing that it survived as long as it did.

Had I known it was going to get this much love, I would have spun up a dozen more servers.

Re: Show HN: I Built Multiplayer Deathmatch Joust

#97

Thanks for the Friday fun. Bug report: Me and another player happened to spawn on the same spot, locking us in place and producing a satanic screeching sound. Other than that, great mechanics!

Yeah, I had to add a Suicide Button (q) for that. It does spawn checking for players and platforms, but there must be a bug there, since you can still get stuck.

Re: Show HN: I Built Multiplayer Deathmatch Joust

#98

On Safari using an iPhone XR, the left and right movement buttons are obscured by the bottom navigation bar.

Yeah, mobile safari is annoying in that it doesn't allow fullscreen mode for anything except video. And that it doesn't always leave you in a consistent scroll state or with knowledge of how much screen is visible. So the left/right buttons drop off the screen unless you scroll it a bit before hitting start.

Re: Show HN: I Built Multiplayer Deathmatch Joust

#99

Most of this code dates back to 1998, when I built a little 2 player Joust game to push the bounds of what you could do with Div (and at the time Layer) tags in the latest browsers such as IE4 and Netscape 3. Surprisingly, most of it still worked when I thawed it out recently, provided your browser knew about document.all. Over the weekend, I brought it up to date a bit and introduced it to Socket.io. Thus far it has…

If you can figure out a way to only send inputs for each player instead of their full state, it should significantly reduce network traffic and lag for each player-- right now it's sending ~1KB/frame!

Yeah, 700b for 20 players, and normally at least somebody does something every tick, so that will go out 30 times per second. It still only works out to 24kbps, so you might not need to upgrade the modem you had back when the original was in the arcades.

I tried only sending updates every 3rd tick, but even there I could notice the difference.

You're right that it'd be worth experimenting with sending keystrokes instead, and backing off the full resync to once/second or so.

Re: Show HN: I Built Multiplayer Deathmatch Joust

#100
post #81

Earlier quoted context omitted.

This is superb, addicting as hell, and now I have to force myself to stop because I have real work to do. The game gets increasingly jittery as it gets busier. It might be worth writing some tests to simulate lots of players moving around so it's easier to tune the performance.

Glancing at the code, it looks like he's rendering everything via DOM elements. I think player sprites are positioned using the top/left properties; could potentially optimize by keeping those props constant and just updating `transform: translate(x,y)` instead...

That's a holdout from 1998. Can't go changing things up after all that time, can we?

I imagine today I would have built the whole thing in canvas. But it's cool how quick you can get something up and running if you let the browser do most of the work.

Post reply on HN