Posts

[Unity][AI][Shader] AI detecting player from vision using camera and shaders

Image
Introduction In a lot of video games, raycasting is often an efficient solution to detect the player from an AI. But the player is often partially occluded, and then a simple raycast is not enough. A solution could be to perform several raycasts on the player bounds, but this is quite limited and can be tricky depending on the gameplay. Also, we often just have to know if the player is visible or not, but sometimes we need to know how much of the vision space the player visibility takes. An idea that has been given to me is to use a shader to detect the player, the AI perform the detection in a similar way the human player do: having a rendered image and trying to detect the target reading the pixels.

The subject I will explain today is a personal try, there is probably a better way to achieve this but I will try to explain a possible solution to achieve this. I will speak about Unity features I used to achieve this, but it is not Unity dependant, this idea is quite general and can b…

[Unity][Shader] Night Vision

Image
A simple shader to make a night vision effect.

Features - Screen colorization - Vignette effect - Noise - Scene diffuse (unlit) and scene color (lit) buffer are blended, allow to see in the complete dark while still having luminance difference on pixel affected by lights - Option to have pixels with high luminance tending toward white
Screenshots


With/ Without (drag the cursor) Video
Source Code[+] Shader
Shader "Post Process/Shader_NightVision"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_ColorTint("Color Tint", Color) = (1, 1, 1, 1)
_VignetteRadius("Vignette Radius", Range(0, 2)) = 0.25
_VignetteSmoothness("Vignette Smoothness", Range(0, 2)) = 0.25
_LightSensitivity("Light Sensitivity", Range(1, 100)) = 1
_LightWhiteTreshold("Light White Treshold", Range(0, 1)) = 0.5
_LightWhitePower("Light White Power", Float) = 2
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always

Pass
{
CGPROGRAM
#…

[Unity][Game Jam] Drunken Master

Image
For the GMTK game jam, we made Drunken Master. The jam theme was to take a game type and to remove one of this core feature (ex: a platformer without jump).

Drunken Master is a 2 player fight game in which you can't fight. 2 drunken guys want to fight and each player control a character that try to prevent his friend to fight. If you can't hold your fighter, he will beat the other fighter. If the other fighter is KO, you loose.

The game is not finished and bugs are still here, but it's quite expected for a 48h game jam game.

Controls Player 1: Hold Q (azerty) or A (qwerty) to prevent fighter to dashHold Q (azerty) or A (qwerty) + Z (azerty) or W (qwerty) to prevent fighter to jumpS (qwerty and azerty) to prevent fighter to slide Player 2: Hold right arrow to prevent fighter to dashHold right arrowup arrow to prevent fighter to jumpdown arrow to prevent fighter to slidePreview

[Unity][AR] 3D Platformer in Augmented Reality

Image
This is a simple 3D platformer I've done to experiment AR with Vuforia on Unity. All the game is drawn on a magazine I used for image detection. The game run on a cheap Android smartphone.


[UE4] Materials collection #1

Image
Surface generation

 Water plane Post process distorsion effect Post process "water on lens" effect

[UE4] Hover based vehicle demo

Image
A demo made on Unreal Engine 4 in which I test hover based vehicle behaviors, post process effects and materials, sound effects.


Download UE4 project

[Unity][Game Jam] Pigeon Break

Image
For the Neon Game Jam #2, we had 40 hours to make Pigeon Break. The idea was to make a runner controlled by Quick Time Events and to play with soda cans. We used a MakeyMakey to connect the cans to the player body. When the player touch a can it sends an input, the QTE keyboard key are so replaced by the cans.
Note: the game is compatible with keyboard SDFG keys too.
Video
Credits
Download Pigeon Break Windows