Various Deathmatch issues

Cheo

Active member
Hello, following an exchange with @RainerWahnsinn on Discord here are a few issues I have to report about the Deathmatch AI Kit :

-The Explosion prefab is missing on the Rocket prefab in Projectile -> Destruction -> Spawned Objects On Destruction.

-Dying with the Rocket Launcher equipped creates this error :

C#:
[Exception] ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
System.Collections.Generic.List`1[T].get_Item() at <eef08f56e2e042f1b3027eca477293d9>:0

ItemSetGroup.UpdateActiveItemSet() at /Opsive/UltimateCharacterController/Scripts/Inventory/ItemSetGroup.cs:625
 623:  // In some cases the ItemSet that had to be activated was disabled during the equip/unequip animation.
 624:  // If that's the case set the newActive index to -1.
--> 625:  newItemSet = ItemSetList[newActiveIndex];
 626:  if (newItemSet.Enabled == false) {
 627:      newActiveIndex = -1;

ItemSetManagerBase.UpdateActiveItemSet() at /Opsive/UltimateCharacterController/Scripts/Inventory/ItemSetManagerBase.cs:587
 585:  #endif
--> 587:              itemSetGroup.UpdateActiveItemSet(itemSetIndex);
 588:          }

EquipUnequip.AbilityStopped() at /Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:1119
1118:      UpdateItemAbilityAnimatorParameters();
-->1119:      m_ItemSetManager.UpdateActiveItemSet(m_ItemSetGroupIndex, m_ActiveItemSetIndex);
1120:  }

Ability.StopAbility() at /Opsive/UltimateCharacterController/Scripts/Character/Abilities/Ability.cs:708
 706:  m_ActiveIndex = -1;
--> 708:  AbilityStopped(force);
 710:  return true;

UltimateCharacterLocomotion.TryStopAbility() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:1071
1069:  m_ActiveItemAbilities[m_ActiveItemAbilityCount] = null;
-->1071:  ability.StopAbility(force, true);
1073:  // Let others know that the ability has stopped.

Ability.StopAbility() at /Opsive/UltimateCharacterController/Scripts/Character/Abilities/Ability.cs:703
 701:  // If the ability wasn't stopped from the character controller then call the controller's stop ability method. The controller must be aware of the stopping.
 702:  if (!fromController) {
--> 703:      return m_CharacterLocomotion.TryStopAbility(this, force);
 704:  }

Ability.StopAbility() at /Opsive/UltimateCharacterController/Scripts/Character/Abilities/Ability.cs:680
 678:  public bool StopAbility()
 679:  {
--> 680:      return StopAbility(false, false);
 681:  }

EquipUnequip.Update() at /Opsive/UltimateCharacterController/Scripts/Character/Abilities/Items/EquipUnequip.cs:540
 538:  var isItemSetValid = m_ItemSetManager.IsItemSetValid(m_ItemSetGroupIndex, m_ActiveItemSetIndex, false);
 539:  if (m_ActiveItemSetIndex != -1 && !isItemSetValid) {
--> 540:      StopAbility();
 541:      return;
 542:  }

UltimateCharacterLocomotion.UpdateAbilities() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:654
 652:  }
 653:  if (abilities[i].IsActive) {
--> 654:      abilities[i].Update();
 655:  } else if (abilities[i].Enabled) {
 656:      abilities[i].InactiveUpdate();

UltimateCharacterLocomotion.UpdateCharacter() at /Opsive/UltimateCharacterController/Scripts/Character/UltimateCharacterLocomotion.cs:577
 575:  // Start and update the abilities.
 576:  UpdateAbilities(m_Abilities);
--> 577:  UpdateAbilities(m_ItemAbilities);
 579:  // Update the effects.

CharacterLocomotion.Move() at /Opsive/UltimateCharacterController/Scripts/Character/CharacterLocomotion.cs:561
 559:  EnableColliderCollisionLayer(false);
--> 561:  UpdateCharacter();
 563:  EnableColliderCollisionLayer(true);

SimulationManager+SmoothedCharacter.Move() at /Opsive/UltimateCharacterController/Scripts/Game/SimulationManager.cs:169
 167:      }
--> 169:      m_Locomotion.Move(horizontalMovement, forwardMovement, deltaYaw);
 170:      AssignFixedLocation();
 171:  }

SimulationManager.MoveCharacters() at /Opsive/UltimateCharacterController/Scripts/Game/SimulationManager.cs:723
 721:  for (int i = 0; i < m_Characters.Count; ++i) {
 722:      if (interpAmount == -1) {
--> 723:          m_Characters[i].Move(preMove);
 724:      } else {
 725:          if (!m_Characters[i].Locomotion.Interpolate) {

SimulationManager.FixedUpdate() at /Opsive/UltimateCharacterController/Scripts/Game/SimulationManager.cs:671
 669:  MoveCharacters(true, -1);
 670:  RotateCameras();
--> 671:  MoveCharacters(false, -1);
 672:  MoveCameras(-1);

-Even on Easy difficulty enemies have too good aim - this would be the perfect opportunity to introduce something I've been thinking about for a long time but never implemented, a task for making enemies miss on purpose ! Like have them shoot at a point near the player. Or at least just decrease their fire rates, they're too deadly at the moment and prevent experimentation.

-I don't think using layers to separate character by team is good practice (especially considering the 32 layers limit), tags and string and int IDs are better used for that purpose, characters should have the Character layer assigned to their root object.
Also, team members all have the same colour layer but it may not match their actual colour, for example I once got the green team characters all having the RedTeam layer assigned.
 
-The main menu scene is missing a Lighting Settings asset. This may seem like a small thing (we can make our own new one after all) but it is expected nonetheless.

-I once got two Nav Mesh related errors :

C#:
[Error] "SetDestination" can only be called on an active agent that has been placed on a NavMesh.
NavMeshAgent.SetDestination()

NavMeshMovement.SetDestination() at /Behavior Designer Movement/Scripts/Tasks/NavMeshMovement.cs:56
  54:  {
  55:      m_NavMeshAgent.isStopped = false;
-->  56:      return m_NavMeshAgent.SetDestination(destination);
  57:  }

AttackMovement.OnUpdate() at /Opsive/DeathmatchAIKit/Scripts/AI/Actions/Attack/AttackMovement.cs:156
 154:  if (setDestination) {
 155:      UpdateRotation(false);
--> 156:      SetDestination(m_Destination);
 157:  }

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.Tick()

BehaviorManager.Tick()

BehaviorManager.Update()

C#:
[Error] "Resume" can only be called on an active agent that has been placed on a NavMesh.
StackTraceUtility.ExtractStackTrace()

NavMeshMovement.SetDestination() at /Behavior Designer Movement/Scripts/Tasks/NavMeshMovement.cs:55
  53:  protected override bool SetDestination(Vector3 destination)
  54:  {
-->  55:      m_NavMeshAgent.isStopped = false;
  56:      return m_NavMeshAgent.SetDestination(destination);
  57:  }

AttackMovement.OnUpdate() at /Opsive/DeathmatchAIKit/Scripts/AI/Actions/Attack/AttackMovement.cs:156
 154:  if (setDestination) {
 155:      UpdateRotation(false);
--> 156:      SetDestination(m_Destination);
 157:  }

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.RunParentTask()

BehaviorManager.RunTask()

BehaviorManager.Tick()

BehaviorManager.Tick()

BehaviorManager.Update()

They kept being thrown when moving to the next frame. I haven't been able to replicate them after that however.
 
Lastly, here are two videos showing some shakiness and clunkiness in the character's controls in fps view.

Here is a video by Rainer :


And here's one by me :


I'm personally less bothered by shaking on long horitontal movements on my end (especially when at 300fps) however I find that pressing left and right successively creates some ugly shaking and clunkiness.

Hope I didn't forget anything and that all this was helpful !
 
Thanks for the report.

-The Explosion prefab is missing on the Rocket prefab in Projectile -> Destruction -> Spawned Objects On Destruction.
Thanks, I'll assign it.

-Dying with the Rocket Launcher equipped creates this error :
@Sangemdoko - any ideas on this one?

-Even on Easy difficulty enemies have too good aim - this would be the perfect opportunity to introduce something I've been thinking about for a long time but never implemented, a task for making enemies miss on purpose ! Like have them shoot at a point near the player. Or at least just decrease their fire rates, they're too deadly at the moment and prevent experimentation.
The game modes increase the spread of the weapon fire. You can definitely add other changes to the DeathmatchManager based on the difficulty level.

-I don't think using layers to separate character by team is good practice (especially considering the 32 layers limit), tags and string and int IDs are better used for that purpose, characters should have the Character layer assigned to their root object.
Also, team members all have the same colour layer but it may not match their actual colour, for example I once got the green team characters all having the RedTeam layer assigned.
Strings and tags are relatively slow to compare so that's why the layers are used. It also makes raycasts faster because you don't need to do an extra layer of filtering.

-The main menu scene is missing a Lighting Settings asset. This may seem like a small thing (we can make our own new one after all) but it is expected nonetheless.
I've gone back and forth on this. The lighting settings doesn't always transfer between Unity versions so I've tended to just let the user bake it since they need to anyway. I know I'm inconsistent on this though.

-I once got two Nav Mesh related errors :
If you can tell me how to reproduce it I can take a look.

I'm personally less bothered by shaking on long horitontal movements on my end (especially when at 300fps) however I find that pressing left and right successively creates some ugly shaking and clunkiness.
That looks like the weapons are updating during the wrong loop. When we went through the simulation manager changes I updated the deathmatch scene but may have missed this. Let me know if you are experiencing the same issues in your own scene but I think with a new character everything will be smooth.
 
-Dying with the Rocket Launcher equipped creates this error :
@Sangemdoko - any ideas on this one?
My guess is that the ItemSets are being updated at the same time that the item set count changes for some unknown reason.
That causes the newActiveIndex to be out of range.
I will add a size check to avoid that from happening.

I'm hoping that will do the trick:
Code:
        /// <summary>
        /// Update the active item set index.
        /// </summary>
        /// <param name="newActiveIndex">The new active item set index.</param>
        public virtual void UpdateActiveItemSet(int newActiveIndex)
        {
            // No updates are necessary if the indicies are the same.
            if (m_ActiveItemSetIndex == newActiveIndex) {
                return;
            }

            ItemSet newItemSet = null;
            if (newActiveIndex >= 0 && newActiveIndex < ItemSetList.Count) {
                // In some cases the ItemSet that had to be activated was disabled during the equip/unequip animation.
                // If that's the case set the newActive index to -1.
                newItemSet = ItemSetList[newActiveIndex];
                if (newItemSet.Enabled == false) {
                    newActiveIndex = -1;
                }
            } else {
                newActiveIndex = -1;
            }

            ItemSet previousItemSet = null;
            var previousIndex = ActiveItemSetIndex;
            // If the active Item Set was removed it might be out of range.
            if (previousIndex >= 0 && previousIndex < ItemSetList.Count) {
                previousItemSet = ItemSetList[previousIndex];
                previousItemSet.Active = false;
            }
 
Hello, about the rocket issue : it seems that the error was thrown only when in first person view. Your piece of code does prevent it from happening.

Strings and tags are relatively slow to compare so that's why the layers are used. It also makes raycasts faster because you don't need to do an extra layer of filtering.
I totally understand this argument, especially if you're working on a small project that doesn't have a lot of layers. However, I maintain that this is bad practice and a bad example, as layer limits can be an actual issue - in my current project I already have 25 layers used due to the many assets in it, so if I were to add a multiplayer mode I couldn't have more than 7 teams ! Or take battle royale games like PUBG for example, they can oppose dozens of team, layers are just not an option in that case. Besides, leaving the Character layer assigned to the root character objects makes clear what their nature is and simplifies collision matrixes and layer masks.

The Nav Mesh error only occured once so far and I still haven't been able to replicate it, sorry :/

The camera and movement do look a bit better with a standard new character and I can press left and right successively without some weird shaking or clunkiness.
 
Hello everyone ? Thanks Cheo for the post.

Maybe it's best to leave my last update about the Movement/Camera shakes/stutters here as well:
If u uncheck "use Root Motion Position" on the Ultimate Character Locomotion Script on Aydan it is smooth. but then I looked at Atlas and it's checked there as well. so maybe sth weird with the model itself

image.png

Also I want to thank you for making your Assets ?- You Rock!?
 
Hello, two last things I forgot :

-Walls are occasionally seen popping off and revealing the skybox.

-The First Person bool in the main menu doesn't change anything, it should either make the game start in first person or be removed.
 
Hello, two last things I forgot :

-Walls are occasionally seen popping off and revealing the skybox.

-The First Person bool in the main menu doesn't change anything, it should either make the game start in first person or be removed.
I made some clips showing the walls popping off and revealing skybox:
 
And some other clips showing a problem with Aydan clipping through walls:
Same when running the Build:

Edit: I tried this with Root Motion Position enabled, but same thing there. Will try with Atlas now
Edit2: Yes same problem with Atlas
 
Last edited:
in my current project I already have 25 layers used due to the many assets in it, so if I were to add a multiplayer mode I couldn't have more than 7 teams !
UMP-GameModes does not require layers and you can have as many teams as you like ;) Every other team player could be simply "Enemy". In fact, I will make a clear example of that too!
 
Top