Retera / WarsmashModEngine

An emulation engine to improve Warcraft III modding
GNU Affero General Public License v3.0
192 stars 37 forks source link

Fog of war #18

Open v4dkou opened 1 year ago

v4dkou commented 1 year ago

To replicate W3 gameplay, there should be a Fog of War mechanic

  1. Unit line of sight (probably some low-res ray-tracing on the tile grid)
  2. Visual effect
Retera commented 1 year ago

Sidenote for whoever does this, there was a bug in Reforged when they rewrote the shaders for emulating the old classic graphics where unit portrait faces in 3D that emitted particles would use the X/Y of the particle in the portrait's coordinate space compared against the game world's fog of war coordinate space and then dim the portrait's particle based on the (0, 0) point essentially in the game world and whether that point had been explored. It was really funny once someone explained it to me -- you could see it with the Wisp portrait especially, which would be dark until you explored a particular region of the map.

It's actually really likely that whoever implements this stuff would make the same mistake in Warsmash given that the portrait coordinate space and the world view are two 3D scenes with a lot of code sharing. So, yeah, don't do that :)

Retera commented 1 year ago

https://www.youtube.com/watch?v=FEYrvLCeyrQ

Some progress has been made on this, but although the terrain shader is mostly working it does not hide units outside the explored area yet.