hello,
is there is a way to make the agents of crowd system collide with the player ?
I dont think they need to colide with the player.Still i cant remember if they do or not.But the if the skeletal mesh you use for the crowd agent has a physics asset they shoud? Im not in front of the pc at the moment but on the other hand,if your crowd agents are using a dynamic destination attached to the player , that destination has a radius to be touched by the agent so that he can stop in front of the player at the desired distance.
yes they has physics asset the problem is that when the player hit the crowd agents he get inside them and pass through them as if they weren’t there .
Are these utcrowd agents or mobile crowd agents?(have in mind that this hapens with vehicles too).
Please explain what are you trying to do with the agents.(their purpose in your project)
they are a ut game crowd and i’m using them a if they were people in the streets
Will give my similar files a look on monday/tuesday and will tell you if i find anything.
ok thank you i will be waiting for you
So…its a litle complicated.
IF you do have a lot of crowd agents as normal people and you want to bump in to them using crowd agents,the only way is to attach to each crowd agent a interpactor with a collision set to block all.
Not so fast!
Attaching a lets say a cube with scaled to the size of a crowd agents body using phisics like block all,will cause unpredictable results.(in my case,the moment the agents spawns and i attach the cube to him,he will do a boost rocket jump in to the sky and never return xd as the physics asset of the agent is fighting the interpactor collision physics.The only way for this to work is to make a hollow cube mesh that has a collision of per poly(that you select from the model viewer once you make the mesh).And than that hollow cube shoud have a collision set to block all.That way it will surround the crowd agent without touching him.
If you want to go that way,let me know and i will post some kismet skreenshot example.
On the other hand,i dont see a problem if you pass through the crowd.Many games do it.
If you dont need many people you can just animate a few skeletal meshes in matinee(npcs) as the physics asset will block the player.
Or you coud use simple utbots and make them with a custom animtree(walking animation only) and make them move.
This tutorial from digital tutors shoud help you with managing utbots navigation using kismet.
great thank you please can you send the kismet screenshots ?
Important:in the kismet screenshot where it say ¨¨4 interpactor with collsion set to block all¨¨i ment collision set to ¨¨block all but weapons¨¨.
So here is how it goes with the kismet.
https://postimg.org/image/w26yv6o51/
Its a example in which i am spawning only 4 agents.At the same time i have hidden in the level (4 cubes).The moment a agent spawns,a cube gets attached to him giving him the desired collision.Also important to know is that the spawn rate of the agents is set to 1 and not 50 by default.If set to 50 or a higher number the engine doesnt have enough time to attach a cube per each agent and you may end up with all 4 cubes attached to the first agent at start leaving the other 3 with nothing.If you use a spawn rate of 1 like i do, than when each agent is spawn>he will get just one cube as it shoud.(maybe a spawn rate of 10? is the maximum desired).Just leave it set to 1 or 2.
This kismet example is with only 4 agents and 4 cubes.If you want more agents,than you need more cubes and expand obviously the count of the switch node and the agent spawner.
Note:
If you have set agents to spawn at infinite but only 4 at a time and you set the ¨¨swithc¨¨ node to ¨¨loop¨¨, and you kill a agent,than the next agent that spawns in his place will get the cube of the dead agent.
In the kismet screenshot i am using a udk cube as i forgot,but here is the upk with the cube you shoud use insted.
https://ufile.io/ifcfy
1.When you place the cube in the level, first convert it to interpactor and than set the collision to ¨¨block all but weapon¨¨.Nothing more!
(ive allready enabled the per poly colision on the cube in the model viewer.
Note that this cube is set more or less to the ut robot bot character size. If you use i different size character than firts scale the cube in udk so that the character can fit inside the cube WITHOUT touching/intersecting its walls.(its a hollow cube,only 4 sides)
And last but not least,once you try the thing and you are cool,dont forget to make the cube hidden so that the player doesnt see it.
Ok!How can I kill the crowd agent now?Well,since the cube has a collision of block all but weapons you can kill him just fine.The thing is that once he dies,the invisible cube will still be there so you beter make a event in kismet that once the crowd agent is dead,taken damage>destroy the cube(something probably with ¨¨agent reached¨¨ havent thought about it yet.
What else?
In the kismet you can see that the attach to actor node has everything set to 0.If you want to set the cube with a utbot or something it might be more clean to do a -40 in Z in the ¨¨relative offset¨¨ of the attach to actor node.That way the cube will be closer to the ground.
Not sure if this will work with a hit and run by vehicles.But with some work it might.
thank you for your help
Glad i helped a litle.There is probably a way and i will probably look in to it sometime but for now im fine with at least the player to agent collision solved thing.I think actor factory can spawn interpactors but some times it just doesnt.Sometimes deleting the udkengine in the config folder and than recompile the scripts solves strange issues with the engine.I havent use UE4 but ive seen the agents it uses in youtube and they do apear to be a copy paste of the udk agents with some extras so its not a lost cause depending on the use.Spawning 500 zombie agents chasing the player in udk is quite fun and i still get 40-45 fps on 1080p on a old quadro k4200(gtx 670).
sorry I can’t help, I neither use vehicles nor crowds
Me neither. I wanted to take a look on the crowd, in case I could replace my bots, what are normal pawns, but I think I cant achieve the same behavior.
Im typing from the phone,so please exuse the mistakes.Just got a small moment of inspiration while being lazy xd.I think i know how you can kill a crowd agent with a vehicle.
There are two type of agents in udk.A utcrowd agent and a mobile agent.From what i see they are the same but a ut crowd agent(i think you are using that one) has a ragdoll physics when he die.A mobile agent doesn and you have to plug a prepared dying animation.This option is in the options of a ut crowd agent too, but for some reason it doesnt work.Probably gets overwriten by the ragdoll death.
So i think for this to work is to:
1.use a mobile agent
2.plug in a dying animation
3.in the model viewer,conect a soud node to the death animation
4.optional-leave the cube collision
5.usind the cube collision technique, attach a normal trigger with radius bigguer than the cube with collision(probably set to touch all but weapons)
6.attach a interpactor cube to the front of the vehicle with the same collision(i think)
7.in kismet make a trigguer touch even (the attached trigguer to the agent one)and that triguer needs to be touched referenced by a interpactor (by defaut is the pawn).
8.whent the trigguer is touched it needs to start a event that is looking for the name of the death sound
So what hapens ia that when the vehicle touches (using its interpactor) the attached trigger of the agent,that trigguer will tell kismet to play the death audio and at the same exact moment the audio plays,the agent death animation will kick in and after that we just kill him in kismet with one more step (cant remember the node name now).
I think it will work.Only problem is that the agent will die usind prepared animations(probably retargeted from mixamo) and not using ragdoll.But with 3-4 random dying animations it shoud look cool.
For fun i will test to see what i can achive.Instead of attaching a cube to the vehicle one can use a normal trigguer.So its a trigguer of the car touching the one of the agent.To attach something like that with precision you have to open the vehicle in the model viewer and copy the name of the bone you want to use to attach the trigguer to.So when doing a hard attach you shoud place the name of the bone were you want to attach the trigguer.
Using volume trigguer tends to give mistakes so normal trigguers are more desirable.O know that actor factory or factory x, one was old kismet and not that up to date so i think EX was the old one?
Will wait a day or two and see if i can discover something my self.
Im sory for not updtanig this guys.Got a litle sick and decided to shut off the pc untill the end of the year as i needed to rest the head too and maybe go out a litle.The moment i get enough rest i will get back to this in my free time and update the thread with a upk scene example as i do beleve i know how to bypass some of those things.
Will subscribe in order not to lose the page.
I give my word
Happy holidays.
seems like a huge amount of effort for very little reward using the crowd in this way.
how many pawns are we talking about here?
why not use a normal pawn and have a pooling system, you can have quite a lot of them on screen without a huge amount of overhead.
the biggest spikes are when they are spawned or killed.
i populated a city using something like this:
have some kind of detector actor, an actor with a collision radius (touch all)
when the player touches spawn in some pawns near by
have on a timer from each pawn detecting the distance from player
when player > some distance disable the pawn and store it somewhere hidden, i placed them inside a building, and add them to a list (array), same if they are killed
when the player touches another ‘detector actor’, check if there are any disabled pawns in the array, place them somewhere and activate them.
it saves all this messing with attaching meshes and such and they will behave normally when hit by a vehicle or whatever
i did upload all my code for teg’s playground on here, look for pedestrian_pawn or similar, cant remember what i called the detector but it will be an obvious name
good luck
yes it does support replication, teg’s playground was multiplayer
pathfinding is a rather crude trace based system, (pedestrianAI or similar) it can avoid obstacles even dynamic ones, find and drive vehicles, find and shoot the player if it has a weapon, engage in conversations and dance with other pedestrians
it has a lot of functions unique to the game but the code should be commented enough to work your way through it if you wanted to