Live data from Hacker News

Running Pong in 240 browser tabs

eieio.games

31–36 of 36 posts

Re: Running Pong in 240 browser tabs

#31
post #14

I'm calling it - Doom is next.

Doom is kind of a pain because: * afaik I'm capped at 4 FPS (just how often you can update tabs) * more of the screen is likely to update on each frame, which requires way more "turning canvases into data urls to update favicons," which is expensive with my current implementation (although I wasn't aware of offscreencanvas, which might help here)

To be fair, doom is also a pain on a calculator[0]/pregnancy test[1]/milling machine[2]/touch bar[3]/PDF document[4]! I think that's part of the fun!

I absolutely love this stuff... I sort of think Doom at 4FPS is... juuuuust in the realm of playable if you've played it before haha

[0] https://news.ycombinator.com/item?id=2251463

[1] https://news.ycombinator.com/item?id=24396780

[2] https://www.reddit.com/r/Doom/comments/ezuw1f/doom_on_cnc_ma...

[3] https://news.ycombinator.com/item?id=13008315

[4] https://news.ycombinator.com/item?id=42678754

Re: Running Pong in 240 browser tabs

#32
post #27

A similar exploration by Matthew Rayfield using the URL bar instead of tab favicons: https://www.youtube.com/watch?v=q7GtCLwTmV4

Matt's work is a huge inspiration for me!

I definitely had his URL stuff in mind when making this, but it'd been a while since I had actually read through his blog / watched his video. It was really fun to come back to it mid-project and remember that he went in the same "stack windows to get 2 dimensions" direction.

Re: Running Pong in 240 browser tabs

#33
post #13

ah hi! I made this! was wondering if this one would appeal to the HN crowd :) Happy to answer any questions! And here are a couple of scattered thoughts: * I'm really interested in what this looks like if you use animations (firefox supports animated favicons) - I could, for example, anticipate future ball positions and create animated SVGs to get a much nicer framerate. * A friend pointed out offline that canvas ras…

> A friend pointed out offline that canvas rasterization (typically) is on the GPU, which is probably why my performance intuitions with my stuttering animation were so wrong Did you solve it? A great resource is Jake Gordon's blog on simple JavaScript game design. He uses a double buffer front and back canvas game loop. [0] https://jakesgordon.com/writing/javascript-pong/part1/

Sorry yeah I'm talking very specifically about the stuttering that I first saw when making a square move into the tab bar.

I was doing something inefficient (updating all my favicons many times a second), but I didn't really understand why that would cause stuttering in my foregrounded tab. My thought process was that the favicon stuff was happening in different tabs in different threads, and so it didn't make sense to me that the thread in charge of the foregrounded animation should suffer (unless my entire computer had slowed to a crawl and everything was getting slower - but it hadn't).

And my friend's point was just that i was probably GPU-bound and not CPU-bound (or at least I could be) and so I was not thinking about the original problem correctly.

Re: Running Pong in 240 browser tabs

#34
post #13

ah hi! I made this! was wondering if this one would appeal to the HN crowd :) Happy to answer any questions! And here are a couple of scattered thoughts: * I'm really interested in what this looks like if you use animations (firefox supports animated favicons) - I could, for example, anticipate future ball positions and create animated SVGs to get a much nicer framerate. * A friend pointed out offline that canvas ras…

Love it and man your output velocity is something else! This, the global cap locks, the bad apple regex, the uuids, and more all since the 1 million checkboxes. I'm impressed with your hustle.

ah thanks adam! fun to see you here :)

Re: Running Pong in 240 browser tabs

#36
WRT firefox and narrower tabs. You can still inspect the browser in firefox, and find the style rule for min tab width, then add it to userChrome.css

There's a few guides out there on this, and I'm sure someone has done one for tab width already.

Maybe that's cheating though. (there's also browser.tabs.tabMinWidth but I think it still forces a minimum unfortunately)

Post reply on HN