Phi Dinh Profile picture
26 Nov, 6 tweets, 3 min read
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
 

Keep Current with Phi Dinh

Phi Dinh Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @phi6

10 Feb
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. Image
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! ImageImage
Read 7 tweets
16 Dec 19
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
Read 5 tweets
15 Aug 19
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)
Read 9 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!