Announcement

Collapse
No announcement yet.

AI fps drops

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    AI fps drops

    Hi,

    I'm working on an AI system for a shooter. They should the basic stuff such as taking cover, dodge and strafing.
    Initially the AI runs a BT for patroulling and do tasks when not in battle. When the AI sees the character it switches to a BT specially made for battle tasks.
    My goal is to get an AI system pretty much like in Jedi Outcast or the old Battlefront II.
    The enemies are all deriving from the character class and having a physical animation component attached since I want the ragdoll effect. I am using the standard AIController.

    The problem(s) I have now are as following:


    1)
    When shooting at the character , they change positions using EQS. The position they are ought to move to depend on the distance to each other (to somehow avoid colliding with each other) and the direction the character is looking to.

    When we the player runs away, they start to follow him. And when sqeezing themselves through the floorways they then squish together very bad, what causes a massive fps drop. (from 120 down to 50 with only 9 AIs). In the video Complex AI Interactions & Optimization this exact problem is adressed at 14:12 to 16:32.

    So my question is: How is the service "JamCheck" implemented ? If I understood correctly, we want to check whether the AI is making progress within a certain amount of time. But I'm still not sure, what kind of progress we want to measure. Do we measure the time the AI needs to get from A to B ? Is it some kind of collision check ?
    I have already RVOAvoidance turned on. But I still get massive fps drops.

    And that leads me to the next question...

    2)
    I can only have at around 20 AI s for a stable (average of 70) fps. When googling about AI optimization I find posts where people complain about not having good performance when dragging 100 (!!) AIs into the world and having still good fps with 50 AIs. I would be happy if I also could drag this many AIs into world...lol

    The biggest fps drain happens when the AIs start running the battle BT. When all happen to start attacking me at the same time. Stats show the world tick time to be the biggest issue. Looking into the session fronted log it says "CPU stalls" everywhere. Ignoring these CPU stalls the animations seem to be the most expensive part. But I am not doing anything fancy yet. They just walk or stand. They don't do crouch, roll or any dodge or cover animations.

    I made the following stats with only 9 AIs. (In the picture it says 11 AIs,because I had two more AIs hanging around the level I totally forgot about. The projectile spawning doesn't work for now. They don't show up but seem to be spawned. I also got these fps problems before the projectile spawning).

    Since I'm still new to AI development, I'm a kind of stuck here...

    BT_new_0 is the left side of the BT. BT_new_1 the right side.
    The Controller is pretty big and it was hard to make a good picture of it.
    Attached Files

    #2
    Grot13 , nice videos! I really like the movement controll of the fish.

    Additional to my init post:
    When I walk very fast around the enemies, the fps drops really bad, as you can see in the picture "sight_fps".

    If I unplug the right part in the AIController, after "CanSeePlayer" is false -> BattleMode CON true, the fps drop vanishes completely.
    But I need to set the Player's location once they loose sight. So it is a bit hard to get rid of it.
    I guess, the fast switch between CanSeePlayer IsSet and IsNot Set is pretty expensive ?!
    Attached Files

    Comment

    Working...
    X