Tàrraco Development

Published: June 2020

If you just want to see a video summary of this post, you can just skip to the end of the post and check out the video.

I recently came across a bunch of backups I thought would be cool to preserve. For that reason I placed them in the github repository so that they can be downloaded and inspected. Source code availability is limited though.

It is worth remembering how this came to be, since it shows how little I knew at the time but also how incremental software development usually works.

The beginning was a simple rotating cubes demo, that was used to familiarize myself with the whole Context/Device instantiation in DirectX, which is not trivial by any means.

Early animation

One of the first things I was worried about was animations. Since I already knew how to create 2D games (check out UFO Invasion) it was clear to me I would need to animate things. However 2D animation is relatively easy: one just creates frames and replays them at the right speed. For 3D however it can get tricky. It is indeed possible to use keyframes but it looks dodgy and requires a lot of memory. In these early demos I tested how one can do linear vertex interpolation between keyframes to create more smooth animations that look great.

Collision playground

Since the beginning the goal was to make a 3rd person view game, so I needed some sort of engine that allowed me to have a character exploring the world. For that reason I played around for a while with collision detection, to ensure that I could move the character in a realistic way (jumping, walking, stairs... but also wall collisions and doors). After spending quite a bit of time on getting this to work I created a collision playground where I added some of the elements that I would later model to experiment and test the engine: stairs, railing, walls, ceilings and arcs, etc.

These two collision playgrounds that I created gave me a lot of confidence that the engine would work. Intially I created a very dodgy version using VB6: Implemented triangle-segment collision and later tri-tri collision. At the time I was learning algebra at school so that helped a lot. Although of course it was hard: there's a lot of issues around the maths of it like singularities, floating point rounding errors, etc.

That's why I came across ColDet and decided to use it. It was not only very precise and easy to use but also super fast. Since it was implemented in C++ it required me to wrap it around an ATL object and export it into Visual Basic. That was my first encounter with C and C++.

Early demos

The first demos were a bit rough but they do not differ much from the latest release. A character placeholder and a few unfinished areas are most of the differences.

I spent a lot of time playing with lighting. It just makes a big difference. Notice how bad the game looks without shadows! That's something that obsessed me for a while since I could not get it to look nice. After playing a bit with Stencil Shadows I settled for static shadow maps. The main reason was that my computer at the time struggled with Shadow Volumes. The first implementation I recall being a simple Volume-Pass which I later changed to the Carmack's reverse to allow my character going into building's shadows. In order to make it viable I segmented the world in a grid and only applied shadows for the nearby grid blocks, which was challenging if you use reverse volumes.

Lightmaps looked much better and costed close to nothing: just a few extra textures, enabling multitexture, and performing a simple dot product with the texture color. This also enables color lights, like fire or torches to lit things in red or yellow. I used Gile[s] (from frecle.net) for that, it was a relatively nice to use Win program. I just remembered the long summer running that thing on my Pentium 4, man it was hot!


I made a video with some footage from different demos to summarize it in a more visual way: 🎥️ Dev Log Video