puksometron
Member
Hello,
I'm using Deathmatch AI with PUN for my bots. The game has 2 teams. If I choose a certain team, then I get assigned the leader of that team when playing offline. I'm using the TeamManager to do so. However, I am noticing that occasionally, only some of the bots will follow me, while others just stand there. Strangely, if I shoot the ones standing there, they sort of 'wake up' and immediately start following me. This happens on and off. If I'm lucky, all of the bots will follow me when they spawn, or all of them will just stand their frozen, until I manually 'wake them up' by shooting at them. I did some observations, and noticed that the bots that are frozen have either: a) have no leader assigned and are trying to seek to a target, when the other bots are following the player, b) get stuck in the V-formation task, or c) stuck in the Wait task at the very beginning, and shooting at them doesn't do anything.
There is also an error associated with the Search For Target task, which happens for those bots who get assigned as leaders, when the player is supposed to be the leader:
I'm assuming the above error is associated with the fact that I haven't set up any waypoints for the bots, so there's no waypoint to seek to. Is there something I'm not doing correctly here? It would be annoying for the player to have to shoot at his teammates just to get them to follow. I am testing with PUN's offline mode, and have followed the tutorial on how to set up the agents. When the bots are working, they will follow the player and engage in combat when necessary, so the behaviour tree does work. It's just this random problem that happens on and off.
Any help would be greatly appreciated, Deathmatch AI is still quite new to me, so there's still a bit of adapting to get used to. Thank you in advance
I'm using Deathmatch AI with PUN for my bots. The game has 2 teams. If I choose a certain team, then I get assigned the leader of that team when playing offline. I'm using the TeamManager to do so. However, I am noticing that occasionally, only some of the bots will follow me, while others just stand there. Strangely, if I shoot the ones standing there, they sort of 'wake up' and immediately start following me. This happens on and off. If I'm lucky, all of the bots will follow me when they spawn, or all of them will just stand their frozen, until I manually 'wake them up' by shooting at them. I did some observations, and noticed that the bots that are frozen have either: a) have no leader assigned and are trying to seek to a target, when the other bots are following the player, b) get stuck in the V-formation task, or c) stuck in the Wait task at the very beginning, and shooting at them doesn't do anything.
There is also an error associated with the Search For Target task, which happens for those bots who get assigned as leaders, when the player is supposed to be the leader:
Code:
NullReferenceException: Object reference not set to an instance of an object
Opsive.DeathmatchAIKit.AI.Actions.SearchForTarget.NextWaypoint () (at Assets/Plugins/Opsive/DeathmatchAIKit/Scripts/AI/Actions/Attack/SearchForTarget.cs:121)
Opsive.DeathmatchAIKit.AI.Actions.SearchForTarget.OnUpdate () (at Assets/Plugins/Opsive/DeathmatchAIKit/Scripts/AI/Actions/Attack/SearchForTarget.cs:98)
BehaviorDesigner.Runtime.BehaviorManager.RunTask (BehaviorDesigner.Runtime.BehaviorManager+BehaviorTree behaviorTree, System.Int32 taskIndex, System.Int32 stackIndex, BehaviorDesigner.Runtime.Tasks.TaskStatus previousStatus) (at <3ed82e893f584901a16bc2e097c74b57>:0)
BehaviorDesigner.Runtime.BehaviorManager.Tick (BehaviorDesigner.Runtime.BehaviorManager+BehaviorTree behaviorTree) (at <3ed82e893f584901a16bc2e097c74b57>:0)
BehaviorDesigner.Runtime.BehaviorManager.Tick () (at <3ed82e893f584901a16bc2e097c74b57>:0)
BehaviorDesigner.Runtime.BehaviorManager.Update () (at <3ed82e893f584901a16bc2e097c74b57>:0)
I'm assuming the above error is associated with the fact that I haven't set up any waypoints for the bots, so there's no waypoint to seek to. Is there something I'm not doing correctly here? It would be annoying for the player to have to shoot at his teammates just to get them to follow. I am testing with PUN's offline mode, and have followed the tutorial on how to set up the agents. When the bots are working, they will follow the player and engage in combat when necessary, so the behaviour tree does work. It's just this random problem that happens on and off.
Any help would be greatly appreciated, Deathmatch AI is still quite new to me, so there's still a bit of adapting to get used to. Thank you in advance
Last edited: