Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Making of CuBeat, Programming-wise

IGDSHARE
April 11, 2014

Making of CuBeat, Programming-wise

It basically is an overview of the libs and tools used, with explanation about some more "re-usable" parts and also about what we (probably) did awfully wrong.

IGDSHARE

April 11, 2014
Tweet

More Decks by IGDSHARE

Other Decks in Programming

Transcript

  1. About me Johnson Lin Programmer & Indie Game igdshare.org &

    IGDA Taiwan ( igda.tw ) archilife.org & Indie game contests scholarship ( 祐生研究基金會 )
  2. Overview Libraries Used (with some in-house ones) - especially: Easing

    Functions & Custom Dictionary Development Issues (that I think is interesting) - AI design & impl - Why game programming is messy - Cross-platform? All (?) the Mistakes (??)
  3. Overview Libraries Used (with some in-house ones) - especially: Easing

    Functions & Custom Dictionary Development Issues (that I think is interesting) - AI design & impl - Why game programming is messy - Cross-platform? All (?) the Mistakes (??)
  4. Libs & tools gcc 4.6 ruby 1.8-1.9 CMake code::Blocks (on

    Win) https://github.com/godfat/cubeat/
  5. Libs & tools Irrlicht 1.7 (custom) Boost 1.48 Freetype 2.3.x

    LuaJIT2 Ogg/Vorbis ALmixer ManyMouse Loki … (any many other things no longer used) gcc 4.6 ruby 1.8-1.9 CMake code::Blocks (on Win) https://github.com/godfat/cubeat/
  6. Easing Equations obj->tween<Eq, Accessor> (start, end, time, loop, callback, delay);

    AnimatorParam<Eq, Accessor> anim, anim2; anim.start(s).end(e).time(t); anim2.start(s2).end(e2).time(t2);
  7. Easing Equations obj->tween<Eq, Accessor> (start, end, time, loop, callback, delay);

    AnimatorParam<Eq, Accessor> anim, anim2; anim.start(s).end(e).time(t); anim2.start(s2).end(e2).time(t2); obj->queue(anim).tween(anim2);
  8. Easing Equations obj->tween<Eq, Accessor> (start, end, time, loop, callback, delay);

    AnimatorParam<Eq, Accessor> anim, anim2; anim.start(s).end(e).time(t); anim2.start(s2).end(e2).time(t2); obj->queue(anim).tween(anim2); * cubeat-core/include/EasingEquations.hpp * cubeat-core/include/Accessors.hpp * cubeat-core/include/view/Object.hpp * cubeat-core/include/view/detail/CustomAnimator.hpp
  9. Custom "dictionary" 'key1': { 'somelist': [-1.1, [14, 15, [3]], 6,

    13], 1: '234', 'val': 5 } #comment #number => 1, -1, 1.0, -1.0, 0xfe, -0xfd. #string => 'string', ThisIsAString_Too #map => { ... } #vector => [ ... ] #delim => ,(comma) :(colon)
  10. Custom "dictionary" map.V("stafflist").M(1).S("phone"); implies => 'stafflist': [ ... , {

    'phone' : 'something', ... }, ... ] map = map_any::construct( from_str ); vec = vector_any::construct( from_str );
  11. Custom "dictionary" Uses: tr1::unordered_map & std::vector + boost.any boost.algorithm boost.lexical_cast

    Have often-used std container interfaces Very ugly usage of exception when serializing
  12. Custom "dictionary" Uses: tr1::unordered_map & std::vector + boost.any boost.algorithm boost.lexical_cast

    Have often-used std container interfaces Very ugly usage of exception when serializing * cubeat-core/include/utils/dictionary.hpp * cubeat-core/src/utils/dictionary.cpp
  13. Overview Libraries Used (with some in-house ones) - especially: Easing

    Functions & Custom Dictionary Development Issues (that I think is interesting) - AI design & impl - Why game programming is messy - Cross-platform? All (?) the Mistakes (??)
  14. AI Design & Impl Problems Started asking around on ptt.cc

    (Prob_Solve) in 2007. Dunno how to impl AI strategy for building chains.
  15. AI Design & Impl Problems Started asking around on ptt.cc

    (Prob_Solve) in 2007. Dunno how to impl AI strategy for building chains. Research some kind of patterns? Neural network?? Reinforcement learning??? Genetic algorithm????
  16. AI Design & Impl Problems Started asking around on ptt.cc

    (Prob_Solve) in 2007. Dunno how to impl AI strategy for building chains. Research some kind of patterns? Neural network?? Reinforcement learning??? Genetic algorithm????
  17. AI Design & Impl Problems http://kamoland.com/wiki/wiki.cgi?RensaWiki Puyopuyo "Rensa" walkthrough site

    with AI programming competiton !!! ... And basically, the strongest strategy is just brute-force.
  18. AI Design & Impl Problems So, let players try the

    AI. Few people could beat EASY.
  19. AI Design & Impl Problems So, let players try the

    AI. Few people could beat EASY. * made AI even slower, too boring - player learns nothing
  20. AI Design & Impl Problems So, let players try the

    AI. Few people could beat EASY. * made AI even slower, too boring - player learns nothing * occasional "critical hit" - randomness problem - you don't want player get defeated randomly - computer simulated "hand-shaking" - had to make pace feel right to new player
  21. AI Design & Impl Problems FACT 1 Easy AI is

    the HARDEST one to get right.
  22. AI Design & Impl Problems FACT 1 Easy AI is

    the HARDEST one to get right. FACT 2 Good enough is good enough.
  23. Why Game Programming is Messy A. Impossible to know what

    will actually work B. Many things are coupled by nature/design, nothing to do with how you code it
  24. Why Game Programming is Messy A. Impossible to know what

    will actually work B. Many things are coupled by nature/design, nothing to do with how you code it A+B = layers of workarounds, unexpected complexity & bugs/crashes hard to keep code clean
  25. Cross-Platform meaning? C/C++ is a portable language. But use cross-platform

    libs & tools & getting all the code to compile is only the beginning.
  26. Cross-Platform meaning? C/C++ is a portable language. But use cross-platform

    libs & tools & getting all the code to compile is only the beginning. Some libraries may not be maintained well.
  27. Cross-Platform meaning? Deployment & UX adjustments is PITA. - OSX

    *.app formats - ManyMouse (old) on Linux - Android apk filesystem restrictions - etc
  28. Cross-Platform meaning? Deployment & UX adjustments is PITA. - OSX

    *.app formats - ManyMouse (old) on Linux - Android apk filesystem restrictions - etc May be better to focus on 1 platform at a time, but keep code portability at all cost.
  29. Overview Libraries Used (with some in-house ones) - especially: Easing

    Functions & Custom Dictionary Development Issues (that I think is interesting) - AI design & impl - Why game programming is messy - Cross-platform? All (?) the Mistakes (??)
  30. All the Mistakes Questionable/Bogus stuff & decisions we had "MVP"

    Presenter View Model Presenter bind view's method to model's function object
  31. All the Mistakes Questionable/Bogus stuff & decisions we had Template

    setter & getter for view objects: obj->set<Pos2D>(vec2(100, 200)).set<Alpha>(128);
  32. All the Mistakes Questionable/Bogus stuff & decisions we had Template

    setter & getter for view objects: obj->set<Pos2D>(vec2(100, 200)).set<Alpha>(128); And because it looks cool: obj->onPress(button) = bind(function, ...);
  33. All the Mistakes Questionable/Bogus stuff & decisions we had Pre-processed

    C++ source/header Using eruby (erb-like) to proc. embedded ruby
  34. All the Mistakes Questionable/Bogus stuff & decisions we had Pre-processed

    C++ source/header Using eruby (erb-like) to proc. embedded ruby Model.cpp.eruby -> preprocess -> Model.cpp
  35. All the Mistakes Questionable/Bogus stuff & decisions we had Pre-processed

    C++ source/header Using eruby (erb-like) to proc. embedded ruby Model.cpp.eruby -> preprocess -> Model.cpp Debug hooks Auto #ifndef #define #endif block for headers Generate property getter/setters. Expand Boost.object_pool signatures.
  36. All the Mistakes Questionable/Bogus stuff & decisions we had "Multiple-View

    System" There was a time when 2D/3D switches seemed cool to us.
  37. All the Mistakes Questionable/Bogus stuff & decisions we had "Multiple-View

    System" There was a time when 2D/3D switches seemed cool to us. And we also thought maybe we need multiple view presentations.
  38. All the Mistakes Questionable/Bogus stuff & decisions we had "Multiple-View

    System" void go_exploding(int color_id){ BOOST_FOREACH(pViewBase& view, view_slaves_){ if(view) view->go_exploding(color_id); } view_master_->go_exploding(color_id); }
  39. All the Mistakes Questionable/Bogus stuff & decisions we had "Multiple-View

    System" void go_exploding(int color_id){ BOOST_FOREACH(pViewBase& view, view_slaves_){ if(view) view->go_exploding(color_id); } view_master_->go_exploding(color_id); } It hasn't been utilitzed. ....Yet.
  40. All the Mistakes Questionable/Bogus stuff & decisions we had Read

    the book already even before we started, clearly that was not enough.
  41. All the Mistakes Questionable/Bogus stuff & decisions we had Read

    the book already even before we started, clearly that was not enough. The last 10% need 90% time,
  42. All the Mistakes Questionable/Bogus stuff & decisions we had Read

    the book already even before we started, clearly that was not enough. The last 10% need 90% time, and it is recursively true.
  43. All the Mistakes Questionable/Bogus stuff & decisions we had Biggest

    Mistake: The game isn't out yet. (hopefully we can get it done before Spring is out, but Spring includes May... hmmm)