Yeah, I have accessed the jsons several times before. Thanks for the tutorial
This is interesting! I'm not quite sure how it would display volume though, if this does work. I'm not an expert at jsons and Hopscotch, though.
Took a quick look. No control of the sound pressure level or decibels (typically dBA) are exposed.
That's interesting, it sounds like it is more probably in the app itself.. (the JSON just has the data/contents for each project, and its blocks, its creator and things, doesn't it)
I would also like to thank you ThinBuffalo, I felt encouraged to peek around too after seeing what you'd been doing with the JSON files in Hopscotch
I saw your topic. It's great that you're exploring the json data and "thinking outside the box". I didn't want to jump in as sometimes the act of discovery is a big part of the fun , but if you have any questions feel free to tag me. I'll be glad to help if I'm able to.
I believe I'm just about ready to ask someone else to test the program I wrote to fix a project that's been inflated with unnecessary data. Are you interested in trying fix the project you previously mentioned that has severe editor lag?
I'm still finishing some testing, but I was able to reduce the size of one of my projects from 7.8 MB to 163 KB
Issues the program should fix:
- severe editor lag
- draft won't upload (if you put up with the lag long enough, the file will eventually get too large to upload)
For now I just need to know if you're interested & I'll let you know when it's ready and give instructions.
Yes please! I will be more than happy to try it out for you. Looking forward to it :)
I forgot to make sure that you have access to a Windows PC?
The program I created is a Windows exe.
No, I don't, but I do have Winebottler which allows you to run .exe files on Mac. How does it work? Do you upload a file then it will generate the code?
Ah. That will be a really good test then
For now, you save a local copy of Hopscotch project data via iTunes. Then just run the program, pick which file you want to "clean" & save it when done.
You may need to inspect the files first to figure out which file it is that needs to be cleaned. But it's obvious enough for me to just sort the the files by size from the file selection dialogue.
That gives me a good idea. In an update, I'll think about adding an option to enumerate all the files in the project folder and display a list of the embedded project titles to choose from. (Edit: titles aren't included in the json )
Ok. File size is significantly reduced, so for me, it will finally upload to the server. Editor lag returned to the normal amount of lag. And the project appears unaffected by my edits.
Do you want to give this a try yet today? I just need to complile the exe & find a good way to share it...
Here's what it looks like (not fancy)
Yeah, sure! Whenever it is ready. You can post it on Dropbox and share the link.
Here's the link if I did it right:
(Removed by TBSr)
- Save Hopscotch project folder to local drive using iTunes (make a copy of the folder)
- Run exe
- Load file
- I suggest cleaning only "eventParameters" first (this may take a while for large files)
- Change checkboxes to only "traits" and clean again
- Save file
- Upload project folder back to iDevice using iTunes
Let me know how/if it works and any suggestions
@ThinBuffalo Your program is working pretty well on Winebottler. I tried loading up my project, but however when I tried the clean up I got this error message:
Then when I click OK the app quits. I tried this a few times, and no luck. That file was 4 MB. (Will try saving this file from iTunes again later.)
I had another draft lying around, that was 1 MB and had a bit of lag. Worked normally when I loaded that file on the program, cleaned up both eventParameters and traits, and it reduced the file size to 460.9 KB (about half). Uploaded it back to my iPad, everything seems to be working well (no broken references). I don't really know about lag for this project, it never was super laggy like my other project, but it's still a bit slow. This is probably normal because it has quite a few objects and code blocks.
Would you be willing to either publish the project that causes the error & give me a link, or send me the project's json text file via Dropbox?
I'd like to try some troubleshooting and see why the error is thrown.
Ok. I have a copy. Thank you.
I'll try troubleshooting it tomorrow. Was this project with severe editor lag that you orginally mentioned?
I'm thinking it must be a problem related to using WineBottler. Your project cleans without error for me. 4 MBs reduced to 231 KB, and the editor lag is fixed.
I'll publish when we're both online & unpublish after you get a copy back.
Any progress on a fix for the root cause of the keyvaluepair inflation?
I don't mean to harass, just curious.
BTW, it may not be optimized but my fix for the project files is simple & straight forward. Just remove any traits or eventParameters when the "id" isn't referenced elsewhere in the project. It looks like all of the traits & eventParameters that are used may be at the end of the respective value arrays (newest), but I haven't evaluated a large enough sample size to have any confidence of that. For now, I'm just enumerating & searching each id individually. For eventParameters this takes a while as I've seen projects with 10s of thousands eventParameters.