Jump to content

ChrisMAN

Members
  • Posts

    174
  • Joined

  • Last visited

Posts posted by ChrisMAN

  1. 80/50 (80% of the results in 50% of the time) rule sucks. The last mile is tedious and laborious. I don't think many can have the satisfaction of knowing they got something to nice polished state. I am looking forward to seeing something that is developer friendly but has a buttery smooth asset pipeline. They tend to fight each other because of the price of abstraction. I don't think anything has gotten close to it yet. I would take great pride, and hopefully money, in accomplishing the feat.

  2. Last week I wrote an emitter for doing easy events on objects. This week I wrote a library for handling deferred values. This is really nice for doing asynchronous programming. These 2 components are all that I really need to do async/evented programming.

     

    https://github.com/friesencr/lua_promise

     

    Promises are one of those things that are so elemental / simple they can be hard to grasp.

     

    Here is a small example of what I might use it for.

     

    function UsePotion()
     SelectPotion()
       :done(function(potion)
      NomNom(potion)
       end)
    end
    function SelectPotion()
     local p = Promise:new()
       gui = LoadPotionGui()
       gui:on('select_potion', function()
      p:resolve(gui.selected_potion)
       end)
     return p
    end
    

     

     

    Peace,

    Chris

    • Upvote 2
  3. I have abstracting a component of my gui library out for general consumption.

     

    https://github.com/friesencr/lua_emitter

     

    Fork and publish issues. OSS <3

     

    It allows for simple event communication between objects. Check out the readme. If you want a similar experience as SendMessage but with a small decoupled object. Try emitter!!!

     

    I will be creating a promise system for lua which will allow for a really nice asynchronous story over the next week. A deferred value system is vastly superior to a system where the server takes callbacks.

     

    I find that dealing with certain problems using events and callbacks clearly states the problems and therefore simpler solutions. STATE MACHINE Y U NO EVENTS.

     

    Thanks,

    Chris

    • Upvote 1
  4. I use the wiki alot. I have found some bugs with the api when using Lua. I would also be willing to fix problems when I find them. Being a beginner, I have found the wiki more useful than the documentation on the main site and still use it today.

     

    I also find it frustrating to find small reusable recipes for LE. The wiki might organically support this.

  5. OO is kind of wierd. It uses prototypical inheritance through metatables. Classical inheritance is more obvious. Mixins an duct typing are kind of the preferred OO model in scripting languages any ways.

     

    I am a professional ruby developer. That is probably what makes me cranky. Ruby is such a joy to code in. I can't seem to get anything meaningful on one line. I miss good built in iterators. I havnt had to do much string manipulation yet but it looks really ugly. I am sitting at about 1500 lines of lua at the moment which would have been 600 lines of clear ruby. At least its not 5000 lines of c++.

     

    The things i have run into it so far.

     

    Arrays start at 1

    cant return early w/o a hack

    really annoying to check false vs nil

    global variables by default

    no self asignment operators

    no ternary operators

    mixins + metatables

    break/continue is borked

  6. If you are using lua and not using underscore you are probably doing it wrong. It is the only sane comprehensive set of utility functions I have found. Gives you alot of nice iterators, some OO facilities, some functional programming. If you have used other languages and miss nice things this gets you closer.

     

    http://mirven.github.com/underscore.lua/

     

    Check it out. Hate lua less.

     

    I did have a problem with the module export. I manually aliased the '_' to Underscore

     

    require 'scripts/underscore'

    local _ = Underscore:new()

  7. I cant wait to see what Matz is cooking up with mruby. https://github.com/mruby/mruby

     

    If you have tasted Ruby; Lua is just lame. You get used to lua not having real booleans, decent built in iterators, no built in mixin support, arrays starting a 1?? global variables by default. Lua does give you the benefit of not over thinking a problem. At least you can return multiple values from a single function... I use that all of the time tongue.png

     

    Being said, I use lua for 85% of the code it seems and c++ for the rest.

     

    +1 for Lua/C++ with the hope of torching lua as soon as mruby is ready :D

  8. I know for terrain slopes I create a plane that has many segments that I paint the texture on and then I loop through each vertex location and get the height of the terrain directly below that x,z and move the vertex y like .001 above the terrain height. Performance is a balance between how many segments the plane has which comes down to how hilly your terrain is to give a nice look. Could probably do the same for models if you can get the y value of the x,z position on a model.

     

     

    How do you find the terrain height directly below each vertex?

×
×
  • Create New...