It looks like you're new here. If you want to get involved, click one of these buttons!
I created a project in Codea. Copied it to the iCloud Drive . Did a Codea edit on the iCloud project. Closed the project. I was still in the Codea project list. Looked at the project and that didn’t have the changes. Had to go to the iCloud Drive and the changes were in that project. When the editor closes, shouldn't it stay with the project that was edited. I guess that also means you can have multiple projects with the same name.
Comments
Tried the Export Projects. After creating the zip file, I looked at what was in it. I noticed that it contained the Dropbox asset folder. Also, when I tried the export of the zip file back to Codea, Codea eventually crashed before it showed the projects to restore.
@dave1707 any external projects will not show up on the main screen project list (for now). You'll have to open them for editing from the Files app. The one in your project list just happened to have the same name as an external project.
Thanks for finding the dropbox asset bug, I will test the re-importing. I may have broken it. How did you try to re-import your zip file? From the files app? From somewhere else?
@Simeon I have the zip file in a folder in the Dropbox app. From there I did an export and selected Codea to receive it.
As for the external project, I created a project named 000 in Codea. I went to the Files app and copied that project 000 to the iCloud Drive. From the iCloud Drive, I selected it to open with the Codea editor. I made a change and closed the editor which left me in the Codea project list. I looked at project 000 there and it was still the original project. I went to the iCloud Drive and looked at project 000 there and it contained the changes. So I have 2 projects named 000, one with changes and one without. Is that how you see it working. I don’t mind the 2 projects, I just didn’t like being left in the Codea project list instead of the iCloud file where I started the editor.
@Simeon I came across something that I hope you can change. This has been there for awhile. If I’m making changes or adding code in a project, I noticed that the autocomplete line hides some keys. For instance, if I key the variable b and I want to multiply it by some value, I press the +-*/ key which brings up a group of options to select. The problem is the bottom area is hidden by the autocomplete words. I then have to guess where the * or + or one of the other options is when I select it.
PS. Maybe you can lighten the color of the autocomplete so the background options show thru.
Yeah the editing external projects (for now) will not show the projects in the main editor. I’d like to include them in the main editor under a section called “External” or something so you can easily find them again.
@Simeon I tried moving the zip file from the Dropbox app to the icould Drive. I did a Share and selected Codea. The list of projects came up and I selected a project to import. That worked OK. So I’m not sure why it works from the iCloud Drive and not from the Dropbox app.
@Simeon I selected Share on the zip file from the Dropbox app and the restore worked. Not sure what the difference is with selecting Share or Export.
Strange, I'll give it a try.
@Simeon The autocomplete with popup keyboard buttons works great. Thanks, that was kind of annoying.
@Simeon Codea still crashes on changes. When I’m trying to understand how some code is working, I’ll edit the code, make a simple change, execute the code. After several of those quick cycles, around 6 or so, Codea crashes. Sometimes it's when I execute the code, sometime when I’m keying changes. It’s not just this version, but has been happening for awhile. I think I mentioned this before, but I don’t know if you haven’t found the cause or you forgot about it. It’s not a big deal, but Codea still shouldn’t just crash.
PS. This is playing with voxels.
@dave1707 I would really like to sort this out, any particular project that triggers this a lot? Would the voxel example projects be a good test case for me to start to reproduce your issue?
I've been developing in Codea lately and haven't encountered this — but I've mostly been on 2D stuff.
@Simeon I’ll see if I can put together an example that does it consistently.
@Simeon Here’s a stripped down example that crashes Codea after about 7-8 restarts. It crashed the last 3 times I tried it. Run the code and while it’s drawing the terrain, stop the code to go back to the editor. Run the code again stopping it before the terrain finishes. Keep doing that cycle and after about 7-8 times it crashes for me. Usually in the code I’m working on, I’ll be making code changes and running it to see what happens. Sometimes Codea will crash while I’m in the editor making changes, other time when it executes the code. This is on a 16gb iPad Air with the latest code of iOS and Codea.
@Simeon I tried the above code on my iPad Pro and it didn’t crash Codea. On my iPad Air it crashes every time.
@simeon with my stuff (mainly 3D) i can almost guarantee that Codea will crash the fifth time i start the program (during the setup). Works fine 4 times in a row!
@simeon i find the camera recording works first time, but if i try to do it the second time it will yield just a grey screen when i stop the recording.
@dave1707 thank you for that! I'll see what's going on in that example
@piinthesky sounds like it could be related to the issue dave1707 has
@dave1707 looks like there's a bad memory leak in the voxel stuff, trying to track it down. Your example was a big help
This will be fixed in the next beta
@Bri_G My Air has 16gb and my Pro has 128gb. The program usually runs ok until the 7th or 8th start. It’s probably a memory problem because that’s about the only time Codea crashes.
@dave1707 - have you tried clearing the garbage?
@Bri_G I put garbagecollect in there just for kicks, but the program still cancels after 7-8 restarts. Memory should be cleared when a program starts. I think it’s a Codea memory issue, not a memory issue with the program. The program above is just a test program to show the problem. Under normal conditions, sometimes Codea will crash when I’m in the editor after I’ve gone thru several cycles of making a program change and running a program.
@Bri_G No. The code runs OK the first 6 or 7 times then crashes the 8 or so time. After that it will run 6 or 7 times then crash again. It’s probably a memory issue with Codea itself.
@Bri_G I run the program then exit back to the editor. I run it again then exit back to the editor. I do that 6 or 7 times before Codea crashes. Codea wouldn’t be running my code when I’m in the editor so there won’t be 7 instances running. I don’t think Codea is cleaning up it’s memory upon restarts.
What's happening is that each time dave's project runs it allocates memory for the voxels (including textures)
It was failing to release the texture loaded into memory, leading to around 25 MB of accumulated memory to sit in RAM
Each run keeps accumulating this wasted memory until the iPad decides Codea needs to just back off, and closes Codea
@Bri_G in this case it's lower level than that. We're allocating and failing to free memory at the C++ level. Lua doesn't know about it so it can't be affected by collectgarbage()
@dave1707 build 145 should fix the crash issue due to memory
@piinthesky hopefully this fixes your crash after >5 runs too
@Simeon My code above crashes at 12 restarts. I tried it twice and both times it crashed at 12.
@dave1707 damn, I have a feeling that one is not memory related now but I'll try running over and over on an older iPad
@Simeon The Export Projects works great now. It doesn’t contain the Dropbox folder anymore. One thing I just found out. If you just tap the zip file, it opens Codea for restore.
@Simeon setInstructionLimit is missing. Is that the api you referred to.
@dave1707 hah yeah, that's the one. It hadn't been doing anything for a few years now,
@simeon with 145 consistently crashing on the 6th start (no voxels). Camera recording still gives grey screen on second try.
@piinthesky damn. Is this with a particular Craft project?
@simeon, yes the neutrino telescope one. It is fairly complex, so could be something i do wrong, but surprising it would work 5/6 times.
@Simeon The find/replace doesn’t work right. If I do a replace all, it finds all occurances, but only replaces the first one.
PS. It also looks like it creates blank lines and screws up other lines. It seems to replace random spots.
PS. It looks like it replaces the first occurance, adds a blank line and the replaces where it thinks the next occurance was but it’s not. Adds another blank line and replaces where it thinks the next occurance was but it’s not. So it ends up replacing the first occurance and then just screwing up stuff after that.
@Simeon @dave1707 - just tried to save my projects with the Codea archive option and it failed part way through. I have a lot of project files but I have a 5 minute setting for auto lock so the screen dims if you don’t catch it - are other iOS features put to sleep like file transfer etc by this setting. What setting do most users adopt?
@Bri_G How many projects are to backing up. I have about 530 and it works OK. My projects aren’t that big so maybe that’s a reason. My zip file is 4.9mb.
@dave1707 - I have 466 projects on my iPad Pro but I have tons of graphics in my Code ‘Documents’ folder many in assets folders. Plus I have a very large Dropbox Codea folder mainly filled with graphics. When I backup my system with your utility it’s very fast. When I backup to the Dropbox folder, using the Codea archiving tool, it takes age.When backing up to Dropbox does the Codea backup write first to the Codea Documents/Dropbox folder, then copy that to the remote Dropbox Cloud?
@Simeon Something I just noticed with Export Projects. When I look at the zip file, I see that whatever is in the Documents folder just gets mixed in with the Codea projects. Is there a reason you don’t save a Documents folder with everything that’s in Documents in it. When you were saving the Dropbox folder, you had all the Dropbox files in there instead of mixed in with the Codea projects.
@Simeon @dave1707 - just to show how my Documents folder() is arranged - I have 317 items in there of which 47 are asset files or collection - it also includes the Dropbox folder which includes 148 folders and 259 files.
From Codea my Dropbox assets visible include 3 Shaders,10 text or json files, 21 images and one model.
My Dropbox Codea folder, examined in FileExplorer, has 145 folders and 101 files.
Many of the files are not recognised in Codea, hence the limited number in the Dropbox.assets folder within Codea. What exactly is recorded in the exporting procedure.
@Bri_G No wonder it takes so long to do an Export Projects. The Dropbox folder isn’t backed up, but you say it’s included in the Documents folder. The Documents folder does get backed up, but in my above post I saw that the contents of the Documents folder just gets included with the Codea projects and isn’t seperate as a folder. I don’t know if that’s a bug or was intended that way.
When you use my backup program, I only backup the Codea projects, nothing else.