Video by Adam Hartling.
VIGHTING GAME is a two player competitive game. Use the control config screen to set up your controls.
- up, down, left and right move your Vighter.
- attack swings your sword
- block brings up your shield
- attack + move towards enemy = thrust
- attack + move away from enemy = backjump
I’ve had a couple people ask me how I did the fog of war effect in PROBE TEAM. It’s too long for Twitter, so I’ll explain it here.
For those not aware, the “fog of war” is the darkness that is slowly revealed by the probes as they make their way through the derelict “system”. Unexplored areas are dark; explored areas have been revealed.
Note: This technique uses render textures, and therefore requires Unity Pro.
Another Note: You can download the PROBE TEAM project here.
First of all, there’s a level-encompassing orthographic camera. It’s level-encompassing in that it can view the entire level. It’s set up to render to a point-sampled render texture, and not clear colour. Its culling mask is set so the only thing it actually renders are special quads that probes carry around with them, called revealers.
The revealer has a graphic on it that is a very faint radial glow. Because the big orthographic camera isn’t being cleared, the revealer texture accumulates in the render texture. The frame rate is fixed, so the accumulation rate should be constant from computer to computer. Even given the extreme faintness of the revealer graphic, it accumulates to pure white quite quickly.
Finally, the render texture is applied to an enormous quad that covers the entire level, closer to the camera than the level geometry. It’s using a multiplicative shader, so where the render texture is black, the level is masked to black, and where it’s white, the level shows through.
The grid lines of the world are arranged to match up with the texels of the render texture quad, so each point-sampled texel of the render texture appears to fill in a square of the grid.
Hopefully this is a clear explanation! Feel free to comment if you have further questions.