Grogger
(Grogger)
September 1, 2014, 10:59pm
1
In our game, the player builds roads (these are square tile pieces). I am looking for a way to make the ai prefer to walk on roads if possible.
The only method I’ve seen so far is to use a NavMeshModifier volume, but I haven’t been successful in spawning one at runtime.
Is there a suggested method of handling realtime navigation cost changes? (Either in c++ or blueprint)
Thanks in advance
TimGS
(TimGS)
September 1, 2014, 11:11pm
2
Rama is making great dynamic AI system
Dear Community, I am designing a custom AI with my own custom pathing system, as requested by a client! Here’s a video of my progress with my very own pathing system! First videohttps://youtube.com/watch?v=mMKQvAf9KSQ What you see in video is...
, pm him
Grogger
(Grogger)
September 2, 2014, 1:55am
3
Thanks Tim, that looks like a really great system but unfortunately Rama re-invented his own system entirely, I simply need to modify the navigation cost (I imagine this should be possible with the existing navmesh system).
TimGS
(TimGS)
September 2, 2014, 12:49pm
4
Well, you can ask him what’s the best wy to implement it in your case.
Rama
(Rama)
September 3, 2014, 4:34am
5
#Solution
Make a BP of NavArea_Default
Set the custom cost value as seen in picture!
Make a c++ class that extends the nav modifier volume
Set its mobility to moveable in the constructor!
You should now be able to spawn it at runtime, position and resize it!
UCLASS(hidecategories=(Navigation, “AI|Navigation”))
class ANavModifierVolume : public AVolume, public INavRelevantActorInterface
extend the above
in the C++ constructor
RootComponent->SetMobility(EComponentMobility::Movable);
1 Like
Grogger
(Grogger)
September 3, 2014, 2:52pm
6
Thanks Rama, this looks like what I’m after.
I’m having a problem extending from ANavModifierVolume though, I’m getting many linker errors (here’s a sample):
error LNK2001: unresolved external symbol "public: virtual bool __cdecl ABrush::IsLevelBoundsRelevant(void)const " (?IsLevelBoundsRelevant@ABrush@@UEBA_NXZ) ...MobileNavModifierVolume.cpp.obj
error LNK2001: unresolved external symbol "public: virtual void __cdecl ABrush::CheckForErrors(void)" (?CheckForErrors@ABrush@@UEAAXXZ) ...MobileNavModifierVolume.cpp.obj
I’m running off of the launcher version 4.4.1 at the moment. Do you know of any steps to remedy this?
I am having the same problem. I’ve already spent a week trying t modify costs on runtime…How did you solve it?
Grogger
(Grogger)
January 6, 2016, 9:38pm
8
For my purposes, the NavModifierComponent is what I am using
I tried to override cost functions in the nav mesh but I found that so *** difficult…Are you spawning NavModifiers on runtime and changing its costs?
Do you know if a lot of nav modifiers can bring performance issues?
Finally I would be very happi if you can you show me a sample code instanciating your own Nav Modifier.
Thanks!
Grogger
(Grogger)
January 6, 2016, 10:15pm
10
I’m placing movable actors with NavModifierComponents attached to them. The components take a NavArea class that defines the custom costs