15 ms·
Development Notes from xkcd's "Machine"
- bell-cot 2y agoFWIW, HN's April 6th item on this, with 14 comments: https://news.ycombinator.com/item?id=39953514 https://news.ycombinator.com/item?id=39953514
- abathur 2y agoI'm just the tiniest bit disappointed to have confirmation that mods probably didn't wait around for one of my zero-element machine submissions (I imagine I called it "patience is a virtue", given how long I had to sit around waiting to click submit on it) to eventually pay off :)
- em-bee 2y agowhat are you referring to?
- abathur 2y agoSome tiles are ~solvable without building anything. Sometimes this is dead-simple (the balls just drop from the top on through). Sometimes, they'll solve if you're patient enough (the balls pile up, shift around, and sooner or later enough of them exit within the time window necessary to trigger the submit UI). Edit: to finish connecting the dots just in case--I waited quite a while for one, probably at least 10 minutes--to do this. When the clearance rate for a machine is poor, it will usually drop back under the submit threshold very quickly. In these cases, you have to watch very carefully to be prepared to submit in the brief window that the submit UI is enabled. The OP suggests that during moderation they generally waited 30 seconds for a submitted machine to do the thing before they moved on.
- aiiane 2y agoWe also set up the minimum requirement for the submit button to be unlocked to not be too strict, to avoid frustrating people, but held a bit of a higher standard for the things we selected to be part of the public machine. So designs that only just barely work well enough to occasionally unlock the submit button are probably too unreliable to get selected for inclusion (but we made occasional rare exceptions if the submission was particularly interesting / inspired for other reasons).
- chromakode 2y agoI saw yours! We do inevitably bias for tiles with some content in them, since otherwise the viewing experience would be quite boring. :)
- abathur 2y agoI stand corrected! :) In my defense, I did personally find it quite suspenseful to wait for my vague sense that chaos would eventually reward me to cash out. Now that I reflect, I might have also called it "WU WEI". I know I also used that for (at least) one of my zero-element submissions. Also--apologies if the "ONLY FANS" submissions wore out their welcome. I'm sure I wasn't the only one, but I was probably a fair fraction :)
- sdwr 2y agoAs a nerd, I hunger for consistency. This wasn't - it took snapshots and handwaved them together. Can't help but feel it would have been a lot better with constrained physics and automated submissions. The current version is probably more fun to be on "the inside" of, evaluating submissions and stitching them together, but at the expense of the finished product.
- NBJack 2y agoI may be missing something, but that seems to be an apples to oranges comparison. How is your turn based app example analogous to a complex physics simulation? And what exactly do you consider about the app's multiplayer to be the bar?
- sdwr 2y agoEdited since, but what that game does is let you participate asynchronously in a completely distributed way. It's a real miracle of game design. This one is kludging from every angle. They're cheating with the physics, they're cheating with who sees what, they're cheating by handpicking levels. It results in an experience that isn't grounded, because none of the foundational dimensions are real.
- junon 2y agoYou're asking a lot from an April fools joke from a comic creation team. Also, what you're asking for is very hard to do with physics engines as they exist now. Simulating a bunch of non-static elements like that is incredibly expensive.
- NBJack 2y agoAs much as I hate to spoil the illusion, the kludging you mentioned is basically the sum of the natural drawbacks faced in virtually all game design. Whether it's a skybox, an NPC, or a virtual bullet, it's all basically cheating through constraints and illusions. Great example: Space Engineers, a very popular game in which you can build ships, bases, etc. with an incredible consideration for automation, moving things around, etc. One of my favorites. But the game intentionally (1) limits the top speed of all entities to 100m/s, (2) doesn't actually simulate orbital mechanics despite having planets, and (3) forces you to construct things on a 'grid'. All of these constraints are arguably shortcomings, but they also enable the physics engine to live and collisions to work.
- its_ethan 2y agoI feel like I'm missing something - why do certain elements seemingly only effect a specific color of ball in the machine? I assume it's to prevent the colors from getting totally jumbled up, but it doesn't seem like that's explained in this write up?
- chromakode 2y agoWe gave each ball different physical properties. Yellow balls are light and have lots of air drag. Green balls are massive. Red balls are very bouncy. This allows physical sorters to be designed.
- its_ethan 2y agoOh neat! Thanks for the reply to clarify that - I like having different properties as a concept added to the machine!
- junon 2y agoOhhhhhh this makes so much more sense. I was confused about how that was working with some of the designs. Thanks for explaining!
- creatonez 2y agoThe Explain xkcd wiki has further documented how the game works: https://explainxkcd.com/wiki/index.php/2916:_Machine https://explainxkcd.com/wiki/index.php/2916:_Machine
- pimlottc 2y agoAh, I was confused by this as well, this information is missing from the article. I couldn't find any explanation about the colors in the application either.
- deleted 2y ago[deleted]
- Rudism 2y agoThe thing I'm most confused about is I thought xkcd was one guy named Randall's webcomic, but this post makes it sound like there are several people involved in creating the comics. Is that the case? Does Randall still draw them or is it like a company with a whole creative team now?
- aidenn0 2y agoI believe his April 1st "comics" have always been coded by someone else; there's been development notes by the developer(s) like this posted after each one.
- aiiane 2y agoMost comics are just Randall, but there are a handful of people who contribute to the occasional more unique / interactive comics, such as the April Fools ones.
- saganus 2y agoI am actually a little relieved because everytime one of these interactive XKCD comic is published I wonder how does Randall find enough time to work on them, plus What If, etx. Of course there are some people that simpliy are hyper productive, but the level of detail and complexity of these comics always made me feel a bit "inadequate" :)
- nolongerthere 2y agotbf, I don't think he has another job, so if he's only creating 3 comics a week and writing his books, there is def enough time as a side project to put out a fun annual comic that requires a bit of work, obviously it would need to be planned well in advance, which it appears this was not.
- deleted 2y ago[deleted]
- saganus 2y agoRight. Maybe the workload is manageable, especially for someone with the amount of experience he has, nevertheless the breadth of the stuff he does is what amazes me the most. Just programming one of those interactive comics must be quite a challenge, to then add the story, the wittiness, depth, etc is what blows me away.
- benlivengood 2y agoWhy are there no cats in the current machine??
- drewtato 2y agoThe explainxkcd wiki says that cats were added later, and that permalinks go to a snapshot of the machine. So it's possible all the cats are lower in the machine, or the permalink is from before cats were added. There's some cats at the bottom of the machine right now. https://xkcd.com/2916/#xt=2&yt=105&v=1402 https://xkcd.com/2916/#xt=2&yt=105&v=1402
- windowshopping 2y agoHonestly every time I start to think I'm rather quite good at frontend development, someone posts something like this and makes me feel like an intern by comparison. To have built this in 3 weeks is Herculean to me. It probably would have taken me 3 weeks to figure out the physics context alone.
- FredPret 2y agoI bet it helps to have a physics PhD on the dev team. It still sure is amazing
- j16sdiz 2y agoMany PhD in physics (even those working with number crunching) can't write javascript. Its not like you can solve a 2nd order differential equation in bowser.
- fragmede 2y agoOpen your browser's debug console and paste this in: function solveSecondOrderODE(b, c, y0, dy0, dt, tMax) { let t = 0; let y = y0; let dy = dy0; while (t <= tMax) { console.log(`At time ${t.toFixed(2)}: y = ${y.toFixed(4)}`); let ddy = -b * dy - c * y; // Compute the acceleration (second derivative) y += dy * dt; // Update position dy += ddy * dt; // Update velocity t += dt; } } // Example usage: // Constants b and c for the damped harmonic oscillator const b = 0.5; const c = 1.0; // Initial conditions: y0 (initial position), dy0 (initial velocity) const y0 = 1.0; const dy0 = 0.0; // Time step (dt) and maximum time (tMax) const dt = 0.1; const tMax = 10; solveSecondOrderODE(b, c, y0, dy0, dt, tMax);
- tialaramex 2y agoThe basic concepts translate well from other languages like say, Python. I work for a major University. The only major numerate discipline for which we do not teach programming to undegraduates is Medicine, and my guess is that Medics are already completely buried by the tremendous amount of stuff they're expected to have at least some knowledge of to do their eventual jobs, without us showing them how to make apps. Like sure, if you come here to study Fine Art, we don't (by default) teach you to write software, but if you come to learn like mech eng. or electronics or chemistry or something you're going to be shown how to write software. You can probably flunk that in most of these subjects and still get a degree because it's not on your critical path, but we tried. These are not software engineering courses. You're not going to learn how to be in charge of a major software project, you won't learn how to design software, nor even stuff like CI and revision control - if you try to scale what you learned in one course as a Biologist into a Chrome-sized application that's going to be a disaster, but you've written software, you know what a loop is, what a variable is, and so on.
- Max-Ganz-II 2y agoI love this XKCD. I have a bookmark for it, and whenever I want to kick back a bit, perfect. However, I've noticed that it has a tendency to go blank (i.e. fail and stop working) when multiple colour spectrum triangles are in play and in particular when they are on top of each other. I'd really like to see some additional objects to place into the machine. One other problem I have is that the "perma-link" button doesn't seem to do anything. When I come back to the URL, my machine isn't there.
- aiiane 2y agoPermalinks are only for machines that have already been approved via the moderation queue as part of the shared public machine. Submitting a machine only submits it as a candidate for inclusion, it doesn't guarantee that your submission is the one picked for the slot.
- scpso 2y agoHaha I've had the same problem with triangles, stopped using them because they always crash. Only when editing, not when viewing. Have a look at my repo if you want to search for any of your submissions to see if they ever got published. https://github.com/scpso/incrediblexkcd https://github.com/scpso/incrediblexkcd
- mihaaly 2y agoReminds me of this from my young adult years, I wasted sooo much time on this very happily: https://www.myabandonware.com/game/the-incredible-machine-1mg/play-1mg https://www.myabandonware.com/game/the-incredible-machine-1m...
- windowshopping 2y agoIt says in the post that this is what inspired the project.
- mihaaly 2y agoOoops, in prime location too [blush]. : )
- iamtedd 2y agoWhat was the rationale for simulating the machine with physics, and not simply creating an animation engine?
- sfink 2y agoBecause the machine is a physics simulation. Where users can set up simulated physical objects like barriers and bumpers, and you want the animation to display a simulation of what happens according to the laws of physics. I think you may be missing the point if you think this is an animated rendering of a static setup?
- iamtedd 2y agoThe problem description is ”Could we make a really big tiled mechanism like the blue balls GIF? Where everyone contributes a small square?”. There is a stated rationale for every other design choice, but the blue balls GIF is an animation, not a simulation. It didn't even start as a simulation. So why the choice of making this a simulation, not an application for users to animate tiles?
- simonmic 2y agoWow! What a work of art! A few more links for the record (don't read too soon, possible spoilers): https://www.reddit.com/r/xkcd/comments/1bxg43b/xkcd_2916_machine https://www.reddit.com/r/xkcd/comments/1bxg43b/xkcd_2916_mac... https://www.explainxkcd.com/wiki/index.php/2916:_Machine https://www.explainxkcd.com/wiki/index.php/2916:_Machine https://github.com/xkcd/incredible https://github.com/xkcd/incredible
- Waterluvian 2y agoI can’t help but hear the Blue Ball Machine music from the YTMND.
- ralferoo 2y agoReading this write up is funny, because I had no idea this is what was happening. There didn't seem to be an explanation of what was going on. I didn't know it was a shared experience, just that various random things seemed to be chaotically happening. I completed a couple of tiles and I guess submitted them as I thought that was how you got to "the next level", but gave them really stupid names like "test 1b" - mostly this is because I assumed it was single player and only I'd be seeing the name! I also got bored after creating a couple of tiles. I scrolled around and saw very complicated things, but didn't realise they were submissions, just starting points for solving the level... I guess I was the April Fool!
- jimmydddd 2y agoLOL. I'm much much worse. I played with it for like 2 minutes and had no idea what was going on and gave up. Maybe because I never used that machine game is was patterned after? :-)
- rossant 2y agoSame. And it took me 10 minutes to realize I could scroll right on the tool selection area... I could only see like a wood bar, a sword and a couple of other things on my phone. With the other tools it's so much fun. My kids will love it.
- creatonez 2y agoIt's still open for submissions, by the way.
- wodenokoto 2y agoI didn't even realize it was interactive. I just looked at it and thought "neat"
- ephaeton 2y agomaybe they'll do the write up next time before it goes live...
- Cthulhu_ 2y ago
- itslennysfault 2y agoI was adding a lot of "bonk" elements and I seem to have murdered rapier... Uncaught Error: recursive use of an object detected which would lead to unsafe aliasing in rust at jt (rapier_wasm2d_bg.js:4836:11) at 4ea5626ea4b1e4145572.module.wasm:0xf061c at 4ea5626ea4b1e4145572.module.wasm:0xf0638 at 4ea5626ea4b1e4145572.module.wasm:0xb5e7b at H.remove (rapier_wasm2d_bg.js:1051:14) at l.remove (collider_set.js:87:18) at y.removeCollider (world.js:343:28) at PhysicsContext.tsx:258:15 Also, this is super fun, and I'm sad I didn't learn about it when it was still live. It'd be really really cool if people could still permalink individual machines created. I know that might be an issue for storage. Maaaaaybe just base64 encode the JSON into a URL param??? Please?? I'd love to create weird maps and share them with people.
- aiiane 2y agoIt's still live. https://xkcd.com/2916/ https://xkcd.com/2916/ Machines that make it into the overall public version can be permalinked, but there's no permalinks for individually created things that don't get selected via the moderation queue. This was an intentional decision to avoid the risk of hosting unmoderated user-generated content on the comic's domain.
- itslennysfault 2y agoOh, gotcha... I submitted a few, but thought the event had ended and the overall machine was finalized. It would've been nice to have a messaging explaining that the machine will be reviewed and maybe a way to check back if it got added.
- utopcell 2y agoI don't know what I'm seeing, I missed the Apr/5 xkcd update, but this is fascinating! :-)
- TacticalCoder 2y agoIt is reminiscent of the very old DOS game "The Incredible Machine": you receive a certain number of various items (fans, conveyor belts, basket balls, tennis balls, cat, mouse (cat would follow mouse upon seeing it), mirror, candles, etc.) and with the items you had, you had to solve a problem like, say: "To win the level, you must send 32 tennis balls above the wall".
- stavros 2y agoYep, the second sentence in the article has a link to Wikipedia.
- CSMastermind 2y agoI totally didn't realize it was collaborative. I thought I was only building rooms for myself lol. Several years ago XKCD released a comic that was different depending the browser, operating system, ip, and referrer you use to view it. I know people uncovered hundreds of versions of it but I never heard a detailed write up about how it worked or how many comics there were available. Does anyone know if they ever figured it out?
- chromakode 2y agoUmwelt! Explain xkcd has a great writeup on it: https://www.explainxkcd.com/wiki/index.php/1037:_Umwelt https://www.explainxkcd.com/wiki/index.php/1037:_Umwelt
- TheAceOfHearts 2y agoI wish they had a way of easily figuring out if any of the machines you built made it into the final version or not. Maybe for a future design it would be neat to store the titles of previous submissions in something like local storage and you could provide a notification.
- lukan 2y ago"Machine is rendered entirely using the DOM. During early dev I was leery I’d reaching the end of my rope perf-wise. I expected I’d eventually ditch DOM rendering for PixiJS or canvas when it got too slow. However, I wanted to see how far I could take it ... I’ve heard comparisons drawn between modern browsers and game engines, with their tightly optimized GPU rendering and DOM / scene graph. The similarities have never felt more apt." The DOM might have become faster, but using the GPU directly via Pixi is still a world above in terms of performance and using Pixi could have made everything more smooth. But dev time was limited .. and the result is still impressive.
- chromakode 2y agoAgreed. DOM started as a prototype and I stayed on it primarily for dev speed due to momentum (and some React DX things -- I checked out the Pixi React binding but decided not to go down that rabbit hole). It's amazing how efficient Pixi is!
- koryk 2y agoThanks Max, this was a great read! Awesome work and write up. Some good insights about player focused game development too.
- rtkwe 2y agoI looked at this one early in the day and didn't even realize it was all user generated machine components.
- scpso 2y agoThis is gold! Folks might be interested in my repo of all published machines: https://github.com/scpso/incrediblexkcd https://github.com/scpso/incrediblexkcd
- donquichotte 2y ago> There was no incentive to carefully consider where to place a sticker. Players didn’t have enough agency to advance the plot through their individual action. This limited creativity to simple patterns like tiling similar stickers or forming lines. Ah, the game turned into a big corp job!
- 1-6 2y agoThe piece was well written and explained the functionality quite elegantly with enough technicality without overburdening the reader with technobabble.
- Cthulhu_ 2y agoAn XKCD staple, their What If series is really good like that too. A bit silly, pop sci, but simple terms and explanations.
- superdisk 2y agoWhoa, me and a friend had this same idea back in 2014 and implemented it for Ludum Dare. https://nickfa.ro/wiki/CoinSlot https://nickfa.ro/wiki/CoinSlot Cool to see a more refined and well-functioning version of the idea.
- salamo 2y agoReally cool, I really enjoy the "follow" feature. Unfortunately, the balls get stuck sometimes and I have to follow a different one. I guess a few bugs slipped through the mod queue.
- deleted 2y ago[deleted]
- CyberShadow 2y agoI tried participating when it came out. I think I spent an hour building something that was as reliable (in terms of getting the correct balls to the correct output) as I could. After I submitted it, I refreshed the page and found at that spot someone else's contraption (which was, admittedly, prettier, but not as reliable). Oh well; though, I wish that sort of thing was a bit more up front. It also looks like I'm not the only one who hasn't figured out that the list of building blocks is scrollable!
- justinclift 2y ago> ... the list of building blocks is scrollable! Ugh. Just submitted two, and had no idea the list could be scrolled. Can't be bothered going back and looking now though. :(
- latexr 2y ago> On April 5th, xkcd released Machine, our 15th annual April Fools project. Wait, “our”? I thought XKCD was just Randal Munroe. > Machine’s backend was written in Haskell by davean and Kevin So at least two other people. Three when counting the author of the blog. The Wikipedia page for XKCD doesn’t show these names. Is XKCD a multi-people effort now, or are these “friends of the comic” who work on interactive stuff?
- defrost 2y agoThere's been a large "friends of the comic" group since day one, there was (and likely still is) an active IRC group that included Munroe that discussed old comics and generated ideas for new ones, the alternative text behind the comics and related facts sheets get a good going over by a small cadre of friends and regulars with an engineering | physics | maths | chenistry, etc bent.
- bell-cot 2y ago(And besides - if Randall f*ing Munroe contacted a few people, who were experts at $Foo, $Bar or $Baz, with "I've got this really cool idea, but I'd need some help..." - how hard would it be for him to get some "yes" answers?)
- proaralyst 2y agoI believe davean has been involved for a while, they're mentioned on the about page: https://xkcd.com/about/ https://xkcd.com/about/
- chromakode 2y agoApril fool's at xkcd is a special occasion where external folks join xkcd to build an experimental interactive comic. Edit: I've updated the first para of the post to hopefully clarify this better