WASM-4: Build retro games using WebAssembly for a fantasy console
151 points
26 days ago
| 7 comments
| wasm4.org
| HN
tantalor
20 days ago
[-]
Pleasantly surprised to see https://wasm4.org/play/untangle on here, remake of my original "Planarity" Flash game from 2005.
reply
meisterglanz
21 days ago
[-]
TIC-80 also has WASM support but is a more capable console IMO. Here for example is a rust template: https://github.com/nesbox/TIC-80/tree/main/templates/rust
reply
panic
21 days ago
[-]
One cool thing WASM-4 has over TIC-80 is built-in networked multiplayer with rollback: https://wasm4.org/docs/guides/multiplayer
reply
jamesgeck0
20 days ago
[-]
TIC-80 is indeed a generally more capable console.

The main reasons I'd personally pick WASM-4 over TIC-80 would be touchscreen controller support, more complete documentation, and better performance on resource constrained devices. (WASM-4 can run on the ESP32 and Nintendo DS, while TIC-80 struggles on the significantly more powerful 3DS.)

reply
lxgr
20 days ago
[-]
Can TIC-80 for Retroarch run WASM "ROMs" directly or do they have to be precompiled?
reply
davexunit
20 days ago
[-]
WASM-4 is a lot of fun! The programming interface is really simple and a great way to learn about the basics of WebAssmembly. No high level language necessary, just write simple programs in WAT format. We used WASM-4 at work as a very early test that our WebAssembly toolchain was working end to end, before we were able to run larger programs in web browsers.

https://spritely.institute/news/hoot-wireworld-live-in-brows...

reply
anshargal
20 days ago
[-]
I wonder if anyone is working on a fantasy console with PS3-level graphics. A lot of games on Steam today have retro aesthetics and aren’t very demanding. A game runtime that works on Linux, macOS, and Windows would solve portability and digital preservation.
reply
Cthulhu_
20 days ago
[-]
PS3 graphics aren't that different from modern day graphics, just lower fidelity and the hardware was a bit quirky but other than that they didn't have any particular aesthetic; I don't think the PS2 had either. The PS1 did though, the weird texture shimmering that was reproduced in for example the Bloodborne demake [0] and subsequent Bloodborne Kart, which had to be rebranded to Nightmare Kart for copyright reasons. But that one's made in Unreal Engine 4, with a forum thread [1] saying the effect can be reproduced across multiple engines like UE4, Unity and Godot, using a shader.

[0] https://b0tster.itch.io/bbpsx

[1] https://itch.io/t/1999076/what-game-engine-did-you-use

reply
modeless
20 days ago
[-]
The web is already a game runtime that works on Linux, macOS, Windows, Android, and iOS* with decent graphics. I've ported a couple of games. Here's Quake 3 including multiplayer https://thelongestyard.link/ and Cave Story https://thelongestyard.link/cave-story/. There are full-fledged web-native games too such as https://gooberdash.winterpixel.io/ (2D Fall Guys) and https://krunker.io/ or https://venge.io/ (multiplayer FPS). And of course one of the most popular recent games has a web version: https://poncle.itch.io/vampire-survivors

* Even more platforms: Chrome OS, Meta Quest, Tesla cars, Xbox, smart fridges, etc. The web is unmatched in platform support and more importantly allows you to completely bypass the software distribution monopolies on all of them. Ship freely without anyone's permission!

reply
cardanome
20 days ago
[-]
> PS3-level graphics

> retro aesthetics

You are really making me feel old.

That said PS1/PS2 style is pretty popular and a fantasy console in that area would be indeed great.

I just hope you mistyped because PS3 is mostly modern graphics for me. Most of the games still look good if you upscale the textures a bit.

reply
tjpalmer
19 days ago
[-]
I'm making a wasm runtime called Taca that has approximately low-end modern capabilities that can run in either web or a separate native player. https://github.com/contextfreeinfo/taca (I also made the intro video for WASM-4.)
reply
two_handfuls
26 days ago
[-]
That looks very cool! I wonder if someone will make a VR player for those cartridges.
reply
ayaros
21 days ago
[-]
This fantasy console sure looks a lot like a Game Boy...
reply
indigo945
21 days ago
[-]
Maybe like what the Game Boy would have been if it had had a framebuffer. It's a little bit sad, actually, that WASM-4, like the Pico-8, is a framebuffer console - there's less cool tricks you can do with raster interrupts and the like.
reply
rob74
21 days ago
[-]
Were you thinking of changing the 4-color palette for every scanline, like the Atari 8-bits and the Amiga could do? Impose arbitrary limitations so you can find clever ways to circumvent them - sounds like fun!
reply
jamesgeck0
20 days ago
[-]
You can actually do this in PICO-8 to display up to 32 colors at once.

https://www.lexaloffle.com/bbs/?tid=38565

reply
lxgr
20 days ago
[-]
The limitations were anything but arbitrary!

The Game Boy has less memory than would be required for a full frame buffer, so its “just in time rendering” of sprites and tiles is one way to support its full display resolution and still leave some space for game state in the RAM.

reply
PittleyDunkin
20 days ago
[-]
> The Game Boy has less memory than would be required for a full frame buffer

This isn't quite true—you need 160 * 144 pixels at 2 bits-per-pixel. This weighs in at 5760 bytes. There are many other reasons why a framebuffer wasn't ideal for the hardware of the time, though.

reply
lxgr
20 days ago
[-]
Ah, sorry, I think I mixed that up with the opposite practical limitation then – IIRC you can't actually display a fullscreen bitmap on the original GameBoy without some hacks, as the full screen fits 360 tiles, but there's a limit of 256.

But in any case a frame buffer would use up almost the entire available VRAM of 8 KB and would have probably also been more expensive since it would have to be dual-port RAM (I believe the Game Boy's VRAM isn't).

reply
epcoa
20 days ago
[-]
I thought it was clear that arbitrary here refers to any modern reimagining of said limitations, which obviously don’t have to be identical constraints either.
reply
rob74
21 days ago
[-]
Might be a nice way to get into WASM development, but 4 colors sounds very limiting. Ok, I know the original Game Boy made do with only 4 "colors" (but that was on a black and white display where you probably couldn't have told the difference if there would have been more "shades of gray"), and the Game Boy Color showed these games using a palette of 4 colors, but actually even that device could show 56 colors at the same time!
reply
jamesgeck0
20 days ago
[-]
It's a little bit more complicated than that. The system is limited to displaying 4 colors at once, but the palette can change at any time. Check out what Phantom Shift does with a dynamic two color palette.

https://wasm4.org/play/phantom-shift/

reply
rererereferred
20 days ago
[-]
The idea of the 4 colors and 160x160 screen is, from my pov, to focus on the gameplay more than the graphics. A lot of people get stopped from attempting to make games because their art skills suck, this removes that element from being an issue.
reply
rob74
20 days ago
[-]
> A lot of people get stopped from attempting to make games because their art skills suck

As a developer with no art skills myself, I can sympathize with that. But I think that is already taken care of by the low-res display - making pixel art is (in my experience) a lot easier than higher-resolution art. I don't think having 8, 16 or 32 colors instead of just 4 really makes an impact on the art skills required for a game...

reply
lucasban
20 days ago
[-]
The play date doesn’t even have shades of grey and has plenty of good games, arguably because of similar constraints
reply
rob74
20 days ago
[-]
OTOH, the PlayDate is a hardware device, so using a monochrome LCD makes sense for cost saving and power consumption reasons. But, even for a hardware device, once you decide you want to have a color screen, in this day and age there is no real (technical) reason anymore to limit the number of colors.
reply
tredre3
20 days ago
[-]
> so using a monochrome LCD makes sense for cost saving and power consumption reasons

The Sharp Memory LCD used in the Playdate is more expensive than a similarly sized IPS LCD. Whilst power consumption was probably a consideration, the main justification was to impose a deliberate game design constraint IMHO.

reply
lucasban
20 days ago
[-]
I agree, I think it’s more of a novelty reason, just a constraint for the sake of encouraging creativity / not just being another place for the same things we already have.
reply
Cthulhu_
20 days ago
[-]
4 colors is still 4x as much as the Playdate or games like Return of the Obra Dinn has (or twice if you consider 'off' a color).
reply
jerf
20 days ago
[-]
Heh, citing the Obra Dinn is cheating a bit. Most people aren't going to do this: https://forums.tigsource.com/index.php?topic=40832.msg136374...
reply