C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
32 stars 9 forks source link

[4.x] TileMap: Fog of War Layer #421

Closed pcen closed 10 months ago

pcen commented 11 months ago

Adds fog of war on par with the 3.5 implementation. Fog of war PCX files are loaded differently, since the alpha seems to be the inverse of the colour intensity, which gives a more realistic fog effect:

Screenshot 2023-08-01 at 4 17 56 PM
pcen commented 11 months ago

It works in game but since I was too lazy to test.. does it still black out the unknown tiles if the FOW image is blank?

If the fog of war is blank (as in fully transparent or missing from the tilemap atlas), only discovered tiles, and tiles adjacent to discovered tiles will be rendered. The adjacent ones need to be rendered since the fog of war reveals the edge of these tiles

WildWeazel commented 11 months ago

Right, I forgot that the bordering unexplored tiles are technically shown underneath the FOW. I think that's why Civ3 ultimately rendered it dynamically instead of using this overlay image that's easily disabled. We might consider the same, but that's kind of a gameplay decision.

pcen commented 11 months ago

Right, I forgot that the bordering unexplored tiles are technically shown underneath the FOW. I think that's why Civ3 ultimately rendered it dynamically instead of using this overlay image that's easily disabled. We might consider the same, but that's kind of a gameplay decision.

The TileMap can also do something more sophisticated when rendering tiles: if the tile is only partially revealed by fog of war, we can only render the terrain below it so no additional information is leaked. Ultimately though, in a client/server architecture the server would have to only make the client aware of some features of the tile when it's partially revealed

pcen commented 11 months ago

will merge this after https://github.com/C7-Game/Prototype/pull/412 is merged into the base tilemap branch, as this can then be merged into the base branch as well

WildWeazel commented 10 months ago

will merge this after #412 is merged into the base tilemap branch, as this can then be merged into the base branch as well

Is #412 still waiting on anything? It looks like my comments were resolved but it's still marked "Changes requested"

pcen commented 10 months ago

will merge this after #412 is merged into the base tilemap branch, as this can then be merged into the base branch as well

Is #412 still waiting on anything? It looks like my comments were resolved but it's still marked "Changes requested"

Not waiting on anything else. I think it remains changes requested until it gets another review