Skip to main content

Posts

Iterating faster

Today I spent a few minutes writing a Makefile. I think they may turn out to be some of the most effective minutes I've ever spent. At work we build using SCons . When I change a single source file, rebuilding takes between 50 and 65 seconds. That's more than long enough to lose my focus and get distracted, so to stay productive I have to work in larger batches. I code in longer bursts and recompile less often, so that the ratio of productive time to down time stays up; unfortunately that also means fewer opportunities to test my changes. That's not ideal, but it's manageable much of the time. Not at the moment though. Right now I'm developing an algorithm where I need to be able to quickly try out different approaches for each of the steps. In this situation I really want to see the effect of each change in isolation, so I can't batch up my coding. All of a sudden those 50 second build times are a real problem. I spent a little while looking into ways to...

OpenGL ES and occlusion queries

This is a follow-up to my earlier post "WebGL doesn't have query objects" . Since I wrote that post, the situation has changed a bit. It's still true to say that WebGL doesn't have query objects, but the underlying reason - that OpenGL ES doesn't - is no longer true. For OpenGL ES 2.0 , there's an extension which provides basic query functionality: EXT_occlusion_query_boolean  (which seems to have been based on ARB_occlusion_query2 from regular OpenGL). For OpenGL ES 3.0 , the functionality from that extension appears to have been adopted into the standard. The extension provides two query types, both of which set a boolean value to indicate whether any pixels passed the depth and stencil tests. While this is progress, unfortunately it's still not sufficient to implement the pixel accurate collision detection method I described in an earlier post. For that purpose it's not enough to know whether any  pixels passed the tests; you want to kno...

A handy little script for QtCreator users

If you use QtCreator for what it calls " generic projects " I've written a little script which might be useful for you: https://github.com/vilya/newfiles This script will rescan your project directories to see whether any files & include directories have been added or removed and update the QtCreator project files accordingly - something QtCreator isn't yet able to do for itself. It has a few extra features too, such as whitelisting or blacklisting paths using shell-style wildcards. See the README file at the link above for more details.

How to outperform std::vector in 1 easy step

Everyone who's familiar with C++ knows that you should avoid resizing a std::vector inside a loop wherever possible. The reasoning's pretty obvious: the memory allocated for the vector doubles in size each time it fills up and that doubling is a costly operation. Have you ever wondered why it's so costly though? It's tempting to assume that because implementations of the STL have been around for so long that they must be pretty efficient. It turns out that's a bad assumption because the problem, in this case, is the standard itself: specifically, the allocator interface. The allocator interface provides two methods that obtain and release memory: allocate allocates uninitialized storage (public member function) deallocate deallocates storage (public member function) (taken from this page ). What's missing is a   way of growing an existing memory allocation in place. In C this is provided by the realloc function, but there's no equiva...

Ludum Dare 24 Results

The voting has finally finished and the Ludum Dare 24 results are finally out. My game , frankly, did a lot better than I expected: Humour #36 Fun #239 Mood #296 Overall #417 Graphics #600 Innovation #603 Audio #615 Theme #672 There were 1006 entries in the 48 hour competition. I'd been hoping to finish in the top half of the rankings this time after a poor showing last time and that's what I managed: 417th overall. The big surprise was the humour score: wow! I was worried that the humour might be a bit too straight-faced for people, or that I'd be the only one who found it funny. Being wrong has rarely been a happier experience! I was also really pleased with the Fun score. To me that's the most important category after Overall. It means I made something that people enjoyed playing and that's a really rewarding feeling. It was nice to get a decent score for the mood category too, but I've never really understood what it means exactly. The ot...

Invaders: Evolution Post-mortem

Invaders: Evolution is the game I wrote for the 24th Ludum Dare competition. It's the 3rd time I've made a game for LD (as well as one for a MiniLD event) & although I think my games get a bit better each time, I still have so much to learn. This is a post-mortem not just for the game, but for my competition experience as well. The game is basically Space Invaders, but with a twist: it tells the back-story of the aliens through cut-scenes as you play. It also has two possible endings, one of which is rather unconventional by video game standards. You can try it out, or find out more, here: Post-competition version  (fixes some of the bugs in the competition version) Competition version  (this is what I submitted for the competition) Ludum Dare page (vote for it if you can!) Source code What went right I made a game! There was a low point where I thought I'd have to quit the competition (see the "what went wrong" section), but in the end I cam...

Ludum Dare 24: Evolution

The 24th Ludum Dare competition has just finished.  I got a game in for it, but only barely. In what seems to be becoming a pattern for me, I spent the first day working on an idea I ended up having to abandon. The game I ended up submitting was done in a mad 12 hour rush at the end. Here it is: Invaders: Evolution It's a fresh take (I hope) on the Space Invaders story. What, you didn't realise there was a story to that? Well if there wasn't, there is now... There were a few things about it I was really happy with and a few things that could have gone better. Expect a post-mortem soon.