pzmarzly 3 days ago

I learned way more about computer graphics here than I expected. Kudos to the author.

One nit: the picture that the author called "The sun" is actually Eirin [0] looking at the moon. In that scene [1] she's reaching for the moon, where she was exiled from, only to hesitate and retract the hand. In the next scene, Kaguya [2] also reaches for the moon, but does not hesitate. I'm not sure what the symbolism here was supposed to mean, as according to Touhou wiki it was Eirin's plan to steal the moon.

[0] https://en.touhouwiki.net/wiki/Eirin_Yagokoro

[1] https://youtu.be/FtutLA63Cp8?t=99

[2] https://en.touhouwiki.net/wiki/Kaguya_Houraisan

  • tmtvl 3 days ago

    You may have misread, the wiki says her plan was to 'seal', not 'steal' the passageway between Earth (or Gensokyo) and the Moon. Eirin deliberately chose to break her connection to the Moon in order to protect Kaguya.

SCUSKU 3 days ago

I don't really understand how or why Bad Apple is becoming the de-facto graphics rendering "hello world" but it's fun to see in real time. I came across this demo which uses Bad Apple for demonstrating high FPS hypermedia:

https://data-star.dev/examples/bad_apple

  • jabroni_salad 3 days ago

    2 reasons:

    1. The creator is extremely cool about remixes and fanuse. In many ways touhou is the OG modern internet fandom in a way that previous ones weren't. Your bad apple video will not be taken down even though it has the same audio as all the others.

    2. The shadow puppet format is recognizable at seemingly any resolution. I have seen examples in a 3x3 grid even. On top of that, it only has two colors (black/white, 1/0) so its dead simple to convert the video frames into any other format you can imagine with only a 'hello world' understanding of what you're doing.

    • munchler 3 days ago

      > it only has two colors (black/white, 1/0)

      As the article mentions, the source video is grayscale, not monochrome. Grays are used for motion blur, glow, gradients, etc.

      • Mogzol 2 days ago

        True, I think it's more accurate to say that the video can be shown in only black & white while still remaining mostly true to the original content, which isn't the case for most videos. So you can play bad apple on two-color display and still easily be able to recognize it as bad apple, which definitely contributes to its "hello world for video" status.

    • layer8 3 days ago

      > its dead simple to convert the video frames into any other format you can imagine

      Maybe read the linked article about that. ;)

      • dylan604 3 days ago

        "It’s grayscale, not just black-and-white."

        Just in case reading TFA is too daunting for those only reading comments

        • layer8 3 days ago

          I was alluding to the difficulties of frame-rate conversion, dithering, and compression artifacts in the original source being amplified by the conversion. Grayscale by itself isn’t the issue.

          • dylan604 3 days ago

            But the person you replied to "it only has two colors (black/white, 1/0)" which is what I was referring

            • layer8 3 days ago

              Yes, but I don’t think that black & white vs. grayscale makes a significant difference. Naively converting grayscale is virtually as “dead simple” as converting black & white.

              • dylan604 3 days ago

                You seem to be interpreting my reply as a challenge to your comment rather than taking as support to it. The original comment made an incorrect statement-as-fact with b&w 1/0, yet TFA clearly stated it was grayscale. Your comment challenged implying TFA was not read, so I just backstopped your comment.

                • layer8 3 days ago

                  Your comment implied that your citation makes reading the article unnecessary, in the context of my initial comment. Since your citation didn’t mention the difficulties I was alluding to, your comment seemed to be missing my point, and to those who didn’t read the article would give the wrong impression that my comment was about grayscale.

    • RockRobotRock 2 days ago

      For the same reason, if you play rhythm games you’ll notice that every single one has touhou music.

      • jabroni_salad 14 hours ago

        The toby fox music (undertale, deltarune) has been making the rounds in that scene as well.

        Commercial music is really hard to utilize in this way. ZUN and Fox know the music is special to the fans and that they like to see it in different places, so they put the effort in to accommodate it.

  • verdverm 3 days ago

    The DOOM standard is here: https://www.reddit.com/r/Doom/comments/1c0g0mi/i_made_doom_i...

    built on a fully programmable cpu in redstone

    IRIS Computer Specs:

    - Custom 16 bit CPU

    - 8 kB of RAM

    - 64 kB of ROM

    - 1 kB texture ROM

    - 96x64 pixel screen - 16 colours

    - Floating point unit (add sub mult div sqrt)

    - 173 redstone tick clock

    - No 3D graphics hardware acceleration (entirely done in software)

    - Runs programs written in URCL

    - Runs at 1 million ticks per second thanks to MCHPRS server - which is 5.8 kHz clock speed

    • everforward 2 days ago

      > - Runs at 1 million ticks per second thanks to MCHPRS server - which is 5.8 kHz clock speed

      I had to go look into this, because that's shockingly fast. The latest Intel CPUs have a 6.2 GHz clock rate when TVBing, so each Minecraft tick runs in ~1,000 CPU cycles. Each thread handles 65k surface blocks (256x256 plot), so that means each cycle is processing upwards of 10 surface cycles in the most lenient circumstances I can think of.

      I went to go look into how on Earth they're doing that with all this Redstone around; there are some docs at [1] if anyone else is curious. It looks like they have some kind of Redstone "compiler" that converts the Redstone blocks into a graph, and execution happens on that graph.

      That's crazy impressive. It does make using Minecraft feel a little silly, to me and perhaps only me. They have an input step where they basically parse the map, convert it to a graph that seems to resemble the AST of an LLVM IR, and then execute it. It makes Minecraft feel like a very awkward scripting language to me; why stack 16k Redstone cubes manually just so they can parse it into an IR instead of just scripting generating the IR or something like that?

      1. https://github.com/MCHPR/MCHPRS/blob/master/docs/Redpiler.md

      • verdverm 2 days ago

        Minecraft has a unique and diverse community, it's what gives it the staying power

        I would imagine they used one of many tools for copy/paste in Minecraft, especially with the repetitive nature of the components.

        Mojang (and now Microsoft) have taken ideas from the community to make the game better. It would be interesting if they incorporated the Redpiler idea, because redstone can get laggy

        • everforward 2 days ago

          Yeah, I spent some time thinking about and I think my reaction is heavily tinged by my experience, interests, and skills and probably doesn’t extrapolate.

          I’m not a visual learner, but many people are, and this is probably a good illustration of a basic PC.

          Likewise, editing visual 3D blocks may suit some people better than writing text.

          It’s also probably the most fun way to build a CPU for most people. I would imagine writing scripts isn’t as much for people. Especially children, who I suspect might tinker with this for fun and would balk at learning to write Python to emulate a CPU.

          I wonder if Redpiler is tied to the “thread per plot” model; it might be. Eg there’s some stuff in that doc about optimizing the size of nodes in the graph so they fit into the CPU cache.

          I’m not an expert, but my offhand impression from the docs is that this is all meant to create a fairly small, very high performance world. The main server seems to want the opposite: maintaining acceptable but not necessarily amazing performance across a very large world.

          • verdverm a day ago

            Minecraft is definitely trying to improve performance. The latest update changes some redstone mechanics to make it more consistent, remove some quasi connectivity, and make it easier on the update phase of the game loop

            Now if they would just do something about inventory...

  • numpad0 3 days ago

    One of less often mentioned characteristic trait of Touhou songs including original Bad Apple!![1] is that, at least to me, it more resembles a data bus status display than music; it makes a lot more sense to imagine it as listening to even bits of a 16-bit bus tied to instruments as MS-DOS boots, than music with regular tempo and musical measures. That's to be expected as these songs were created for hardcore PC-88/PC-98 shooter games by the developer of Touhou games all by himself without formal education in musical theory. I think that makes it rather familiar to embedded hardware engineers than most other music.

    Another factor is nicovideo.jp / nico-tech community developed from 2ch/futaba culture. Lots of users with way more domain expertise than pay or financial ambitions threw in their skills into remixes for fun(many were STEM students back then). Unidentified FPGA wizards, motor driver experts, video editors, would just come by and drop psychedelic videos. It was absurd. So absurd that Maker Faire Tokyo once put suspected nico-tech dress-shirts into a quarantine zone in a separate venue to save face for ambitious t-shirt webdevs(that was naughty, and lead to creation of nico-tech meetups, and also was never repeated). That absurd content quality-quantity density sure had created inertia for Bad Apple!! PVs.

    Undoubtedly one last key element was that the PV was monochromatic(okay, grayscale). That's probably why it wasn't one of other ones from the golden age of nicovideo.jp.

    1: https://www.youtube.com/watch?v=Yw5HTeT_dis

  • dokyun 3 days ago

    That the video is entirely monochrome while also extremely fluid and intricate makes for an interesting duality when applying it to a technical problem, and that it's also a very pleasing and impressive work of art in of itself, I would think gives it many of the qualities that demosceners in particular appreciate.

  • jasonjayr 2 days ago

    https://www.pouet.net/prod.php?which=63591

    8088 Domination used an awful lot of technical tricks to show Bad Apple, Full frame rate, Full screen on a real 8088 Intel Processor, back in 2014. As far as I know, that was the first, most recognized use of Bad Apple as a "demo benchmark" along side Doom as attempting to display it on as much hardware as possible.

  • nomel 3 days ago

    I think it's simply that it's (mostly) black and white.

tombert 3 days ago

"Bad Apple on all the things!" is one of my favorite geek trends. I remember the first time I saw it on the Genesis/Mega Drive I was astounded that such a thing was possible on such weak hardware.

I love seeing the new ports that people make for underpowered stuff. I'm afraid that I'm not smart enough with low-level programming to ever do one myself, but I have a lot of respect for people that can.

fayalalebrun 2 days ago

My favorite dithering algorithm for motion video is Yliluoma dithering: https://bisqwit.iki.fi/story/howto/dither/jy/

It is especially useful for grayscale content, as finding the optimal dithering matrix from the available palette is a straightforward exact operation, and the result can be placed in a LUT for real-time rendering.

In my opinion it looks much better than bayer or random dithering, especially on gradients.

thih9 3 days ago

Off topic, Youtube embed gives me:

> Sign in to confirm that you're not a bot

While viewing in safari mobile private mode. Same if I navigate to the youtube page. This is new for me.

Switching to a different browser (firefox focus) makes that disappear, I can play the video without signing in.

  • ezfe a day ago

    I've been getting this a lot from embedded youtube videos (not in private mode) over the past week

63 3 days ago

> it’s even worse: redstone dust is, like, the only component that doesn’t introduce tick delays, but it’s very laggy, because no one at Mojang seems to know graph algorithms.

It's gotten much less laggy since the post OP linked to for info was posted, with many improvements in the last 3 years including one very recently. Mojang gets a lot of hate from every direction. It took them so long to make Redstone less laggy because every time they touch Redstone in any way, the community screams at them and any time they do anything other than introduce brand new features the community screams at them so it just wasn't worth it. Getting mad on the Internet and saying they don't know graph algorithms isn't helpful. Mojang has repeatedly hired some of the best and brightest minds in the Minecraft community to work for them (e.g. Panda4994, Kingbdogz, Gnembon) so they do have the technical expertise to do anything they want. What they don't have is infinite time/budget and it turns out that working on a 15 year old Java codebase and a massive multiplatform C++ app at the same time and trying to keep them in sync is really damn hard so can we please give them grace? I'm just tired of so much hate from every direction every second of the day. Can we please just say that Minecraft is awesome? Thanks

  • sdflhasjd 3 days ago

    Statements like that pop up in quite a lot of programming blogs like these, they used to annoy me more until you realise it's less gloating and more naivety from the 16-21 age bracket with less "professional" experience.

  • xnickb 3 days ago

    Why? It is in their power to rewrite the engine (in rust) and make it everything they want.

    It's not like they care about cross version compatibility or something.

    • bonzini 3 days ago

      Sure they do. There are people who have taken worlds from 10 years ago and brought them all the way to the latest Minecraft release, and breaking changes are done very carefully. The only two substantial nerfs that I can remember are zero-tick farms and fishing farms.

saintradon 3 days ago

I haven't been addicted to Minecraft / building serious redstone stuff since high school. Now I just play a few times a month with some friends when the craving randomly comes back to just build and explore. Looking at the redstone landscape now it has completely changed and it's unrecognizable to me - I wonder if that's how I'll feel as I slowly become a senior software engineer, years pass by and I look at stacks I haven't touched professionally in years and wonder in awe just how rapidly things change in tech and what new things people are creating with it.

vessenes 3 days ago

> And… that’s it? Looking back, the result looks almost trivial to achieve, which raises the question of why no one has done it before.

Umm, wow. I do not share that reaction to the work. This is an awesome dev log and closet lesson in splitting up what seems like an insurmountable task into nearly-impossible-but-doable chunks. Love it.

For reference, this renders Bad Apple at 20fps in vanilla minecraft, with only a custom texture and some custom object definitions changed to allow more textures. The rest is (very exotic) vanilla.

  • scotty79 3 days ago

    I'm mostly impressed with the display of knowledge visible in rejected solutions.

saagarjha 3 days ago

Kind of amusing how much effort this puts on the actual video itself. When I’m done with implementing a Bad Apple I’m usually too tired to think about dithering or frame rate Instead I just run it though ffmpeg and call it a day.

ConcernedCoder 3 days ago

ACHIEVEMENT UNLOCKED: "Get'r Done" -- The ability to interate and solve individual hurdles and issues within the constraints of a system to achieve a grand idea.

pkilgore 3 days ago

> Looking back, the result looks almost trivial to achieve

I wish the author was a bit more gentle on herself! What a ride.

  • thaliaarchi 3 days ago

    That feeling seems common in hindsight. Everything seems easier, once all the problems have been solved. Related, I enjoy the author's sense of humor:

    > I made a prototype and, lo and behold, it was in fact slow, as predicted. (I’m smart.)

    And in another article[0], describing an inefficient collision algorithm:

    > Mojang’s decision never crossed my mind. I guess I’m not a real programmer.

    [0]: https://purplesyringa.moe/blog/ru/minecraft-compares-arrays-...

MrPowerGamerBR 3 days ago

> Resource packs can change the music played by discs. The duration of the music disc stays fixed even if the audio is replaced

You can change the music disc duration with data packs since Minecraft: Java Edition 1.21, you can even add new music discs definitions without replacing any of the vanilla music discs.

I know that one of the rules was "no data packs", but hey, it is a cool thing if someone doesn't know about it. (also, in my opinion this wouldn't break the "no data packs" rule, because the "no data packs" rule seems mostly related to not using data packs to set blocks in the world)

throwaway918299 3 days ago

This boggles my mind that something like this is even possible in Minecraft.

I build redstone dust contraptions with my 4 year old and it blows my mechanical engineer father’s mind but this kind of animation is just another plane of reality to me.

kmacdough 3 days ago

I learned most of what I know about computer architecture from Minecraft CPUS. It's great to see this is still around for younger generations.

packetlost 3 days ago

It's amazing how much staying power Touhou has had in internet culture.

treyd 3 days ago

Prior art is missing the one I worked on, using Sheep and Bukkit plugin, although that might be considered out of scope since it's not entirely in-game.

In any case this is great work! I find it hard to imagine anyone improving on it.

trollied 3 days ago

Now I want to see this in Factorio...

floydnoel 3 days ago

Off topic: I was excited to see the demo video, but when I pressed play YouTube accused me of being a bot and refused to play. Apparently it protects their community. There are some privacy respecting alternatives, it might be good to see those gain traction. I'm going to try to do so myself, if i ever make or post a video!

efilife 3 days ago

A woman did this, a rare sight in the hacker community. That's so cool!

  • scotty79 3 days ago

    I'm more impressed she's 19 years old. We truly have a new generation of some awesome people.

  • kamma 2 days ago

    She is transfem though, which is not that rare in hacker community.

    • userbinator 2 days ago

      Another one of those riding the fine line between genius and insanity.

    • efilife 2 days ago

      Does it matter? You said that like she's not a woman

      • teddyh 2 days ago

        The common view is that women on average accomplish less (in areas which are publicized) because they are, from the moment of their birth, held back by society, or at least not encouraged to excel in any visible fields of endeavor. Logically, I would assume that this applies less to trans women, depending on their age at transition, and also whether they “pass” or not. Therefore, accomplishments by trans women should maybe not be seen as being as inspiring as should similar accomplishments made by people who were treated as women from birth.

        (Similarly, I would therefore logically assume that accomplishments by trans men are treated as less inspiring than they maybe ought to be, since, compared to non-trans men, trans men accomplished things despite having lived through more years of society treating them as women.)

        Of course, this focus on men/women/trans is diverting us all from the topic at hand, which is cool Minecraft stuff.

        • seethedeaduu 2 days ago

          If you don't pass you are universally treated as a freak, and if you transition late you have usually wasted your time dissociating. At the same time regardless if you pass or not, you have to deal with transphobia (if you are not stealth) and with people with good intentions who are uninformed and try to discourage you and make you repress and waste your life. Being treated as a male is not something that a trans female will benefit from, even if male upbringing is commonly associated with privilege.

          • teddyh 2 days ago

            OK, yeah, that makes sense. I guess that it shouldn’t really be surprising that there are a lot of hidden factors to these things than can be immediately intuited by the outside observer, therefore making logic and reasoning less than useful.

      • rife 2 days ago

        [flagged]

        • kelseyfrog 12 hours ago

          What perspective is that?