Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Codea 2.5.1 (97)

SimeonSimeon Admin Mod
edited October 2017 in Beta Posts: 5,054

Here's what's changed:

• Importing from the Files app works now. Hooray. Or something.

• Craft project templates now add your project name to the top of the file. How else would you know which project you were editing? You wouldn’t, that’s how.

• Changed the default constructor for quat to (1,0,0,0) and its toString() prints (w,x,y,z) instead of (x,y,z,w). If you know what this means then please tell us.

• Added normalize(), normalized(), len(), lenSqr() and conjugate() methods to quat. Bet you didn’t see that coming

Previous thread: https://codea.io/talk/discussion/8811/codea-2-5-1-95

This is being submitted as the final version of 2.5.1. Don't let that stop you reporting bugs.

Comments

  • dave1707dave1707 Mod
    Posts: 7,907

    @Simeon The zip imports now work. I tried a single project and a full zip. The full zip listed all my projects, but I did do an actual import on all of them. I did an import on the single project OK.

    PS. When you do an export projects, is there any way you can also export/import the global variables. I deleted Codea a while back and reloaded it without realizing I didn’t save my global variables anyplace. I guess I can add that to my backup/restore program for future use but it might be handy in the zip file.

  • SimeonSimeon Admin Mod
    edited October 2017 Posts: 5,054

    @UberGoober I did test the Find/Replace reports you made and wasn't able to make it crash. I did resolve a bug that could cause a crash if you deleted a tab containing find results and then attempted to select a result found in that tab.

    (Note I only tried iOS 10 and 11, I recall you are on iOS 9. I'll have to try that too)

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @dave1707 glad it works now. I hadn't even considered exporting the local and global data. That's a good point.

  • Posts: 455

    I'm not able to record on my beta iPad. Is it because it is stuck on iOS 10? My newer iPad (which doesn't have the beta) is on iOS 11 and can record, but the recording seems to use the iOS 11 screen recorder rather than the old in-built recorder.

    Is this an iOS thing or a beta/non-beta thing? If iOS, could Codea fall back to the old method of recording the screen on older versions?

  • Posts: 1,384
    @LoopSpace my Codea bombed when I used the screen capture to photos. Have you tried that?
  • SimeonSimeon Admin Mod
    Posts: 5,054

    @LoopSpace the old method of recording really entangled itself with the main runtime code. Getting rid of it was such a relief, though I get that it leaves iOS 10 and earlier behind. Not having the feature is bad, but keeping it meant more old code to maintain into the future so we made a trade off there.

  • edited October 2017 Posts: 1,384

    @Simeon I placed an item on the tracker, as Anon as I forgot my bitbucket password, with regard to dropping the camera and video options in the bottom left-hand corner as iOS has those features built in. That would leave the ext/pause and restart controls.
    In retrospect loss of the camera would remove the easy option to the project icon which I wouldn’t want to lose.
    Can I suggest adding the latter to the remaining three but arranging them vertically, which would help avoid the iOS multitasking bar on the bottom of the screen.

    Edit: thinking about it further, what about a single button in the blhc wchich could pause activity and allow a number of options from a pull-out or floating window, that would eliminate the need for a separate pause button.

  • I am still getting the crash from searching for things. Can anyone else weigh in on this, preferably someone running iOS 9? It's simple to reproduce: tap the magnifying glass to search for something, then tap back into the main project/code area, and try to type anything. Crash-a-rooney!

  • I'm not sure if anyone else has mentioned this, but there's a very disruptive editor bug around selecting text. Apologies if this is already being tracked.

    To reproduce:

    • open Learn Craft
    • Scroll to the bottom of the Scene tab
    • Highlight the last word--"end" of course
    • When the keyboard pops up, all the text will have scrolled far up offscreen, and you'll be looking at a blank page

    Those are precise directions, but in my experience it happens all the time, in any tab and any project, if you select something below the top of the file while the keyboard's off.

    It appears to be a bug in the algorithm for scrolling the text up when it would be obscured by the keyboard, to hazard a guess.

  • If I may, I'd like to make a strenuous plea for my #1 wish-list item: autocomplete for dependencies.

    Autocomplete won't detect functions and variables in dependencies, let alone class names themselves, meaning to use code in another project you either have to have it all memorized or you have to jump back and forth all the time.

    The lack of autocomplete for dependencies is perhaps the entire reason I can't and don't write truly modular code.While perhaps that's a failing on my part, I'd guess it is also a stumbling block for many others.

    I'll tell you something from my experience, for example, which is that I crawl through the forums and the old posts and I find all this truly great stuff, and I'm left wondering, what happened to these things? Ignatz alone developed and shared tons of demos that other people could have picked up and used as the basis for hundreds of games. For goodness' sake, he developed a basic FPS engine, which I'd wager is the #1 thing beginning gamers want to learn to make.

    But what I don't see on the forums, and I wish I saw, was people using and building on other people's code. It happens a little but not much. I mean, I'd wager that if someone went back through all the old cool projects, and standardized them, and made them truly modular, Codea just might be left with a terrifyingly versatile user-generated game-creation API.

    Going back and making all that old code re-usable is an idle fantasy of mine, tbh. I'd probably never do it, even if dependency autocomplete existed--who has the time?-- but I'll definitely never do it without it.

    I mean, you know, it's discouraging to me that every project made by now isn't using SODA. @yojimbo2000's work there is stunning. But we've still got newcomers coming to the forums and thinking, "what this engine needs is a good standardized UI, and I'm gonna make one!" I was one of those people, once, and a new one came along just last week, as I'm sure you noticed.

    I get it, though. I ran into problems trying to use SODA, myself. I've been trying to solve those problems in ways I can share with others. But if you look at the comments in my SodaSpec code, I recommend people cut-and-paste it into their projects, so they can make use of autocomplete as a learning tool for it, which is in fact what I also do with it. I wrote the code, and I can't make use of it as a dependency because the dependency system lacks autocomplete.

    The dependency system itself is great. And Codea is great. And on this forum you'll find incredible examples of what it can do. But most of those examples went nowhere beyond the forums, and in fact went nowhere on the forums as well, and it makes me scratch my head all the time, wondering why. It could be because the code wasn't modular enough. But it could also be that, even with perfectly modular code--like SODA--it was too hard for other people to really use it--it has been in fact too hard for me to use it--because of the lack of autocomplete for dependencies.

    Whew.

    Sorry to go on and on.

    It might change nothing--newcomers to anything always try to reinvent the wheel, for a while, that's par for the course--but it also might change everything. As is probably, I think, evident, I am humbly imploring the Codea powers-that-be to implement autocomplete for dependencies. :smiley:

  • dave1707dave1707 Mod
    Posts: 7,907

    @UberGoober Just to throw my 2 cents in, I don’t use dependencies and I don't use code written by other people. The reason I don’t use dependencies is because I like to have all of the code in the same project so I can see all the code without having to open up different projects. The reason I don’t use other peoples code is because I like to know what the code does. A lot of time other people’s code is confusing. I don’t know exactly what they’re trying to do or why they’re doing it that way. Also using other people’s code means that you’re pulling in a lot of code you don’t need just to use a few things. And using other people’s code means you’re dependent on them to make changes when something doesn’t work right. That means your code doesn’t work until they fix there’s. My advice to new coders is to learn from other people’s code, but don’t become dependent on it. There’s nothing wrong with new coders trying to reinvent the wheel. Rewriting other people’s code is a excellent way to learn how to code.

  • edited October 2017 Posts: 557

    @dave1707: Clearly the dependency system isn't for you, for the reasons you describe, and I can't fault you for it.

    But I do think you'd subscribe to the general notion that if a feature exists, it should work, and if it works, it should work well.

    Given that the dependency system does exist, and its purpose is to enable modularity for those that see value in that, I think it has a fatal flaw that keeps it from achieving that goal.

    As to the virtues of re-inventing the wheel, I think the priorities you describe are excellent, and Codea should reflect them to the degree that its creators see its primary reason to exist as a tool for learning to code.

  • SimeonSimeon Admin Mod
    edited October 2017 Posts: 5,054

    @UberGoober you are absolutely right that it if it's in there then should work well. I haven't read through your feedback yet, but I will and we'll make some feature requests from it.

  • The structure of a parameter definition for sliders consistently uses the format min-then-max-then-current.

    Defining an OrbitViewer’s range of motion uses the format current-then-min-then-max.

    I suggest standardizing the OrbitViewer to follow the convention established by the parameters.
  • edited October 2017 Posts: 557

    I am somehow destroying the camera and crashing my project (but not Codea itself).

    The message I get is this:

    Component - N10CodeaCraft6CameraE has been destroyed.
    stack traceback:
        [C]: in ?
        [C]: in metamethod '__newindex'
        Main:93: in function 'update'
        Main:101: in function 'draw'
    

    And my code is this (it's an attempt to modify the Cameras project):

    https://gist.github.com/DolenzSong/d9c26576872ea5df8a11f1b336e8448a

    To reproduce:

    • After starting the project, scroll down in the parameters and tap the button that reads "OrbitViewer" (it also has an emoji)
    • Do something or do nothing, it doesn't seem to matter
    • After 25-35 seconds the project crashes with that error.
  • SimeonSimeon Admin Mod
    Posts: 5,054

    @LoopSpace the video recording should be available on iOS 9+. We migrated to ReplayKit, an Apple API introduced in iOS 9. So it should work, if it isn't then it's a bug. Though occasionally I have had screen recording fail to work on my iPad until after I restart it (both ReplayKit and the iOS 11 control center recording option).

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @Bri_G does Codea consistently fail to capture the screen and video for you? We'll have to look into it. Which version of iOS?

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @UberGoober autocomplete for dependencies is absolutely something we should do. I have a feeling it will be easier to implement than I expect, and your points are correct. I find myself not using dependencies for the exact same reasons. (Also, an easy way to switch to dependency code.)

  • Posts: 1,384

    @Simeon yes consistently 5 seconds after pressing the camera save icon
    iPad Pro 9.7 iOS 11.0.3(15A432) Code 2.5.1(97)

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @Bri_G I will try to reproduce, does video recording work for you?

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @UberGoober the Find/Replace crash has been fixed. I was using an iOS 10+ only API. Reverted to an iOS 9 compatible API. It hasn't made 2.5.1 (that's "In Review" atm with Apple), but it will make the next update.

  • edited October 2017 Posts: 1,384

    @Simeon
    Video - I find a little messy - first try it recorded a snapshot to the photos app. The icon going red screen cleared until icon pressed again. Then it opened a play window from which you can save or export (note the text and export options are faint could they be enhanced by line thickness darker colour or button?

    The returned to normal screen tried recording second video (without exiting the app) and the play window opened icon not red. Looked to save again OK. Repeated several times and eventually Codea crashed. Probably be better to replay videos in photos app the replay screen can be confusing. Mentioned this before and someone pointed me to the iOS recorder.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @Bri_G hmm I think we are just presenting the standard iOS screen recording interface at that point in time. It's supposed to have advantages over our old recording method: records sound, captures the full UI, records at higher frame rate. But it seems like there are some issues.

  • Posts: 1,384
    @Simeon looks like a good package, might be associated with full exit of the iOS sub program before releasing control to Codea. Did you see my note and issue on the control panel on the bottom right hand corner of the screen, a single pause button opening to a toolkit record/snapshot/etc could be a better option avoiding a clash with the multitasking slide up window and allows a springboard to further options.
  • SimeonSimeon Admin Mod
    edited October 2017 Posts: 5,054

    @Bri_G I did see that, but I'm not sure how the buttons in the bottom left would clash any more or less than a single button in the bottom left corner?

    (What's the multitasking slide up window?)

  • Posts: 1,384
    @Simeon that's the app bar which allows you to tap and switch to different apps without double tapping the home button. I kinda like that but it's easy to pull up if you are stroking near the bottom of the screen so some of the buttons in the bottom left hand corner can be misinterpreted by the touch sensing. The bar takes up quite a lot of the lower screen real estate.
  • SimeonSimeon Admin Mod
    Posts: 5,054

    @Bri_G oh yeah I know what you're referring to

    I'm trying it out now and the tap vs. swipe from screen edge are quite distinct. I'm not able to swipe a button and accidentally invoke the dock. Though maybe I just need to try it out more.

  • edited October 2017 Posts: 415

    while on the topic of screen capture!...another plea to save the screenshot in .png format, so as to preserve the alpha channel.

  • @Simeon yay! You found it and fixed it, yay.

    On the subject of swiping near the edge of the screen:

    I've been running into a recurrent issue that's troublesome. If I have a slider whose value starts at the leftmost position--say it ranges from 1 to 10 and the default is 1--very, very often when I try to slide the slider I end up swiping the whole project closed and being dumped back into the editor.

    I wasn't even aware of swipe-to-close-project before this conflict arose, so I certainly wouldn't miss it if it was gone. Would anyone else?

  • Posts: 1,384
    @Simeon you are probably right, I just need to be more careful when I'm using it. Although if Apple continue adding features around the screen edge we'll have to limit our in app interactions to a rectangle near the centre!!!!!
  • Posts: 455

    @Simeon How does blendMode work for craft materials?

    In order to get alpha to work, I appear to have to set material.blendMode = NORMAL. However, when I did that (on a complicated project), I got black traces of other objects on the screen.

    Doing a bit of printing, I see that the default blendMode on craft.material is not one of NORMAL, ADDITIVE, or MULTIPLY but has constant 3. I've tried looking at the shader, but I can't see the effect of that (I can see stuff like ENVMAP_BLENDING_... which I presume is what blendMode sets).

    So there seems to be something happening to all materials when I set the blendmode on one material.

    Maybe there's a different way to do what I'm trying to do. What I have is a plane with a map which has some alpha, and I want that alpha to be noticed. I know that with meshes, we had to be careful with drawing order to ensure that alpha worked as it should. What's the equivalent with models?

  • Posts: 455

    @Simeon Here's code to reproduce the blending mode stuff:


    supportedOrientations(LANDSCAPE_ANY) function setup() displayMode(OVERLAY) scene = craft.scene() cam = scene:entity() cam:add(craft.camera) cam.position = vec3(0,5,7) ball = scene:entity() ball.model = craft.model.cube(vec3(1,1,1)) ball.material = craft.material.preset("Surfaces:Basic Bricks") -- ball.material.blendMode = NORMAL ball.position = vec3(0,0,6) shadow = scene:entity() shadow.model = craft.model.cube(vec3(1,1,1)) shadow.position = vec3(-1,0,7) local mat = craft.material("Materials:Basic") mat.map = "Cargo Bot:Codea Icon" mat.blendMode = NORMAL shadow.material = mat crot = quat(1,0,0,0) crot.x = 1/math.sqrt(2) crot.w = 1/math.sqrt(2) cam.rotation = crot end function draw() scene:update(DeltaTime) scene:draw() end

    I get a black square in the middle of the screen. It goes away if I comment out the mat.blendMode = NORMAL line, or uncomment the ball.material.blendMode = NORMAL line.

    (Incidentally, when I exported this project as a zip file, it included some deleted tabs.)

    I just realised that this was actually on the published version of Codea. I'll check on the beta.

  • JohnJohn Admin Mod
    Posts: 584
    @LoopSpace this sounds like a rendering state bug. If you send me a project that causes this issue I can debug it.
  • Posts: 455

    @John Is the code I posted just before your reply sufficient?

  • edited October 2017 Posts: 415

    for me, the commenting out of a section of code using - -[[ and - -]] does not show up as green in the editor anymore. Nevertheless the code is disabled.

  • JohnJohn Admin Mod
    Posts: 584

    @LoopSpace Hah, I missed that!

  • dave1707dave1707 Mod
    Posts: 7,907

    @Simeon This is no big deal, but I’ve noticed this several times but haven’t been able to recreate it at will. Sometimes when I open Codea, it will show me the screen from a program I ran maybe several days ago, then show me the list of projects or the text of a project I was in depending on where I was when I previously closed Codea.

  • dave1707dave1707 Mod
    Posts: 7,907

    @Simeon I’ve been able to recreate the issue mentioned above.

    1. Open a project in landscape mode and run it.
    2. Use the finger squeeze on the screen to close Codea.
    3. Open a different project in portrait mode and run it.
    4. Use the finger squeeze on the screen to close Codea.
    5. Rotate the iPad back to landscape mode and open Codea.
    6. You should see the screen from the first program and then the screen from the second program.
  • SimeonSimeon Admin Mod
    Posts: 5,054

    @dave1707 what this sounds like to me is that iOS has killed the app but the last screenshot preserved had your open projects. So it shows the screenshot of the last state while Codea is reloading, then replaces it with the project browser screen. I'll try your steps and see if I can confirm that.

  • dave1707dave1707 Mod
    Posts: 7,907

    @Simeon Here’s something else I ran across that I don’t understand. If I use the Files app and go to on my iPad and do a search for M, I see 5 files call Main. If I long press on those files and select info, it shows that they belong to a Codea project. The thing I don’t understand it why do I see them as Main and only 5 of them when I have hundreds of projects. If I delete them, they delete the Main tab in the project they belong to. The same for I. I see a few files called Info that belong to some projects. I haven’t tried deleting any of those to see what happens.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @dave1707 I guess with Codea supporting the Files app you could potentially do things that you wouldn't be able to do in Codea. Like delete the Main tab of your project.

    I'm not sure why it only shows some files and not others, though. Maybe it's capping the search results? My iPad shows significantly more results for "Main" (but I can't be sure if it's all or just some).

  • dave1707dave1707 Mod
    Posts: 7,907

    @Simeon I think the Files app is unpredictable. Why does it show some Main files, some Info files, and some files if I do a search but not when I don’t do a search.

  • SimeonSimeon Admin Mod
    Posts: 5,054

    @dave1707 It's also surprisingly buggy in the UI. Overlapping text, regions that become un-scrollable

    Closing this thread and discussion continues in the new one here:
    https://codea.io/talk/discussion/8836/codea-2-5-2-98

This discussion has been closed.