Howdy, Stranger!

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

Codea 1.5 (Beta 20)

SimeonSimeon Admin Mod
edited February 2013 in Beta Posts: 5,362

This beta (17) could be considered a "release candidate."

It has a lot of little enhancements relating to handling error messages, polish, documentation and example projects. As always, please report any bugs you find here. The release notes have detailed changes.

From now until submission (when the localisation is finished) I'll be trying to fix bugs.

Tagged:
«1

Comments

  • Posts: 502

    Looking nice! Tried a few of my projects and after some tween easing renamings it seems to work fine. The only issue right now is that search results that I click on scroll a bit to little in the editor, especially if the result is in the end on the tab, so that there is no lines below it to scroll.

    Might be nice to have an introductory project next to getting started. Or think about the order of the example projects for a beginner. More like lesson 1, lesson 2. Just an idea for future versions. Was a bit surprised to see the ui in swedish. :)

  • Posts: 1,255

    17 is blowing up when I create a new class.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Tried your bug @Mark. When i create a new class codea is still alive, but the tab is completely empty (no pre-written functions). Ipad1, ios5.1.

  • edited February 2013 Posts: 502

    Ah, mine too, crashes with new class. (And I'm afraid to say that the swedish translation is a bit messy, with some faults, but maybe I can change the language of my iPad to avoid that. :) )

  • SimeonSimeon Admin Mod
    Posts: 5,362

    .@tnlogy is the Swedish translation bad enough that I should remove it from the release? Anyone can edit it at http://translate.twolivesleft.com

    .@Mark I am unable to re-create this, does it happen every time for you? In every project?

  • Posts: 502

    Yes, you should remove it. I've seen so many strange mistakes now I'm afraid. Drives me crazy. :) :P. Maybe I can help out later on.

    Have only crashed once for me after an evening of tests, so I think it is stable enough, except if that new class error is happening often.

  • Posts: 1,255

    @Simeon Yep, seems to be every time, in projects small and large. When I create a new class, the tab appears empty, without to usual boilerplate text. If I touch this tab, I get kicked out of Codea. When I come back in, the tab is still there, and still blank, but from then on it works normally.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    .@tnlogy will do on the removal. What is the new class error? I keep trying to make new classes and am unable to get anything unusual to happen.

    Is it possible to describe in more detail? (I.e. step-by-step)

  • SimeonSimeon Admin Mod
    Posts: 5,362

    .@Mark thanks for the more detailed explanation. That's very strange, I am unable to get this to happen on my device — perhaps it is a release mode only bug.

  • Posts: 1,255

    I'm on an ipad2, still running 6.0, if that helps (on 3G at the moment and haven't spent the bandwidth to move to 6.1)

  • BortelsBortels Mod
    Posts: 1,557

    Downloading now...

    I know it's way too late, but parameters now? Crazy good. Id like a way to make them full screen, ie have a program that was only parameters - sliders and such - and no main screen.

    You guys never cease to amaze me, btw. I know people have asked before, but I want to use this environment (or something very similar) on the desktop. Just saying. Love2d, my goto for that, is lovely, but I want the full codea API. But I don't want to take time away from the iPad version. Is a puzzlement.

  • SimeonSimeon Admin Mod
    edited February 2013 Posts: 5,362

    Thanks @Mark, it happens to me too, but only with the TestFlight version. I'll have this fixed soon.

    Thanks for the kind words @Bortels! Glad you like it. I want to do a Mac version very much.

    Edit: This bug is really odd. Doesn't happen in anything except the version on TestFlight, which is extremely hard to debug. I'm starting to think the App Package was corrupted in some way.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    Okay I figured out the new class bug. Next build will have this fixed.

  • Posts: 563

    +1 for the Mac version. Coding graphic intensive apps on Codea is at least an order of magnitude easier than Xcode.

    I have almost completed another app headed for iTunes - is there an updated runtime in the works?

  • SimeonSimeon Admin Mod
    Posts: 5,362

    Sorry @Reefwing, the new Runtime will take a bit of time. Though given you are a beta tester, I would be happy to start sending you some stuff early so you can try an App Store submission.

    I plan to re-design the whole process for Codea Runtime. Having the source is nice, but most people just want to compile their app, and the rest want to add functionality to the runtime.

    I'm thinking about a simple static library with a formalised extension architecture, so you can easily add your own extensions. I was hoping to work on some useful pre-packaged extensions too, such as iAds, Game Center, and so on.

  • Posts: 563

    No drama .@Simeon, my new app isn't using any of your funky new bits so the old runtime is fine for now. I've been working on understanding the physics library better and will do a tute on that to coincide with the app release.

    Happy to test out the new runtime when you get to it.

    I agree with your thoughts on a modified workflow. Exporting to an Xcode project format would be awesome. It would also be nice to test iAds and Game Center from within Codea but I suspect that may not be possible.

    The extensions are a good idea too. I'm sure the community would put out useful stuff and it would mean that you and the boys at TLL don't have to do all the heavy lifting. Access to some of the standard UIKit controls would encourage more utility apps.

    BTW v1.5 looks fantastic, the documentation format is a lot easier to use and the new animation functionality is great. I'm going to have a play with that next. I still haven't quite got my head around the whole shader thingy (yet).

  • Posts: 502

    I would also enjoy an early release for an app store submission. The current runtime seems to be much slower than Codea 1.5, which is a good rating for the new Codea. :)

    Would be nice if the runtime would create a community in the future, for adding different functionality.

  • Posts: 2,161

    .@Simeon: some "issues".

    1. I'm still getting the odd editor issue with long lines where the cursor isn't where the display thinks it is.

    2. I notice that strokeWidth now takes into account the matrix. This is ... interesting. I broadly like it (though have to rejig a few bits of code) except that it is possible to define the scale in 3 directions but the strokeWidth only in one. So if one wants a consistent strokeWidth regardless of the matrix (as was the old behaviour), one is scuppered by scale(10,20) strokeWidth(??) - that is, there's no value there that ensures a consistent line width. (example in the code below)

    3. The tooltips gets confused by tables. It seems to just count commas but if an argument is a table then the internal commas should not be counted (example in the code below).

    4. The tween documentation could do with a list of the possible loop settings and an example showing how to set both a loop and easing. The Animations sample program helps here, but it would be nice to have an example in the docs.

    5. Also in the tween documentation, in the explanation section you have {x: 10} when it should be {x = 10}. That confused me!

    6. After doing lookup there's no obvious way to get rid of the documentation window. After a while, I remembered that the triangle did it. Maybe the documentation-eye could also function as a close button here since if I press it once it effectively replaces the lookup view with the documentation view, and then it can be used to close it. So pressing it twice effectively gets rid of the documentation.

    Here's some code demonstrating the strokewidth feature:


    function setup() x = WIDTH/2 y = HEIGHT/2 L = 300 tw = {xs = 1, ys = 1} tween(3,tw,{xs = 21, ys = 1},{loop = tween.loop.pingpong}) end function draw() local xs = tw.xs local ys = tw.ys local x = x / xs local y = y / ys local Lx = L / xs local Ly = L / ys background(69, 69, 69, 255) scale(xs,ys) strokeWidth(5) stroke(153, 141, 26, 255) noFill() ellipse(x,y,Lx,Ly) end

    (Must admit, I quite like this one!)

  • SimeonSimeon Admin Mod
    edited February 2013 Posts: 5,362

    Thanks for your great feedback, Andrew.

    Interesting example project. It's probably something you could account for inside a shader. The ellipse you are drawing just uses a simple shader (you can actually see the code in the "Patterns" pack of shaders). You could pass the non-uniform scale into the shader to adjust the stroke widths unevenly, maintaining the width under different scales.

    1. I know about this one, but I can't fix it without completely rewriting the editor. Which I plan to do after 1.5 (it will take a long time to rebuild all of Apple's text editing controls from scratch!). I have a workaround that fixes the issue, but performance is quite slow. I guess I could release this workaround as a beta version to see what you think.

    2. I actually changed this behaviour on @mpilgrem's suggestion. I realise that scale-invariant stroke widths could be useful, but it did seem like the right way to go. The old version of noSmooth() line was drawn using the GL_LINE primitive. This resulted in clipped end caps and, because the line consisted of only two vertices, the scale only affected the end points.

    3. I forgot about that bug. I'll see if I can fix it now.

    4. I could probably add this to the English docs, but it would be too late to make localisation. I might have to consider this for next release.

    5. Good catch, fixed it. I thought I had fixed all of those occurrences. @John briefly forgot the table syntax when writing the initial draft of the animation docs. We can only put it down to too much javascript.

    6. Using 'Lookup' should cause the reference 'eye' button to become highlighted. Tapping the eye button will dismiss the documentation as normal. I am unable to create a situation where using Lookup does not highlight the eye button.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    Beta 18 is uploading. This fixes the create new class bug and a number of others I stumbled upon while working. Also removes the Swedish translation and includes the latest localizations.

  • Still cannot create multiple tabs with saveProjectTab().


    -- Will only create tab "5" in project |pname|. function createSomeTabs(pname) for i = 1, 5 do saveProjectTab(pname..":"..i, "-- Contents of tab "..i) done end
  • edited February 2013 Posts: 489

    Hello @Simeon. Are you still looking for possible shaders for the example packs? The following example from earlier in the beta testing now has suggested bindings, for added interest:

    Vertex:

    //
    // Vertex shader: Mandelbrot
    //
    
    uniform mat4 modelViewProjection;
    attribute vec4 position;
    attribute vec2 texCoord;
    
    varying highp vec2 vTexCoord;
    
    void main() {
        vTexCoord = texCoord;
        gl_Position = modelViewProjection * position;
    }
    

    Fragment:

    //
    // Fragment shader: Mandlebrot
    //
    
    precision highp float;
    
    uniform float minRe;
    uniform float minIm;
    uniform float fRe;
    uniform float fIm;
    uniform int maxIter;
    
    varying vec2 vTexCoord;
    
    void main() {
        int iter = 0;
        float cRe = minRe + fRe * vTexCoord.x;
        float cIm = minIm + fIm * vTexCoord.y;
        float zRe = cRe;
        float zIm = cIm;
        float zRe2 = zRe * zRe;
        float zIm2 = zIm * zIm;
        while ((iter <= maxIter) && ((zRe2 + zIm2) < 4.0)) {
            zIm = 2.0 * zRe * zIm + cIm;
            zRe = zRe2 - zIm2 + cRe;
            iter++;
            zRe2 = zRe * zRe;
            zIm2 = zIm * zIm;
        }
        float c = float(iter) / float(maxIter);
        float r = mod(c * 11.0, 1.0);
        float g = mod(c * 5.0, 1.0);
        float b = mod(c * 7.0, 1.0);
        gl_FragColor = vec4(r, g, b, 1.0);
    }
    

    Bindings:

    int maxIter = 255
    float fIm = 2.7/math.pow(3, ElapsedTime/3 % 6)
    float fRe  = 2.7/math.pow(3,  ElapsedTime/3 % 6)
    float minRe = -1.1531 - 0.8469/math.pow(3, ElapsedTime/3 % 6)
    float minIm = -0.3069 - 1.0431/math.pow(3, ElapsedTime/3 % 6)
    
  • SimeonSimeon Admin Mod
    Posts: 5,362

    That's fantastic, @mpilgrem. I will definitely include it under "Patterns". Thank you.

    .@Codeslinger looking into it and will fix, thank you for the report.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    .@Codeslinger fixed the saveProjectTab bug — it happened when saving to an external project (i.e. not the currently running project). Next build will have this fix.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    Beta 19 going up with the saveProjectTab() bug fixed.

    I forgot to include @mpilgrem's excellent Mandelbrot shader, but it will be in for the next / final build. (In the "Patterns" shader pack.)

  • Posts: 489

    Hello @Simeon. I have a few observations on beta 1.5(19):

    1. The print bug here still affects the beta for me, causing Codea to crash.

    2. The in-app reference for Easing Types still omits the existence of tween.easing.circIn, .circOut, .circInOut and .circOutIn (which do exist).

    3. The in-app reference for tween.stop(id) and tween.reset(id) still refer to id as being type 'number'.

    4. Am I imagining it, or are the names of the Example Projects below their icons more transparent than the corresponding names of the user Projects? (I prefer the latter, if they are.)

  • SimeonSimeon Admin Mod
    Posts: 5,362

    .@mpilgrem thank you for this

    1. I'll try to fix this one tonight

    2. I know they exist, but they are quite exotic easing types and add four entries to the documentation. I thought it might reduce clutter in the docs (and autocomplete) by omitting them.

    3. Fixed

    4. It does kind of look like that. I think it's an optical illusion caused most of the backgrounds being darker towards the bottom.

  • edited February 2013 Posts: 489

    .@Simeon, I see what you mean about the clutter when listing each of the tween.easing fields individually in the in-app reference. Have you considered this approach: having a page only for tween.easing and then describing its fields in the narrative for that page (as you do when documenting the easing argument of the tween() function)?

    That would probably be more useful than just a list of each field (recognising that the current pages for each field of tween.easing do not currently contain any explanation of the field).

    Also, the narrative for tween.easing could go on to explain the arguments that each of its easing functions take, helping users to write their own bespoke easing functions with the same structure of arguments and return value.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    That's a good idea, @mpilgrem. It does make sense to bundle them into a single page, however I am thinking at some point down the line to include an image for each of the tween.easing.* entries, showing its curve. This would justify the one-per-page approach, I think.

    Unfortunately I can't really touch the documentation anymore — every change I make causes delays due to localization, but it's good to keep in mind for the next release.

  • I didn't read through all changes but it seems to be a given that stored data always comes back as a string now (e.g. with readLocalData()) even if it is a number, at least if Jmv38 is better informed as hinted in this comment http://twolivesleft.com/Codea/Talk/discussion/comment/18140#Comment_18140 . At the moment this breaks Cargo-Bot if you enter a level set where you have gained stars.

    Funny thing: I came across this problem when I got a report that it misbehaves in loveCodea.

    http://twolivesleft.com/Codea/Talk/discussion/comment/18064#Comment_18064

  • SimeonSimeon Admin Mod
    edited February 2013 Posts: 5,362

    .@Codeslinger odd, I thought I had fixed that. Thank you.

    Edit: Should be fixed in the next build.

  • Posts: 489

    Hello @Simeon. If the 'Arc' shader is of any interest as an example shader (reproduced below, now with added bindings) please feel free to use it.

    Vertex:

    //
    // Vertex shader: Arc
    //
    
    uniform mat4 modelViewProjection;
    
    attribute vec4 position;
    attribute vec2 texCoord;
    
    varying highp vec2 vTexCoord;
    
    void main() {
        vTexCoord = texCoord;
        gl_Position = modelViewProjection * position;
    }
    

    Fragment:

    //
    // Fragment shader: Arc
    //
    
    precision highp float;
    
    uniform float size;
    uniform float a1;
    uniform float a2;
    uniform vec4 color;
    
    varying vec2 vTexCoord;
    
    void main() {
        vec4 col = vec4(0.0);
        vec2 r = vTexCoord - vec2(0.5);
        float d = length(r);
        if (d > size && d < 0.5) {
            float a = atan(r.y, r.x);
            if (a2 > a1) {
                if (a > a1 && a < a2) {
                    col = color;
                }
            } else {
                if (a > a1 || a < a2) {
                    col = color;
                }
            }
        }
        gl_FragColor = col;
    }
    

    Bindings:

    float a1 = math.pi * math.sin(ElapsedTime/5)
    float size = 0.24 * math.sin(ElapsedTime/11) + 0.24
    vec4 color = vec4(ElapsedTime/11 % 1, ElapsedTime/5 % 1, ElapsedTime/7 % 1, 1)
    float a2 = math.pi * math.sin(ElapsedTime/7)
    
  • SimeonSimeon Admin Mod
    Posts: 5,362

    Thanks @mpilgrem, I will definitely include it.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    Beta 20 is out. Includes @mpilgrem's new shaders, and fixes the bug that @Codeslinger mentioned.

    I tried to fix the print bug, @mpilgrem, but I can't manage it in time. It occurs when printing lots of information (i.e. lots of print calls) in a single frame.

  • For everybody who is suffering from the string/number kind of bug (just in case):

    If you saved a number while this bug was around, the number was saved as a string. This means that it will be read back as a string even with the fix in place, it will not be forced into number format. In the worst case you'll have to issue a clearLocalData() or whatever applies to get your data clean again.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Or you can just write x=tonumber(x) after reading x, that will do the job, and at next save x will be saved as a number...

  • Posts: 563

    I'm not sure if this is new but if you use displayMode(FULLSCREEN_NO_BUTTONS) then the triple tap with 3 fingers doesn't seem to bring back the "back" button any more.

    Anyone else experience this?

  • SimeonSimeon Admin Mod
    Posts: 5,362

    .@Reefwing I think I forgot to put it back in when we re-wrote the runtime. It will have to come back in 1.5.1

  • Jmv38Jmv38 Mod
    Posts: 3,295

    Never used this function, but there might be a problem with triple tap: it is set by the 'accessibilty' parameters to make a zoom in the app (you are the one who showed that to me @Simeon), but i've noticed that when activated, the '3 touches' seems desactivated in Codea (i saw that playing with Spacemonkey boucing balls: 2 or 4 touches would work, but 3 would do nothing). So are you sure in this case 'triple tap' will work and not be cancelled by ios?

  • SimeonSimeon Admin Mod
    Posts: 5,362

    Interesting point @Jmv38. I guess if you have certain accessibility features enabled — such as triple-tap-to-zoom, they will override any apps that use them.

    Maybe a four-finger tap then, though that seems a bit much.

  • Posts: 563

    .@Simeon - might be easier to just leave it out and take it out of the documentation. You can always implement your own close button if required.

  • edited February 2013 Posts: 489

    Hello @Simeon. I think the following is a bug in beta 1.5(20):

    The in-app reference for 'buffer' implies that user-defined buffers can hold data of type 'float'. However, when I try to set a 'float' attribute per vertex using the buffer mechanism, all that seems to be stored/returned is an array of 'zeroed' vec3 data.

    On the other hand, the in-app reference for 'buffer.set' implies that user-defined buffers can not be of type 'float'.

    (Update) The work-around is to use vec2(x, 0) and myAttribute.x when only x is required.

  • Posts: 1,255

    For what it's worth, I have a couple of apps that use triple-tap to access security settings, so it is being used by other apps.

    Not to say it should be.

  • Jmv38Jmv38 Mod
    edited February 2013 Posts: 3,295

    I am working on a window tool and i get many crashes. I do many edit/run/stop cycles and have the feeling the memory is not correctly cleaned up inbetween, because there is no error but after 5 to 10 cycles i start getting a black screen, and eventually a crash. I have the feeling it is a new behavior, because i always work hat way. Anyone having the same problem?
    [edit] i have added collectgarbage() at the beginning of my setup() => not a single crash since.
    I saw later that there was a missing popStyle() in my code. I remember another time (months ago) when i had the same kind of problem and i linked that to a missing popStyle() too.

  • edited February 2013 Posts: 489

    Hello @Simeon. I am experiencing something similar to what @Jmv38 describes above. If I work through my projects, opening them, running them, closing them, I get to a couple where the Viewer is black when run and then Codea crashes. Rerunning Codea, the projects in question then run fine. I will try to experiment to see if I can be more precise about the circumstances.

    (Update) I am reasonably confident that it is not project-specific behaviour. I have to open/run/close a large number of projects for the odd behaviour to manifest itself. Most recently, the manifestation was that the Codea home screen stopped rendering any icons for user-created projects (and then Codea crashed).

    (Further update) I also tried a large number of run/stop/run cycles with a single project, with no problems - so perhaps it is something to do with open/close/open cycles.

  • SimeonSimeon Admin Mod
    Posts: 5,362

    .@mpilgrem @Jmv38 thank you for finding this. I'll look into it.

    .@Jmv38 it's very strange that collectgarbage() helps with the issue. I'll check it out.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    BUG using saveProjectTab: after modifying part of a tab with string edition, the editor does not work correctly in the edited zone: when i select some characters, it is a different region (some 10 characters before) that is really edited. I have to kill and restart codea to get it right. Closing the project isnt enough.
    Btw, how should i implement line breaks? '\n' works, but should i do '\n\r' instead? Could it be the cause of the problem?

  • SimeonSimeon Admin Mod
    edited February 2013 Posts: 5,362

    Hmm I've been trying to recreate this crash behaviour on my iPad 3. I spent about 30 minutes opening, running and closing example and user projects over and over again (i.e. going all the way back to the project browser screen each time). I have been unable to get it to happen. I'll have to try more.

  • Jmv38Jmv38 Mod
    edited February 2013 Posts: 3,295

    With that code i get the black screen about 1 out of 2, but no crash: https://gist.github.com/JMV38/4752973
    There s a way to accelerate or remove the crashes: play with the win.w or.h parameter: the bigger, the more problems. These param are there in the code, win.w=800,win.h=600! With win.w=400 i am ok but win.w=1000 never works. It is clearly a memory problem.

    Windows = class()
    
    function Windows:init()
        self.window = {}
        --<windows>
        local name = 'details'
        local win = Window({})
        self.window[name] = win
        win.top = 200
        win.left = 800
        win.w = 200
        win.h = 200
        win.name = "details"
        win.HEIGHT = 1024
        win.WIDTH = 768
        win:refresh()
        local name = 'console'
        local win = Window({})
        self.window[name] = win
        win.top = 50
        win.left = 0
        win.w = 800
        win.h = 680
        win.name = "console"
        win.HEIGHT = 1024
        win.WIDTH = 768
        win:refresh()
        --</windows>
    end
    

    Ipad1, ios5.1, Lanscape

  • SimeonSimeon Admin Mod
    Posts: 5,362

    Thanks @Jmv38 I'll check it out.

Sign In or Register to comment.