Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    O

    Oskar Stålberg

    oskarstalberg.com · Personal blog · on HN since 2015

    Portfolio of game developer Oskar Stålberg, with browser demos of procedural generation, wave function collapse, and his game Townscaper.

    Visit blogHN submissions
    GamesDesign & UXProgramming
    What HN says

    Commenters enjoy Townscaper as a relaxing toy and link his demos as clear examples of wave function collapse and WebGL work.

    Stats for nerds
    44HN people shared it
    17linked in comments
    927story points
    Oct 2025last shared
    2017people per year2025

    Top posts on HN

    1. 1
      Townscaper Running in the Browser
      17 people · 703 points · first shared 2021 · 97 comments on HN
    2. 2
      Brick Block (2016)
      9 people · 207 points · first shared 2017 · 36 comments on HN
    3. 3
      Polygonal Planet Project
      8 people · 11 points · first shared 2016 · 1 comments on HN
    4. 4
      Procedurally-Generated Art by Oskar Stålberg
      1 person · 3 points · first shared 2015 · Discussion on HN
    5. 5
      Wave Function Collapse Demo
      5 people · 2 points · first shared 2018 · Discussion on HN
    6. 6
      3D In-Browser Tile Editor
      1 person · 1 points · first shared 2015 · Discussion on HN
    7. 7
      CityGenerator
      3 people · first shared 2017
    8. 8
      5b6b4a87 7358 438a a06d fd708250936b(1)
      1 person · first shared 2021
    9. 9
      UnityLoader.js(1)
      1 person · first shared 2021

    What HN people wrote when they linked it

    • DonHopkinsJan 2023

      I am a huge fan of Sandspiel, which Max described in this article from 2019, and recently I was delighted to discover that he and TodePond have been doing a huge amount of wonderful work since then.

      What happens when you combine Sandspiel with a Scratch-like blocks based visual programming language that lets you look inside and see how rules work, tweak and modify them, and even define your own rules for different types of particles? And then form a community around it for sharing

      Here is Max's and TodePond's brilliantly ambitious visually programmable sequel, Sandspiel Studio!

      https://studio.sandspiel.club/

      Here's my profile, where you can play with the version of Max's flower growing rule that he shows here:

      https://www.youtube.com/watch?v=ifyYITDq1oo

      ...to grow underground potatoes and fancy flowers:

      https://studio.sandspiel.club/user/clanzgor8006109mtjooi348t

      I've written more about Sandspeil Studio and related topics of artificial life, cellular automata, and visual programming, and quoted some interesting discussion with Max and TodePond from their Discord server (they actually already knew about most of this stuff, but they love it as much as I do), in the "Ask HN: What weird technical scene are you fond/part of?" discussion, in reply to api's comment about Digital Artificial Life:

      https://news.ycombinator.com/item?id=33698163

      api 67 days ago | parent | context | favorite | on: Ask HN: What weird technical scene are you fond/pa...

      Digital Artificial Life --…

    • t8yDec 2021

      This uses the "wave function collapse" algorithm. Oskar Stalberg also made a great demo of how it works[0], but it might not make sense just from that. Martin Donald made a really nice youtube video on how it works[1]. The name "wave function collapse" can be off putting but it's pretty straightforward, and an algorithm that can come in handy for many uses both in game development and just general software development.

      I'm actually procrastinating on HN from working on a GPU parallelised version that can generate millions of positions every frame. In Townscaper you can actually see that the algorithm runs quite slow and lags behind the players input, there's just a bunch of animation to hide it. I'm hoping to eventually get a version that can run in log2(mapsize) time.

      [0]http://oskarstalberg.com/game/wave/wave.html
      [1]https://www.youtube.com/watch?v=2SuvO4Gi7uY

    • samwillisJun 2022

      Townscaper is an amazing little toy, my kids (and myself) love it. Perfect for distracting them on a car journey. We will pass them an iPad and three minutes later you hear the little “sploosh” sounds of them building something having picked it to play.

      There are so many little hidden detail to find (look for “round” grid areas, build a tower in the middle then delete the bottom of it and see what happens)

      I have been following Oskar on Twitter [0] for last few years, he is such a good communicator. It’s always a joy when one of his posts turned up with the details of the latest thing he is working on. Even if you aren’t interested in game design he is such a good follow.

      You can play a demo of Townscaper in your browser here: https://oskarstalberg.com/Townscaper/

      0: https://twitter.com/OskSta

    • chriscjcjDec 2021

      Not sure why, but whenever I'm presented with something like this, I always seem to want to build the least functional, least utilitarian, most maddening and stupidest structure I can.

      http://oskarstalberg.com/Townscaper/#IzhCuCAJioFFB00CAajRAN2AiWdAR32DI6zcARP_hGSABtoIAaaBA0GjIoyGQfxjI6jcEt9Ii_YDQDJggWU0GjIoyGBQwPCoP5AUNhAg2cA9hHAoPtA0QiIqFVB00iAajRUt6AimfUXmhoBEB0jcKgu1CRwmAo9TDpggWUNtCAajRA0YDIq5HU1TSIatEANbAg2PABNkAaRFENtIi2YERjNCgmfQQPlg2mENSb2AE0_BAaIFAtoopFB0GjIasBA0qDAa_BB9MyJJR12kAakSAtWJCa2S7XAohMtoBg2YERjNgoWdAQwPonAQLBabAANSACa2AAtfohMA0iCAajREN2AA6JAERtEACaSAE12AIoRCQQrFgomNEBtfJiaaBAtyIasBE0TJAakAEtWoZLQ0_hIohEAQLKoqNGRQjNggeCIRQLRigmk02kIoRKtWBa-QE0QCAqFFANtoNGQQPBgIoJBQQbDatCU1_hIqFFBNtAo6JAUBtEAAaSAE02gAoRCAQr1ZDR0_BohEtoAonSAE02sAoR6ahIa-Q1

    • waboremoOct 2022

      You already can, Unity has their own section of Unity on the web games you can play. They aren't graphically impressive usually but comes down to lack of development resources.

      Then there's examples like Townscraper (https://oskarstalberg.com/Townscaper/) which are graphically nice and already playable on the browser. There are also many games on itch.io of varying quality, but IMO Townscraper is the nicest.

      The problem of storage is also quite important, it's hard to push a high quality game on the browser when a lot of people won't stick around for the 10GB+ download needed, not like they would if they're downloading from the Xbox store or something like that. So it's a bit of a cultural issue as well on that front.

    • simple10Jun 2024

      That was my immediate reaction as well. Some part of my brain just prefers building walkways. In the web version, you apparently have to keep adding walkways above a building to convert it to a walkway. Super satisfying.

      https://oskarstalberg.com/Townscaper/#IzhCuIQmN6b832-HkACCzFNQQQOtACCzbAnkkkT_b-fi_0_GDBB58-ncAAAzbaDAgcjjkkc_-zMAAA5A_vWAAAz97pFAAzy_V-nkAAAkr173LaAAkT7P3AAAIXrHSAAIX0AAInWABIfKBAAQuNvWvoACQ_MBAAgcbekAEkrVggc2AEk7XgggcIBkkcRBkPBAAAIXiAAA5kAAAI3mXLAIntAAA5QCAI5iCIfCIAAQuEBAAzJBAAQuNBAAzRCACQuWBAAzZDAAQufAAQuoAznACAAkTCAAgcbAgcketswGAgkcRBkPB8SAAAInEAI3mHpJXLAIA5sBAAI3PAAIHSA5iCIfCIAAQuEQQAzJpICQuNBRAzRaCCQuWAQObASQz9DQuoAznAAAAkLBAEgcSKAAkbTAEgckCAAkrFAEgc2AEAk7HgcIBkD

    Related

    Mapbox Blogblog.mapbox.com77 people

    A new kind of map: it’s about time

    Mapbox Blog
    Company · last shared 2026
    PhobosLabphoboslab.org123 people

    QOI: Lossless Image Compression in O(n) Time

    PhobosLab
    Personal · last shared 2026
    Red Blob Gamesredblobgames.com199 people

    Hexagonal grids for games

    Red Blob Games
    Personal · last shared 2026
    Here Dragons Aboundheredragonsabound.blogspot.com22 people

    Creating a Pencil Effect in SVG

    Here Dragons Abound
    Personal · last shared 2026
    Surmasurma.dev67 people

    Ditherpunk: The article I wish I had about monochrome image dithering

    Surma
    Personal · last shared 2025
    André Staltzstaltz.com76 people

    Google, Facebook, and Amazon have fundamentally transformed the web

    André Staltz
    Personal · last shared 2026
    Simon Schreibtsimonschreibt.de33 people

    Don’t starve, Diablo – Parallax 7 (2016)

    Simon Schreibt
    Personal · last shared 2026
    Jake Archibaldjakearchibald.com191 people

    I discovered a browser bug

    Jake Archibald
    Personal · last shared 2026