Show HN: An online 2D MMO game, written in Rust and JavaScript (polyfight.io)
I made a game (https://polyfight.io/) which revolves around a player (a tank) leveling up and upgrading by killing shapes and other tanks (partially inspired by https://diep.io). It has a bunch of features, a vast number of tanks, an inbuilt chatting system, clans to make teams with your friends, a colour scheme maker, controllable sandboxes which can be public or private, a last man standing gamemode, and an inbuilt 1v1 system with its own ELO rankings and a global leaderboard. The game has a few players right now, and I'd hope to spread the joy players have with this game to people here, as well as any critiques people have about the game. Exploits/gray hat hacking is warmly welcomed, as I strive to make sure my game is secure and hard to script/bot in.
102 comments
[ 3.1 ms ] story [ 179 ms ] threadWhat Rust libraries did you use, what are you using for state management, etc.?
That's kind of funny. When this project said it had elo rankings, I had the thought, "it's a shame they're using elo when there are better options." It seems like you are already using one of those better options!
Other than where elo is used for historical reasons, about the only other reason I can think to use it in a new project is as a placeholder until you do something better. It's great as a placeholder since it is so easy to implement.
That said, this is still good work, especially considering your experience and age (I checked out your 2D physics library on github and I found the trailer on youtube).
One suggestion: As someone in the game industry, I personally wouldn't label it an MMO as it doesn't include many of the features, particularly the "massive" part of MMO, that is usually associated with that term. The work is already impressive enough, you don't need to give it a label that could open it to criticism.
Otherwise, this is solid work. If you're aiming for a career in the game industry eventually, it's a good foundation to build on.
I have ported Quake III to use DataChannel and it works great (once all the WebRTC boilerplate is in place). You can test it here: https://thelongestyard.link/ Once you click the multiplayer link you will get a URL with your server name, which others can visit to join your server instantly.
Back then Quake 3 would require 3d accelerators and now we can play it in the browser... and some person on HN just casually "ported it". Awesome!
What's the technology there? Do you run it on WASM?
In addition to WebRTC multiplayer and a bunch of random improvements I added web gamepad API support as well as touch controls. Yeah, touch controls, because half of everyone is browsing on their phone and I don't think you can really call it a proper web port if it doesn't work on phones. Touch controls for Quake III were a challenge but I think I have something that's fun to use. I'm interested to hear if it works for people.
I'm also experimenting with a port of Cave Story (the classic 2D indie platformer) with touch controls for mobile: https://thelongestyard.link/cave-story/
This the demo we share: https://github.com/rivet-gg/examples/tree/main/javascript/we...
Taking great care to design your data streams to be self-correcting (e.g. transfer a world location where characters are going towards instead of which direction they are heading) can go a long way towards saving a ton of synching headaches, and enables very efficient networking.
One-off events go over the TCP-like channel, but constant streaming data that naturally self-correct over time, like the example above, can benefit from being on the UDP channel.
Like QUIC?
That's also how some speed hacks are made possible.
https://developer.valvesoftware.com/wiki/Prediction
Also on Firefox the FPS meter says 40 FPS, but visually the game (the interface rather, I was unable to play) is clearly not smooth, clearly below stable 24 FPS.
I'm currently enjoying more relaxed MMO settings using threeJS libraries with multiplayer built in:
https://summer-afternoon.vlucendo.com/