Codea 2.1.1 Beta

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.

I tested two apps

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

  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 :-/

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

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

@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.

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.

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.

@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?

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

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?

@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.

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)

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

I’m trying to create something you can test

@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



```

@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)

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

@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.

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

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

@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.