#gameplay-ai
1 messages Β· Page 100 of 1
I'm just looking for a way to make one system to handle movement for characters, not to split it between several plugins..eh..
No idea how it works
Hi everyone, I've noticed that the AI nav walking sometimes fails because the character is out of the range of valid navigation . FindNavFloor returns false in PhysNavWalking in CharacterMovementComponent, in this situaiton the engine switches the movement mode of AI back to MOVE_Walking (physical walking which doesn't rely on navmesh) but it doesn't seem to swtich it back to nav walking at some point.
So I wonder if there is a system can switch the movement mode of an AI controllered character between walking and nav walking depending on whether it's on valid navmesh?
Any ideas about why the nav walking fails would be helpful too, thanks in advance π
@charred glade yeah, a lightweight movement component for navmesh walking AI would be great
like what Epic did for paragon iirc
hmm yeah
heres a question, i want a respawn delay time on bots and am running into a logic problem. say i have 3 bots. and when they are destroyed it passes a respawn bot request to gamemode. and destroys itself. however because of thedelay, when two requests are sent, since its the same command one gets ignored because the delay. i need some kinda way to have separate requests made
this is prob more a blueprint prob, i need an asynch task i guess
inside the gamemode you could store the time the request came through
keep a list of times that represent the request arrival times
oh god i just got a crazy idea
then each tick check whether the difference between current time and arrival time is greater than the delay you wish
if so, spawn
Heyo
I've seen all of Epic's AI tutorials
yet they don't feel like im able to get realistic AI
like i want certain AI to just do a full fucking beeline
when u run up to them lol
and also some other things
better save all for sure right now ;P
this is going to hurt to look at @wary ivy
not sure if the macro's will "instance" per each but guess thats my test
why not store the queues in a map and get/set them with the team id
no need to do a massive switch
or instead of a map you could have an array of arrays
well the bots are to balance vs real players which can change
this is working so far actually
the respawn time varies as well
if a ball exists or not
if it doesnt the condition is likely a round reset meaning spawn .5 delay
if it exists its durring a around so 7 seconds
the macro
maybenot π
@static dew why not keep the ai controller and have the respawn logic inside it?
guess i'm not 100% how to spawn the ai controller and then its pawn it will posess, i can spawn a ai character and just have it give itself a controller.. when i destroy the character dont i lose the ai controler?
though your absolutely right, i'm trying something.
so far so good π
yes deffinately working
i wasn't seening the controllers on my outliner
so i replaced the call to game mode with a call to the controller to unposess and run the routine on the controller to then request game mode respawn it
Hello, I have a question about open world AI... I have a 5km x 5km map and want to use NPC's but baking a navmesh takes a very long time... now, a player pawn actor (me) can walk on this map without a nav-mesh... can I have bots/AI's that don't need a navmesh either, or is a navmesh required for anything but human players?
what prevents AI from dropping off ledges to chase the player?
the player would have to drop off the ledge first π
thats exactly what I'm doing
the map can be boxed in np.
I've also briefly tried nav invokers https://answers.unrealengine.com/questions/425015/what-is-the-lightest-way-to-use-navmesh-in-an-open.html but did not get too deep into them, was trying them on the bots that ship with Shooter Game sample, didn't really work. Most of the game logic is in C++
@vast wharf that's a big "it depends" question. Short answer is very likely Yes. But it depends on the design intent of the ai
some reason EQS testing pawn isnt working for me
just like this guy
anyone else had this and found a solution?
it doesnt exist on a empty build
a fresh build
I can find the eqs pawn but. No templates and it says depreciated.
This is an engine build π¦ 18.2
anybody know a good place to start learning how to do ai with c++?
There is some one who implement blackboard and behavior three in c++
But thats a pain, you have to give a look at ai controller c++, there shoulda be some tutorial atthis point
can you not reference the behavior tree in c++?
You can if you exposure it. The controller should also be holding a ref to it
Hi, everyone. I have an AI controlled NPC which is using MOVE_NavWalking on the server but MOVE_Walking on the client. Does this sound correct (because the navmesh only exists on the server side IIRC)? Thanks.
Are you not able to add comments in the behavior tree?
Hey, so I finally finished with one part of my UE4 AI with C++/Blueprints basics tutorials. I really wanted to get some community feedback on how I could make my content better, or just overall how people found it, if they've seen it? Link: https://www.youtube.com/playlist?list=PLRiAzpaeIpPSivZPVLqkr5OfoL8wxy_Xc
Thanks!
Hi, I am experiencing a very weird situation. When I load up my project in editor and hit play, my AI does not respond at all. I have tried this many times without success. Then I only open the Behaviour Tree asset that is used by my AI pawns (no change was made at any time!), hit play and AI responds as expected. Also does not work in Packaged build. Any ideas what might be the cause of this? Running on 4.18.3
Dynamic nav mesh, hitting play before t rebuilds?
No navmesh used
Raises another question. How do they path find?
My AI just moves through air and follows a target. The thing is I can't debug what's going on in the Behaviour Tree because as soon as I open the asset, it works again.
check brain component in aicontroller, where are you setting the BT?
check if its set it holds the BT
try windows->devtools-> visual logger: start recording before start, maybe there you can see something
Gonna try that, thanks
Does anyone know how change the value of a blackboard boolean key from a different actor? I'm really new to all this so assume I know basically nothing. I have ai that travel to the nearest fishing spot. Trying to work out how to make only 1 ai go to each spot.
here's my ai task for determining closest fishing spot
and the fishing spot itself
red line indicates how i tried to set the key
the fishing spot has a ai controller?
no fishing spot is just an actor
this is the sort of set up i have
and the tree
sorry for image spam, not sure how much info you need
than self get aicontroller wont get anything, i would set a bool on the fishing spot and check when finding a spot if its used
should i loop through all ai_bp instead?
no in the function from your first image, before checking distance, check if the spot is inUse(you need to add that bool), if not in use do your old test and when you are done and have found one set InUse true
Isn't your task for finding closest spot wrong?
yeah
it seems to be working
it takes the first that is closer than 9999999
yeah and then loops through all of them and then constantly updates with any that are even closer
you run the loop but finish executing the task on your first element
You want to move the part with Set blackboard value into the Completed execution branch
ohh okay thanks, fixed that now
I have a boolean for IsSpotTaken
how do i set that boolean?
wont that have to be set from the ai task?
is this how you were suggesting it to be set? @vagrant pasture
That FishingSpot_BP screenshot looks odd too
so you have an AI actor that finds the closest fishing spot and moves to it, right?
and the FishingSpot_BP does not have AI?
no
Ok, then why are you calling Get AI Controller for that actor?
alright give me a few minutes to digest and undertsand this
the hidden and set actor hidden, is the bool InUse you would add to the fishing spot
sorry if this is a really dumb question but I cant work out what the target/hidden node is.
it has an actor/object input and an bool output?
input should be your FishingSpot_BP type
First set the Actor class to FishingSpot_BP, then create for each node, it will output FishingSpot_BP object
and then you should drag out your IsSpotTaken bool variable, he was lazy and used Hidden instead
where should I be going from here?
i forgot to attach the index to the get node at the bottom
and inside your fishingspot bp add a new boolean variable IsSpotTaken
and replace hidden with get isSpotTaken and setActorHiddenInGame replace with set isSpotTaken
alright will do, thanks
and you want to add finish execute to the false path of the if index >=0, but with success false
@vagrant pasture I have sort of tracked down my issue from yesterday. I found out that no service I attach to a Task gets ticked, however basic. Once I open the BT asset again, it receives tick events (Search / Activation events do this too).
Any ideas what can I do now?
I wanted to try a clean project, but I am having trouble exporting both my C++ base classes and BP subclasses.
no idea there should be no relations between opening the asset and using them
do you have c++ code that does anything with the BT?
My c++ is just a custom movement component and a pawn that uses it, then I subclass those in blueprints. Doesn't do anything with AI
would try to copy BT,Task.. to new project and try using it with a new pawn
thanks for the continued help, is this what you had in mind (i added prints to help me understand what's going on)
adding the IsSpotTaken branch into the fishingspot_bp
IsSpotTaken probably doesnt need replicated but doesnt matter
directly above the get node is NearestIndex, no need to run a connection directly from where you set it
and most importantly you want to set IsSpotTaken to true when the branch is true and dont change it when it is false that only means you didnt find any fishing spots, so you tell the AI to do something else by finishing excute with no success
and i noticed now, IsSpotTaken needs to be part of the fishing spot BP
So in the fishing spot bp do i need to set IsSpotTaken to true if an actor is overlapping?
you set that to true when ai selects a spot to go to and set it back to false when ai stops using it
if the player can block a spot, you could set it to used when player starts fishing and either not allow the player to fish when ai is on its way there or abort the AI and let it search for somewhere else
that makes sense yeah, i was thinking about travel time causing an issue with what i had in mind
the ai still all go to the same spot i'm probably missing something stuff in the FishingSpot_bp
that code will likely do nothing. only if in the first 12-14 somebody is in the overlap it will spawn fish
it's working fine from what i can see
i set the timer for ai before then go off to their task to 15-25 seconds and they all ran to the nearest spot and fish spawned with random intervals
or do you mean if there's more than 14 AI's?
ah wait that runs endless, yeah
oh alright cool
still cant work out how to stop them going to same spot though
also yes, i'm using lamps instead of fish
can you show current version of you task again?
Maybe you don't want the variable IsSpotTaken to be local for that function, you want to create it on FishingSpot
yeah, drag of the Array element pin in the for loop and type getIsSpotTaken and use that for the branch and than drag of the Get node and type setisspottaken and replace the other set IsSpotTaken
like this?
Yeah but you forgot to plug the execution from Branch to that Set node
you dont set it to true
sorry?
oh wait i think i got you
omg i think it works
Thanks man, I appreciate it. It's such a headache wrapping my mind around all this but i'm making progress in my understanding. I'll go over the hraphs some more to glean as much understanding as i can
hey does anyone know if hierarchical task network (HTN) are coming to the engine anytime soon? I think I've read somewhere that they are but can't find anymore...
*it
I think Miesko (cant spell his name) was working on an experimental HTN plugin
MieszkoZ
Ty π
if I have multiple SimpleParallel nodes running at the same time, do they execute on the same (extra) thread, or do each get their own thread execution context?
Hey guys, is it possible to make noise from ActorComponent?
Anyone here that has been messing around with Clientside navigation ? Any lessons learnd ? My project is a peer to peer multiplayer with some AI features. It runs right now with replicated movement on the Tank ai that i have. Do i save myself alot of network load by doing Clientside navigation and setting replicated movement to false ?
Anyone got thoughts on ways to navigate bots around moving objects. Updating the navmesh dynamically with obstacle doesnβt seem to work well.
This clip shows points around a ball the colored bot is trying to get to in order to be in a better defensive or shooting position. Sometimes they donβt avoid the call as youβll see in the end π
asked in the wrong chat earlier, but hey! Is there anyone that has an experience with traffic simulator?
Got a car moving on splines, randomly choosing which are allowed, but how do i define for example if a car wants to get from start to end through splines? Tried to search how i can define pathfinding
@errant phoenix You could try defining the path as if it was part of an βGraph Traversalβ
Google it and see how it might apply to what you need.
alot of non-related stuff to ue4 to read, but it depends on "Point" based navigation finding the shortest path trough the points as i understood?
not non-related but yeha
Basically i was getting at that your Spline points could be represented as part of an graph. Then finding an path on an graph in 2d space is much easier and thus you should be able to translate that directly to an path of spline points which may not be necessarily be apart of the same spline.
Got any links? tried to search this up, finding mostly unanswered answerhub threads haha
Anyone ever had issues with AI not wanting to follow nav links?
I followed this and have interactable doors set up with nav links but AI ignores them
If I manually place nav link proxies by hand it works
when an observer aborts the underlying node tree, does it abort tasks in the middle of execution, i.e. in the middle of a function, or does it wait for the running ExecuteTask() to complete?
So I am having trouble with dynamic navmeshes and using world composition.
specifically when I call moveto it fails because it can't find the nearest navigatable point
I checked the "full rebuild on first load" checkbox as well
hmm it would appear this has something to do with the size of the world I believe...
@night hazel have you dealt with world composition and dynamic navmeshes?
nope
sadface
following this tutorial series (https://www.youtube.com/watch?v=eND5XlHvX0o) but getting errors like this
Announce Post: https://forums.unrealengine.com/showthread.php?109449 In this Live Training Stream, Ian and Alexander talk about what we'll need to create MOB...
which links back to this
no idea what exactly is going wrong, but my minions will spawn, but will not move to any waypoint (given the error that makes sense) but cant tell whats wrong in the blueprint, getting some sleep- thanks anyone!
@pale current you clear your waypoint count and than resize it to 2, but you try to access lane 3(index2) also when you use increment you dont need to set it again
anyone know how to make sure when an ai spawns it doenst immediately start using any cached up movement information? i have rounds in my game and some reason after each round when the bots respawn and posess a new pawn they take a few steps in directions when they shouldnt
you reuse ai controller?
yeah
they unpossess and a new pawn is spawns and they get pushed into it
tried stop movement in pawn when it unpossesses no change
you can stop ai logic
hmm wonder if its the blackboard/behavior tree still running the move routine
and make sure that you reset the blackboard keys
giving this a whirl
getbrain component-> stop/restart logic
yup
since movetolocation was still set it was valid and it continue with the logic on spawn
thanks π
service nodes in behavior trees may have random deviation specified for their tick interval. is it per BT instance of per BT? say I have 5 AI controllers all using the same BT: do each of the units get their own, randomized intervals or does it just randomize once and apply that number to each?
I'd guess that the goal of random deviation is so that service execution is staggered, i.e. my 5 units won't all be executing the same service at a similar point in time, correct?
Hey guys. I'm running into an ai issue where if i spawn an ai it changes the variable for multiple actors. Basically I have fishing spots that the ai are supposed to travel to and this works really nicely when i manually place ai before pressing play. but when i spawn by standing on a button, the ai behave differently
basically the way the ai works is that it finds the nearest available fishing spot, checks if it is already taken, if not it will mark the spot as taken and move to it. Issue is, that when the ai sets the spot as taken, it also changes the variable for all other fishing spots
how are you setting it?
the way you showed me last week π
Thanks for that, really appreciate the help
i'll get a screenshot now
check if that task runs more than once for one ai and make sure that the ai resets the spot if it takes a different
hmm i added a wait node before the find fishingspot task and i think it solved the issue
very strange. will make 100% it's solved now
seems like it...
literally spent an hour trying to fix aha
I've gotten my actor to recognize its waypoint assignment, but it stops at the first waypoint despite having more in the list...is this a behavior tree problem most likely?
considering if its maybe nav mesh...? maybe ill just sleep on it and try again tomorrow lol
Hi everyone, I need to pick a random point in radius (2000) but I don't want the point in radius (500).
So is it possible that I pick a point between radius 500-2000?
do a random range between 0-1500 then add 500? π
Hmm..that might work. I can pick a random direction and multiply it by a random range between 0-1500 then add 500 π . I'll give it a go. Thanks.
just get the actor location, break vector, add a random float range to each axis, then add 500, set that as the target location
you just make a blackboard vector variable, set that in the task we just created, then use a walk to in the tree and walk to the target we set
Let me know if you get that working and i'll post my question. (having trouble with spawned objects not behaving the same as when i place then manually)
@acoustic tulip oh wait i got it wrong, give me a sec
Thanks a lot @outer bane since all my logic is in C++ so I will probably try to implement it in C++. I think the idea should be good and I just need to make it fit my situation. You can post your question though. π
@acoustic tulip i think this should be it
(i know you said not to worry but I wanted something like this too)
basically checking if the direction they are moving is positive or negative and then either adding or subtracting 500 accordingly
Alright to onto my issue. I have fish that spawn when ai stand on a fishing spot. I've made it so that the player can pick up these fish when they walk over them.
then ion the player i have this
everything works perfectly when i manually place the fish, but when i spawn the fish using the fishing spot, the fish dont work
this is the fishing spot
are you using BT?
I'm using behavior trees for the ai movement only
the actual spawning happens in the flishingspot_BP
i dont think it's an issue with bt
the fish spawn using a blueprint
and the player is supposed to pick up fish
"the fish dont work" isnt very precise
i have BP showing the entire BP for the fish
if you scroll back a bit i included all BP screenshots
basically the fish are set up to be destroyed when player overlaps
this works great when i place them manually before hitting play
but when i spawn the fish (actor/object?) using the fishing spot BP they stop being able to detect the actoroverlapevent
from what i can see
hmm it's printing a bunch of times
means what
sorry?
do you want the player or ai to pick them up?
player
if your branch fails
then your cast has failed
the player pawn is not the one overlapping
i ask myself why you even did that math
equal player pawn
unusual
just cast to the player
wait did you want me to add the print here?
yee
and these are incorrect?
I'm really new to programming so i just tackle it as i go and do my best to learn and work things out
woa that is creepy
youre doing overlaps inside the player
dont do that
dont
that entire code there could be in one actor
and that one has a collision sphere
from wich you get on component overlap
where should i keep track of many fish the player has picked up then?
in the player ofc
but youre not doing overlaps inside the player
the fish has the entire code
not the player
at least this case demands it
you want to overlap fish
not check if player has overlapped
the difference is the perspective
the player is constently overlapping lots of stuff
its to global
the fish can detect alone, is enough
So inside the player I should check if fish overlaps, then destroy fish, and add to the counter?
no
youre already checking inside the player
thats bad
the fish checks
give the fish a collision sphere
then get oncomponent overlap
other actor > cast to player BP
if that all works, add 1 fish. Destroy fish(self)
@outer bane
Ahh okay. I just read up on casting some more and understand it a little better I believe. So when it adds to the Red Rishcounter that is happening in the RedFish_BP, how do you tie that variable to the player?
that variable is from the player, you could also write a function on the player that handles adding fish since it would give you more control to add other side effects
Also when i place the red fish now i can destroy actor by walking over to it, but when it's spawned using the fishing spot i can no longer destroy it
that ++ node actually works?
it uses reference to increment
i always have a bad feeling using it
well i would normally have a function on player that does the actual logic, but use increment there too, its only a macro adding 1 and setting the var
alright awesome, I have that set up. Still an issue with spawned actor not being able to be destroyed when player overlaps trigger
did you change collision settings in anyway in the placed actor?
I dont think so, just dragged and dropped it into viewport
actual BP actor looks like this
the table is a red fish aha
are you standing inside the overlap when it spawns?
@vagrant pasture no, i stepped way back
try comparing the collision settings of both to make sure that nothing is changed
in the details panel in the main window?
this is the one i placed
this is one spawned
i cant see any changes other than the listing order of the items inside the fish BP
click on the sphere component and look for collision
Making logic for an ai to intercept a moving ball is quite interesting
Itβs like... I think I need to dot the actors to get a vague idea of coming or going. Then get its predicted location. And add or subtract the base movement speed of the bot hmm
@outer bane i see your problem look at the blue collision of your "fish" its larger than the overlap so you cant touch it, you need to make the colision sphere larger
but the blue collision isn't what we're using for the overlap detection? @vagrant pasture
oh wait if i scale it up to 1000 it works
its a blocking collision you run against it and never got to the sphere
so the fish is being spawned with incorrect sphere size?
or either that the sphere doesn't move with the fish?
and stays up in the air
yeah make sure to always have overlaps larger than the object
i just let liek 10 spawn and then were positioned apart from each other, when i got within a certain range then all vanished in one go
i think the sphere collision isn't in the right place
didnt you scale it by 1k?
yeah
fix the setup first, set the scale to 1 and set the radius until its 10% larger than the object
oh sorry have scale set 1 and the radius at 1000
than make sure that radius is only 10% larger
should it be working? It doesnt :/
weirdly things look different between spawned and manually placed versions
where does the blue box come from? and when you take the spawned object now and place it does it work?
i just enabled bounds which lets me see the sphere collision
no moving the spawned objects does nothing. when i say manually i mean by dragging from the content browser
meant adding a new one, in viewport switch from lit to player collision(near the bottom)
i was right!
the collision sphere is floating up there
it doesnt fall with the fish
is your sphere attached to the fish?
it is now
which just solved the issue
before it was attached to the scene root
thanks man for the help, really appreciate it
How to make one AI chase another AI (On seen) ?
I suppose we need mesh reference of the other AI , but how to get it in first AI's blueprint graph?
When are BT decorators evaluated? For instance, if a decorator's condition becomes true, it evaluates the subtree. What happens if the condition becomes false? What triggers the decorator to check?
Reference for the Behavior Tree Decorator nodes.
@kind wigeon Maybe this helpful?
@acoustic tulip Thanks, but I've read that page several times already and it doesn't seem to have the answer.
It goes in order of the numbers on the tree working itβs way down left to right when it fails it moves to the next. And itβs failure type is determined by a drop down on the decorator
Fail self etc
i think he wants to know if the decorator gets notify on change of the variable it observes or if it checks in some interval
Ah
So I've gotten team0 to recognize their proper assigned waypoints and they progress in the proper order using a waypoint array. I thought doing a 'reverse' loop would allow me to use the same array, and just run it in reverse for team1. It's still assigning the waypoints in the same order as team0. Suggestions on how to have the order run in reverse for team1? thanks π
I debated just making seperate waypoints entirely and repeating this process, but I feel thats a lot of extra tasks unnecessarily being done
you get the waypoint number from the waypoint which will be the same even if you reverse the loop, you could add them reverse by subtracting it from last index and than setting it with the result, but why not use 1 array for each lane and have team 1 pick the waypoints in reverse when they pick them
hmm yaeh i tried subtracting but that kept going wrong somewhere as well
Hi guys, who is created first when I launch the game, the pawn or the controller?
@fallow gull If you are spawning everything from the GameMode (as in "not placing the pawn directly into the map"), the Controller is created and then the Pawn.
@neat summit okay. and the inverse if I place the pawn directly into the map right?
yes
Okay cool, thanks
np! π
I have a question about EQS, how could I trace from an actor set? In other words, from multiple actors?
I have some hiding spots that are actors in the world, and I want to trace from every enemies to check if they see any of the hiding spot actors or not. If they do, the score is null, or filtered.
I can only get one enemy tracing
@fallow gull you have to create an EQS Context (either using C++ or Blueprint). It has a method called "ProvideActorsSet" where you can return all the actors you want. The trace test will use this and score/filter accordingly
I forgot to say thanks, It worked. Let me explain what I did, because I'm not sure I get everything :
The main query was supposed to search for all the hidding spots in the maps. Although I was using a single actor method as the context on the main qurey (that was my error).
Then I had a visibility trace test that was supposed to trace from each enemies and check if they see the hiding spots or not. I used a context that provides an actor set on this test.
The wierd thing (And I still don't understand why) is that I would find all my hidding spots even though the context on the query was set to provide a single actor. And the trace test would trace from only one enemy even though the context was set to provide actor set. Normally, shouldn't it be the inverse?
How does AI Controller actually move the pawn?It looks like it uses "Add Movement Input".
Is there a possibility to incercept/customize the behaviour?
What would you modify in it?
Hello guys, How that is supposed to work?
Do the trace fires from my enemy to my actors of class ''BP_HidingSpot''
Or do the trace fires from my enemy to my querier?
Or even something else? My results are quite strange...
this is what I get :
My enemies are circled in red
@static dew Well, AI Characters always move in straight lines. A more organic movement would be neat.
Like strafe dodging?
I am too interested in ai that goes a to b but. It so straight. If it was a texture Iβd be letβs allow a noise texture to be fed in to randomly provide left and right deviations but still go straight π
you can chop it in smaller querries
Hi peeps! I barely did any AI in UE4 at all, and after a huge break, I need to set up some really basic AI logic, however it's not working as I would expect it to do so. I got a basic Tree/BlackBoard, that fires a sequence, like: Start -> Sequence -> Find Random Point -> Move To.
However, it's always giving me 0,0,0 for the point, and the AI is not moving. Tried Random Navigable and Random Reachable, and I just can't get it to work.
got a navmesh?
Tried hooking up the NavData pin in both, and without them, same issue persists.
Ofc
Checked a tutorial by Tesla, same code, not working here (4.18.2
MoveTo in behaviour trees not work with FloatingPawnMovement ?
or maybe my BB value isnt being set...
Here's my incredibly complicated code. Char location printed properly, random point prints 0-0-0 and no movement happens.
i think you need that NavData pin connected
Event received ai input
Will give you controller pawn
Oh duh I see it
You have an actor casting to a player controller
That cast is probably failing @quick anchor
And a player controller doesnβt exist in the world so itβd prob return 0 if it was working
The prints are working, it wouldn't even print if the cast failed
can I make a character not being affected by Nav Area Costs?
Or by a specific Nav Area?
Hey guys, I have this problem where MoveTo starts failing and it won't take any MoveTo inputs. AI just stands still and refuses to move anywhere. Any idea of a workaround? Engine version is 4.15.3.
@ruby sinew are you sure you've created navmesh for your level?
MoveTo wont work without it
There is a navmesh, and it works fine for a couple of minutes. Until one of the actors starts failing its MoveTo.
Hello! I am facing an issue with the function MoveTo. I wrote a detailed post (project included) on the answerhub in December but didn't get any answer yet π . Could someone give me some help? π https://answers.unrealengine.com/questions/734472/move-to-bug-when-toogle-collision.html
Hello, anyone here have experience with Quixel Megascans?
Hello again! Could you please give me upvotes on my answerhub post π€ ? (see my yesterday message)
Hello people. I am facing this issue when using EQS and moveTo : https://answers.unrealengine.com/questions/759917/move-to-not-working-when-passes-through-dead-playe.html
any idea why the blackboard key isn;t being set? https://i.gyazo.com/7058346c3a8a8e085b2e67d5009ab120.mp4
nvm, was using wrong set value node :l
is there a way to block a task from executing with a blackboard based condition, but at the same time return success as a result?
I know about the force success node, but I think it only forces success if the underlying task has failed (not another observer)
you can put it in a Selector with a decorator that prevents exec and ForceSuccess after it
Question - i got a AI problem with some physics i'm doing in a project ..... I have a "fan" that applies a force from it - pushing whatever objects come into its "BLOW" path away from it. I have AI Bots that when theyre on a pathfinding goal, and cross into this fan.... become "Confused" and when blown.... try to get back to the spot they were blown from before progressing forward with their goal.
I can easily pickup when the bots enter into this "FAN" area.... but i'm not finding a way to RECALCULATE their goal... or what i would expect to see is a Nagivation/Pathing ForceUpdate function. Does such functionality exist?
Hey I'm running into some issues with 'the move to' task. I have a tree i want them to move to and have a vector key storing the location but the location is at the center of the tree. I think this causes the task to fail as the ai cant get to the center of the tree due to collisions. I've tried adjusting the acceptable radius but this doesnt solve the issue unfortunately
oh that worked like a charm! Thanks!
I'm in the stream lol
It's in your profile
1 sec
@outer bane Debug points
I have a custom Environmental Query built for my AI to determine illumination, how could i use the same query system data to determine the illumination of my Player?
Is it possible to have non-conditional decorators? For instance, I want to trigger an event when a BT node deactivates.
@kind wigeon whats about receive execute finish?
@vagrant pasture What does that do?
gets called when the decorator finish's with a reason
Great, thanks.
Anyone got some spare time and want to help? I am really getting desperate now... AI doen't want to do what it should
From the left into the branch comes the result of the linetrace, true = player in sight, false = no direct LOS. Somehow the AI always instantly falls back to idle, despite there being a memory marker
do you ever clear your MemoryMarker?
because if you do not, all those MemoryMarker == NULL checks will always return false
How can I make my AI
walk around dynamically placed structures
and foliage
they just get stuck...
and cant path around it
if its walking around, you can probably use a NavModifier or Blocking Volume
make that part of NavMesh not exist for them
Hey guys, I'm working on Blackboards/Behaviour Trees for the first time... can someone tell me how I can trigger a task only once when a key is changed?
Hi! I need some nice AI tutorials. Please DM me them if you know some.
hi guys is there a reason why i cant use the "LocationToGo" key to my Blackboard key??
Judging from the colour, it looks like its type Object. How are you using the key in the task? Normally "go to" functions are down with vectors.
Hi guys I have a problem with the AI not playing its walking animation, it is playing the Idle animation so the Anim BP is working. Maybe it is not reading its speed as to why it's not moving? Can someone tell me where to check? Here is my Anim BP graph setup:
Anyone got some thoughts why my bots don't want to move when i travel from one level to the next?
like the behavior tree is running but they don't do there thing
open VisualLogger
record the incident, and check what are your bots actually doing
@sinful zealot i have the same exact issue
hi so im having an issue exactly the same as kemp that i cant figure out to solve and that is my MoveTo isnt accepting my LocationToGoKey
@inner crane do you know what is the exact reason for failure?
exact reason no because i have no errors but it seems to me that its not pointing to it all but i dont quite understand it. Im kinda new to ai and programming with it.
go to windows>developertools>visuallogger
start recording, and then play the scanerio where it fails to move
visual logger will present you in detail what each AIController is doing
that can fail for alot of reasons
SelectControlPoint fails, you didn't add a navmesh, location isn't reachable to name a few
that is why visual logger, so you know what you need to fix instead of stabbing at it in the dark
your SelectControlPoint should fill a blackboard key
and your moveto should access it, it should not be None
im pretty sure i did set it too. would you like to see the code for any issues?
i mean knowing me
i probably messed up one line
Tool that captures state from actors and then displays it visually in game or editor.
you start recording
it will list all the AIControllers that are active
and it will draw boxes in the graph whenever they try to do something
when you select one of those, you can see its state, its pawn's state and any feedback from its actions
at the time of execution
LogVisual (Log) Redirected 'PathFollowingComponent' to 'AIController_0'
LogVisual (Log) Redirected 'ActionsComp' to 'AIController_0'
LogVisual (Log) Redirected 'BP_aiPatrol_2' to 'AIController_0'
LogVisual (Log) Redirected 'GameplayTasksComponent' to 'AIController_0'
``` this is all i got
that happens at the very start i take it?
what happens when you give it a MoveTo command?
how do i do that
when tree executes as the game goes on
it should draw more boxes in the graph
you select one further in and see what happens when your BTree runs
it didnt draw anything
in that case i'd wager your BTree doesn't even run
im going to sleep in a couple of minutes
Do people do AI with CPP or just via the editor ?
Yes AI can be done in C++
Blackboard is just like BP
I'm guessing CPP AI is more performant too?
ai perception
ai perception?
Some mixture of C++ and BP/Editor, as always, is the best
But yeah you can make/use most everything in C++
Not to be a prick, but that's an incredibly non-answer answer.
But that's probably because my question was overly broad.
Β―_(γ)_/Β―
ive a map with a blocking gate in it, which i enable/disable based on certain conditions
the ai is refusing to move through it when its disabled
am i gonna have to manually recalculate the nav volume when i enable/disable it? or could there be something else im missing?
its a bit odd, because they do move all the way up to the gate, then kind of hit an invisible wall
So, I can see it has been asked 1000 times in here, but I find no answer
How do I make my AI jump up to another Navlink?
I can make him drop down just fine, but... not jumping up
@snow night because not many people worked out how, or are willing to share! I'm busy now but message me later I'll explain how
@keen furnace Thanks!
np
Hello! I am facing an issue with the function MoveTo. I wrote a detailed post (project included) on the answerhub in December but didn't get any answer yet π . Could someone give me some help? π https://answers.unrealengine.com/questions/734472/move-to-bug-when-toogle-collision.html
(at least upvotes ^^)
you could put a decrator around the MoveTo function that checks if the destination is reachable and aborts if its not
Hi everyone, can I ask if anyone has experience using FindPathToLocationSynchronously to decide whether a location is reachable for an AI taking the NavQueryFilter into consideration also?
how would i set my ai to go back to path if lost actor
Set a homelocation and tell the AI to return to it if the actor is not valid
in the code or behavior tree
what is the best way to have the ai to check if it can still see player and if it is close enough to attack without a homelocation and just continue on its path. also keep in mind im in c++
is there a way to limit the angular speed of an AI character? ive done basic movement and it turns instantly around corners
i think that is the movement component's job
Hi. I have this behavior tree setup
It's causing me some problems
The first two on the left work fine. But once angerlevel goes over 600, they stop standing up and just follow the player
eventhough they are supposed to stand up before they can start moving
Any ideas what I've done wrong?
Tall order here but anyone have the logic handy to make a pawn, that's using the character animation that comes with third person, rotate when moving?
AI is Artificial Intelligence. Discussion about anything that can be described as non player
Is there a tutorial, or an online class or a book or an instructor, that can teach me BTs and EQS?
what is ai from?
@DCorvinos#1829 you can take a look at this one, it's an official unreal live training
Noticing an inability to let my AIcontroller control my BOTcharacters yaw inputs.
However letting my AI drive my Add Movement Input on the Movement Component works just fine.
is there a way to make a decorator with 'observer aborts' update immediately? I notice sometimes the behavior tree will execute another task before the decorator further up is re-evaluated
so sometimes an extra task happens that shouldn't, after the conditions for aborting happen
I see blackboard values cause immediate update, so I guess the answer is to push all data through the blackboard
so much boilerplate setting/getting though, and having duplicate data around is error prone
it's a shame you can't tag properties in the actor to automatically be in the blackboard or something
@potent minnow https://youtu.be/NZZtMNdJk5o
Training Content Creator Ian Shadden is joined by Lead AI Programmer Mieszko Zielinksi as they build on the Basics of AI stream and delve into more advanced ...
is there a way to have a MoveTo BT task run in the background, i.e. return immediately?
I'm guessing I could make do with a SimpleParallel node w/ the left branch being the moveto, right branch everything else, but doesn't MoveTo somehow support this by default?
Is there any lovely person that can help me? Is there any way a can fix the navmesh build, to fit better? Or are my world scaling off?
you have anything invisible protruding from those walls?
Anyone familiar with AAIController->FindPathForMoveRequest ? I'm not sure how to format a MoveRequest or Query member
@patent hornet No nothing. The yellow lines is the navmesh tile bounds. There are only static meshes in the level, and the collision sems correct. . . Any idea?
@exotic dove regarding small navmesh bounds you can adjust your navmesh agent size to fit up closer to the sides of walls. It can also be a result of the entire world itself not being large enough, you can try scaling literally everything by some factor
Also I was really lazy and didn't even inspect the agent radius lol
Yes I would try scaling the world by a factor of 8 and see if it doesn't improve
@fluid sequoia That was my fear. π¦ Theres a lot to change in my characters in that case. ha ... damn. A appreciate the help tho. Thanks a ton.
@exotic dove tell me if scaling everything actually fixes it whenever you give it a try
@fluid sequoia I will try. My fear is that to mutch must be rebuilt. Already started thinking on ways to go around it. .. **** me.
I faintly remember there may be a way to adjust the world scale amount as an engine variable but I'd need to look into it
@fluid sequoia I tryed loking in the documentation for quik bit, but i didet find anything obvious. Sounds like a awsome feature tho.
You are controlling a Mouse in the game. So i started building everything way to smal... foolish of me. haha
i'm using tensorflow to make a chat bot ai
i have a code with these lines
import numpy as np
import tensorflow as tf
import re
import time
tf.__version__
lines = open('movie_lines.txt', encoding='utf-8', errors='ignore').read().split('\n')
conv_lines = open('movie_conversations.txt', encoding='utf-8', errors='ignore').read().split('\n')```
but when i try to debug it via vscode (code runner) it says that it can't import numpy and tensorflow..
and when i try to run it via live code runner (https://cloud.backend.ai/) it says that it can't find 'movie_lines.txt' and 'movie_conversation.txt'
please help
@lyric flint I would assume the errors you get trying to run it through (https://cloud.backend.ai/) is because that remote site doesn't have access to the local files 'movie_lines.txt' and 'movie_conversation.txt'. In regards to failure to import, make sure the files you want to include are arranged in the folder hierarchy correctly
Also including that web link puts a switch button under my message in discord which I can't interact with... which is cool
oh i'm sorry
as far as i know i can't seem to upload my local files to the cloud
so i guess the only solution is to make vs code able to import tensorflow
i'm installing Anaconda right now
@viscid oasis It is done in Template project. They just rotate the Pawn to the Controller's Yaw rotation every frame.
hmm?
Can I extend AI to use more MovementModes than Walk,Swim and Falling/Flying?
like Climbing Ladders, Climbing Ledges (implemented via different Movement Mode. NOT flying)
hey anyone knows how can I see the vision cone when using AI Perception?
Hey all, I'm having a problem with getting back the NavPath from pathfinding request. I prototyped a function here that my character uses to tell the AI controller to move it. I have a working implementation using MoveToLocation but now I'm using FindPathForMoveRequest to get the NavPath separately.
Here is the current implementaiton
void ADungeonCrawlerCharacter::NavigateToLocation(FVector TargetLocation)
{
CharacterAIMoveRequest.SetGoalLocation(TargetLocation);
((AAIController*)GetController())->BuildPathfindingQuery(CharacterAIMoveRequest, CharacterPathFindingQuery);
((AAIController*)GetController())->FindPathForMoveRequest(
CharacterAIMoveRequest,
CharacterPathFindingQuery,
CharacterNavPathSharedPtr);
((AAIController*)GetController())->GetPathFollowingComponent()->RequestMove(FAIMoveRequest(), CharacterNavPathSharedPtr);
//CharacterPath.Get()->GetPathPoints() Will operate on path points here to draw visual of path
}```
Also yes a proper implementation should just get the controller when my character is created but I was roughing it out
ANYWAY the pressing issue is that this code works but only once, anyone have any clue why?
Addendum, checking path points that I receive on the second attempt to call pathfinding, I only get the start and end location which are the character's current location
OK, solved the problem.
As it turns out, you should modify the FAIMoveRequest goal location by using UpdateGoalLocation function rather than SetGoalLocation. I assume this is because updating the goal location is setting some metadata in FAIMoveRequest to repath so when the query is made through BuildPathFindingQuery it knows to use the new value... or something like that lol
In any case if anyone is interested in getting NavPath node locations from their pathfinding request then this is a good way to handle it, it seems.
OK new question, anyone familiar with rapidly modifying a path target location rarely causing the character that's following the path to get stuck stuttering on a node? Not entirely sure what the cause is
Another question, is there any helper function for making navpaths?
I wish I could find more implementations of AI in games to look at as examples. There have been a few AI example livestreams but they seem to me to be too rambling and verbose to be useful.
I know of one video in particular where a guy throws a ball and has his dog return it to you then go back to running and hiding, but that's the only kind of thing I've found like that.
Anyone familiar with efficient function for checking whether navigation node is valid, recast nav mesh has GetRandompointInNavigableRadius which returns a bool whether it can find a point but I can't seem to find a function that merely checks whether a point lies on navmesh
@fluid sequoia UNavigationSystem has something like that. Namely "ProjectPointToNavigation", which checks if a specific point can be project to the NavMesh
Thanks @neat summit , I have an implementation using GetRandomPointInNavigableRadius that seems performant but was looking for a better solution, I will see whether this is better suited
anyone knows of a reason why a simple "move to" fails?
it goes to the target, the problem is not that it can't find its target
it just goes there, waits a few seconds and then fails
last night it was working perfectly, I don't know what happened
and now, I changed the target variable into another type, didn't change the code at all (except for when i reference the old variable) and it works
Is Unreal AI bugged or something?
should i stop using BTs?
Hi all. Does anyone know if you can feed in the PlayerController to an AI Blackboard and use that with AI sensing to track the player? Im having an issue now where the AI lose sight of the player character when they enter a vehicle. Or perhaps any other suggestions on getting the AI to keep sight of the player character when they enter a vehicle. Thanks!
How far away from the player can I spawn an AI and it still make its way to the player?
how far before the engine says its too far and stops running its BT?
how would you go about creating enemy boat ai for a pirate game? shis should chose to broadside, ram, mortar or flee and attack ships or idle
that's a really broad question
@wary ivy *that's a real broadside of a question
More specific question: I know how to make a behaviour tree, and get it working with one AI character, and one AI controller. What about multiple enemy types?
Do I create a seperate AI controller, character, behaviour tree and blackboard for each enemy type?
or is it better to re-use the same assets and just have variables to define if an enemy can do a thing?
Like with my weapon class, I use a data table to define different weapons, and I can use it to have anything from a single shot pistol, to a full-auto rifle, to a pump shotgun on the same weapon BP
I'd have same kind of AI try to use the same controller class
but with different behaviour tree
like all humans would use the same controller class
ok, so far my AI controllers are just this: https://docs.unrealengine.com/portals/0/images/Engine/AI/BehaviorTrees/QuickStart/6/fullEG.png\
a simple use blackboard, set a variable and run behaviour tree.
so would I get the blackboard and behaviour tree to use off the character?
afaik, I spawn the enemy character class (the actor), which would then create an instance of the AI controller for it
Just found some tutorials on spawning waves of enemies that might help me
Dumb question: Am implementing AI behaviors for a dumb FPS game. Currently struggling with how to design my BehaviorTrees.
- Should I re-evaluate blackboard values in one single ServiceNode at the Root?
- Should I instead break up behavior into many different ServiceNodes further down the tree?
- Should I not even bother with ServiceNodes because they run on every tick and might lag up the game as my AI behaviors scale due to re-evaluating the logic?
- Should I instead just assign Blackboard values from the Character's AIController and trust the BehaviorTree's may Decorators to sort everything out?
- Should I use an ENUM to determine the behavior state of the current AI? Or should I just use Condition decorators on Blackboard values to determine it dynamically within the BehaviorTree itself?
Not sure what the best practices are and I've never seen any tutorial video that shows recommendations. I've seen official UE4 Training Livestreams that take one approach, but then I've seen others that take another approach.
For example, in the Advanced AI Official Training Livestream, they take the "Use the AIController exclusively to assign/edit Blackboard values and then use a single ServiceNode at the Root Selector in the BehaviorTree to determine which behavior nodes to run"... but in the Game Ready AI Official Training Livestreams, they took the ENUM approach, if I remember right.
In the "Throw a ball and the dog will retrieve it for you" AI EQS demonstration video, the guy in his example took the "Use Service Nodes everywhere to re-evaluate Blackboard keys" approach.
... So is this one of those "all of the above are valid and good regardless of scale" situations like so many others in programming? Or is it one of those "do X in Y situation, and Z in W situation" things?
is there an in-depth tutorial on the web explaining the mechanics of how Decorators work?
I am checking the source code but sometimes I see comments like // highly inefficient, but hopefully people will use it only for prototyping. in the engine source that I'm very glad to stumble upon but ultimately freak me out a little - UE4 AI veterans must know these by heart
Is there anyone one that could point me in the direction to setting up a good flocking ai controller. I need all the characters in the flock to have collision. Essentially I want free roaming ai that will run from player characters, but they need to stay grouped and not scatter..... : /
@woeful wren check this out: https://youtu.be/lFpXqggbUP4?list=LLR4A_B5-BjWRpwN_pggvqVg&t=4412
Announce Post: https://forums.unrealengine.com/showthread.php?124316 CORRECTION: Alex and Ian said this is the "Strategy Game" but it is "Turn Based Strategy...
flocking behavior that also follows the player, great for hoards of zombies
w/ some minor tweaks you can probably make them run away from the player vs. running towards it
yes @buoyant geyser you the man
artificial intelligence
with a name like crusher? a troll? how I not see a connection!... :)
@patent hornet since you're here, I might as well ask: are you aware of any in-depth tutorials covering Decorator nodes in particular?
@elfin socket it's hard to find any best practices for ue4 AI. Do not forget that you can setup tick rate for the service nodes, which will reduce cpu load
@elfin socket also, as I think it's best to avoid stacking service nodes at root node.
@buoyant geyser was just going home from work, but no, i don't know of any
and enum for state machines is the best option. You can make general enum and some optional enums for more details (to use them down in tree).
Question: Attempt to make an AI attack where the character moves at a fast speed ( using char movement property) and applies damage and force to any players hit. How do I go about this?
@delicate sparrow imo You need to break that down into a bunch of smaller tasks and smaller questions because in order to answer that we'd have to write an entire essay
Okay. Umm How would I do collision check during an AI Move to so I can do damage?
By replacing AI Move with your own function that involves AI Move, and then adding in the collision check stuff (i.e. sphere trace)
Ah. I kinda get it.
Hey animation and AI people, I have a problem where the root motion of an enemy AI Pawn istn't playing, or at least it appears so. It's an anim montage with root motion where a drone moves back and upwards., but its capsule just stays in place. I already tried an other animation with a simple backward root motion, but it won't move either. The Drone is controlled by a behavior tree. Any ideas why the actor just stays in place?
Question, can I play an Animation graph from AI Behavior Tree?
Good night folks, i've been stuck in a issue here for a while, would really appreciate some help :)
So, my AI was working fine using the nav invoker to move around, then i decided to migrate from my "dev_level" to a persistant world, i put all my weather and time controllers on the persistant level and made an island, but when i tryind to run the game, the AI wouldn't move at all, i've double checked every setting for the invoker navigation system am it's all fine, the only way i got them to work is by having a "spawner" and create them at runtime, and even so, the first spawned AI won't move ...
Any ideas?
Pics:
Editor:
https://i.gyazo.com/cb78d09b727ea3840a3f4c046007048d.png
Runtime:
https://i.gyazo.com/56ea6bdd1825ad28b176621e88949654.png
.. are... are you using Emojis to convey the AI's current behavior state?
That... that's... that's fucking genius. Why didn't I think of that?
@raw flame singleplayer or multiplayer?
Singleplayer
streaming levels involved?
Yes
and if you pre-place AI directly on the persistent level, does it still happen?
yes, the placed AI on the screenshot is on the persistant level
they have the controller spawned?
Yes
have you gone thru VisualLogger?
no
under windows > developer tools
you have visual logger
it will record what AI controllers and Navigation are doing when its active
ok, will check it, thank you π hope it shows me what is wrong
then you can examine result of every command, pathfinding query + status of controller/blackboard and pawn
Now not even the spawned ones work, and all the log lines seem normal, the only discrepancy is that all black board tasks are failing since the AI cannot move to them.
you can examine the blackboard at any "block" with visual logger
see if its values were set
They were, the AI got initialized normally, filled the BB and executed the behaviour tree, the perception system is nominal as well, it just won't move
no clue why
you should see any move to results there as well
No moves, it gets the instruction to move, but the next log line is just the task timing out
but below it will log what happened when it was given the order
is the starting point not on navmesh, can it find a path...
is the move blocked
like you spawned them with their feet in the ground and then its just [Blocked}
it will point you in the right direction
good luck with this, i'm off to bed
This is all the nav info i got
yeah i think i'll try to fix this tomorrow, thanks for the help β₯
select one of the controllers in the top left
then click on a teal block in its row
and you will get detailed info for that controller
at that point in time
Ah, thanks, i'll try to fix this tomorrow morning, wasted 2 days on it already, might as well waste 3 hahaah, thank you a lot for the help, really.
np & gn
Is there a way to show additional info of the running nodes in behavior tree, like remaining time for "wait node"? I know you can hover over it and it will show you the value (through DescribeRuntimeValues), but I could've sworn it was shown along with description before. Kind of hard to debug when you have several things running π¦ .
Working on some really basic AI for a tank.
https://i.imgur.com/kM9xJFN.png
If i set this capsule at this location, it'll do what it's supposed to. If i put the capsule inside the tank, it fails to move.
what does Visual Logger say?
How do I bring that up? Forgive my ignorance aha, this is my first time doing something along these lines.
My thought is that the mesh is blocking its vision
window > developer tools > visual logger
start recording, play and select the tank's AI controller
it will log any AI command or pathfinding request there, including the reasons for why they failed
it will also draw you the current controller's path
i'd imagine that your tank is affecting navigation
effectively removing part of navmesh below it
Ah yes that is happening
the nav mesh turns red
well
scratch that
its just blank under the tank
and the nav mesh is ontop of it
i don't have the editor up, so best i can suggest off the top of my head is uncheck CanAffectNavigation
I disabled can ever affect navigation on the mesh
or
set its NavFilterClass
this way one tank will happily path thru another tank
collide and get stuck
Yeah I have another issue where when the tanks get to the waypoint, they all get stuck
i think turning off CanCharacterStepUpTo in collision settings will remove the navmesh from top of the tank, if you care about that
visual logger will tell you why they get stuck π
Right now they just drive on top of each other instead of getting stuck haha
I'll have to disable nav mesh on top of them, but they do go inside of each other, I guess i can fix that with box collision or something
For the tanks blocking
it says onpathfinished: blocked[blocked]
that capsule is what your NavAgent for the tank takes as its... bounds
Any reason i can't make the capsule bigger than 88?
haven't worked on that tho, so can't recommend a good fix
I see
Well thanks anyway, you helped me solve my biggest issue π
I've read for Ai on Ai avoidance you have to add steering or something
guys I used a moba spawning wave bp to spawn my ai characters
but once spawn their behavior tree isn't running
I'm using event on posses to set the blackboard tree
you sure right controller is set and that it posses pawn on spawn?
@radiant zodiac
ah I see
@here I hope this is the right place, I am working on an AI turret that is attached to a ship (so it has to be able to account for different up angles. Right now I have it working with the Look At function but that always aligns it to world Z not to the ship or parent object I needed it to align with. Anyone have any materials resources I can have a peek at to help me understand what I need to do?
Hey folks, i could use some help on level composition and AI navmeshing, i've been stuck on it for some days now.
I posted my issue here https://answers.unrealengine.com/questions/769535/ai-and-light-issue-with-level-composition.html , i't a bit more in depth.
TL DR : Made a level with 2 sub-levels 1 for the day cycle and 1 for all the landscapes, but when i play the game, the AI doesn't move at all, @patent hornet helped me use the visual debuger but the behaviour tree is running perfect, just the move to task is failing, i think it has something to do with the nav mesh but im not sure, i'm using invokers to generate navmeshes at runtime.
@raw flame Have you made sure to set navmesh generation to Dynamic and set Force Rebuild on Runtime?
@fluid sequoia yes for both π
The only way i can get the AI to move is if i put the terrain in the persistant level.
@raw flame Do your invokers generate navmesh around them when you run the game?
Yes at runtime
Could you screenshot the odd navmesh at runtime lol
yeah 1 sec, my editor crashed π
might have broken my project, keeps crashing at initialization, i'll post the ss as soon as i fix this, sorry for the delay π
No problem π
got it
im testing 2 AI controllers at the same time just to be safe
mine and the engine default
Yeah, the lights stoped working agin after the crash https://gyazo.com/39c6c5765b83a80ea502bb6ccfdda940
still no vaigation data
weird
Yep, im going mad with this, if i put the terrain on the persistant level it works fine, if i put it in a sub level , it breaks
I don't get it, why bother with level composition then?
Uhhh, so for your streaming level, you have set your RecastNavmesh actor to dynamic right
Yes
If you press P when running the game is navmesh being generated?
nope, its just like i showed you in the ss
the light stops affecting the terrain and no navmesh is generated
Riiight
lol that naming scheme
Internet says that you should have a navmesh bound only in your persistent level, which is large enough to encompass the sublevels you stream, so if you haven't tried that, go for it
uh...
I was using a method miezko talked about in one of the streams of puting a nav mesh bounds volume in each chunk to be streamed
Yeah i think i suck at googling, i spend 3 days looking articles and tutorials up hahaha
thank you so much
If you want to post the link as a answer to my ticket i'll gladly karma you up π
Sure I'll post an answer
posted an answer and realized my account name is different for Epic, need to update it
hahaha thank you, i'll give you some karma, you deserve it π
Hello everyone .. someone knows how to make a melee system
Hey guys. I've been searching this for a good while πΊ I'm hoping someone here can help me out
Recently added AI walking to my game and found the cost was pretty high
Came across a post on Answerhub about Paragon using a cheaper mode called "navmeshwalking"
So I set my characters to use this mode, and yet in AI debug mode they always show to be using the default "walking" mode. I tried forcing "navmeshwalking" by setting it in various ways, like at runtime, and still it never seems to work
Okay so im working on an Ai that patrols and has postions that it goes to, and i have it to where if it see the player than its moves towards the character, but when it reacts the character it stops and doesnt move. Any idea on why this is doing this, and how to fix?
Like a drone lol
Alright but like
What are you using to issue the move command?
What else are you doing?
You question is kinda like
xD
"I have a game that I want to respond to the spacebar, but it doesn't"
"Like a jump"
lol
well then you see that i dont really know to much on what im doing lol
But anyways when i go into the pawnsense area, the Ai it follows me, then is just stops and doesnt move again lol
Idk tbh
lol
I was about to be sarcastic but you posted an image
xD
Try going out of the area, far enough away that it can't see you
then try coming back so it can see you
lol
your problem could be that its only running its chase logic once
Thats what i was thinking, but in my following Ai, its only set up like this, and it follows you no matter what
Those are practically the same though.
Thats what im saying, so idk why it would be pausing and stoping in the other
So either your settings on the component are different or SetActorRotation does something weird.
Anyway, its been a while since I've done PawnSensing work, but does OnSeePawn fire every frame?
I'd have thought it was once-per-start overlap
Sorta lol
it keeps going off until the casted character or object is out of the sensing area
Okay so now its just pausing every so offen
Could it just be the squence?
Mmmm idk lol
Alright, well, you can figure out what's happening if you print out the result enum on either success or fail
I doubt it
SetActorRotation MAYBE_
Look into behavior trees though
Its a little more complex but they're much more suited for AI
Yeah understandable. I've never used one before
@dapper kayak you might like this:
A lot of you seemed to enjoy the last post - so come and learn a bit about Navigation Filtering and Avoidance whilst making a game of tag!
It took a bit of time - but I think that this new UE4 AI tutorial has come out looking quite spiffy!
https://www.vikram.codes/blog/ai/03-navigation-filtering-and-avoidance
Thnks mate
New to AI, have a question - I'm trying to setup a point-click system where I point at the ground and my AI Character moves to that location. My Pawn(with camera), AI Character, AI Controller, Behavior Tree, Blackboard, and BTTask is created and ready to go.
My Pawn is setup and works with a line trace to get the ground location where I click. This is stored in a "ClickLocation" float inside my pawn.
How can I pass this information to my Behavior Tree so my AI Character will move to the click location? I have a variable on my Blackboard called "MoveLocation" but I have no idea how to update ClickLocation to MoveLocation. Assuming this is what I need to do?
make an input action in project settings > input
then pull the input node inside your controller (it will have the input action's name)
and update blackboard there
Just gonna post my issue again for the day-time crowd π¬ Would really appreciate anyone weighing in on this issue
Hello friends. someone available to help me in my video game (payment in between) if you have enough knowledge in programming
@patent hornet was that response for me?
Is there any rhyme or reason to put the AIPerception components on the Character rather than on the AIController? In the UE4 Livestream, they put it on the AIC, but in the Tom Looman Udemy course they put the AIPerception on the Character.
How can I use AI move to on my player character, the node doest fail, but it doesnt move the character either, nav mesh is built
@tribal lagoon Pawns without an AIController don't know how to do AI Move To
Player Pawns don't have AIControllers
yeah, thats what I thought, can I add an AI controller to one
Instead of telling the pawn to do it, tell the pawn's AIC to tell the pawn to do it
I am not going to use any keyboard or mouse imput, its only move to, for the movement of my pawn, so it would make sense to switch to AI controller only
The PC needs to possess something, so have it possess something else and tell the pawn to have an AIC
how can I do that
thanks, unfortunately I don't have time to learn all of this now
I am prototyping for a touch game on mobile, and it doesnt need to be that complicated, my AI is just moving where I click with the mouse, but I cant get the player pawn to swap to an AI controller
Maybe I am not understanding the hierarchy of UE4 right
I cant send commands to something I dont posess right
So if I want to control something using AI Move to, i need it to be possesed by an AI controller, and for me to control it, i need to posses a player that casts to that AI and issues comands?
@tribal lagoon I ran into this issue developing my own mobile game and settled on having the visible Character controlled by an AIController. Then, I have a separate pawn which is invisible called PlayerAgentPawn that is attached to the Character. PlayerAgentPawn has the PlayerController.
I am trying to get that exact thing working as you wrote this lol
how do you attach the camera to the AI, by simply parenting it in the level?
DungeonCrawlerPlayerCameraBoom = ObjectInitializer.CreateDefaultSubobject<USpringArmComponent>(this, TEXT("CameraBoom"));
DungeonCrawlerPlayerCameraBoom->SetupAttachment(DungeonCrawlerPlayerCameraScene);
DungeonCrawlerPlayerCameraBoom->bAbsoluteRotation = false; // Player rotation will not affect boom rotation
DungeonCrawlerPlayerCameraBoom->TargetArmLength = 1200.f;
DungeonCrawlerPlayerCameraBoom->bDoCollisionTest = false;
DungeonCrawlerPlayerCameraBoom->bEnableCameraLag = true;
DungeonCrawlerPlayerCameraBoom->bEnableCameraRotationLag = true;
DungeonCrawlerPlayerCameraBoom->bInheritPitch = true;
DungeonCrawlerPlayerCameraBoom->bInheritRoll = true;
DungeonCrawlerPlayerCameraBoom->bInheritYaw = true;
// Instantiate player camera
DungeonCrawlerPlayerCamera = ObjectInitializer.CreateDefaultSubobject<UCameraComponent>(this, TEXT("PlayerCamera"));
DungeonCrawlerPlayerCamera->SetupAttachment(DungeonCrawlerPlayerCameraBoom);```
You can handle it in CPP or BP, I attach the camera to the AgentPawn since the PlayerController will automatically go to the camera attached to the same pawn/character
This is a setup for a top down game by the way, so your implementation may vary
Alright, I will try it once I sort out the jumping
for some reason the AI doesnt jump to reach its destination
even with nav links
nav links are kinda buggy
I don't think jumping behavior is actually present in nav link implementation
@tribal lagoon As I understand the way nav links work is that they merely state that two points on paths are connected
yeah, so how do I tell my AI that it can jump
I am using the paper 2D template
maybe thats the issue, as I remeber an AI I made was jumping on with a third person character template
" It's currently not supported out of the box and would require some C++ coding. You can however implement a kind of jumping behavior with navlinks and triggers. Navigation links tells AI "you can traverse this segment", so if you place a link between two platforms AI will find a path as expected. You just need to take care of the jumping part, and you can "fake" it by placing a trigger on the link start that will make AI move to the other end.
Making "AI move" could be done in couple of ways: you can simply teleport your AI, matinee-animate him, or set his physics to Flying and just let him continue (should work, but I haven't tried it ). If using the flying option don't forget to turn Walking back on once "jump" is done"
https://forums.unrealengine.com/showthread.php?3512-NavLink-and-making-AI-jump
For gameplay programmers writing C++ code.
This is from an ancient answerhub post https://answers.unrealengine.com/questions/84659/navmesh-jump-points.html
OK so ancient I suspect things may have changed since then
@tribal lagoon You can implement jumping while navigating by having a trigger box which causes a certain behavior and the beginning of a navlink, for example a "launcher" that throws the character up. It is also possible to write an advanced implementation of the navigation to have the character calculate jumps in real time, I believe Rama did a quasi-tutorial on it
The Rama tutorial is here https://wiki.unrealengine.com/AI_Navigation_in_C%2B%2B,_Customize_Path_Following_Every_Tick
Well, at this points it would be easier if i added slopes
Sometimes the simple solution is the best one
If you have your characters jumping only at specific location then launchers can be a good solution
I need it for playtesting
I thought UE had jumping, so the AI can go on the floor above
guess i will have to fake stairs with slopes
that was about as complicated as the jump thing but anyway
@fluid sequoia thanks
Anybody familiar with UNavigationSystem::ProjectPointToNavigation , I don't quite grasp the arguments
Specifically why do I pass in an FNavLocation and an FVector point?
Hey guys! how to character disable rotation when I do AI MoveTo?
I want to move my character, but controller should be always forward to some target
@vocal sinew Uncheck "Use Controller Rotation" on the pawn
then you'll have to rotate him yourself
@glossy spire But I need to rotate controller, not character. Character Must use controller rotation
I just don't want "MoveTo" to change controller's rotation.
Orient To Movement checkbox is also disabled
i guess you could change the rotate speed to zero
on the character movement component
Hey guys, I've got an AI character class that inherits from my normal character class. I'm trying to re-use as much logic from there as possible; things like drawing and firing a weapon, taking cover, etc. The problem is that I handle all of my aiming code using the player Control Rotation, which doesn't seem to be a thing in AI. If I could just "SetControlRotation" on my AI character (which appears to be deprecated functionality long before 4.18), I'm pretty sure my problems would be solved. Is there any way that I can set control rotation? If not, I pretty much can't inherit from my other character, because so much of the logic is bound to that attribute.
you can pull the common functionality in common base class and have both your AI and normal character class inherit from it
@patent hornet Hmm...still a lot of rework, but I guess if there's no other way...
@tribal lagoon I blog about how to make launchpads here: https://www.vikram.codes/blog/ai/02-nav-modifiers-links
@fluid sequoia for your future reference as well ^^^
@buoyant sphinx thanks, will have a read
As of 4.19 it's possible to do everything in blueprint, I'll be updating the guide this weekend to show how
(I had a pull request accepted, you should be able to figure out how, because I show what I was trying to do in the #Issues section at the bottom)
When spawning Ai char's from class do you have to spawn an ai controller as well?
@buoyant sphinx thanks
How do I create a function that does AI Move and collision checks at teh same time?
@delicate sparrow I think the Nav Mesh does that automatically for you, doesn't it?
Well I tried to make a function like you suggested within a pawn to do AI move and collision checks but it wouldn't let me use AI Move there
But would I use something like "Event On Hit" for Collision w/ collider?
Overlap is what you use for collision, the OnHit thing is for dealing damage to actors.
What about just "Event Hit"
I think you might need to do some more tutorials dude
I mean, that's not wrong, but googling this hasn't really gotten me anywhere
When all else fails, I go straight to answers.unrealengine.com and search there
But I really think you should just do some more of those official UE4 livestream tutorials from the engine developers. They have some stuff about AI and it's really good quality stuff that will help you fix your problems along the way.
Hey guys, I'm a bit stumped. I posted this on reddit, but so far, no response. Long story short, I can't make my character rotate via AI functionality, but he does other actions just fine.
Any help would be appreciated.
For the life of me I can't get AI debugger to work, I enable show ai debug and click on the controller but nothing happens. Any clues?
nvm, had to look in engine settings and realize I rebound gdt
@woeful wind have you tried setting the focus of the AI controller to be the player? Also there is a specific edgecase where focus only works in the yaw for something but I can remember what, but that function is virtual and can be overridden
Hello, can I use Pawn Sensing to detect a character being possesed by an AI controller
i don't think its meant for that
you should have OnPossessed event tho, inside the character
what do you mean, how would that enable another actor to sense it?
you could attach something to it that another actor can sense with PawnSensing
Thanks @heady arrow , I'll give it a shot later today. It seems weird that I'd have to set focus on the player to turn toward him, but I don't have to do that to MoveTo him.
@patent hornet i wasnt aware that would work, what actor should I attach to my AI so its detected
Thank you so much, @heady arrow ! Setting the focus worked! I stand by what I said earlier in that it's odd that some things work without focus and some things require it.
@woeful wind yeah in the source code of the AI controller for focus, it sets the pitch to zero for a specific reason that I can't remember
So I created a pawn actor, and attached it to AI, but pawn sensing still wont work
Hmm...okay, well, good to know. Does that mean it always needs a focus to turn...ever? Even if it did its own thing agnostic of the player's actions?
So I'm still pretty new to AI in Unreal, but I'm failing to see why Decision Trees and Blackboards exist at all. Normal blueprints seem perfectly capable of doing all of this stuff. What's the benefit here?
@woeful wind Blackboards are pretty pointless, but decision trees are very important
Is it a performance thing? Is there something Decision Trees can do that blueprints can't?
decision trees are just a way to run blueprint tasks
so the code is done in tasks and decorators
hmm its hard to describe
basically, when you start getting more advanced AI, having lots of if statements or whatever becomes really messy
so it's just an organizational thing? Easier to rapidly make changes than messing with blueprints?
well, decision trees run blueprint files
so its still working in blueprints
you make tasks
which are a kind of blueprints
no, I get that, but I also don't see why I couldn't code the entirety of the decision tree in my AI controller
ok, so it COULD be done, but it would be messy?
sure
I'm all for best practices; I'm just trying to understand why this is the best practice.
another way of doing AI is with a state machine
but basically a decision tree is the more modern way
but yeah, its a glorified organization method
gotcha, thanks for the explanation
but I have no idea why people use blackboards
To store data that your decision tree uses.
yeah but why
heh, same thing: organization
yeah