1. Post #321
    Gold Member
    Programmer's Avatar
    February 2012
    98 Posts
    Is it too late to ask too contribute?
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Programming King Programming King x 4Agree Agree x 1Disagree Disagree x 1 (list)

  2. Post #322
    Is it too late to ask too contribute?
    When we're near the end you can sign up
    Reply With Quote Edit / Delete Reply Windows 8 Netherlands Show Events Programming King Programming King x 1 (list)

  3. Post #323
    hOnK :o)
    i300's Avatar
    December 2009
    3,987 Posts
    Is it just me, or does it crash when you press space to activate turbo boost mode? (Love 0.8.0)



    Edited:

    Whoops, forgot this thing was happening. Here's the latest build.

    http://i3software.org/trade-off/buil...ftandshift.zip
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 4 (list)

  4. Post #324
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    Is it just me, or does it crash when you press space to activate turbo boost mode? (Love 0.8.0)

    works on my machine ™
    Reply With Quote Edit / Delete Reply Mac Australia Show Events Funny Funny x 12 (list)

  5. Post #325
    Gold Member
    Dennab
    January 2012
    1,137 Posts
    Is it just me, or does it crash when you press space to activate turbo boost mode? (Love 0.8.0)
    Have you guys decided on a build you are all using? IIRC 0.7.* has some stuff that isn't quite working properly in 0.8.0 yet

  6. Post #326
    Gold Member
    chonks's Avatar
    April 2009
    1,133 Posts
    when it's my turn I'm deleting all the code and putting my own shit in
    While there are no fine lines in terms of changing the code I think we can agree that essentially reversing people's turns is going too far.

  7. Post #327
    hOnK :o)
    i300's Avatar
    December 2009
    3,987 Posts
    Have you guys decided on a build you are all using? IIRC 0.7.* has some stuff that isn't quite working properly in 0.8.0 yet
    We should be using 0.8.0. I thought I said that somewhere. I'll put it on the website and OP.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 1 (list)

  8. Post #328
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    Perhaps you could link to the 0.8.0 download page?
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Agree Agree x 1 (list)

  9. Post #329
    Gold Member
    ZenX2's Avatar
    February 2009
    5,046 Posts
    love2d.org/builds for windows

    Edited:

    Or https://bitbucket.org/rude/love/ to build it yourself
    Reply With Quote Edit / Delete Reply Mac United States Show Events Informative Informative x 2 (list)

  10. Post #330
    Gold Member
    jack5500's Avatar
    November 2007
    106 Posts
    The newest downloads and media aren't working... :/
    Reply With Quote Edit / Delete Reply Windows 7 Germany Show Events Agree Agree x 2 (list)

  11. Post #331
    hOnK :o)
    i300's Avatar
    December 2009
    3,987 Posts
    The newest downloads and media aren't working... :/
    Fucking hell. Sorry about that. Problem on my side. I put swift_and_shift.zip instead of swiftandshift.zip.

  12. Post #332
    Gold Member
    iPope's Avatar
    October 2008
    1,774 Posts
    It's okay guys I fixed the turbo boost bug. I was unawares of love 0.8.0 I guess I'll upgrade or some shit. I'm trying to make it so you can add codeable objects to the map but my lua is not really up to scratch so I'm tearing my eyes out. Also, fucking code man - what is up with this whole rename the library shit. Is that a standard practice in lua? I hope not. Also do all arrays start at 1 in lua, or is it just that guys explode function? I'm so confused at this code sometimes I just like fucking write something I think should work and cross my fingers.

  13. Post #333
    Also, fucking code man - what is up with this whole rename the library shit. Is that a standard practice in lua? I hope not.
    I always do that, it just speeds things up and you have to type less.

    Also do all arrays start at 1 in lua, or is it just that guys explode function?
    Yes, Lua arrays start at 1.

  14. Post #334
    Gold Member
    Darwin226's Avatar
    January 2009
    4,144 Posts
    I always do that, it just speeds things up and you have to type less.



    Yes, Lua arrays start at 1.
    Someone said it doesn't since you didn't set them as local.
    Also, on character variable names isn't a preference, it's a very very bad habit.
    Reply With Quote Edit / Delete Reply Windows 7 Croatia Show Events Agree Agree x 4 (list)

  15. Post #335
    Gold Member
    BlkDucky's Avatar
    May 2008
    6,502 Posts
    Someone said it doesn't since you didn't set them as local.
    Also, on character variable names isn't a preference, it's a very very bad habit.
    It speeds things up in terms of fewer keystrokes, but you only get the actual performance boost if it's local.
    Reply With Quote Edit / Delete Reply Windows Vista United Kingdom Show Events Dumb Dumb x 1 (list)

  16. Post #336
    Gold Member
    Darwin226's Avatar
    January 2009
    4,144 Posts
    It speeds things up in terms of fewer keystrokes, but you only get the actual performance boost if it's local.
    He said it speed things up AND you have less to type. So the first one was obviously about performance.

  17. Post #337

    April 2010
    2,427 Posts
    Kind of a stupid thing to do in a group project.

  18. Post #338
    Okay so now I have to check it out.

    _g = love.graphics
    
    function love.load()
        local t = love.timer.getMicroTime()
        for i=1, 10000 do
            love.graphics.point(0, 0)
        end
        print(love.timer.getMicroTime() - t)
        t = love.timer.getMicroTime()
        for i=1, 10000 do
            _g.point(0, 0)
        end
        print(love.timer.getMicroTime() - t)
    end
    

    Result of 3 executions:
    Code:
    0.0018206217901025
    0.001087894605007
    
    0.0016644974093651
    0.0011979902883468
    
    0.0016570332954871
    0.0012480620498536
    Well it seems like it -does- matter, only a tiny bit.. Anyway I'm still keeping it as less to type.

    Also, here's the result of having local _g:

    Code:
    0.0016707175018382
    0.0011233491495659
    
    0.0016887557758309
    0.0010123204519914
    
    0.0015503586655541
    0.0010533730783209
    Local doesn't matter.

  19. Post #339
    Gold Member
    ralle105's Avatar
    October 2005
    4,648 Posts
    You have one less table lookup doing that so obviously it's faster, though you have absolutely no reason to define it as a global.

  20. Post #340
    You have one less table lookup doing that so obviously it's faster, though you have absolutely no reason to define it as a global.
    Use it in all files?

  21. Post #341
    Gold Member
    ralle105's Avatar
    October 2005
    4,648 Posts
    Then you might as well use love.graphics. If you're gonna make shortcuts to globals at the top of your file they should be locals, it's just good practice.

  22. Post #342
    Gold Member

    July 2006
    1,953 Posts
    You shouldn't use single letter variable names. It looks messy as fuck and has no advantage over normal variable names. You should use an editor with auto-complete if you can't be bothered to type it out.

    Micro-optimizations like that are also pretty much useless. Yeah, it might run even a couple of microseconds faster, but would anyone even notice that? All that they do in the end is just clutter up the code.

    Edited:

    Sorry if I came out as rude - wasn't my intention.
    Reply With Quote Edit / Delete Reply Windows 7 Finland Show Events Agree Agree x 9 (list)

  23. Post #343
    hOnK :o)
    i300's Avatar
    December 2009
    3,987 Posts
    I suggest reading these and becoming familiar with the Lua syntax and naming conventions.

    http://lua-users.org/wiki/LuaStyleGuide
    http://www.lua.org/pil/

    Being a good coder means knowing these naming conventions. Programming in Lua is also a really good read and important to know as a Lua coder. Lua isn't a hard language to know and understand, but it takes time to learn and remember common conventions and practices. This is pretty important for all languages.

    I'm not going to enforce this in this event, but don't be an asshole and write terrible code for others to fix. Nobody wants to spend their 24 hours with the code fixing shit you did wrong.

    Edited:

    Note: I am not taking minecraft into consideration here. Minecraft's code is god awful and the game, in a technical standpoint, is terrible.

    For example, look at Notch. He is a bad programmer. Why? He knows computer science and understands common practices. A lot of his code is efficient and runs fast. Whats wrong with that? He doesn't know variable naming conventions. Here's an example of code in Catacomb Snatch (a game he made in a weekend for the Mojam):

    Code:
    int xy = xx*yy;
    What the fuck does that mean? We have no clue what xx or yy is or holds. A better name for these could be deltaX and deltaY.
    Reply With Quote Edit / Delete Reply Mac United States Show Events Informative Informative x 1 (list)

  24. Post #344
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,616 Posts
    Here's an example of code in Catacomb Snatch (a game he made in a weekend for the Mojam):

    Code:
    int xy = xx*yy;
    What the fuck does that mean? We have no clue what xx or yy is or holds. A better name for these could be deltaX and deltaY.
    to be fair, you don't make a game in a weekend by writing clear, relatively long variable names
    Reply With Quote Edit / Delete Reply Windows XP United States Show Events Dumb Dumb x 6Agree Agree x 2Disagree Disagree x 1 (list)

  25. Post #345
    I suggest reading these and becoming familiar with the Lua syntax and naming conventions.

    http://lua-users.org/wiki/LuaStyleGuide
    http://www.lua.org/pil/

    Being a good coder means knowing these naming conventions. Programming in Lua is also a really good read and important to know as a Lua coder. Lua isn't a hard language to know and understand, but it takes time to learn and remember common conventions and practices. This is pretty important for all languages.

    I'm not going to enforce this in this event, but don't be an asshole and write terrible code for others to fix. Nobody wants to spend their 24 hours with the code fixing shit you did wrong.

    Edited:

    For example, look at Notch. He is a bad programmer. Why? He knows computer science and understands common practices. A lot of his code is efficient and runs fast. Whats wrong with that? He doesn't know variable naming conventions. Here's an example of code in Catacomb Snatch (a game he made in a weekend for the Mojam):

    Code:
    int xy = xx*yy;
    What the fuck does that mean? We have no clue what xx or yy is or holds. A better name for these could be deltaX and deltaY.
    For projects like these okay, but for private projects, what if you don't want others to read your code?
    Reply With Quote Edit / Delete Reply Windows 8 Netherlands Show Events Dumb Dumb x 1Funny Funny x 1 (list)

  26. Post #346
    hOnK :o)
    i300's Avatar
    December 2009
    3,987 Posts
    to be fair, you don't make a game in a weekend by writing clear, relatively long variable names
    If you're working on an open source project that you may or may not show off to companies you apply to work at, I would make my code as clean and good looking as possible. Maybe Notch doesn't care anymore because he has a solid job at Mojang, but when collaborating with other people (like he did. Catacomb Snatch was a collaboration between Notch and Jeb) I would make my code clean and readable.

    For me, programming is about having fun but also writing good code that I can show off. I want to know how to write good code and be persistant about writing good code. If this is going to be my career I want to be damn good at it.
    Reply With Quote Edit / Delete Reply Mac United States Show Events Agree Agree x 2 (list)

  27. Post #347
    Gold Member
    Darwin226's Avatar
    January 2009
    4,144 Posts
    For projects like these okay, but for private projects, what if you don't want others to read your code?
    It will be hard for your to switch.
    What if you need help and you need to show your code? Or what if you decide that you do want to release it open source? Why make it hard on others(or yourself, if you end up changing it later)?
    Reply With Quote Edit / Delete Reply Windows 7 Croatia Show Events Agree Agree x 1 (list)

  28. Post #348
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    For example, look at Notch. He is a bad programmer. Why? He knows computer science and understands common practices. A lot of his code is efficient and runs fast.
    Uh, I think you might be thinking of someone else there...
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Agree Agree x 10Funny Funny x 4 (list)

  29. Post #349
    hOnK :o)
    i300's Avatar
    December 2009
    3,987 Posts
    Uh, I think you might be thinking of someone else there...
    I'm not really talking about or considering minecraft. Minecraft's code is god awful. It got too big and became tangled and convoluted. His smaller weekend games run pretty fast and well.
    Reply With Quote Edit / Delete Reply Mac United States Show Events Agree Agree x 1 (list)

  30. Post #350
    Gold Member
    gparent's Avatar
    January 2005
    3,949 Posts
    For projects like these okay, but for private projects, what if you don't want others to read your code?
    Don't show them. Additionally, delete the code when done. No need to write in ass-backwards naming conventions just in case someone happens to run away with your laptop and starts reading your source code. Ridiculous.

  31. Post #351
    Gold Member
    iPope's Avatar
    October 2008
    1,774 Posts
    I've kinda run out of time and motivation for the day after a really busy day so I've kinda implemented some really cool stuff for the future to allow for objects in the game to interact with but at the same time have left them half complete. I'll see if I can gain any energy to finish them a little more, but I guess the future people will just need to hack on top of what I've done.

  32. Post #352
    Don't show them. Additionally, delete the code when done. No need to write in ass-backwards naming conventions just in case someone happens to run away with your laptop and starts reading your source code. Ridiculous.
    We're talking about LOVE here.
    Reply With Quote Edit / Delete Reply Windows 8 Netherlands Show Events Dumb Dumb x 1 (list)

  33. Post #353
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    We're talking about LOVE here.
    How does that change anything?
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Agree Agree x 1 (list)

  34. Post #354

    August 2007
    550 Posts
    I know we already went over this whole _g thing, but for those who are still curious about optimizing Lua, This is actually pretty good.
    http://www.lua.org/gems/sample.pdf

    an excerpt:
    Code:
    for i = 1, 1000000 do
        local x = math.sin(i)
    end
    
    
    runs 30% slower than this one:
    
    
    local sin = math.sin
    for i = 1, 1000000 do
        local x = sin(i)
    end

  35. Post #355
    How does that change anything?
    Let's have a bundled .exe:


    And open it with WinRAR:


    Now this is a "compiled" LOVE game, including needed dll's. The .exe has been made by copying the .love file to the love.exe.

    Now let's open that one with WinRAR.



    There you have it, all source files are visible. That's the disadvantage of LOVE, it doesn't get compiled. So it's easier to (for example) upload fake scores to an online scoreboard, which means more people are gonna do such stuff. Now this is just an example, but there are many people who just don't want others to (easly) read their source. I'm one of those.
    Reply With Quote Edit / Delete Reply Windows 8 Netherlands Show Events Dumb Dumb x 3 (list)

  36. Post #356
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    There you have it, all source files are visible. That's the disadvantage of LOVE, it doesn't get compiled. So it's easier to (for example) upload fake scores to an online scoreboard, which means more people are gonna do such stuff. Now this is just an example, but there are many people who just don't want others to (easly) read their source. I'm one of those.
    Oh, you mean public projects where you wish to keep the source private.
    Private projects are ones that you don't give to anyone.
    In any case, obfuscation should be something that happens later, not something you do while you write the thing.
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Agree Agree x 1 (list)

  37. Post #357
    Oh, you mean public projects where you wish to keep the source private.
    Private projects are ones that you don't give to anyone.
    In any case, obfuscation should be something that happens later, not something you do while you write the thing.
    Well, I'm used to it and I'm the only coder, so I don't see any problems.
    Reply With Quote Edit / Delete Reply Windows 8 Netherlands Show Events Dumb Dumb x 3Disagree Disagree x 2Agree Agree x 1 (list)

  38. Post #358
    Gold Member
    iPope's Avatar
    October 2008
    1,774 Posts
    Hi, I'm a horrible and lazy person. Have fun.

    http://filesmelt.com/dl/FP.zip
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Friendly Friendly x 1 (list)

  39. Post #359
    Gold Member
    Darwin226's Avatar
    January 2009
    4,144 Posts
    Well, I'm used to it and I'm the only coder, so I don't see any problems.
    God damn. How can you be so persistent about continuing your bad habits?

    Can you really not see how it's a bad thing to do?
    Screw "personal projects". It's not called a habit for no reason.
    Reply With Quote Edit / Delete Reply Windows 7 Croatia Show Events Agree Agree x 3 (list)

  40. Post #360
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    Well, I'm used to it and I'm the only coder, so I don't see any problems.
    Getting into terrible habits early is a problem if you ever want to get into the professional world.
    In any case, using short variable names is to obfuscation what ROT13 is to cryptography.
    A couple of minutes with global find/replace and your code is fully readable.
    Write it cleanly and then destroy it with things like multiple variable redefinition, abstract stacks and befunged tables.
    Reply With Quote Edit / Delete Reply Mac United Kingdom Show Events Agree Agree x 2 (list)