Codea 3.1 (203)

@Simeon @dave1707 given the URL of a text file is there anyway to load the file into Codea? I would like to avoid having to copy my files to the ipad each time. I usually use readText(fileName) when the file is stored locally. Actually the file would be in json format.

@Simeon The example in Craft, 3D Asset Viewer need updated.

A lot of the examples in Craft and Examples need updating. Some of them in Craft don’t respond to touch and eventually crash Codea after they’re forced closed.

The brickout program in Examples has a problem. After several hits, the ball will hesitate for about 3/4 seconds as the sound plays when the ball hits anything.

Same with Lua Jump. After awhile the character will pause while the sound is played.

Craft World Generator crashes Codea.

@Simeon - @dave1707 may have covered this but the learn craft demo uses a json file and trying to find it in the documents file is impossible as when you click on the selection brackets the file display does not show the text/json files present. They are not in documents or environments. Perhaps we need a separate folder for scripts.

Please keep the scripts and textures together for the 3D objects - perhaps we need a folder for that purpose for users to place 3D assets. In the long term I think we’ll have to get used to placing these assets in you project folders but during development a generalised folder could be useful.

Out of interest, since I hardly ever do it, do you have to place assets in your project folder using the file app?

@Simeon The print function isn’t working the way it should. Values separated by a comma aren’t always separated when printed. See the third and sixth print.

function setup()
    print(1,2)
    print(11,22)
    print(111,222)
    print(1111,2222)
    print(11111,22222)
    print(111111,222222)
end

@dave1707 I’ve fixed the sound issue. Looking into the example projects now too.

The print issue is not a bug but just an issue with tab characters. The comma separated print in Lua is equivalent to using the tab character \\t to delimit strings. So print(1,2) is the same as print("1\\t2").

The tab character lines up its spacing at specific column counts. So when you have two strings of just the right size, the tab character can actually align them fairly close together, as it’s supposed to align the strings into columns over multiple prints.

At some point the first string “bumps” the second string up to the next column. It’s just that the spacing can get quite tight before it does so. See the image showing how the columns line up.

@Simeon Here something I put together. The tab spacing just isn’t right. You might have to scroll the image up/down to see all of it. I added a long row of eights at the top and bottom just for alignment. The tabs/printing is lousy. If printing stops just before a tab position, then a double tab should be done to increase the space between the first and second number.

@Simeon Version 198 fixes. I’ll add things as I test them.

I tested the sound delay on the Brickout game and the delay for sound is fixed except for the very first time that a sound is made. There is still a delay there. Adding a sound call when the program first starts fixes that.

Ran all the projects in Examples and Crafts. Everything ran OK. Received Assets warnings on Blocky Characters, Voxel Terrain, Voxel Player, and Block Library.

Parameter.clear with parameters was OK.

Not sure about the other fixes. Don’t know what they’re were.

@Simeon - quick one on model loading, just added obj model which displays correctly - but the model seems to take ages to load. This is a Dropbox model and I was wondering if the model is being downloaded each time instead of loading from the local mirror of Dropbox. I synced the Dropbox folder but still a delay before presenting object image.

@Bri_G it should always be local when you run your project (the Dropbox folder). How big is the model?

@dave1707 thank you for catching those warnings on those projects

The other fixes all came about from investigating why many of the example projects were hanging / crashing, so thank you for pointing that out.

@Simeon - just short of 800 vertices but a number of textures, I would have thought that was OK for rapid loading. Fiddling with project to test timing.

@Bri_G @Simeon I created a model with a vertexCount of 28,933 and it took 1.08 seconds to display. It’s in my Codea Dropbox folder. I’m not doing anything with texture.

@Bri_G yeah that model is tiny it shouldn’t load slowly

@Simeon did you change the line numbering? a line number over 999 is now 10…
I don’t like that, my tabs are often longer than 999-bad programming style i guess!

By the way, often i have to press on a search item twice to jump to the correct location- a bit annoying.

@Simeon - I also noticed that when selecting an asset in the craft.model() parentheses that the path is slow to appear. Is the model loaded/parsed at that stage?

@piinthesky I did change it but that’s a bug! I’ll fix

@Bri_G hmm which model iPad are you running? It does have to do a bit of work to figure out the asset code to put in between the parentheses

@Simeon The autocomplete is a whole lot easier to read now.

Line numbers over 999 now show correctly. I guess that’s good until 9999. I never ran into the 999 problem because I don’t write anything that big in one tab.

3D Asset Viewer still shows a lot of assets warnings.

@Simeon This gives an error.

    img=image(CAMERA)   

Main:3: bad argument #1 to ‘image’ (string expected, got table)
stack traceback:
[C]: in global ‘image’
Main:3: in function ‘setup’

@Simeon - iPad Pro (9.7-inch) iOS 13.2.3

@John @Simeon a surprising observation (at least for me)…if i have a scene with a lot of 3D models resulting in a low fps (around 13) and I then zoom in so that only one model is actually onscreen the fps stays the same! I am pretty sure that before Craft the fps did depend on the number of onscreen objects. I thought opengl culled offscreen objects?