Showcase [Showcase] Bad Apple!!

Romixal

Terrarian

Screen is based on the real world matrix displays.
This design is similar to Moh.M@gdy’s implementation, but instead of using regular logic gates I used faulty ones.
With carefully planned execution order we can change state of the regular lamps on the whole row multiple times per tick,
wherein we actually can get some corresponding results from faulty logic gates.

I2viBi2.png


These rows of “Faulty AND gates” I call “inverters”, because when they activated they change state of the pixels that they connected to.

EtyVHdI.png


Look at execution order, between step 1 and step 2 (4-5; 7-8; 10-11) we can place jumpers that change state of certain inverters.
That set of jumpers I used to call “frame block”:

VqgAYzz.png


So, now we can change any pixels on this screen in one tick.
But each next frame strictly rely on previous one, because we only can inverse state of pixels.
For example I pick these two frames:

NF66yh8.png


Let’s say left frame is the current screen state and the right one we want to get.
Because we dealing with inverters, easy way to figure out when we need activate/deactivate them is overlay desirable frame on current frame with XOR algorithm.
You can do it with your graphical editor, by blending layers with “Difference” mode:

Wf75ZyV.png


That image shows us where inverters should be turned on (white pixels) and turned off (black pixels).
Then we need to figure out when we toggle our inverters: we looking for thoes when horizontal line change it’s color, I highlighted those pixels with red color
(if previous frame left some inverters turned on, we need invert state of the first pixel of the corresponding row):

RfTBWot.png


Then given pattern i apply to these cheat sheets, this mess helps me to build a frame block.
Left cheat sheet shows input wire, and the right one shows output.

2jbBrjF.png


xWnt7Gh.png


And i end up with this frame-block at the end.

I’m not good at explaining how I get from this cheat sheet mess to this pretty frame block… Well, you will figure it out, it will be your homework.
Rsorr6C.png


Then I just repeated this process ~6571 times.
Feel free to ask your questions, if you don't get something.
 
This is just amazing. I've been trying to make that display work for so long and still haven't done it. Great job on figuring out how to do it.
 
Very impressive @Romixal. Quite a splash with the video! (Saw it via Reddit.)

I'm not going to pretend to begin to understand how you've encoded the pixel change data so compactly (what is it, a 16 x 32 pixel matrix display? Only roughly counted)... Let alone what all the data buses must look like!

I couldn't initially believe there would be space in a single world for all those frames, as your video kept playing, but from looking at the numbers here, it seems like you've just really pushed things out the to the limit! From my very rough calculations, if each of your state change data 'frame block's is about the same size as the one shown (roughly 70 x 24 = 1680 tiles, area?), and you have....
Then I just repeated this process ~6571 times.
Approximately(!) 6571 animation frames (what, did you loose count?:p). Then that's ~ 11 million tiles of storage space. Which is the majority of a large world (at 8400 x 2400 = ~20M tiles), just for data storage (a medium world wouldn't fit it).... And that's before space for interconnects.

Did you really edit in all the state change data by hand? (Via TEdit?) I swear I would have gone blind before processing the 5th frame...:confused:

Anyhow. Great work and video! ;)Are you going to keep the world file to yourself, or share it with your fans?
 
Very impressive . Quite a splash with the video! (Saw it via Reddit.)
I'm not going to pretend to begin to understand how you've encoded the pixel change data so compactly (what is it, a 16 x 32 pixel matrix display? Only roughly counted)... Let alone what all the data buses must look like!

Resolution of this screen is 30x17, that's most densest screen, that i can get...
Yes we actually can fit 40x17 pixels on the 1920x1080 resolution, but we will end up with not pleasant pixels/gaps ratio.
"Column" bus is 16 tiles wide, seven lines of [RBGY] and one line of [RB] with single tile gaps between the lines.
"Row" bus however takes 18 tiles, eight lines of [RB] and one line of [R].
I use 2 wires because i can't compress everything that goes with Row bus, because each line of this bus take through itself up to 30 pulses per frame,
obviously logic gates cannot take it.
"Jumpers" is just 4 tiles tall, so they are not a problem.

I couldn't initially believe there would be space in a single world for all those frames, as your video kept playing, but from looking at the numbers here, it seems like you've just really pushed things out the to the limit! From my very rough calculations, if each of your state change data 'frame block's is about the same size as the one shown (roughly 70 x 24 = 1680 tiles, area?), and you have....

With this type of screen we get some sort of RLE compression.
On average there is 15-30 jumpers per frame, not that many.

QNb5Xw9.png


Theoretically worst possible frame block takes 30*17 jumps, and it will be 510 blocks width.
But in reality most of the frames takes less then 20% of that, there are some heavy frames, but they are really rare.
Still, this is not making it easy, whole animation takes about 6500x1900 tiles of space.

Did you really edit in all the state change data by hand? (Via TEdit?) I swear I would have gone blind before processing the 5th frame...:confused:

I did ended up with some tools, that i probably will never release.
I really did like "Smart Wire" feature, that i came up with: it's just place junction boxes automatically, when they needed.

Anyhow. Great work and video! ;)Are you going to keep the world file to yourself, or share it with your fans?

I would like to release it, but there is some downsides:
I don't feel like people should see this terrible boring mess, and connecting everything in one big circuit is not a great thing in terms of performance.
 
Last edited:
Wow... This is probably the most complex & impressive work I have ever seen. Thank you so much for sharing Romixal!
I don't feel like people should see this terrible boring mess, and connecting everything in one big circuit is not a great thing in terms of performance.
It wouldn't be boring, quite the opposite in fact.:)
 
Christ almighty, this is impressive.

Seems like every time I forget about the song/video, something brings it back up front and center. I just wasn't expecting it to be Terraria of all things this time.
 
When I saw the title of this thread I thought of that song. Then it turns out that, yup by "Bad Apple" you were talking about that song. XD
I was thinking about doing something like this but not a display screen kind of thing, more like a light show kind of thing. Sadly my computer is a slow piece of crap and would have a hard time running something like this that takes up the full size of a large world. :(
Now the next step is to add color and make a display screen using wire bulbs.
 
Theoretically worst possible frame block takes 30*17 jumps, and it will be 510 blocks width.
But in reality most of the frames takes less then 20% of that, there are some heavy frames, but they are really rare.
Still, this is not making it easy, whole animation takes about 6500x1900 tiles of space.
Wow, so each encoded frame block is a custom size and design, rather than an identical template with different connections selected... Obviously that later option would have been too big for even a large world, so you had to compress them. A variable bit rate encoding, effectively. Sheesh!

Even with some tools (that you made yourself? nice), that still leaves the process a very long way from automated then...? Think it would be very tough to make some tools to automate the wiring? (By using a fixed, maximum, frame block size, to make things easier, for example.)

Did you pick this video mostly because of it's suitability, being 2 tone monochrome, and also the frame transistions are fairly reasonable? Or have you been wanting to do something Bad Apple related for a while? Which thought came first?

Sorry to say this is the first time I'd come across this cool little animation. Or ZUN and his Touhou Project games - is that where it comes from? (For the benefit of us uncultured fools.;))
 
Last edited:
Sorry to say this is the first time I'd come across this cool little animation. Or ZUN and his Touhou Project games - is that where it comes from?
You mean this?

This song was originally from a 2D shooting game called Touhou Fantasy land - Lotus Land Story (東方幻想郷 ~Lotus Land Story), released in 1998. You can hear the original music in stage 3. A guy named Zun made this game entirely by himself. Programming, composing music, etc. He's insanely talented.

Due to their catchy melodies and the fact that they don't have lyrics, making arranged Touhou songs became popular among Japanese Dojin music artists. (Zun himself permitted them to make arranged songs as long as they follow certain rules.) The song itself in @Romixal's video, Bad Apple!! feat. nomico (arranged by Alstroemeria Records) is one of the most famous one among them.

This shadow art PV was made by another guy named "あにら" (pronounced as Anilla). The PV originally posted on NicoNico, a Japanese video sharing site in 2009. Thanks to this PV, the song became explosively popular all over the world. Even american CNN featured it, from what I heard. Currently the original PV video on NicoNico has 23 million views.

That's pretty much everything I know about Bad apple! Sorry for the irrelevant post.
By the way, welcome back @ZeroGravitas!:happy:
 
Even with some tools (that you made yourself? nice), that still leaves the process a very long way from automated then...? Think it would be very tough to make some tools to automate the wiring? (By using a fixed, maximum, frame block size, to make things easier, for example.)
Actually, at the end i fully automated frame block generation, but getting those stuff into the game was a pain.
Here is the piece of code that generates frameblock:
q92U3o5.png

Sorry, it looks like crap, because it never meant to be presented.

And result of it's work look like this:
PzH1nSl.png
So, it defiantly possible to automate whole process of generation. But i never get Terraria to load my generated worlds.

Did you pick this video mostly because of it's suitability, being 2 tone monochrome, and also the frame transistions are fairly reasonable? Or have you been wanting to do something Bad Apple related for a while? Which thought came first?
This is the most obvious choice you can make if you doing something like this.
Before 1.3.1 update was released, i worked on some project for PICO-8.
Sure, it was cool little project, i even managed to fit it in 400kb. But i was never satisfied by this, because i didn't do nothing new and you will not surprise anyone with "Bad Apple!!" on another "device".
So, release of 1.3.1 really decided my near future.
 
Back
Top Bottom