Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
LUA newbie questions and fears - alias "Why not others?" — Gideros Forum

LUA newbie questions and fears - alias "Why not others?"

devfujidevfuji Member
edited March 2014 in General questions
Hi guys,
i've started creating a little game in Gideros but it happens LUA seems too hostic to me and i try google the web to find alternatives.

I don't know why but develop in a language that don't offer me any help while i'm writing makes mee feel alone in the dark. I'm using ZeroBrane that give me some help more, but his features are neither comparable with hints/helps given by any other IDE for any other common language (including JS) in terms of Intellisense, suggestions, linting etc.

The debugging seems also worse... hitting a breakpoint, the watcher don't give me any clue on types of variables or their real states... i only get a bunch of numbers like "userdata: 01SDF4SF = 'function 01FD44W4F'"...

maybe that from my experience i'm too used to have full control of language and debugger but i really don't feel safe programming this way. For me it is not concepible i have to RUN the entire app to test a line or to have a sign i've not wrote junk code in a module...

First question: Have you some suggestion, reccomendation, best practice, or suggested enviroinment to be very productive with LUA and "feeling home"?

Many times it happens i end on LibGDX and i wonder why not to go for it... i'm used to Java and actually my game target is Android/iOS

Second question: why i shouldn't go with Java + LibGDX? what are advantages for a developer using Gideros over LibGDX?
Have anyone experienced both and can give me a clue?

thanks.

Comments

  • @devfuji,
    you are correct - Why do you not go with Java + LibGDX? specially since you are familiar with some java IDE, it could be IntelliJ, Eclipse, etc

    You are used to the tools that you are using. The question you must ask yourself is that if you want to consider alternative options to Java + LibGDX why is that, is there something that you expect from the library and are unable to get it? That is generally when people look for alternatives.

    Someone that is entirely comfortable with using Windows would not and should not move to a Mac, similar for the programming tools and languages.

    Likes: devfuji

    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
    +1 -1 (+1 / -0 )Share on Facebook
  • Usually i learn new languages and technologies just because i like to do it. I'm curious and i ever try to do things the best way and i think you can't do the best way if you don't know alternatives ways to choose from.

    I've initially started with Gideros (this is my real first game) because i'm reading about LUA pratically everywhere and because it seemed a good way to start without thinking too much ad game/engine details and building process...
    unfortunately *actually* i think the learning curve of LUA and the time i will spend in testing the code will be more than the time i could spend on any other famous language/framework as all speed-coding advantages of LUA seems to be eaten by disadvantage of programming on a not-well-supported language-enviroinment (IDE/tools/etc).

    Just to make my opinion clearer, it seems that with Gideros+Lua i'll write good game code in 1 hour, undefined hour to debug it or get it at least working, and run it on the emulator in 1 second.
    With Java i'll write code good/at least working game code in half an hour, debug in very few time, but will eventually take a while to test it on devices... also i won't have really cross-platform plugins or some high-level abstraction i've seen in Gideros.

    still confused.
  • ar2rsawseenar2rsawseen Maintainer
    It's actually quite interesting opinion

    Because I'm complete opposite
    I hate languages/environments where runtime libs are mixed with the language itself, as Java and C# (with .NET), and you need to know so much classes to code.
    And those weighted IDE, argh, don't get me started on that

    And I love simple languages as Lua or Javascript, where I simply learn the syntax, and don't need any intellisense and code completion to code. All I need is a notepad (well maybe Notepad++)

    Gideros is something in between (also mixing predefined classes). And my first bonus when I started using it, was the lightweight IDE, which basically was as light as Notepad, with bonus of launching the player and starting the app. Basically all I ever need :)

    Yes at first it took a lot of looking into the docs (I actually still don't know the api well and look in the docs when answering in forums), but maybe it is a habbit from using Notepad instead of proper development ide. I work mostly on reusable components. Need a progress bar, I create is as separate class with API and use in any future project, same for common scenes, etc. And even having a game template with some predefined scenes.

    All my coding on games is now mostly, game logic in the game scene and adapting existing reusable code form other Gideros projects.

    And since my work is usually divided in components, I also don't have much debuging problems, at least I don't see it that way, mostly print or print_r is enough for me :)

    Likes: devfuji

    +1 -1 (+1 / -0 )Share on Facebook
  • Hi @devfuji,
    I believe that you create your app with you love tools and prefer.
    The important is have a idea of your app to start to work in your code and another aspect too. ;)

    Good luck! and remember, it's best to start with what you are good.
    Just my 2 cents and again Good luck and successful in your project :)>-

    Likes: devfuji

    +1 -1 (+1 / -0 )Share on Facebook
  • Thanks all for all your replies. They helped me a lot.
    Actually I decided to give Java a try so i can have personal vision of both the world and decide.

    @ar2rsawseen
    Yes, i understand perfectly what you mean, there are times that i feel the same need of using lightweight enviroinment like Notepad++, but to me this happens only on well known (by me) language like Javascript if i'm not usign external libs/api. When i'm in the "learning" step i prefer get support everywhere i can.

    The real step that took me to search something different wasn't the autocomplete features of the IDE but the debug enviroinment. When the script break with a not too clear error message and I can't watch clear values and types of local variables (that most probably caused the error) i feel lost. Even in C you can debug code with clear vision of surrounding variables.

    Thanks again for your replies!
  • @devfuji,

    > I'm using ZeroBrane that give me some help more, but his features are neither comparable with hints/helps given by any other IDE for any other common language (including JS) in terms of Intellisense, suggestions, linting etc.

    I'd be interested to hear more in terms of what doesn't work for you if you have a minute. ZBS provides auto-complete for Gideros API and static analysis to cover linting needs. It sure could do more in terms of auto-complete for custom classes and there are several improvements planned in that aspect.

    > The debugging seems also worse... hitting a breakpoint, the watcher don't give me any clue on types of variables or their real states... i only get a bunch of numbers like "userdata: 01SDF4SF = 'function 01FD44W4F'"...

    That's an interesting point. The debugger gives you access to everything that the SDK provides. If the Gideros SDK hides some data behind userdata value, there is not much the debugger can do. What values were you trying to watch? Gideros classes?

    There are still ways to show the data you want, but it requires a bit of help from the user. For example, you can add to your script something like this:

    getmetatable(application).__tostring = function(t) return {PORTRAIT=t.PORTRAIT} end

    and whenever you retrieve the value of the `application` variable (whether in the Stack, Watch, or Console window) it will include PORTRAIT field and its value.

    > When the script break with a not too clear error message and I can't watch clear values and types of local variables (that most probably caused the error) i feel lost. Even in C you can debug code with clear vision of surrounding variables.

    Do you mean you can't look at the variables after a run-time error in the script? I've explored ways to do this, but there is no portable way in Lua to do this and the one I had in mind doesn't work in Lua 5.2 or LuaJIT. What you can do is to put a breakpoint on the line where the run-time error happens and explore the values at that time. If it doesn't happen there all the time, add a "fake" if statement with the condition you need and put a breakpoint inside.

    I'm always open to ideas to make debugging simpler and easier...
Sign In or Register to comment.