Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
how does gideros work? — Gideros Forum

how does gideros work?

mumujamumuja Member
edited September 2011 in General questions
Does it use LUA VM? Or is it a code translator?
Does general Lua optimization methods apply? Such as localizing variables, etc?

Comments

  • atilimatilim Maintainer
    It's using a little bit modified Lua VM and general Lua optimization methods applies.

    As you said, localizing variables (and also using strict.lua) is recommended.
  • if that is the case, how will the VM adds to the size of the app? In here we have a limitation of 20MB for over the air download, bigger than that will have to go either itunes/wifi to install the app.

    Also, it seems that every lua file will be included automatically when the project is run, I am assuming we shouldn't/cannot use lua's "require"? I can see as the project gets bigger, in certain part of the game we might not want to load everything, just the necessary parts?
  • atilimatilim Maintainer
    Afaik, the compiled size of Lua VM is ~150kb. Usually the images and sounds takes most of the 20mb.
    Also, it seems that every lua file will be included automatically when the project is run

    You're right.
    Also, it seems that every lua file will be included automatically when the project is run, I am assuming we shouldn't/cannot use lua's "require"? I can see as the project gets bigger, in certain part of the game we might not want to load everything, just the necessary parts?
    We usually find easier to simply remove the unused Lua files from project instead of removing all related require calls. But after your suggestion, we start to consider enabling/disabling the automatic execution of Lua files. (For example, you may right click a Lua file and exclude it from execution, then use require to load it whenever you want)

    Thank you


  • the manual inclusion gives developers better control on which files to load, especially when scene management is introduced.
    something like
    scene(''options_menu'', scene.FADE_IN)
    where it would basically call options_menu.lua and fade it into view
  • atilimatilim Maintainer
    I understand now.

    With gideros, one of the options may be to wrap each scene into a function like
    function options_menu()
    {
        local scene = Sprite.new()
        -- create the scene into this sprite
     
        return scene
    }
    and let scene manager call this global function with _G["options_menu"]()

    But I agree with you. Loading each scene with require is more elegant and more memory efficient.
  • I also wants to know about it and I am very pleased to know about working of Gideros.
  • atilimatilim Maintainer
    We're planning to publish a detailed post about how gideros works. stay tuned.
Sign In or Register to comment.