Howdy, Stranger!

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

Codea 2.1.1 Beta

SimeonSimeon Admin Mod
edited December 2014 in Beta Posts: 5,204

Please let me know if the performance issues are resolved in this release. They appear to be in my testing, but I'd like to be sure prior to App Store submission.

Otherwise this is a fairly minor update with bug fixes.

Comments

  • IgnatzIgnatz Mod
    edited December 2014 Posts: 5,396

    I tested two apps

    1. the speed test dave1707 referred to in the 2.1 thread earlier, and the previous speed has returned. :)

    2. my 3D dungeon program, which is graphics intensive. It was above 40 previously, and dipped to 29 with 2.1. It is still at 29 with the latest beta. It's always possible there's another reason, so let's see what others say :-/

  • SimeonSimeon Admin Mod
    Posts: 5,204

    @Ignatz thank you for that! Is your 3D dungeon more graphically or computationally intensive?

  • IgnatzIgnatz Mod
    Posts: 5,396

    @Simeon - lots of meshes - but let's see what others say, wait for confirmation this is a problem

  • Posts: 2,042

    @Simeon, I've also seen speed return to previous with the speed test from Dave. I also tested one my games with a rudimentary fps counter - on 2.0 it was ~50, on 2.1 it was ~30, on 2.1.1 it is still at 30. It's using physics and meshes if that helps.

  • Posts: 1,976

    On 2.1 with dave's speed test, I got 17.2, on 2.1.1, I got 7.8. Pretty much back to normal.

    I also tested out a sandboxy 3D game I was working on, and found that with a large terrain mesh, heightmap shader, godray shader, and world-to-screen matrix computations, I was boosted from 25-35 FPS to around 35-45 FPS, around a 5-10 FPS boost.

    I also tested the godrays in its own project and found that had been boosted too, for again, 5-10 FPS.

  • Jmv38Jmv38 Mod
    edited December 2014 Posts: 3,295

    speed seems ok.
    However, i got something strange: i was playing 'snake' from Mark, from 'codea showcase', in landscape mode. Then i shake somewhat the ipad and the screen turned into partly portrait and partlt landscape, and it wouldnt change back, until i stopped the game. Here is the screenshot:
    .
    The blue left part is my game (part of it) and the green right part seems to be some part of codea project screen, but i didnt make it.
    Looks like a codea bug.

  • Posts: 1,976

    @Jmv38 When I first ran a project in Codea 2.1(.0), I got a weird dark project screen like you had, but on the whole screen. When I restarted the project, it fixed it, and I've never gotten the bug again. Does it happen consistently, or is it just a one-time bug like mine?

  • Jmv38Jmv38 Mod
    Posts: 3,295

    @SkyTheCoder i dont know yet. Just once for now...

  • IgnatzIgnatz Mod
    Posts: 5,396

    I tried a second graphics intensive (moon landing, lots of mesh terrain) program, and it took a long time to show the opening screen (longer than previous) and my FPS was only 20. I can't remember what it was before but it was definitely higher.

    There may be still be a problem with meshes. Anyone else?

  • SimeonSimeon Admin Mod
    Posts: 5,204

    @Ignatz could you send me a piece of code you think should be running faster? I'll profile it on 2.0 and 2.1.1 tonight to see if there are any differences.

  • Posts: 1,976

    Here's a "bug" that won't let you close the project via the standard buttons:

    -- Sidebar Testing
    
    displayMode(OVERLAY)
    
    rectMode(CORNER)
    
    function setup()
        print("Hello World!")
        enable = nil
        tween.delay(0, function()
            displayMode(FULLSCREEN)
            tween.delay(0.05,function()
                enable = OVERLAY
            end)
        end)
    end
    
    function draw()
        background(0)
    
        if enable ~= nil then
            if enable == OVERLAY then
                enable = FULLSCREEN
            else
                enable = OVERLAY
            end
            displayMode(enable)
        end
    
        fill(255)
    
        rect(WIDTH - WIDTH / 4, HEIGHT - HEIGHT / 4, WIDTH / 4, HEIGHT / 4)
    
        fill(0)
    
        font("HelveticaNeue-UltraLight")
        fontSize(72)
        text("Close", WIDTH - WIDTH / 8, HEIGHT - HEIGHT / 8)
    end
    
    function touched(touch)
        if (touch.state == ENDED or touch.state == CANCELLED) and touch.x >= WIDTH - WIDTH / 4 and touch.y >= HEIGHT - HEIGHT / 4 then
            close()
        end
    end
    
    
    

    Also, rectMode() is still broken and stuck on CORNER (and shows RADIUS as a parameter option)

  • IgnatzIgnatz Mod
    Posts: 5,396

    @Simeon, it's difficult because it involves custom assets.

    I'm trying to create something you can test

  • SimeonSimeon Admin Mod
    edited December 2014 Posts: 5,204

    @SkyTheCoder hah! Thank you for putting in the "Close" button on that example.

    I can't find any issues with rectMode, here is a demo project based on the "Ellipse Modes" example that demonstrates all the rect modes. They appear to work correctly for me.

    (Edit: Note that RADIUS is supported for rects, even though it doesn't make geometric sense.)

    --This is an example of the ellipseMode. 
    --It is an integer value from 0 to 3.
    --The ellipse modes are:
    --      0 = CORNER (x,y = bottom left of bounding rectangle)
    --      1 = CORNERS (x,y = bottom left as above, 
    --                   and w,h is now the top right corner absolute
    --                   position, not the width and height)
    --      2 = CENTER ( x,y = the center of the ellipse, 
    --                   w,h is the width and height)
    --      3 = RADIUS ( x,y = the center of the ellipse, 
    --                   w,h are the horizontal and vertical
    --                   radii. Its basically the same as CENTER, 
    --                   but w and h are doubled)
     
    function setup()
        parameter.integer("EllipseMode",0,3, function()
            shouldPrint = true
        end)
        parameter.number("x",0,WIDTH, WIDTH/2)
        parameter.number("y",0,HEIGHT, HEIGHT/2)
        parameter.number("w",0,WIDTH,150)
        parameter.number("h",0,HEIGHT,150)
     
        --The rect methods do pretty much the same as the ellipse ones, but
        --they draw a rectangle with x,y,w,h. Setting this to true shows that.
        parameter.boolean("DrawRect", true)
    end
     
    function draw()
        background(10,10,20)
        fill(255,0,0)
        stroke(255)
        strokeWidth(20)
     
        --translate(WIDTH/2,HEIGHT/2)
     
        strokeWidth(2)
        line(WIDTH/2, 0, WIDTH/2, HEIGHT)
        line(0, HEIGHT/2, WIDTH, HEIGHT/2)
     
        if DrawRect == true then
            rectMode(EllipseMode)
            rect(x,y,w,h)     
     
            if shouldPrint then 
                print( "Rect mode is " .. rectMode() ) 
                shouldPrint = false 
            end
        else
            ellipseMode(EllipseMode)
            ellipse(x,y,w,h)
        end
    end
  • Posts: 1,976

    @Simeon I just figured it out - rectMode() only seems to work in draw. I was trying to use it at the very top of my tab to set it once.

    But anyways, wasn't the default rectMode set to CENTER? Now it's CORNER, and it messed up a few of my projects which used coordinates as CENTER (and I never set it to CENTER because it was the default)

  • Posts: 2,042

    @SkyTheCoder, I'm pretty sure it's always been CORNER by default

  • Posts: 1,976

    @JakAttak In my project Flickable's demo, the square is now off-centered and looks weird. I never used rectMode() but it was fine before. The coordinates look like they go with CENTER.

  • dave1707dave1707 Mod
    Posts: 8,200

    @SkyTheCoder I went back to version 1.5 and the default for rectMode is CORNER. As far as I know, it's never changed.

  • Posts: 1,976

    Nevermind, it was just rectMode being out of draw again...

  • dave1707dave1707 Mod
    Posts: 8,200

    @SkyTheCoder I noticed in your code above that you have rectMode(CORNER) outside of "the code". It has to be inside a function, setup() or some other function. Only some statements work outside of "the code". displayMode or supportedOrientation are two. There may be others.

  • edited December 2014 Posts: 2,161

    The ordering-by-name still isn't working.

    Recording speed seems to be very slow (see video or just posted on twitter, when not recording then that runs about twice as fast).

    I got a weird effect where the special row on the keyboard appeared by itself, first on the editor screen (no actual keyboard showing) and then it persisted in the program screen. It went away when I went back to the editor and brought up the keyboard.

  • SimeonSimeon Admin Mod
    edited December 2014 Posts: 5,204

    @Andrew_Stacey ordering by name appears to work for me (including when the app is killed and restarted). Is it just not working at all for you? Is it not working for anyone else?

    The keyboard issues are often due iOS 8 — it has some serious bugs with keyboards, though they are getting better in the later point releases.

    Was the recording speed for that particular demo much faster under 2.0?

    @SkyTheCoder if you can, please try to keep all your code inside setup() / draw(). I think the only function that might be necessary to call in the global scope is supportedOrientations().

    Codea actually disables a lot of API functions when it validates your code and executes it in the global scope because things like the renderer aren't yet available (render commands are only available once the GL context is established and the viewer is on screen).

  • Posts: 2,042

    Recording speed has been pretty good for me, I just used the built in recorder to make a video and with the exception of one or two dropped frames speed was fine

  • SimeonSimeon Admin Mod
    Posts: 5,204

    @JakAttak just to let you know, you can record at full speed and resolution with audio on recent iPads using the lightning cable and Quicktime on a Mac. It's probably the best way to get footage off an iPad.

  • Posts: 2,042

    I just exported my app and it runs only a black screen with the sidebar out. A little of digging showed Mark had a similar issue he tracked down to sound effects, and sure enough taking out calls to sound() using sound assets causes the error.

    Any idea why this is?

  • SimeonSimeon Admin Mod
    Posts: 5,204

    @JakAttak so the sound() calls had not actually been called at the point where your app had started up?

  • Posts: 2,042

    @Simeon, no, they are in callbacks around the app, none are called in setup.

  • SimeonSimeon Admin Mod
    edited December 2014 Posts: 5,204

    @JakAttak that's very unusual. I wonder if it's due to the sound assets being included in the exported project — were they the built-in sound assets?

    Was there anything in the console log?

  • SimeonSimeon Admin Mod
    Posts: 5,204

    Also, is it happening in both the simulator and device, or just device?

  • SimeonSimeon Admin Mod
    Posts: 5,204

    @JakAttak I just wrote this tiny test and it appears to work correctly on simulator and device after export and build:

    -- SoundTest
     
    function setup()    
        displayMode(FULLSCREEN)
     
        sound("A Hero's Quest:Arrow Shoot 1")
    end
     
    function draw()
        background(40, 40, 50)
     
        strokeWidth(5)
    end
     
    function touched(touch)
        sound("A Hero's Quest:Bottle Break 2")    
    end
  • edited December 2014 Posts: 2,042

    @Simeon, both in simulator and on device.

    Your test seems to run fine, which is weird, must be sound and something else together. I'll try to narrow it down.

    EDIT: After running your example, then un-commenting my code, my sounds no longer caused a problem...

    Another issue, once I dealt with the sound is im getting crashes on start related to physics. Here's a screencap from Xcode: https://www.dropbox.com/s/8ppdxpfc8f4ciq6/Screen Shot 2014-12-11 at 9.56.16 PM.png?dl=0

  • Posts: 2,161

    @Simeon, I hadn't tried recording that on a previous version of Codea. What I mean is that when I record it then it runs at about half the speed of when I run it without recording.

    The sorting issue in the browser is pretty consistent for me.

  • SimeonSimeon Admin Mod
    Posts: 5,204

    @Andrew_Stacey when you toggle the sorting option it does nothing?

    Does project sorting not work for anyone else?

  • Posts: 2,042

    @Simeon, I've narrowed the runtime physics bug down as much as I could: it occurs anytime you apply a force to a body IF you have the collide function implemented anywhere.

    In the example below, if you remove the collide function, it runs fine. add it back in and it crashes.

    function setup()
       ball = physics.body(CIRCLE, WIDTH / 20)
       ball.position = vec2(WIDTH / 2, HEIGHT / 2)
    
       wall = physics.body(EDGE, vec2(0, 0), vec2(WIDTH, 0))
    end
    
    function draw()
        background(255)
    
        fill(0)
        ellipse(ball.x, ball.y, ball.radius * 2)
    end
    
    function collide(c)
    
    end
    
    function touched(t)
        local d = vec2(t.x, t.y) - ball.position
    
        ball:applyForce(d)
    end
    

    Hopefully this can help you find the issue

    RE: Project sorting, I just tried to make sure, and no problems for me.

  • SimeonSimeon Admin Mod
    Posts: 5,204

    @JakAttak what device do you have?

  • Posts: 2,042

    @Simeon, iPad Mini 1

  • Posts: 2,161

    @Simeon When I set the project sorting to "name" then it sets it for the current session. Then at some point later, it will revert to "recent", usually after I've been not using Codea for a short while (or it crashed).

    I've had some issues with shaders not compiling when defined in code and loaded before setup is run. Reloading the project (using the on-screen re-run button) fixes it.

  • SimeonSimeon Admin Mod
    edited December 2014 Posts: 5,204

    @Andrew_Stacey that's very strange, that bug was present in 2.1 but I thought I had fixed it (I think @dave1707 reported it in the 2.1 thread).

    In my testing (ver 2.1.1+)

    • Change the project sort to "Name"
    • Then I close Codea
    • Then terminate Codea from the task switcher (double tap home button, swipe up)
    • Then re-open, project sorting is still by name

    In version 2.1 Codea would forget the sort option in the above scenario.

  • dave1707dave1707 Mod
    Posts: 8,200

    @Simeon That's what was happening with the sort. As long as Codea wasn't terminated the sort order would remain in name. Once Codea was terminated and restarted it would revert back to recent.

  • SimeonSimeon Admin Mod
    Posts: 5,204

    @dave1707 but is that resolved for you in 2.1.1? (Or 2.2)

  • dave1707dave1707 Mod
    Posts: 8,200

    @Simeon Sorry, but I'm only on version 2.1 (24.4) . Due to family commitments and other obligations I didn't get involved in any beta testing for this release. I should be able to beta test the next major release.

  • SimeonSimeon Admin Mod
    Posts: 5,204

    @dave1707 no problem, thanks for letting me know.

Sign In or Register to comment.