Weekly Update: August 4, 2023

Earlier this week I posted a patch to the opt-in Helios build fixing some minor issues that testers uncovered.

Since then I’ve worked on some additional minor issues, and started work on a new “fog of exploration/war” feature, which at least a dozen players have requested.

This was a rare feature that turned out to actually be less work than I thought, at least so far. My main concern was how to store exploration data without blowing up save game sizes. The universe of Starcom: Unknown Space is theoretically infinite in size, although practically players aren’t expected to get more than 100 sectors from the origin, maybe 200 allowing for future flexibility. There is also more than one universe. If the fog of exploration divides a sector into quarters, then a 1024×1024 image should be sufficient to store its exploration data. But that’s several MB per universe.

I came up with several ideas for how to compactly store this data, such as expanding the texture size as needed, packing resolution into color channels, etc. While prototyping the interface I discovered two important things: 1) There is an 8-bit alpha only texture format and 2) The PNG graphics format is very efficient at compactly storing image data with no extra work on my end. A quick test showed a fog PNG would likely only be a few dozen kilobytes on disk with real data.

The current system works as follows:

The game’s visibility manager periodically samples a few hundred coordinates around the player to determine what is the lowest visibility object they could detect at the supplied coordinates as a faction from 0-1, then writes that as a float in the alpha channel (actually the square root of that value for reasons of perception) of the texture. There’s some simple shader math to turn that into a color and pad the fog’s edges so the layer can be larger without requiring a larger resolution.

The effect is a soft haze that fades in around the edges of the areas that the player has explored.

My present thinking is that this will be a tech that unlocks a toggle in the map view. The reason is that while players are free to explore off the main path (and sometimes are encouraged to) I worry that first time players seeing the fog near the start of the game will feel that they are “supposed” to clear it.

I hope to get this feature to Helios before I switch to working on the next named content update.

Until next week,