Live data from Hacker News

This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

iczelia.net

51–60 of 93 posts

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#51
i wonder if such a mechanism could be "enhanced" to produce a true "universal" binary, using a source-to-source compiled language like Haxe?

With Haxe, you can write the application once, target both win32 and linux by compiling to C++ (which then you compile using the platform specific tooling for each paltform), and then target html by compiling to javascript. Then use the same concatenation mechanism and header abuse as described in the article to have all three targets merged into one file that can then be run on all platforms!

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#52

Earlier quoted context omitted.

Hmm, Windows 11 25H2 here as well. Redbean works so there must be something about this particular approach combined with some unknown setting on my install. Edit: Got it working, was DEP.

What's DEP?

Data Execution Prevention https://learn.microsoft.com/en-us/windows/win32/memory/data-...

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#55
post #5

Not cross-platform, but I'm reminded of the kkrieger game for Windows which was a 96k FPS game that looked visually impressive for the time. https://web.archive.org/web/20100304155706/http://www.thepro...

I've been reminded of this while playing Metroid Prime 4.

I wonder what kinds of modern games we could make with these same ideas.

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#57

I extracted the linux executable and was surprised to find that both readelf and objdump choke on it despite it loading and running correctly. Some investigation reveals that the name of the dynamic linker was shoved into the "unused" fields in the PT_DYNAMIC header entry to save space: Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align INTERP 0x0000000000000088 0x0000000000010088 0x00000000000…

ndisasm can help read it and hex editor. no tools should mangle such format, its useless savings, worth nothing. it will cause problem with AV and other things potentially.

saw some comments about DEP on windows and this and honestly i wouldnt touch this thing with a 10ft stick. if the creator want ppl to play it they can provide a normal binary. not some obfuscated mess.

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#58

On a related note -- when I see the minuscule filesize of the original Zelda game on emulators, I marvel at how little text/code/information could produce how much wonder, how far-reaching impact, and how many hours of enchantment for me. https://en.wikipedia.org/wiki/The_Legend_of_Zelda_(video_gam...

Indeed, magic. How about the Commodore 64, there was a game (Eindeloos, Radarsoft, 1985) within 64kb that has a huge map. Someone recently (after 40 years!) extracted the map (500 screens) and the png alone is 800kb. See the story an zoom in and try finding the little heart in the map! https://adayinthelifeof.nl/2025/03/07/endless.html

that is a legitimate post by itself

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#59
post #47

The binary relies on the runtime, so yes it is nice. Forma instance, a static compiled and linked "hello world" in C on Linux is around ~785KB

> a static compiled and linked "hello world" in C on Linux is around ~785KB Huh? $ musl-gcc -xc -static -Wl,-z,norelro -Wl,-z,nosectionheader -Wl,-z,noseparate-code -s - int main(void) { static const char s[] = "Hello, World!\n"; fwrite(s, (sizeof s)-1, 1, stdout); } eof $ ./a.out Hello, World! $ ls -l a.out -rwxr-xr-x 1 oguz oguz 4976 Jan 12 09:38 a.out And if that's not enough $ musl-gcc -xc -static -nostdlib -fcf-…

Probably 785k unoptimized and unstripped with all debug info.

Re: This game is a single 13 KiB file that runs on Windows, Linux and in the Browser

#60
post #47

The binary relies on the runtime, so yes it is nice. Forma instance, a static compiled and linked "hello world" in C on Linux is around ~785KB

That's just because glibc is not designed for static linking. It works, but it doesn't exclude unused code, unlike with other libcs.
Post reply on HN