8 ms·
Show HN: Acolytefight.io – Multiplayer Skillshot Arena HTML5 Game
- aaronm14 8y agoWas this inspired by a custom map on Warcraft 3? Name is escaping me right now.. Been such a long time since I played it! Would love to know about some of the tech you used to build it
- BSTRhino 8y agoYes, it was based on Warlock, the WarCraft 3 map! I had many fun Friday night LAN parties playing that map and wanted to recreated it! It's TypeScript, canvas, React (for the UI elements), NodeJS and socket.io on the server. The entire simulation is run on the client. It is deterministic so it is just replaying the action stream identically to all the other clients to stay synced. The server is running a pretty simple loop really, every 32 milliseconds it collects all the actions and broadcasts them to all the clients. If there is anything else you want to know, feel free to ask, I'm happy to talk about it :).
- aaronm14 8y agoThat was it! Man completely forgot about that game! This is a great take on it, I was able to quickly have fun, especially once I was able to recognize the concept. I love that you can mod via JSON as well. Do you have the code open sourced anywhere?
- BSTRhino 8y agoThanks! I'm not open sourcing the game at this time, maybe in the future I might consider it.
- zpr 8y agoDid you use any server or client game or rendering framework? eg. Phaser, pixi or the like. And when you say the simulation is running on the client, do you mean it is client authoritative and the server just acts as relay? What sort of actions do you send?
- BSTRhino 8y agoThe only thing I'm using is Planck.js as the physics engine, besides that it's just raw canvas. I did spend quite a bit of time deciding whether I should go for WebGL or Canvas, but Canvas was just easier and it performs well enough. There are actually 5 canvases stacked on top of each other - background, glows, objects, interface, cursor. The glows layer has a CSS blur property on it, which lets it be done on the GPU. Initially I just used the canvas shadowBlur everywhere but it was horribly slow, so this was one of the biggest performance boosts. The other layers are just there because they're invalidated/refreshed at different rates for performance reasons. The interface layer is particularly slow to update as its got to draw all the button icon paths, so it only ever rerenders the parts as they change, as opposed to some of the other layers which rerender every frame.
- newnewpdro 8y agoUnplayably slow on this old thinkpad (core 2 duo)
- BSTRhino 8y ago:( sorry, I guess it's still quite demanding, too demanding, despite being a browser game
- exikyut 8y agoAre you using Chrome?
- newnewpdro 8y agoNo, FF 52.9.0 x86_64 as shipped in debian 9.5.
- exikyut 8y agoThat may well be why. There are tons of reports of FF being unusably slow even on the newest processors.
- newnewpdro 8y agoI'll see if I can try newer versions of FF when I get around to it. Chrome, like all Google trash, is not an option [0]. [0] https://www.theregister.co.uk/2015/06/17/debian_chromium_hubbub/ https://www.theregister.co.uk/2015/06/17/debian_chromium_hub...
- laserBro13Fcali 8y agoCan I please NOT have to play against other people? Why does my super cool laser ball marble madness character move like a beach ball in a bath tub? I can't even figure out what to do, or why I should care about laser balls and triangle ghosts, and they're just killing me before I figure out how cool my lasers are.
- BSTRhino 8y agoAh, that's fair enough, I should really add a training mode. That is good feedback! Thanks for trying!
- laserBro13Fcali 8y agoUpdate, I figured out the beach ball problem: Firefox on a Mac. I switched over to Chrome, and even Safari, and it was better, so it seems like Webkit/Blink/V8 is the best browser scoped runtime, for some reason.
- BSTRhino 8y agoIf it helps, you can create a party and then click "Make Private" and then you won't have to play with other people (you'll just be in a party of 1). I should really make that workflow easier though, I wouldn't expect a new player to figure that out.
- laserBro13Fcali 8y agoYup, I had to dig to find it. The "party" link didn't seem like the option I was looking for, until I saw the "private" option. Also, I created a private party link, and figured out how to add an AI bot, after learning the controls. The AI bot was still too strong, and beat me every time, so I need dumber bots, to have more fun up front. I sent the link to myself, and opened it up in multiple private windows, to learn the rules, against dummy sessions I created by invite. But either way, maybe add a default practice button, that puts people in a private game, against a really weak AI, and you have your trainer option for new users. I think a big, obvious training button sounds like a good idea. Especially for users that get killed in a competitive game with other people.
- remremz 8y agoReminds me of the game Magicka (https://en.wikipedia.org/wiki/Magicka https://en.wikipedia.org/wiki/Magicka)
- BSTRhino 8y agoI've never heard of that game but Magicka looks awesome! Thanks for sharing it with me!
- wlesieutre 8y agoIt’s hilarious to play with friends, you’ll frequently mix up keys and drop a boulder on yourself or party members. If you want something similar with a Starship Troopers vibe, also check out Helldivers! https://store.steampowered.com/app/394510/HELLDIVERS/ https://store.steampowered.com/app/394510/HELLDIVERS/
- foota 8y agoI really loved magicka wizard wars, it was such a shame when it was shut down.
- patricklorio 8y agoI really enjoyed this. Bookmarked! Would be great to get some sound effects, currently all the actions don't feel that heavy.
- BSTRhino 8y agoWoohoo! Yeah sadly being a solo developer I could only do what I knew how to do, don't yet know how to do sound effects, but I think that would be worth looking into! Thanks for playing!
- flashman 8y agoDesign question: are the players click-to-move because that improves performance compared to, say, following the cursor at all times? Compare this with agar.io, where the player is always moving towards the cursor. Well done on this game. I assume I'm playing on American servers but as an Australian this hasn't caused me many issues.
- BSTRhino 8y agoIt's not for performance reasons actually, in fact it is already sending every single mouse move to the server because there is a certain spell (Acolyte Beam) that tries to follow your cursor and needs this information. I did some user testing with following the cursor at all times and people didn't seem to like it. I think the difference between this and agar.io is its quite common to want to be aiming and moving in two different directions, so the mouse click gives more control. On this topic, one interesting thing which came up in testing was how important it was for the Acolyte to "move through the spells". Initially movement was a spell, and so if you cast another spell, it would stop movement. The game was very stuttered. When I separated out the code for movement from spellcasting, the Acolytes started moving fluidly and the game was much better :). As for the servers - there are three servers - in Australia, US and EU - so you're playing local. I'm from New Zealand, and US lag was unbearable for the reaction time required for this game. Google Cloud Platform is awesome in that it automatically connects you to your closest server :).
- d4l3k 8y agoThis game is pretty much unplayable on Firefox on Linux due to how slow it is, even with an 8th gen i7 processor. Seems to run fine on Chrome, but having to switch is super obnoxious
- BSTRhino 8y agoYeah, I'm on a Mac and it's unplayable with Firefox. Firefox works fine on Windows though, weirdly enough. I've made all the performance improvements I can think of and it's still really slow. I don't know how to fix it, if I could I would!
- Lerc 8y agoHave you tried turning off the #glows { filter: blur(5px) } Canvas can be fast but if you step into the unoptimized areas the slowdowns can be substantial. Blurring can slow things down a lot. Drawing strokes with a thickness other than one also seems to be an issue. I had one game running at 10fps on an i7 with fancy 3d card, it ran at 30fps on a $200 arm ChromeBook. This wee game prototype http://www.fingswotidun.com/ld42/post/ http://www.fingswotidun.com/ld42/post/ runs fine on fairly modest cellphones but the puff of smoke on death kills performance due to the multiply composite mode not being accelerated. The only thing you can really be sure of is that drawing images is fast. Untransformed images are very fast, rotated and scaled images, less so but still quite impressively fast. This http://www.fingswotidun.com/ld42 http://www.fingswotidun.com/ld42 uses only unscaled images and ran at full FrameRate on an 900Mhz Arm9 Mali400. For reference. A machine that handles only a few fps on Acolytefight handles 40,000 bunnies on this https://lemon07r.github.io/kha-html5-bunnymark/ https://lemon07r.github.io/kha-html5-bunnymark/
- BSTRhino 8y agoOMG... that's exactly what the problem was. I turned that off and performance is 60fps on Firefox once again. Now I need to figure out how to I detect the conditions that I need to turn it on/off... it actually works fine on some Firefox Windows installations at least. https://bugzilla.mozilla.org/show_bug.cgi?id=925025 https://bugzilla.mozilla.org/show_bug.cgi?id=925025 Looks like Firefox does the blur in software whereas the other browsers do it in hardware, but apparently you can turn on gfx.webrender.all to make Firefox do it in hardware, not that it seems to work for me... Edit: It's just easier to turn off blur in Firefox always. So I'm doing that. Turns out there is a clever way to detect Firefox from CSS. Thanks so much for the suggestion!
- davidscolgan 8y agoThis is super cool! Networked games are a special kind of challenging to pull off, and I'm always really impressed by people who manage to pull these kinds of projects off at any level of polish. Any plans for further development?
- BSTRhino 8y agoYeah, the multiplayer part certainly was a big part of the challenge of this game! In terms of future development, I have some ideas but I think I will hold on to them so they can be more surprising later :)
- dvh 8y agoHow does server architecture look like and how much it costs?
- BSTRhino 8y agoI'm using Google Cloud Platform. There are three servers - Australia, EU and US. The Google Cloud load balancer automatically connects people to the closest one. I had to do some special things to make websockets work correctly - configured session affinity (with a cookie) and the HTTP timeout has to be set to a large number. It costs around $150 US a month, which means at some point I will probably stop running the game because that's a lot. The entire game is simulated on the client. It is a deterministic simulation, so the same sequence of inputs will generate the same state. The server doesn't do any of the simulation at all, it just passes the action sequence to all the clients. Every 32 milliseconds the server wraps up all the messages received and sends them to all clients in the game as the next frame. I used the nanotimer library in NodeJS to get this 32 millisecond interval as accurate as possible. Because the server does none of the computation, it theoretically can support lots of clients. I don't know how many yet, but maybe a thousand? Even at its peak usage of 40 users yesterday it was still only taking about 1-2 milliseconds to do each frame.
- dvh 8y ago$150 for 40 users is quite a lot, is it fixed rate or will it rise when DAU rises?
- kuroguro 8y agoHmm... and now it's time to make bots that play the game better than I ever could.
- BSTRhino 8y agoIf you go to the AI page you can program your own bot there! It's built-in.
- Y14NZZRhRT5 8y agoPerformance is bad on firefox but on chrome it worked fine. As for the game I think the gameplay is very awkward. In a skillshot game I want to be in really good control of my character. This could be improved by faster turn and movement rate(and perhaps being able to stop) or alternatively a more cave flier style both hands on keyboard combat where one hand is controlling the ship(arrow keys/wasd) and one hand is controlling weapons. As for the skills/weapons there are way too many in my opinion and the synergy of them feels awkward and the cooldowns are way too long. If you have 2 defensive spells I think they should be on a sub 5 second cooldown but maximum 1 sec duration and have all offensive spells kill on first or second hit to make to combat fast paced.
- BSTRhino 8y agoYeah, I've got that feedback from some people. Something I've realised is that everyone is that there are two broad categories that this game looks like it could be similar to: * A twin stick shooter * A MOBA And I've got two distinctly opposing sets of feedback from those two groups. MOBAs have long cooldowns and you move and shoot with the mouse. Twin Stick Shooters let you move and shoot using separate controls (it's common to run away and shoot forward at the same time) and have very short (almost non-existent) cooldowns. I'm a MOBA person, and I based this game off my happy experiences with Warlock, the WarCraft 3 map, so I've ended up making something which is more like that. I think the genres are fun for different reasons and I can't please them both.
- setr 8y agoMoba’s feature a number of low-cd spells. I’d say the bigger differentiator is that mobas usually have a “skillset” while twin stick shooters usually have “set of skills”. That is, the former features a very high degree of synergy, and performing the whole combo is main task you want to achieve. That latter features shooting as the main goal, and your skills support that one basic task. Your game is in an awkward spot because it fits neither: there’s no real combo to act out (i didnt look through the skills too thoroughly so maybe there are some interesting combos to derive), so your primary task is fireball’ing, with skills to support that task. Yet the cd is annoyingly long, so you’re mostly waiting! The high risk shots dont seem to have real any way to allieviate the risk too: think of the basic moba combo: snare & pummel. You can still fire off the slow as hell ultimate, but its only really risk—free if they’re pinned first (and so pinning, not the ultimate, is really the thing you’re trying to avoid as the enemy). Again, I haven’t gone through your game with any thouroughness to really judge; this is just my ideas on how skills play a significantly different role in the genres you’re coming from, and how theyd function in yours
- aymeric 8y agoBSTRhino, would you consider open sourcing this so that I can contribute to the development?
- aymeric 8y agoOr can I talk to you about joining your project?
- BSTRhino 8y agoThanks for your offer... at this point I want to keep doing it myself, I think when I run out of time/energy I will probably open source it. If you want you can message me your contact details (you can message the Facebook page http://fb.com/acolytefight http://fb.com/acolytefight maybe) and if I change my mind in the near future I will at least have your contact details.