August 2025 Update

August 2025 Update

September 5, 2025

Another month has passed. As mentioned in the July update, the goal was to recreate the class Geoscape view from the original X-Com game. So, what’s the status with that? Well, it’s unfortunately not done. There are a few reasons for this: the weather here in Iceland was surprisingly good, so more time was spent enjoying it before the inevitable harsh and dark winter returns. Also, implementing mouse picking and fixing some issues with the skybox took a bit longer than expected.

Skybox glitches

I spent a good amount of time trying to figure out why the skybox was not rendering correctly. It turned out that there were two issues with the SDL PixelFormat I had chosen. The first one was in the cubemapgen skybox generation tool, the second one in the skybox setup code. Because it was wrong in these two places that build on top of each other, it took a bit longer than I would have liked to fix it. There was also an issue with the coordinate system, which was not consistently right-handed, which also caused some minor issues with the skybox when rotating the camera.

Mouse picking

Mouse picking is the process of finding the object under the mouse cursor. This is used to select objects in the game. Or, as in the case of Z-Com, to realize what country is hovered over. This is important, because one of the game design ideas is that location matters. A base can only be built on land. Each base also has a limited area of operations. From this area of operations follows that not all countries will be equally satisfied, which is going to have several negative consequences. For example, funding depends largely on a country’s economy and its satisfaction with your work.

Therefore, getting this implemented well was a high priority. On the implementation side, mouse picking works by casting a ray from the camera through the mouse cursor to detect the cursor position on the sphere. Then, this position is converted back into UV coordinates, which are then used to look up the color value of the UV coordinate in something that I call a “country ID texture”. The color value is equivalent to a country’s index in the game’s internal country database.

Country database and the country ID texture

Quite some work actually went into creating both the country database and the country ID texture. For starters, finding good source data was a bit of a journey. Then some tooling was required to convert the source data into both the ID texture, as well as the database.

September goal

The goal for September is to finish the Geoscape view, as well as getting a first version of starting a new game going. Starting a new game involves choosing a location for the initial base, hiring key personnel, and similar activities. Therefore, I foresee a bit more work on generating the country database. Also, some refactoring is in order to turn some of the prototype code into something that is more suitable for production. This might be a bit of a stretch, but I rather aim high because I want to see some real progress on the gameplay front.