5,828 karma · joined February 16, 2010
Blog: https://phoboslab.org/
I was confused for a second why this game made its way to HN again (there's a making of for the game itself from 2018[2]). This seems to be a port of the game to D[3] as a demo for a WASM runtime, Spasm, which is also written in D[4].
[1] https://phoboslab.org/underrun/
[2] https://news.ycombinator.com/item?id=18031024
[3] https://github.com/skoppe/spasm/tree/master/examples/underru...
JS13k, the contest this game was made for, has the 13kb size limit for a ZIP containing all necessary files. The build process[3] produces a q1k3.zip[4] that sits at 13309 bytes.
Granted, the JS and assets without ZIP compression are a bit bigger, but when sent out over http with fast gzip compression there's still only around 15kb going through the wire.
[1] https://github.com/phoboslab/q1k3/blob/master/source/map.js
[2] https://github.com/phoboslab/q1k3/blob/master/source/model.j...
The collision detection however builds a grid out of these, so the game can quickly look up any position within the game world[2].
[1] https://github.com/phoboslab/q1k3/blob/master/pack_map.c#L78... [2] https://github.com/phoboslab/q1k3/blob/master/source/map.js#...
Play: https://phoboslab.org/q1k3/
Code: https://github.com/phoboslab/q1k3/commit/a522cb597d805ef7e9d... - curiously this only increased the final ZIP size by one byte. 13309 bytes in total now. ZIP compression (and by extension: Roadroller compression) can be very non-intuitive.
15 years back I did some hobbyist programming for the GameBoy. Drawing a status bar there was comparatively easy. The hardware allowed you to set some registers to define a "window region", overlaying the main background map.
I have previously tinkered with ffmpeg in the browser and implemented a workaround[1] for the (then) missing pthread support. It turned out quite clunky, but worked.
No one here can pay for their pizza delivery through SEPA. Intermediaries like PayPal are still needed. I'm baffled that banks can't get their shit together to offer an instant payment solution that works over the internet (ie. no card reader) for small purchases.
What's the problem?
This feels similar. The blog post and the site is beautifully designed (really!) but I have a hard time figuring out what I'm buying. Is it access to a chat where everyone tries to sell you their "startups"?
I guess it's not for me, but congratz to your success!
https://github.com/phoboslab/jsmpeg#example-setup-for-stream...
Gameplay falls a bit short, but in my opinion it's the technically most impressive entry this year.
We have a few hundred Raspberry Pi in operation at customer sites, running 24/7. Back when we started our business we used generic Micro SD (can't remember the brand). They would fail after 2-6 months. This was a big hassle. We have customers all over Germany and would need to ship them a complete RPI as a replacement, as the customers are usually not tech-savvy enough to just replace the SD.
We now use SanDisk's "Industrial" Micro SD and haven't had this problem since.
Also, reducing writes to the SD is certainly a good idea. Ideally - if you can - mount the system as read only.
We have tried a lot of different advertising networks and sadly we have found none that's even in the same ballpark as AdSense (revenue wise). Advertising on the web is a shit show.
I was able to get latency down to 50ms, streaming to a browser using MPEG1[1]. The latency is mostly the result of 1 frame (16ms) delay for a screen capture on the sender + 2-3 frames of latency to get through the OS stack to the screen at the receiving end. En- and decoding was about ~5ms. Plus of course the network latency, but I only tested this on a local wifi, so it didn't add much.
[1] https://phoboslab.org/log/2015/07/play-gta-v-in-your-browser...
For a reddit-like social site, we have a Maria database with around 3 billion rows in total, with the largest table (votes) spanning about 1,5 billion rows.
We can select data within ~3ms for about 20k-40k concurrent visitors on the site. Our setup is a simple Master-Slave config, with the slave only as backup (not used for selects in production). Our 2 DB servers have 128gb of RAM and cost around 200 EUR/month each - so, nothing special.
Of course you have to design your schema with great care to get to this point, but I imagine PG to be as lost as any other database if a crucial index is missing.
I wouldn't have thought it's possible to get H264 running at reasonable speeds on the N64. Congratz for pulling it off!
Disclaimer: I wrote PL_MPEG, but not the N64 port.
[1] https://github.com/phoboslab/pl_mpeg
[2] https://www.reddit.com/r/n64/comments/dr15py/i_just_started_...
A while ago I ran a (quite naively written) nodejs application that maxed out at ~700k WebSocket connections per server - using only 4GB of RAM. Here CPU became the bottleneck.
Why not? Many modern phones have upwards of 512GB of storage. 33 GB for a useful model seems entirely reasonable to me.
The MPEG-2 state object you linked to looks a lot like the private data of my decoder already[2]. I wonder if there's any restriction on when a packet may be concluded. I.e. do MPEG-PS packets have to contain full slices, or can they be cut off in the middle of slice?
The "hairy" part with my current design would be to reproduce the call stack. Again, if the decoder would live in its own thread, it would be a no-brainer.
> and it's been done successfully by every major decoder implementation afaik
As far as I can tell, ffmpeg's decoder does not allow for this. It always searches for the next picture's START_CODE before starting to decode the frame. Similarly, the libmpeg2 source you linked to doesn't seem to provide any functionality to resume decoding from anywhere in the stream either!? The NEEDBITS and DUMPBITS macros just assume there's always more data.
[1] https://github.com/phoboslab/jsmpeg-vnc/blob/master/source/e...
[2] https://github.com/phoboslab/pl_mpeg/blob/master/pl_mpeg.h#L...
Edit: found it. https://www.reddit.com/r/ipfs/comments/al8emd/cloudflare_ban...
See here for some clever examples of this technique. Everything that's overlapping is done with sprites:
Test Launch: https://www.youtube.com/watch?v=QQt-9SSJ51c
Test Landing: https://www.youtube.com/watch?v=lXy-x6lkQvQ
I also mentioned selling jQuery plugins (remember jQuery?) and advertising my own game engine (now free) in the thread. Feels like such a long time ago.
Gratz for pulling it off, Sahil!