Skip to main content

Ludum Dare 29: Beneath the Surface

I'm halfway through making a game for Ludum Dare 29. The theme this time around is "Beneath the Surface". For once I've had an idea right from the start that's practical, fun and in keeping with the theme. It's a lovely change from my usual pattern of starting with an idea that turns out to be impractical or boring & having to start over halfway through the competition. So on that basis alone I have high hopes for this one.

Here it is: Project Tethys

It's an underwater shoot-and-rescue-em-up inspired by the likes of Defender and Resogun. You control a state-of-the-art combat submarine tasked with defending an underwater research facility from an invading army. Or at least, that's what it should be if I can finish it in time...

The controls are arrow keys or WASD to move, left mouse button to fire.

There's still loads left to do: implementing the rescue mechanic; sound effects; enemy AI; a high score table; a menu system; better models and textures; a tutorial; and lots of polishing. Here's hoping I can get it all done!

One thing that's different this time around is that I've been using Unity instead of my own Javascript framework. This is my first time doing anything serious with Unity & it's been absolutely brilliant! It's such a productive environment. The documentation is absolutely first rate and the tutorials are some of the best I've ever encountered. If anyone on the Unity team is reading this: thank you!

Comments

Popular posts from this blog

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 away of growing an existing memory allocation in place. In C this is provided by the realloc function, but there's no equivalent in the std::allocator interfa…

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 know whether al…

Octree node identifiers

Let's say we have an octree and we want to come up with a unique integer that can identify any node in the tree - including interior nodes, not just leaf nodes. Let's also say that the octree has a maximum depth no greater than 9 levels, i.e. the level containing the leaf nodes divides space into 512 parts along each axis.

The encoding The morton encoding of a node's i,j,k coordinates within the tree lets us identify a node uniquely if we already know it's depth. Without knowing the depth, there's no way to differentiate between cells at different depths in the tree. For example, the node at depth 1 with coords 0,0,0 has exactly the same morton encoding as the node at depth 2 with coords 0,0,0.

We can fix this by appending the depth of the node to the morton encoding. If we have an octree of depth 9 then we need up to 27 bits for the morton encoding and 4 bits for the depth, which still fits nicely into a 32-bit integer. We'll shift the morton code up so that i…