This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
secret6timb1's profile picture

CC-Recorder

Started by secret6timb1, 25 March 2017 - 11:38 PM
secret6timb1 #1
Posted 26 March 2017 - 12:38 AM
This software creates wrappers for all of CC's graphical methods and records them

-Install-

pastebin get 4ePpPigk recorder

-Video- (by me, credit to Zero Miz-kun for the amazing nightcore <3)
https://www.youtube.com/watch?v=QxprN3ZAtzA

Usage

recorder -program -output

Graphically heavy programs will almost run out of memory instantly, I'm going to work on some encryption methods.

TODO :

-Filter out recording (remove unnecessary drawing in-between yields
-Create video partitions in several different floppies
-Create a streaming service over rednet
-Change lengths of method names written to files (1 char each).
-Make a frame by frame viewer.

If you can increase file size limits on your server/client, this will solve any memory issues.
Videos will be less costing than the actual programs themselves.

Expect this to be highly optimized in the future.

~Sacrificable
Edited on 26 March 2017 - 12:45 AM
KingofGamesYami #2
Posted 26 March 2017 - 02:16 AM
Simplest way to make your executable smaller would be to minify. Get rid of all whitespace characters (such as \n) and rename functions to single letters.
CLNinja #3
Posted 26 March 2017 - 02:33 AM
that video is a kickthepj video, not anything related to the post.
secret6timb1 #4
Posted 26 March 2017 - 02:39 AM
LOLwhat- updated.

My browser must have not refreshed.

dying rn.
CLNinja #5
Posted 26 March 2017 - 02:44 AM
It still hasnt updated for me.
secret6timb1 #6
Posted 26 March 2017 - 02:44 AM
https://www.youtube....h?v=QxprN3ZAtzA

-Fixed main post too

Also, I was going to do the 1 letter function calls.

I'll remove white space + any unnecessary draw calls and declare the one letter functions next update.
Edited on 26 March 2017 - 12:46 AM
TheRockettek #7
Posted 26 March 2017 - 10:19 AM
The way you save files are pretty inefficient. Why not just save the file as like a table for example and make another program to parse that so your files not just alot of term.writes and would save on alot of space

}
secret6timb1 #8
Posted 26 March 2017 - 09:46 PM
parsing? you don't want to put stress on other peoples computer's when watching videos real time.

instead you should make each function 1 character long
TheRockettek #9
Posted 26 March 2017 - 10:30 PM
It doesnt put much more stress when you parse XD
secret6timb1 #10
Posted 27 March 2017 - 12:41 AM
Still doesn't change the fact that something like this should be ran in the most optimal way possible.
CLNinja #11
Posted 27 March 2017 - 02:12 AM
Still doesn't change the fact that something like this should be ran in the most optimal way possible.

If the end user sees nothing wrong, then its not wrong. A second or 2 on something like this wouldn't make anyone angry or upset. They may say "see if you can make it faster" but if not, no one cares.
secret6timb1 #12
Posted 27 March 2017 - 10:36 PM
CL, it's bad practice, and many care.

Making it the fastest it can be, end of discussion.

Also if they're too lazy to make optimization they're just bad coders.
Edited on 27 March 2017 - 08:41 PM
TheRockettek #13
Posted 28 March 2017 - 05:16 PM
So you admit you're a bad coder? Also as it is alot of just calls, the length of recordings would be decreased dramatically which wouldnt be good.
Exerro #14
Posted 28 March 2017 - 08:05 PM
There are so many further optimisations you could make to this.

Localising functions to shorter names will actually make your program run faster, not just reduce the file size.
Just saving changes to a buffer and rendering those would run even faster and reduce the file size enormously. You'd probably want to use a custom format, which would take milliseconds to parse, be ridiculously smaller file size-wise, be more efficient in its rendering, and reduce server lag (reduced number of draw calls as it only draws changes).
SquidDev #15
Posted 28 March 2017 - 08:18 PM
To add to Exerro's post, one thing you could consider is the TRoR format. Whilst it isn't designed for file size efficiency, it is incredibly portable, easy to parse, and can be read and displayed by programs like howl.ci.
Edited on 28 March 2017 - 06:20 PM
Gorzoid #16
Posted 28 March 2017 - 09:27 PM
Localising functions to shorter names will actually make your program run faster, not just reduce the file size.

… no
local variable names are in source code only, once compiled they are just indexes in a stack.
SquidDev #17
Posted 28 March 2017 - 09:32 PM
Localising functions to shorter names will actually make your program run faster, not just reduce the file size.
… no
local variable names are in source code only, once compiled they are just indexes in a stack.
Actually, Exerro is quite right there. When you have a global variable (such as term) this requires a table lookup in the global environment. When you have local variables (or upvalues), this then is a lookup in the stack.

Compare:

for i = 1, 1e8 do local x = math end
and

local math = math for i = 1, 1e8 do local x = math end
The latter runs 60% faster on my machine than the former. Obviously your normal code wouldn't look like this, but it is still a good optimisation to make for functions/tables which are used a lot.

Edit: To clarify on the above point, I'm pretty sure Exerro was talking about two things there: localising functions, and making their names shorter. The former will result in more efficient code, the latter will only reduce code size.
Edited on 28 March 2017 - 08:11 PM
secret6timb1 #18
Posted 28 March 2017 - 09:52 PM
to answer the last 3 posts

"I'll remove white space + any unnecessary draw calls and declare the one letter functions next update. " ~Sacrificable

also, the optimizations have been complete, i've just been working on a bigger update.

also, for some reason these forums won't let me change my profile pic, i'm not even uploading, I'm using a link.