Using Lua to Build a Component-based Architecture for Game Apps

077b906e1080962b3989c1d598dab852?s=47 Jheng Wei Ciao
August 05, 2013
1.6k

Using Lua to Build a Component-based Architecture for Game Apps

Presented on COSCUP 2013 http://coscup.org/2013/en/

077b906e1080962b3989c1d598dab852?s=128

Jheng Wei Ciao

August 05, 2013
Tweet

Transcript

  1. 3.

    Lua

  2. 7.
  3. 11.

    Pitfalls of IBA Deep and tangled hierarchies Diamond ring inheritance

    Copy-paste code here and there Special cases Magic: don’t touch it
  4. 12.

    Component-based Architecture Each functionality is a game component Data-driven method

    for objects creation Design Patterns: “Favor composition over inheritance”
  5. 16.

    Don’t use CBA... yet CBA can’t save your world OOD

    can do good things too Don’t make everything a component Leave messy code alone You might need an editor or tool
  6. 17.
  7. 20.

    Drawbacks of Lua Most editors don’t support auto-completion code Goodbye

    to debuggers & breakpoints Hello to loggers & print() No excuse for coffee break time
  8. 21.

    Pitfalls of Lua Naming convention for global variables Do garbage

    collection manually Don’t forget to compile scripts & strip debug info
  9. 22.

    My Lua Trilogy Lua 5.1.5 Luabind 0.9.1 Time-saver & OO-like

    Boost Luabind depends: template programming
  10. 23.

    My Programming Trilogy C++ Generic framework Objective-C iOS platform-specific OpenGL

    ES implementation Lua Data description Game logic 10% 65% 25% C++ Lua Objectitve-C
  11. 26.
  12. 27.

    Traditional OOP Game Objects Update #1 #2 #3 #4 #5

    Game Objects Render #1 #2 #3 #4 #5
  13. 28.