Move Your Feet video in ComputerCraft - Vi...
CrazedProgrammer 12 May 2015
Cranium, on 12 May 2015 - 07:46 PM, said:
Yeah, when I tried importing the music, I kept getting a tickrate of 7.5 t/s, which is just outside of the range that Minecraft can do, which is 5, 10, or if you use Note, 6.66
Edited by CrazedProgrammer, 12 May 2015 - 07:52 PM.
Bomb Bloke 13 May 2015
It may or may not help to know that the script is playing a video intended for rendering at 25 FPS (0.04s between frames), but due to the exact same limitation imposed on Note (that being the MineCraft server tick rate), it caps out at 20 FPS (0.05s between frames) - 4/5, or 80%, speed.
To complicate matters further, it always sleeps after rendering each frame, regardless as to the time already taken to render it. So if it takes more than a tick to get a frame drawn (which it almost certainly will when scaling over a full-sized external monitor), then that time + a 0.05 sleep = 40% speed (10 FPS). Ideally the script would keep tabs on the clock to work out whether it needs to use a timer or just instantly yield/resume before getting on with the next image...
There are 4967 frames, so at full FPS it plays for ~3:18, whereas in MineCraft it plays for at least ~4:08.
Edited by Bomb Bloke, 13 May 2015 - 01:43 AM.
To complicate matters further, it always sleeps after rendering each frame, regardless as to the time already taken to render it. So if it takes more than a tick to get a frame drawn (which it almost certainly will when scaling over a full-sized external monitor), then that time + a 0.05 sleep = 40% speed (10 FPS). Ideally the script would keep tabs on the clock to work out whether it needs to use a timer or just instantly yield/resume before getting on with the next image...
There are 4967 frames, so at full FPS it plays for ~3:18, whereas in MineCraft it plays for at least ~4:08.
Edited by Bomb Bloke, 13 May 2015 - 01:43 AM.
CrazedProgrammer 13 May 2015
Bomb Bloke, on 13 May 2015 - 01:43 AM, said:
It may or may not help to know that the script is playing a video intended for rendering at 25 FPS (0.04s between frames), but due to the exact same limitation imposed on Note (that being the MineCraft server tick rate), it caps out at 20 FPS (0.05s between frames) - 4/5, or 80%, speed.
To complicate matters further, it always sleeps after rendering each frame, regardless as to the time already taken to render it. So if it takes more than a tick to get a frame drawn (which it almost certainly will when scaling over a full-sized external monitor), then that time + a 0.05 sleep = 40% speed (10 FPS). Ideally the script would keep tabs on the clock to work out whether it needs to use a timer or just instantly yield/resume before getting on with the next image...
There are 4967 frames, so at full FPS it plays for ~3:18, whereas in MineCraft it plays for at least ~4:08.
To complicate matters further, it always sleeps after rendering each frame, regardless as to the time already taken to render it. So if it takes more than a tick to get a frame drawn (which it almost certainly will when scaling over a full-sized external monitor), then that time + a 0.05 sleep = 40% speed (10 FPS). Ideally the script would keep tabs on the clock to work out whether it needs to use a timer or just instantly yield/resume before getting on with the next image...
There are 4967 frames, so at full FPS it plays for ~3:18, whereas in MineCraft it plays for at least ~4:08.
It took me around 8 minutes to record the video because it only ran at 10fps (8x6 block 0.5 scale monitor).
I didn't do any time calculations in the demo, so that's what's causing the problem.
I may make an update so that it includes timing calculations.
CrazedProgrammer 14 May 2015
Xerxes, on 14 May 2015 - 04:33 PM, said:
This is absolutely awesome.
How long did this take to make?
How long did this take to make?
I worked on it for about 4 hours.
The first hour was spent on downloading the video and converting it to around 5000 JPGs.
The second hour was spent on writing my own converter which takes JPGs, downscales them,
converts them to ComputerCraft colors and then saves them to a file.
The last two hours were spent on writing, testing and optimizing the player.
I mostly tested it on a 8x6 block 0.5 scale monitor with 164x81 pixels, which really tests the limits of ComputerCraft and my scaling algorithms.
CrazedProgrammer 19 Sep 2015
Bomb Bloke 29 Oct 2015
Waitdev_ 30 Oct 2015
thinking about it, you could use a constant palette changer in craftos 2.0 when it comes out, giving you a better colour choice for each frame using the colours not used.
CrazedProgrammer 06 Nov 2015
Bomb Bloke 06 Nov 2015
Well, I guess it was less a "report" so much as a "thought you might be interested to see it", but I guess it did come off that way.
TYKUHN2 15 Dec 2015
The size of the program crashes notepad++ are you SURE it is maxmimally optimized?
Anavrins 16 Dec 2015
It's the screen drawings that is optimised.
Opening this in NP++ is pretty much the same thing as opening an actual video file.
Opening this in NP++ is pretty much the same thing as opening an actual video file.
CrazedProgrammer 29 Dec 2016
houseofkraft, on 28 December 2016 - 03:29 PM, said:
I wonder if you can add music with iron noteblocks
My audio API is capable of playing NBS songs so if you made Move Your Feet in Note Block Studio you could totally play it alongside the video.