Hacker News new | past | comments | ask | show | jobs | submit login

This 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



Yeah, 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!


Have 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/ 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 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/


OMG... 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

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!


This is how it goes.

Remember when Microsoft started to move faster then specs with IE? At first, all office applications required IE to work and nobody cared. Then games. Then it was a mess and netscape died. Then it got better again.

Now we have chrome, with google moving faster then the specs. I can't even join a hangouts in my office because google didn't bother to update the plugins (after they forced their own plugin into obsolesce by pushing the chrome extension format as a standard and lobbying firefox to adopt it). Now games. Wonder how long firefox will last this time.


> with google moving faster then the spec

What does that mean?


Specs take a long time to arrive. There's a lot of toing and froing, discussions and revisions. Many take years, some take decades.

Netscape, Google, Microsoft and Apple have all been guilty of losing patience and ploughing ahead by adding features to their browsers that aren't fully standards-backed at one point or another, but it's usually the decisions of the market leader that have the biggest impact. Lots of people develop for Chrome and assume it'll work elsewhere as a result, or worse they don't care.


"Guilty of losing patience" is nonsense. If you look at the process by which web standards advance, it requires that two or more vendors have created proof-of-concept implementations, before the standard can be standardized. That, in fact, how standards have always worked.

As a Firefox user, I don't like the results either. But I don't think any of the actors in question are acting in bad faith. Not even the lazy web developers who build Chrome-only games; why should they build shit for me, if they don't want to?


I'm a web game builder and I'm definitely guilty of that. However, I make the games for myself. If other people want to play, fine, but I have no personal reasons to support anything other than my own setup. I presume a lot of other indie game developers are the same. I don't make any money on the games and have neither time, resources nor interest in making it compatible for browsers I don't use.


Yeah, this is pretty much it. I definitely have tried with a lot of browsers, I learnt about a lot of quirks of different browsers doing this project. I just gave up on Firefox because I ran out of ideas to try. It wasn't due to lack of trying.

Anyway, someone made a suggestion of what to try in another comment, and turns out it was really easy, so now it's fixed. Firefox just does software blurring which is super slow and so I just had to turn that off entirely for Firefox. So Firefox performance is now okay enough, although still not quite like Chrome.


For example Chrome has implemented Web Components which Polymer uses. Most Google sites (e.g. Google Play Music) use Polymer, so they work fine and speedily on Chrome, but on other browsers they use a slow Javascript polyfill.

Actually I think Firefox supports them natively now but until very recently it didn't.


car analogy. imagine one car maker sells 80% of the cars. tomorrow they change how the gas pump works to only fuel their cars, but it fills a tank 5s faster! and they use the fact that they got 80% of the market already to force all gas stations to change to their pumps or lose their customers. now everyone buys their car because they can't even find a gas station with the universal pump anymore.

companies that move "faster than the standards" always do so under the guise of offering better products faster, but with the actual goal of locking in consumers to later enjoy a monopoly. see sony trying to always come up with a new media device, minidisc, memorystick, etc.


People who weren't there don't know, and this is why they don't care either.

It's exactly the same with Google, they have become the Microsoft from before, being bad guys.

Slowly people are seeing it but they are not going to help by switching browsers it seems, so we are doomed to repeat this.


It's kind of a shame that this is the most up voted comment where this guy is just sharing something cool he made, he's not saying it's the next big thing. It may not be worth spending the time to optimize for these other platforms unless he can get some initial traction.

I would be curious to know where the performance lies and what could be done to improve. I saw on another commend he mentioned how using a css blur was a big performance gain over canvas shadowBlur


I was curious what the networking looked like as I loosely floated the idea of how hard it would be to make a bot for this.

Well, the networking's very trivial JSON as WS text frames. Hardest task to do is reason through the X and Y attack direction information. I probably won't do that; others surely will.

But there is an absolute firehose of frame data flying over the wire, I would say maybe 10 per second.

So, my guess is this: the dev only ever tested in Chrome, so they inherently avoided what Chrome is slow at.


Bot programming is built in, see the AI page. It runs your JavaScript as a web worker and gives you the world state.

It would take a lot of work to write a bot on the raw network data because you're missing the simulation code that applies the actions and so won't know the world state.

There are actually specific lines of code for Firefox, Edge and Safari all through the code. Edge can't draw a line if it's width is bigger than its length, so I had to code around that. Safari and Firefox tell you the wrong mouse button on the mousemove event. Firefox performance improved dramatically when I removed all the alphas from the top objects canvas layer. I've tried lots of different ways to stop the scrolling on iOS and Android, and both required different approaches. It's not due to lack of trying. At some point I just had to give up on Firefox for Linux. No one is paying me to make this game!


Ooh wow. I feel stupid for not at least seeing what the AI page was about, haha. That's awesome.

I tried using the default AI, and since nobody else was connected I picked "Play vs AI". Apparently the bots also use the same AI... and so they all proceeded to engage in a hilarious (and cute) sped-up standoff dance with each other.

And regarding making my own bot, I originally did mean that to mean figuring out/reverse engineering the world state, etc. This is absolutely trivial because this is computed by the clients so there's no server to headscratch about. But the AI system you're using is several levels cooler.

The only suggestion I'd make is to include a socket.io+etc bootstrap that lets people run bots using Node. A rainy-day project might be a login system that lets people tie bot instances to specific rooms...

I had no idea you'd poked the various browsers. Sorry about joining in the flamewar on that, heh. I (honestly) wonder why FF is so much worse than Chrome :/ I wonder if everyone who had issues was using it on Linux.

This is fun, btw. Thanks for building it. :P


On Windows with a 8700k and GTX 980ti and it runs at about 10fps in Firefox. Runs slightly better in Edge, but not by much.


On Windows 10 with a 8700K and a 1080Ti and it runs fine on Firefox. Clearly you need a GPU upgrade!


Based on the descriptions of poor performance on otherwise fast hardware in this thread, I was really expecting something a lot more graphically impressive. That's the web for you I guess, keep adding layers of abstraction until even the simplest stuff runs like molasses.


Yeah, I'm confused about this too. It's literally just circles and lines, so I was surprised how much effort it took just to get it to this level of performance.


The solution is for Firefox to fix their broken performance. I don't understand how all comments make it sound like this is a problem with Chrome.


Not likely. There are tons of webgl demos out there, performing quite advanced tasks, well beyond what this game is up to, and Firefox and Chrome produce equal results.

Example: https://zenphoton.com/

My guess is there's some sort of misplaced network hook, introducing latency into OP's event handlers, and it's producing a noticeable side-effect in Firefox, which, perhaps Chrome optimizes for, as a common, anticipated programmer tendency, that gets re-ordered behind the scenes.


Seems a big part of it was the software rendering of the filter: blur(5px) in Firefox, where other browsers are doing this in hardware. I've removed that CSS class for Firefox specifically now, and it's performing a lot better. The profiler now says 60% idle, 14% graphics, whereas previously there was no idle and it was 85% graphics.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: