On Friday we visited the Music Hack Day, which Erik was MCing. Surrounded by about 200 creative techies and music company people, we primarily enjoyed the atmosphere and continued composing sounds for our game.
We even made it into DIE WELT - have a look at the article! Can you find us in the picture?
Today we optimized the performance of the collision detection. The previous code made the game reeeaaaaalllly slow. Erik used this opportunity to introduce his principle "Never do unnecessary work". This basically means that you should refactor in a way that your code is A) short and B) it only computes values it really needs.
In order to see the performance difference we used a fancy gem called ruby-prof. It shows you how long each call takes and how often it gets called while the program runs. You can display the output as html (ruby-prof game.rb --printer=graph_html > prof.html) or with graphviz, which visualizes nodes and edges, i.e. the relation between objects (ruby-prof game.rb --printer=dot > prof.dot).
We even made it into DIE WELT - have a look at the article! Can you find us in the picture?
Today we optimized the performance of the collision detection. The previous code made the game reeeaaaaalllly slow. Erik used this opportunity to introduce his principle "Never do unnecessary work". This basically means that you should refactor in a way that your code is A) short and B) it only computes values it really needs.
In order to see the performance difference we used a fancy gem called ruby-prof. It shows you how long each call takes and how often it gets called while the program runs. You can display the output as html (ruby-prof game.rb --printer=graph_html > prof.html) or with graphviz, which visualizes nodes and edges, i.e. the relation between objects (ruby-prof game.rb --printer=dot > prof.dot).
Another tool to measure the time performance of your code is Benchmark. As opposed to ruby-prof, Benchmarks tests your code under laboratory conditions.
You probably won't hear from us for the rest of the week because we're going to BaRuCo in Barcelona!! Yeah! :)