Show HN: A Marble Madness-inspired WebGL game we built for Netlify (5-million-devs.netlify.com)

616 points by franck ↗ HN
Hello HN! We’re a small creative studio specializing in real-time 3D experiences. Netlify approached us to design and build an interactive experience to celebrate reaching 5 million developers.

Inspired by the classic game Marble Madness, we created a gamified experience where users control a ball through playful, interactive levels. The goal was to blend marketing content with the look and feel of a game to engage users.

The app is built with Three.js [1], using our custom render pipeline and shaders, and uses Rapier for physics simulation [2]. The 2D content is overlaid on the WebGL view using CSS 3D transforms for a seamless integration with the 3D view.

We’d love for you to try it out and share your thoughts!

[1] https://threejs.org

[2] https://rapier.rs

EDIT: More info on this project here: https://www.littleworkshop.fr/projects/5milliondevs/

242 comments

[ 2.0 ms ] story [ 111 ms ] thread
I'm one of the developers who worked on this project. Happy to answer any questions.

More info on the project here: https://www.littleworkshop.fr/projects/5milliondevs/

add a built in timer and I bet people would speed run this thing
Thanks for playing. Actually, your time is displayed once you finish the experience (there are 5 levels in total).

During the project, we discussed adding a speed-run mode but ultimately had to drop this feature due to time constraints. However, we intentionally included some shortcuts in the level design with that intent in mind.

and physics bugs, there are a few edge spots you can clip into and really send yourself flying!
the purpose of the game was to force marketing upon the players. a speed run version would defeat the dwell time of the marketing on the screen. i'm sure the marketing department would not be a fan
Perhaps make it such that once you've completed it at 'normal' speed all the marketing messages are disabled, enabling the speedrun.
For what it's worth our head of marketing was the one asking for a speedrun mode, but it just couldn't make the cut in terms of scope :)
Surprisingly, you have to sit on the opening screen for a second or so before starting every run to get the best speedrun cycle for level 3. So I would say also with fast resets, it would be enough marketing even in the speedrun lol. (Coming from someone has spent hours speedrunning it so far)
release it on steam with the promise of multiplayer and it'll sell for $10
There is a glitch on the momentum level, where the marble gets stuck behind a wall after dropping into a hole.
I got stuck in the spiral slide on the same level. I got the impression framerate glitches are affecting the collision detection (common physics implementation pitfall). I could be wrong though.

Still, very cool. Too cool to waste on marketing in fact :)

Yeah, sometimes the ball does some crazy things due to the way collision detection works. We tried to optimize and avoid most of the issues but it can happen.
Only the OP would know for sure, but it might be the case that this never would've come into existence were it not for the project to land the messages about the company.
There is code in place to respawn the ball if we detect that it's stuck inside a block or wall, which can occur due to frame drops during the physics simulation. I'll try to reproduce this issue. Thanks for reporting it!
I hit the same thing. It killed me while I was dropping into the hole, then respawned me into the block, ending my game.
I seem to have dropped through a wall while taking an elevator on the elevation level, it keeps respawning me in the void, so that was a game over =)
I was being malicious and dropped down onto the hovering pink cube outside the play area on the final level. Once you roll off that pink cube your respawn point is on the cube, leaving you stuck and unable to get back to the main course.

NBD but sharing in case you want this kind of playtesting feedback!

Great work, it really captures the feeling of Marble Madness. Its maybe to deep of a thought, but I really fancy the spin of the marble, something that the original was not conveying as fancy as your version does.
Thank you. The physics engine we're using (Rapier) really does most of the work to make the spin of the marble look realistic. But we spent quite some time tweaking the controls to make them as enjoyable as we could.
You did a great job. The physics seems about as enjoyable as those of Rocket League and they must've have spent a considerably larger effort.
The marble has the perfect amount of friction, I'm able to "drift" around corners which feels really nice.
the "feel" is tremendous, S-tier for real.
As a MM fan, I wanted to second this. Great work, engaging enough to make me finish it and wish there were more mechanics like the catapults and enemies.
That’s really lovely and polished. Nice job…
Thanks for playing! Glad you enjoyed it.
How long till people start speed running this?
How many people worked on this project and how long did it take to develop? Nice job!
Besides people from the Netlify team who helped write the content and worked on some back-end aspects, the design and development of the game took around 8 weeks for a team of two.
How is the gameplay related to the information? The connection seems pretty contrived to me.
The glowing line represents a timeline of Netlify's milestones that you have to follow in order to discover their journey. No particular reason for the physics-based gameplay except to have a bit of fun.
Nice work, love to know more about the technical bits: what framework did you use for 3D scene, objects? how did you handle camera movements to track the ball? What library for sound as that was a nice touch. How did you do physics? Thanks!
Thanks. The WebGL rendering is based on Three.js. We're using Rapier for the physics simulation, and Howler for the audio. Our game engine is responsible for all the controls and updating things like the camera position (which follows the position of the ball at every frame).
Why did you choose to do things this way instead of using Unity WebGL?

It's okay if the reason is, "because we make websites and the programming we know is Javascript" or whatever. It doesn't have to be about some objective comparison, like optimization or whatever, which isn't going to be true or necessarily matter anyway.

Unity WebGL is not supported on mobile and we needed the experience to be playable on both desktop and mobile browsers.

However, mobile browsers will be supported with Unity 6 web exports, still experimental currently AFAIK, but that should become a viable option soon.

> Unity WebGL is not supported on mobile.

Hmm... Unity WebGL has worked correctly on Mobile Safari since 2013. Support has probably been flawless since around 2019. It has been supported in all the ways that matter for a long time.

I should have said that it's not officially supported. For client work, we prefer not to choose an engine that may not work on a few devices and which we have no ability to fix.
I wasn't aware of that. The Unity 6 Preview announcement from just this year had a lot of stuff around iOS and Android browser support:

From the article:

Android and iOS browser support has arrived With Unity 6 Preview. Now, you can run your Unity games anywhere on the web, without limiting your browser games to desktop platforms.

https://unity.com/blog/engine-platform/unity-6-preview-relea...

Also no one wants to see a Unity Splash screen :(
I don't know if it's just my system or the particular games I've been playing, but Unity WebGL stuff always seems to take a long time to load. TFA loads seemingly instantly.
This was really fun. Right before this little hole on the second level, my macbook started running a bit slow and the collision detection somehow sucked the marble into the floor.

https://imgur.com/ZANb1cT

Physics collision bugs are more likely to occur during frame rate drops. We’ve tried to address this by implementing an auto-respawn mechanism to handle cases where the ball gets stuck inside a collider, but it seems this sometimes fails. Anyway, thank you for playing!
Nice work! In level 5 there are three bounce green boxes and if you fall on one, it bounces you to second, which bounces to third and you "fall into the void" like noclip through the platform and you respawn under it and instantly die forever. Buggy and not going to start from beginning. Open source it!
Made my day. No notes!
Congrats on your work! You mentioned "using our custom render pipeline and shaders", can you please elaborate more on that?
Any chance this could get open-sourced? This seems like a great example of a lot of stuff for which there are few tutorials currently.
No plans to open-source at the moment, but we intend to share some behind-the-scenes info in the future.
(comment deleted)
> This seems like a great example of a lot of stuff for which there are few tutorials currently.

Not OP but, what exactly you feel like is missing tutorials? It's a nice little polished experience, but I don't think there is anything particularly innovative or difficult to build with the resources that exists today. Or is there something in particular that looks/seems difficult from what they shared?

I disagree, I think the "nice little polished experience" is the difficult part.

In practice building something like this with resources that exist today can still mean a stream of issues specific to a given platform, browser, library, programming language, IDE, issues related to a combination of any earlier two and a yak that needs shaving[1].

Meanwhile this project is described as[2]:

> fully optimized for both desktop and mobile browsers, with user controls and UI components tailored for each device, ensuring intuitive navigation and interaction across all platforms.

If this process was easy and well documented, Netlify wouldn't hire an external agency.

[1]: https://en.wiktionary.org/wiki/yak_shaving

[2]: https://www.littleworkshop.fr/projects/5milliondevs/

> I disagree, I think the "nice little polished experience" is the difficult part.

Right, I agree, most of the time will be spent in the polish. But is there really no resources out there on how to polish? Assuming there isn't, what would you want a tutorial to contain to make it apply to a wider audience, as polish is typically hyper-specific to the project.

> If this process was easy and well documented, Netlify wouldn't hire an external agency.

Companies don't typically hire external agencies because something is difficult for them to do per se, but more that it would be wasteful for them to spend the time building something like that instead of focusing on things core to the business.

FWIW: I'm asked parent about this in order to see if there are actual gaps in the available resources today for what parent wanted to do, hence the question to specify what exactly they're looking for. I guess "how to polish" is a valid answer, but again, there are resources out there to help understand how to approach that.

> But is there really no resources out there on how to polish?

I didn’t mean “how”, I was after the examples. As in: what code, hacks and optimizations, results in this particular polished experience.

Yes, it is hyper-specific to the project; but this particular project is hyper-generic. It could be a nice starting point for other experiments.

You can't really compare the depth of resources that exists for something like React versus something like Three, which has a bunch of toy examples but no fully coherent experiences.

Companies like Figma have shown that there is a huge appetite for solutions built on top of Canvas or WebGL, but if you don't have the privilege of working for one of these companies that built up lots of proprietary building blocks from scratch, it's much more difficult to get started.

Could you explain more on:

> The 2D content is overlaid on the WebGL view using CSS 3D transforms for a seamless integration with the 3D view.

Maybe a simple example of this with code?

Very nice way to show off some of the history of Netlify while making it fun. Congrats on 5m.
Its been a long time since someone built something like this for the web. Praystation was a long time ago. No one has really followed up since then.
The ASDF controls are absolutely backwards while the cursor controls work.
That was enjoyable. I wasn't at all interested in any of the "Netlify facts" but it was fun to push the marble around and I'm impressed by how smooth the experience was. Well done!
This is fantastic!.

Time to start speed running!

4 minutes 58 seconds.
I'll post my slowest time at the bottom of the stack: 5 minutes and 59 seconds didnt work on FF, and only 1/4 screen on brave index-dffbfc39.js:4603 expected expression got ?

Anyway great fun, and much easier than what I remember of the Amiga version, very forgiving controls, thanks and well done.

4 minutes and 31 seconds, any%. Need to do some better routing.

4 minutes and 21 seconds after few more attempts.

3 minutes and 59 seconds. Sub 4 is good enough for me :)

My competitive side got the better of me and spent too long playing this :|

3 minutes 33 seconds after ~10 attempts

routing is definitely fun, I enjoyed figuring out which bounce pads to take

---

3:20 after some more tries, I think sub 3 is possible

3:14 even with the game glitching me into the abyss on the last level :(

I got 2:57 — required a near-perfect run but still room for improvement
I am very curious how the physics feel realy-wordly for the most part at the mathematical level. Are there existing algos that define the gravitational pull of the "Facts" spots or was there a lot of tweaking?

The 45 degree rotation does require more dual input than I care for which makes me wonder if that is a design choice.

> The 45 degree rotation does require more dual input than I care for which makes me wonder if that is a design choice.

Well they say "A Marble Madness-inspired WebGL game" so there is not much choice about the rotation [1]

[1] https://en.wikipedia.org/wiki/Marble_Madness

Looking through the linked docs I see the physics frameworks.

Of all the programming I find the 3D gaming to be the most complex and unattainable at my current knowledge or intelligence level.

The NES Marble Madness port (and probably others) had a choice of control schemes, where the D-Pad is either mapped directly to the screen (Down is down) or mapped at a 45 degree angle (Down is down-right). I never could wrap my head around the latter, but I can see the benefit given the stage layout mostly uses 45 degree paths.
The second scheme works pretty well if you can turn the controller 45º. I never had an NES but I am pretty sure some of the isometric games I played on the c64 and Amiga had this as an option.
The physics engine we are using is Rapier 3D which does a lot of the heavy lifting, even though we had to tweak a lot the physics properties of the ball and surfaces in order to get something that felt right. For hotspots specifically, we implemented the magnet-like effect with custom code (by applying a force that pushes the ball toward the center and slowing it down at the same time) as there is no attractor primitive in Rapier.

The dual input is indeed a consequence of our isometric-view design choice, which I agree may not be the easiest way to control the ball. But the 45 degree angle just looks cooler in our opinion.

FWIW, you can mentally remap the keys to partially eliminate dual input. E.g. Pressing down and right together as a single input moves the marble southeast. This considerably simplifies game play for me.
Great game! On mobile, feels like the joystick is a bit too sensitive. Ie: I move my finger a tiny amount and the ball goes flying.

What's your company called?

Thanks! Agreed that the mobile experience can sometimes be a little difficult compared to the desktop version. It was hard to get right, and we may have set the ball speed a bit too high.

Our studio is called Little Workshop. You can find more info about us here: https://www.littleworkshop.fr

This was actually very fun, great work here! There was a PC game called hamsterball that I really enjoyed a long time ago; this brought back memories.
Well, I'd love to know what Netlify does, but...

#1. I could not find pricing anywhere.

#2. The "ROI calculator" steered me to enter in my name, e-mail, and phone number. I don't want to sign up to get spam from a salesman just to find out the basics about some tool or platform.

#3. Wikipedia's page for Netlify has a content warning that the content appears to be an ad brochure, but at least it said this:

"Netlify is a remote-first cloud computing company that offers a development platform that includes build, deploy, and serverless backend services for web applications and dynamic websites.

The company enables building, deploying, and scaling websites whose source files are stored in the version control system Git and then generated into static web content files served via a content delivery network."

Still have no idea what Netlify does (beyond what I can already do with git with a few clicks), or if it's right for our team, or if we can even afford it.

The Marble game was quite fun, however...

#4. The main thing that stuck in my mind from the little "milestones" about Netlify was that they changed their logo. This may seem significant to the Netlify team, but is completely irrelevant to the rest of us.

#5. The second thing was that they "bought Squirrel, an open source"... it is rather dystopian to hear that someone "bought" an open source platform.

Since we have a few Netlify people posting here, please feel free to correct my ignorance or point me in the right direction.

Used Netlify back in the day (prior to Cloudflare pages / workers sites). The experience was largely smooth. HOWEVER, pricing was both opaque and prone to explode without warning, with little to no way of setting billing limits. Ultimately, that was too risky for the kind of small-ish projects I'm running. They had the Netlify CMS for a while, which I quite liked. But that's gone now. Be interesting to know what their USP is over CF Pages.
Netlify is Vercel before Vercel.
Netlify being related to Gatsby and Vercel being related to Next.js.
Not exactly. More that Netlify started as a no-devops-needed static website hosting platform, and gradually branched off into value props that naturally fit into that starting point.

Vercel (formerly ZEIT) basically did the same thing.

Since founding, both companies have raised an insane amount of VC money, making them both unicorns by valuation a few times over. Though imo it remains to be seen if this was actually a good investment. Neither company seems to have fully made good on their business model, which is quite similar in both cases: encourage and allow devs (or non devs) to do the absolute bare minimum of work in exchange for hosting/bandwidth/etc prices that many consider exorbitant.

> The company enables building, deploying, and scaling websites whose source files are stored in the version control system Git and then generated into static web content files served via a content delivery network.

That’s the meat of it. It’s Heroku for statically generated websites or websites that can run as lambdas. Pretty limited but very fast for those purposes cause everything is handled by edge servers rather than primary data center servers.

(comment deleted)
Great fun and very polished! I'd love to try this with accelerometer based controls.
(comment deleted)
The controls don't seem to work for me. AWSD, only up and down work, unless I try to go diagonally, then it just gets "stuck" moving forever. Arrow keys no directions work unless I hold multiple keys down at once, then it also gets stuck moving.

M1 macbook pro, Arc browser

That's weird, the desktop controls are supposed to work regardless of your keyboard layout. Are you able to play with your arrow keys (which are also supported)?
Nope, arrow keys also misbehaving. Very vanilla keyboard layout. Let me know if I can provide something to help debug, maybe the key events
Super fun. Loved the rubbery sound design.

I’d want to watch the CEO host a speed run stream.

Actually, we used a recording of a basketball for the sound of the marble bouncing. It wasn’t our original intention, as we initially imagined the ball to have more of a metallic quality. However, the rubbery effect kinda works, I guess. :)
Got stuck in a re-spawn loop : some collision detection failed in level 4 at the start of a standard 30° incline, the ball fell through, and was re-spawned at the same place resulting in falling again, locking me in loop.
(comment deleted)
It needs more gravity for the marble to roll down slopes better.
Seems like the ball is 0.5m in diameter, if you treat single wireframe texture tile as 1m. Gravity seems to be correct for the ball of this size (although linear dampening aka air resistance is quite high).

I think this is intentional, since higher gravity/smaller ball would significantly raise difficulty.

On iOS, sometimes it scrolls the page and pressing and holding opens a weird right click magnifier and releasing it a share option on the top left?

Those jarring little things seem to just never disappear from modern browser games.

Beyond that it‘s amazingly fluid.

i got a few questions:

- you say it's built with three.js but you also use rapier. How does that work / integrate? I see one is JS frontend thing, the other rust engine

- how did you design levels, with what?

The rendering engine is using Three.js which is a WebGL library. The physics/collision detection code is using Rapier through a WebAssembly module available on npm [1], which means that it can be used on the web even though it's originally written in Rust.

The levels were built inside the Unity Editor, then exported to FBX, then went through a pipeline based on Blender python scripting that optimized their geometry, assigned materials and exported them to GLTF (the final format that we load in the browser).

[1] https://rapier.rs/docs/user_guides/javascript/getting_starte...

thanks for answering! Interesting you used unity for level layout. Interested to hear the advantage here. Considering you already use Blender down the pipe, how come you haven't used Blender for it or any other dcc app lile maya, max, whatever?
The main draw of the Unity Editor for us is how it auto-reloads assets, like 3D models, as soon as the asset file is updated. So the workflow is having your DCC app open in which you model things and export assets from, and Unity Editor to design your level where every model is always up-to-date.

This is not possible with Blender because it contains all models inside a single .blend file, so assets must be manually re-imported each you change them. There is a Link feature in Blender but in my experience it's not as good as what Unity does out of the box.

interesting! I haven't got much into blender, but sounds rather basic functionality. FWIW Maya has that since forever.
How did you assemble Rapier colliders from GLTFs?
Nothing complicated, we simply have initialization code that parses the GLTF scene on startup by iterating over the children of a specific group, and creating Rapier colliders for each of them (Triangle Mesh Colliders to be specific, in order to allow things such as curved ramps). Since their geometry is very simple, we can use directly the rendering geometry for the collider geo.
Not the dev, but Rapier has a JavaScript binding through WASM. And you can design the levels with a 3d tool like Blender, then script out the animation.
Great work. Are there any plans to convert some of the code to OSS?
Nice! My favorite challenge was avoiding the glowing white dots along the path.
I also went for 0% speedrun challenge.
Yeah, they really should be some kind of powerup so you're incentivized to hit them.

Right now learning about the company feels like a penalty which I doubt was the intent.

Also for anyone who hits a dot and is confused how to get out of the information screen - you just press the arrows. I tried escape and clicking for longer than I would care to admit before I realized this.

Super cool idea though.

Should we be learning about the product or the company? Only one seems valuable, no?
It's really commendable these guys focused on making a fun game. The glowing dots are easy to avoid and even the story they tell is not intrusive. It's an understandable compromise!
Lol. Same for me, the game was avoid the white dots. It almost speaks to something deeper in terms of corporate-sponsored games, how does a "brand" form a relationship with me? Perhaps just calling the game "avoid the white dots" would have been a step in this direction?

I often get YouTube advertisements thrust upon me when I'm engaged in content and think "what are these brands thinking... bursting into my living room mid-content and trying to push tampons onto me?" I'll never buy your tampons again.

However, I digress, and apologies, because I love the game and also the studio that created it - but honest feedback - I still have no idea what the company does that sponsored this game. I don't feel an emotional connection, and the game didn't peak my interest enough to find out what they do.

In the past when I've encountered great "art" - it's inspired me to go deeper into what was behind the art; to learn more about the author, and perhaps if it's truly amazing, another step beyond this. Brands like Panic have made me do such a thing.

I remember that great commercial for (I think) it was Geiko insurance on YouTube that said "You can't skip this ad because it's already finished", it was wonderful IMHO because it empathised with the viewer. Perhaps calling the game "Avoid the dots" would do the same?

Just my opinion, insignificant such as it is.

[edit] After a moment on the balcony it occurred to me, what if the game began with a big white Super-hot title that said "Avoid the dots (Speedrun challenge)" and at the end of each level displays a high-score table? Perhaps that would even give it a chance of virality in the speed running community? (credit to the commenter that said he "speed ran" avoiding the dots for the idea)

Hello, really amazing work, well done! Just one curious question: have you made the background music yourself? if not, can I know the name?