Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    How i exported fuze code to pc for backup purposes

    General Discussion
    9
    21
    2155
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • joyrider3774
      joyrider3774 last edited by joyrider3774

      I just succeeded in exporting code from fuze to my pc ...

      979862b8-37b5-4338-bbf1-5fa1ffd79cea-image.png

      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)

      WIN_20210225_06_01_59_Pro.jpg

      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

      1 Reply Last reply Reply Quote 11
      • pianofire
        pianofire Fuze Team last edited by

        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

        1 Reply Last reply Reply Quote 5
        • SteveZX81
          SteveZX81 F last edited by

          Simply amazing.

          1 Reply Last reply Reply Quote 0
          • joyrider3774
            joyrider3774 last edited by joyrider3774

            This is another screenshot with the code of my little car game (about 1300 lines of code)

            64cf1915-9097-4b33-859b-2bacbdb3366a-image.png

            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

            1 Reply Last reply Reply Quote 3
            • PickleCatStars
              PickleCatStars F last edited by

              I vote for allowing programs to destroy themselves :)

              1 Reply Last reply Reply Quote 1
              • spikey
                spikey F last edited by

                @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

                1 Reply Last reply Reply Quote 0
                • pianofire
                  pianofire Fuze Team last edited by

                  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!

                  1 Reply Last reply Reply Quote 0
                  • joyrider3774
                    joyrider3774 last edited by joyrider3774

                    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

                    pianofire 1 Reply Last reply Reply Quote 2
                    • vinicity
                      vinicity F last edited by

                      That’s a cool idea! I like it.

                      1 Reply Last reply Reply Quote 0
                      • pianofire
                        pianofire Fuze Team @joyrider3774 last edited by

                        @joyrider3774 Yes Max data capacity for Alphanumeric is 4296 characters. There is a lot of error correction

                        1 Reply Last reply Reply Quote 0
                        • joyrider3774
                          joyrider3774 last edited by joyrider3774

                          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:

                          6b29ce27-d54d-44d2-ad2f-669dadf8a1b4-image.png

                          1 Reply Last reply Reply Quote 5
                          • pianofire
                            pianofire Fuze Team last edited by

                            Oh Delphi! I haven't used that for along time

                            1 Reply Last reply Reply Quote 0
                            • joyrider3774
                              joyrider3774 last edited by

                              @pianofire i still use it every day at work :)

                              1 Reply Last reply Reply Quote 1
                              • pianofire
                                pianofire Fuze Team last edited by

                                Delphi was great I used it for many years

                                1 Reply Last reply Reply Quote 0
                                • joyrider3774
                                  joyrider3774 last edited by joyrider3774

                                  yeah it is still great, they just released their latested version 2 days ago :)

                                  1 Reply Last reply Reply Quote 1
                                  • S
                                    Slydog last edited by

                                    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.

                                    waldron 1 Reply Last reply Reply Quote 0
                                    • waldron
                                      waldron F @Slydog last edited by

                                      @Slydog not so simple when dealing with Nintendo I bet ;)

                                      1 Reply Last reply Reply Quote 0
                                      • AlienDjinn
                                        AlienDjinn last edited by

                                        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.

                                        1 Reply Last reply Reply Quote 0
                                        • PickleCatStars
                                          PickleCatStars F last edited by

                                          That sounds like a lot of work. Wouldn’t a screenshot be enough most times?

                                          1 Reply Last reply Reply Quote 0
                                          • joyrider3774
                                            joyrider3774 last edited by joyrider3774

                                            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 from

                                            Also 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

                                            1 Reply Last reply Reply Quote 2
                                            • First post
                                              Last post