Unity NavMeshes! We've recently switched to them from our old custom A* pathfinding solution, and we've found it super fast, robust and accurate. Here's a few #UnityTips to help you make the most out of the NavMesh API
(thread) #madewithunity
NavMeshAgents are great to get something working quickly, but they're a bit limited & prescriptive when dealing with finely tuned movement & steering. Instead, we use CalculatePath, passing the result to our own character controllers. No agents necessary! docs.unity3d.com/ScriptReferenc…
Consider using NavMesh.SamplePosition instead of just passing your source and destination positions directly! This way our AI can create a best effort path even if the player or enemy positions aren't directly sitting on the NavMesh itself
If you're not using NavMeshAgents then you won't get local avoidance. But you can still use NavMeshObstacles to carve out the NavMesh, and this works really well if agents are also obstacles themselves. Some manual avoidance may still be necessary to make it look good though!
CalculatePath IS expensive, so be careful calling this function many times per frame. I like to randomize the interval between calls to spread out the work done for multiple AIs. I think the tradeoff between this and the flexibility of not having to use NavMeshAgents is worth it!
As always, if you like what you see and want to support us making more stuff like this, please help out by wishlisting Recompile on Steam. Thank you! steam.recompilegame.com
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Finally ported my old particles to HDRP shadergraph!
And poor @Skepsisology has been working on converting our hundreds of VFX prefabs to the new renderer, but it's totally worth it!
Recompile VFX uses 4 different shaders.
Here's how we made them (thread) #madewithunity#gamedev
First up is the unlit opaque particle shader. This is the most important part of the VFX, and provides all of the core glowing shapes. The bloom ramp is controlled by particle value (intensity), and the alpha cutout is controlled by particle alpha.
Next up is fog/smoke/steam particles. This is an unlit transparent shader with an inverted fresnel fade and soft particle depth. We can layer these up to create a faux volumetric effect!
I ported Recompile's hologram shader over to HDRP Shader Graph!
Also added a couple of new features & improvements...
Here's how it works (see graphs in thread) #madewithunity#gamedev#unitytips
It's basically a transparent lit shader with two layered screen space scanlines, fresnel glow, flicker, and some glitchy, wibbly wobbly vertex extrusion thing
For the scanlines, we simply scale the screen UVs and use the fraction node to get a gradient for each line. No textures required! We also animate/pan this along the Y axis
Finally added alpha dithering to our particle shaders! @Skepsisology has been requesting this for ages.
We use it for 2 things: fading out smoke that's too close to the camera, and fading out smoke over lifetime.
Here's how we did it (THREAD): #gamedev#unitytips#madewithunity
Btw here's the YouTube version that doesn't suffer from Twitter's video compression so you can see the effect clearly (2/9)
Firstly, fading out particles close to the camera. In the vert function we get the distance between the world space vertex and the camera position, and normalize that with our desired dithering distance (3/9)