3D loader for android, first roaming zombies

A 3d game needs 3d models, so I wrote a simple .obj (wavefront) model loader, and it was surprisingly easy with java. It took me roughly 30 minutes and is no more than 50 lines of code (including declarations and comments). So the “game” (still no gameplay in) can now display 3d models, and since it’s a zombie game, I’ve put in a (drum roll please) zombie! But it’s not just visual, but also backed by an NPC class that makes it move (more or less randomly) around the dungeon in a turn based manner.

device-2014-01-28-135250 device-2014-01-28-135411 device-2014-01-28-135538

Next on my list are 3d models for the doors, which are currently plain textured (and two-sided) quads that you can simply pass through. And replacing them with 3d models will allow me to add opening animations (think of the first resident evil games), and I also plan to use doors as a gameplay element that’ll hold back zombies that chase you. I’ve also implemented a simple gesture based model viewer that I’ll use to display items to the player (weapons and such).

After adding the doors I’m going to implement color picking for touch inputs, so that the player can interact with the objects in the 3d world, for e.g. opening the doors by touching them (or gestures for locked doors), hitting enemies or picking up items. Since it’s OpenGL ES 2.0, all the rendering is done using shaders anyway, and just adding shaders for color picking and reading pixel colors should be an easy task, especially as I’ve been using that technique in several other games too.

As far as the model format is concerned, I plan to use .obj just in the beginning. It’s ASCII based, so it’s taking up lots of space, is slow to parse (compared to a binary format), and the most important drawback is the lack of animation. It supports neither keyframe animation, nor bones or anything else do store animations. I guess I’ll go the same route for android as with my Delphi projects and create my own binary 3d file format that’ll implement animations.

I’ve also already gathered dozens of gameplay ideas, including randomly generated zombies from a pool of different body parts (heads, upper and lower parts, arms, weapons) and I even think about taking photos of your friends or relatives, that can then be used as zombie faces. Should make up for a pretty nice moment if a zombified friend of yours is trying to rip you apart 😉

3D loader for android, first roaming zombies

Zombie infected random dungeon crawling

2014 started off pretty busy and I haven’t had that much time to work on my current (and first) android project. But at least I wrote down the first pages of the basic game design draft, and I plan on doing a randomly generated, zombie themed dungeon crawler with not your usual zombie story.

device-2014-01-11-110401  device-2014-01-11-110513  device-2014-01-11-110614

So in terms of gameplay it’ll be a traditional dungeon crawler (think of “Eye of the Beholder“, or more recently “Legend of Grimrock“), with semi-realtime movement but with a modern horror theme based on a zombie infection (yeah, I know, zombies are all around nowadays, see the success of DayZ, but I always wanted to do something with zombies anyway). It’ll have RPG elements like health, stamina, skills, experience and an inventory sytem and I plan on having the items generated procedurally like the dungens itself. I even though about randomly generated enemies with random body parts that can be comnnected at random, though I’m not certain if that’ll work out as I want it to be.

I already got the basic engine up and running, and did the first performance optimiziations (visibility checks), so it’ll run smooth and nice on even lower end devices (like my Huawei Ascend G510, it “only” has a dual core with 1,2 GHz and a mere 512 MBytes of memory). I added smooth animations for turning and moving, and wrote a nice looking shader for per-pixel based spotlight shading with distanc attenuation, which is basically a low-powered flashlight that makes up for a an eerie and claustrophobic atmosphere. What you can’t see on the screenshots : It’s animated and sways around and flickers, and I plan on adding some kind of touch or sensor based way of having to regenerate the batteries from time to time to add some suspension to the gameplay.

As soon as things have settled, I’ll post more information on this project, including some of the technical aspects of the “engine”.

Zombie infected random dungeon crawling