playMaker

Author Topic: Need Help with Real-time performance having issue with Bool  (Read 972 times)

san

  • Junior Playmaker
  • **
  • Posts: 93
I don't where to start explaining it and it would not make sense if i upload a video to show you either, because when i click play, the bool test(all true/none true) are working correctly with lower frame rate performance. And when i have faster or normal frame rate (nothing turn on in inspector) Bool test (all true/ none true) does not work correctly.

Short Example what i am doing is: in Enemy, i have Ray cast that look at Player that is using set bool Turn on and off; if Ray cast see the player or not. That set Bool is sending to another FSM in Enemy that using Bool Test. If Bool Test = see the player > go to next state. But that Bool test is not responding/not sending a correct next state when i am in normal frame rate.

If i don't have anything empty object in inspector such as FSM or other scripts it is  Normal frame rate when i click play.

But if i have a lot of FSM and states are running in the game it slow down the frame rate of the game/unity.

Weirdly seem the Bool test is working on lower frame rate but not in Normal frame rate. So the issue is when tested in iPhone, the game is playing in normal frame rate which is good but the bool test is not working correctly.

I really don't know how to debug this problem. So if anyone someone interesting to look into this please let zoom ~! we don't have to show faces but i can share the screen on my project.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Need Help with Real-time performance having issue with Bool
« Reply #1 on: June 15, 2021, 01:17:18 AM »
Make a debug mode for build testing, either let the FSM feed the data to log in dev version, or make it display it on screen so you can keep track of what is happening. Probably a race condition somewhere.
Available for Playmaker work

san

  • Junior Playmaker
  • **
  • Posts: 93
Re: Need Help with Real-time performance having issue with Bool
« Reply #2 on: June 15, 2021, 01:27:15 AM »
Thanks for fast respond ~!

I am sorry i am still learning how to use all of it.
Can you go step by step with me for this one please.
How to feed FSM data to log in dev?? 

I see the Debug tabs but i still don't know how to use those menu yet.
« Last Edit: June 18, 2021, 12:32:22 AM by san »

san

  • Junior Playmaker
  • **
  • Posts: 93
Re: Need Help with Real-time performance having issue with Bool
« Reply #3 on: June 15, 2021, 01:47:13 AM »
Hi, So Here is the debug log.

As you see the Player is in "Range_Finder" so it's Turn ON in input.
But in Bool Test, if "Range_Finder" is False > go to E_Arms_Up.
That is the wrong event that is sending. Because "Range_Finder" is not Turn OFF in input.
Also you can see in Debug Log EVENT: E_Arms_Up.
« Last Edit: June 18, 2021, 12:32:33 AM by san »

san

  • Junior Playmaker
  • **
  • Posts: 93
Re: Need Help with Real-time performance having issue with Bool
« Reply #4 on: June 15, 2021, 01:55:46 AM »
Sorry if the picture is too small.
Here is the link for bigger Picture.


« Last Edit: June 18, 2021, 12:32:41 AM by san »

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Need Help with Real-time performance having issue with Bool
« Reply #5 on: June 15, 2021, 01:38:20 PM »
Well, first of all, talking from experience, FSMs this big are a recipe for disaster, it should be broken down in smaller FSM's in charge of particular function (patrol, attack, retreat, whatever) commented via global events.

They can be reused, are easier to debug since the problem can be pinpointed a bit easier.

All off this stuff you have is happening in ONE state?
Available for Playmaker work

san

  • Junior Playmaker
  • **
  • Posts: 93
Re: Need Help with Real-time performance having issue with Bool
« Reply #6 on: June 15, 2021, 02:48:39 PM »
Thanks for respond ~! and This is not the biggest FSM I've ever made lol.

Well as you see in the image, I color them into different groups and those groups doing specifically one thing only. Look for Bool true or false. if its true go to another state to do certain animation or false go another state to do another. I do have other SendEvent but that should not be a problem. All is look for bool true/false.

I still don't know a lot of about Unity performance related to FSM and entire playmaker etc... I am still doing and learning at the same time. Its been a year up to this now.

But in this case, before this happened i updated one of my prefab translate (uncheck Fixed update) and suddenly this issue come up. I've been tracking all trigger event and bools and they all seem respond correctly expect this one.

Also i encounter with unity problem last night. the W,E,R keys aren't working so i am installing new version of unity and i hope this fix it as well.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Need Help with Real-time performance having issue with Bool
« Reply #7 on: June 16, 2021, 03:41:24 AM »
Maybe break it down a bit with some waits between states and less actions per state that all work at the same time every frame?
Available for Playmaker work

san

  • Junior Playmaker
  • **
  • Posts: 93
Re: Need Help with Real-time performance having issue with Bool
« Reply #8 on: June 18, 2021, 12:33:12 AM »
Thanks, I will have to go back and break those down. And i removed all images that i posted here.