How i exported fuze code to pc for backup purposes
-
I just succeeded in exporting code from fuze to my pc ...
Here's how i did it...
Basically the only thing you have is screenshots, so you have to encode text to pixel data.
You can start by wrapping your code in a double quotes. But i'm guessing if your code contains a lot of strings you need to escape them somehow first.What i did then was make each bit of a character a single pixel. 0 for black and 1 for white. Since i'm using an hdmi capture card to view my switch on the pc i can save screenshots using the windows camera app in 1920x1080 instead of 1280x720 when using switches screenshot features. so in a single full hd screenshot i can store 1920x1080 / 8 characters which if using 100 characters per line (which is never the case) would result in saving about 2600 lines of code in a single screenshot.
Since both switch as my camera app save pictures in jpeg, which is a lossy format you have to counteract jpeg artifacts. Basically what i do on the pc is created a program that checks every pixel's RGB value and if R < 128 and G < 128 and B < 128 i consider it 0 bit otherwise a 1 bit and then you just reconstruct the text. and i stop processing the picture if i encounter the 0 character. One other thing you have todo if using windows is when you encounter the 10 char (linefeed) is to replace it with 13 10 or your return characters won't display correctly
This a screenshot of how such encoded screenshot looks like for the program in the 1st screenshot (1st 3 rows of pixel data)
if you save the image and zoom in you'll see what i mean lossy jpeg format (jpeg artifacts).
So now you can code a fuze code exporter yourself :)
I'm not sure if checking for half the pixel value for black / white is enough to counter act the jpeg artifacts all the time but it did seem to work with my test code / screenshot
also when using switches screenshot system you probably have to enforce 1280x720 even in docked mode or you might loose pixel data if they do not save the screenshots as full hd
-
This is a cool idea. I have thought for a while that it would be useful for the file commands to be able to open the source code and at least be able to read it. Probably not write as we don't really want programs to be able to destroy themselves
-
Simply amazing.
-
This is another screenshot with the code of my little car game (about 1300 lines of code)
and it seems to work fine.
I did notice you can not escape
"
with a double one""
but you can replace a single"
with"+"
to make your multiline string work to feed to your program@pianofire access to the code would be nice, it would prevent having to replace a single
"
with"+"
to make your multiline string constant work although i guess once the new patch hits it will be easy with the replace functionality -
I vote for allowing programs to destroy themselves :)
-
@joyrider3774 it was a pleasure to read your post. Very nice project. Maybe this is interesting for you: Did you saw @faz808 ideas and @pianofire s implementation of QR code? https://fuzearena.com/forum/post/8615
-
I never got around to fixing this after the patch I think it needs some refs adding. I got it working to some extent but there were problems with longer messages. It didn't help that the two reference sources didn't produce the same output!
-
aren't qr codes more limited as to how many data you can store ? but it could still be nice to have something like that and implement it in a game somehow but i guess you'd need todo something with the data then. One idea that comes to mind is for submitting online highscores to a generic website for your games like create some generic php system and encode the game name / version and highest score in the qr code and let user scan it somehow using phone or so and send the data to your website to submit but not sure one would be able to protect it i mean the url would be visible so you would need some kind of token as well so data can not be tampered with
-
That’s a cool idea! I like it.
-
@joyrider3774 Yes Max data capacity for Alphanumeric is 4296 characters. There is a lot of error correction
-
good news guys i asked @pianofire if i could share the code and it was ok.
So i released the PC Part of it all on my github and the code is there with it but i also created a share but don't know when or if it will be accepted.Usuage video:
-
Oh Delphi! I haven't used that for along time
-
@pianofire i still use it every day at work :)
-
Delphi was great I used it for many years
-
yeah it is still great, they just released their latested version 2 days ago :)
-
Why can't Fuse simply have an option to email a copy of your project? I've wanted to post code snippets before, but wasn't going to retype my code.
-
@Slydog not so simple when dealing with Nintendo I bet ;)
-
What about a Fuze Nintendo mobile companion app? It could allow you to open the programs on a device and to view (and copy) the code from there. Seems like that might be a way to thread the needle with the current terms of service.
-
That sounds like a lot of work. Wouldn’t a screenshot be enough most times?
-
Hey just a quick tip if you need to replace a lot of
"
characters with" + chr(34) + "
and you get recursion limit exceeded. Split up your string over multiple variables and concat them when calling the encode function. I just had todo that and did not know initially where the error was comming fromAlso another tip, copy your program to new file first (ctrl-c ctrl-v) and then do ctrl-h so you can easily replace
"
with" + chr(34) + "
the only place it can cause troubles is with empty strings""
there you need todo manual intervention most probably