I have a base made of rocks and things i can destroy to make my way in it and after some time mobs spawn and there goal is to kill me but they are stupid :(
natural, not enemys. They are ment for me to dig into and create a "base" while using them as walls. Right now they just take the red line and stop at that wall trying to push them self trough the rocks altho that cant be done.
this is a tough problem. you probably send them with an attack move to the green dot. they can't find a way, so the engine sends them to the nearest place nest to your base. if you want them to attack the yellow building first, you have to teach it where it is. whenever a player creates a building, check the path, if it is still possible or save this building as a first target and send the unit there
The units "shortcut" into the wall because the valid path is too long. Pathfinding function surrenders and returns (65535 - no path) after an approximate pathingcost of ~300.
One solution is to add waypoints along the way and que the move/attack commands.
I'm not sure how to do this, can you tell me or make a simple demo map for me?
The code used in mineral< is well made for this, not sure how it works tho but the mobs seams to target my base rather then me becouse they try to get in all around the base and if they fail on a spot then they turn around and try another spot and so on. I made a base in minerals where they first tried the direct route but before they got to the stone wall i manage to kill them so they never got to my gate. If they however would reach the wall and not dying then they would turn around and got for the gate. The bigger base i made with more and more buildings on the edges then they tried to attack them as well and in the end they even went for the back of my base where i had buildings.
So i think they try and target any random unit that i own and if it failed then they turn around go for another unit own or something like that. If this is the case then how do i check if a unit is stuck trying to get past a wall?
IF i block my self in with a pylon then this problem is fact but if i do not block mys elf in then they take the correct path directly and do not get stuck on the wall.
If i'm walled in and stay close the the wall then they try and get trough the wall but if i back down some, mabye 7-8 in range then they get smarter again and get back on the correct path.
Is there some way to change the ai "aggro range" to lets say only 3 in range? If so then i believe all problems would be solved but not totally.
I have a base made of rocks and things i can destroy to make my way in it and after some time mobs spawn and there goal is to kill me but they are stupid :(
as you see they take the red way instead of taking the purple way and killing the building in the way.
are the rocks enemies of the mobs?
@b0ne123: Go
natural, not enemys. They are ment for me to dig into and create a "base" while using them as walls. Right now they just take the red line and stop at that wall trying to push them self trough the rocks altho that cant be done.
this is a tough problem. you probably send them with an attack move to the green dot. they can't find a way, so the engine sends them to the nearest place nest to your base. if you want them to attack the yellow building first, you have to teach it where it is. whenever a player creates a building, check the path, if it is still possible or save this building as a first target and send the unit there
The units "shortcut" into the wall because the valid path is too long. Pathfinding function surrenders and returns (65535 - no path) after an approximate pathingcost of ~300.
One solution is to add waypoints along the way and que the move/attack commands.
@Zytrug: Go
I'm not sure how to do this, can you tell me or make a simple demo map for me?
The code used in mineral< is well made for this, not sure how it works tho but the mobs seams to target my base rather then me becouse they try to get in all around the base and if they fail on a spot then they turn around and try another spot and so on. I made a base in minerals where they first tried the direct route but before they got to the stone wall i manage to kill them so they never got to my gate. If they however would reach the wall and not dying then they would turn around and got for the gate. The bigger base i made with more and more buildings on the edges then they tried to attack them as well and in the end they even went for the back of my base where i had buildings.
So i think they try and target any random unit that i own and if it failed then they turn around go for another unit own or something like that. If this is the case then how do i check if a unit is stuck trying to get past a wall?
@Sherlia: Go
anybody knows how to fix this?
IF i block my self in with a pylon then this problem is fact but if i do not block mys elf in then they take the correct path directly and do not get stuck on the wall.
If i'm walled in and stay close the the wall then they try and get trough the wall but if i back down some, mabye 7-8 in range then they get smarter again and get back on the correct path.
Is there some way to change the ai "aggro range" to lets say only 3 in range? If so then i believe all problems would be solved but not totally.