Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: agelvik on July 08, 2019, 11:39:53 AM

Title: Disable "Select Game Object" in editor?
Post by: agelvik on July 08, 2019, 11:39:53 AM
Hey, I already posted this on discord, but thought i'd post it here as well.

Is it possible to turn off or disable "select game object" button in the editor? or make it stop listing every objects i have in the scene? i think this is the culprit for everything going so slow when i have the editor tab opened due to all the object references it contains. if i switch from Playmaker tab to example Animation tab as shown in the attachment, things are running smooth again. in addition, unity doesn't freeze whenever I edit any Array/Hash components or Animator tab. there's always this 0.5-2 second delay when i toggle bools or write something in text fields.

I also tested performance in a new scene, and had no problems from above. editor tab was active, things was running normal and smooth due to way fewer game objects containing FSMs i'm guessing.

another thing, if i click "Select Game Object" in the editor, unity freezes for around 1-2 mins. afterwards i get 1500-2000 errors saying "failed to insert item. name: X

i've attached some images.


hope there's a fix for this, would really speed up my workflow.
looking forward hearing from you!
Title: Re: Disable "Select Game Object" in editor?
Post by: agelvik on July 16, 2019, 09:20:00 AM
bump
Title: Re: Disable "Select Game Object" in editor?
Post by: djaydino on July 17, 2019, 10:04:37 AM
Hi.
I can't seem to repo this on my project using Unity 2018.3.10f1 and playmaker 1.9.0p16.

I tried both in playmode and editor mode.

1 thing is know that when you have lots of fsms on an object and if they are expanded and the hierarchy is visible it can slow down (mainly during playmode)
Title: Re: Disable "Select Game Object" in editor?
Post by: agelvik on July 17, 2019, 11:12:31 AM
hmm, how big is your scene? my scene is quite large containing well around 1000-1500 FSMs. however 90% of them are inactive both in editor and playmode, but they still get referenced in the "Select Game Object" section so i doubt it really matter.

i forgot to mention which version i'm on, my bad
2018.2.10f1, playmaker 1.9.0
Title: Re: Disable "Select Game Object" in editor?
Post by: agelvik on July 17, 2019, 12:03:57 PM
btw, i deleted everything in my scene and everything went back to normal. but this doesn't really solve it LOL.
i'm trying to find a way to completely disable this "Select Game Object" feature in the editor, but I can't find the source of it...
Title: Re: Disable "Select Game Object" in editor?
Post by: djaydino on July 17, 2019, 12:23:06 PM
Hi.
The source of it is probably in the playmaker.dll file so you can't change this yourself.

But i am not sure if the 'Select main object is the main reason.

I will do some test, my project has about 350 fsms at the moment.
and about 900 @runtime (when enemies are spawned)
Title: Re: Disable "Select Game Object" in editor?
Post by: agelvik on July 17, 2019, 01:01:48 PM
appreciate it!

i made some gifs showing how slow it is atm:
https://www.dropbox.com/sh/ne90q5g31cwjtds/AACfhbHfFqvNQGd598AeZFfEa?dl=0

you don't get much visual feedback from my mouse clicks, but in the gif "moving-actions-around_spam-clicking" i'm clicking like crazy whenever cursor is barely moves.

in the gif "fast-component-typing" i have the animation tab open instead of playmaker editor tab.
Title: Re: Disable "Select Game Object" in editor?
Post by: djaydino on July 17, 2019, 04:11:05 PM
Hi.
Are fsms expanded in the inspector?

Do you have many fsms on that object.

Is there a difference in performance on objects that have only 1 fsm vs objects with many fsms?

I'm just asking questions to narrow down the issue :)
Title: Re: Disable "Select Game Object" in editor?
Post by: agelvik on July 18, 2019, 02:58:11 AM
Yeah, they're expanded
No, there's no difference whether it's got 1 FSM or many.

not sure it matters, but many game objects containing FSMs is a child of another game object quite deep down. i've attached an image of this.
Title: Re: Disable "Select Game Object" in editor?
Post by: agelvik on July 31, 2019, 08:00:06 AM
hey man, just checking in if you've found anything new related to the issue.

also, if anyone else have any ideas on this issue i'd greatly appreciate it. it's very painful to work with these freezes lol.
Title: Re: Disable "Select Game Object" in editor?
Post by: jeanfabre on August 01, 2019, 04:39:48 AM
Hi,

 I have raised this issue to Alex, Hopefully, something can be done here to bring that option and/or improve perfs.

Bye,

 Jean
Title: Re: Disable "Select Game Object" in editor?
Post by: Alex Chouls on August 01, 2019, 07:41:31 AM
I’ll look into this. Very long freezes can be caused by error spam. Console logging in Unity is very slow, so if you have thousands of message it can freeze the editor for a while. The error message in the original post is strange, haven’t seen it before, but I’ll investigate what might be causing that... Are there more details in any of the error messages? E.g., a stack trace with filenames and line numbers?
Title: Re: Disable "Select Game Object" in editor?
Post by: jeanfabre on August 01, 2019, 08:08:04 AM
Hi,

also, the Pref  to turn gameobject selection is actually already available :)

(https://i.imgur.com/dkiV6Qq.png)

Bye,

 Jean
Title: Re: Disable "Select Game Object" in editor?
Post by: agelvik on August 01, 2019, 12:39:40 PM
Are there more details in any of the error messages? E.g., a stack trace with filenames and line numbers?

ye, i've included some images in attachments. the error message is pretty much the same among all 2000 errors i received.

Hi,
also, the Pref  to turn gameobject selection is actually already available :)

yeh, but i'm more aiming at the button that is placed top left in the tab, i want to completelly remove that button and what it does so it doesn't store all objects that contains an FSM in the scene.


also, i got an update to the issue.
i moved the whole project to another PC using an external hard disk so i could work on my laptop during vacation, but when i moved it back to my main PC performance suddenly increased?
now when I press the "Select Game Object" button i suddenly get no errors, and performance seems to be much much better as well with minimum, if any, freezes.

I checked an earlier version of my project from last month, and the massive freezes and errors from "Select Game Object" still exists there, but not on my current version...

I'm so confused about what's happening lol.

it doesn't end there!
i now have a new problem where I need to rename some FSMs to something else, then back to normal in order to fix some null reference exception errors. same thing with some of my FSM Templates that has variables with Inspector checked on... but here i need to manually reassign variables over again to exactly how it were lol... this fixes the null ref errors for some reason, I'm just baffled



I don't mean to drag this topic on with new issues, but it's a strange domino effect going on which may be relevant all together maybe? i'd love to get clarity on this so i can prevent it from happening again in the future

thanks for helping out tho guys, appreciate it. looking forward to hear more from you!


Edit:
Nvm, the huge freeze and amount of errors suddenly came back this morning after i pressed "Select Game Object" with an accident. Performance in editor seems good though, for now...
Title: Re: Disable "Select Game Object" in editor?
Post by: agelvik on August 01, 2019, 12:57:12 PM
Regarding the most recent issue, this is the error that appeared right before the null ref exception errors started coming in like mad. (see attachment)
it didnt appear until about 4 hours later after opening my project.

another thing i just realised, the FSMs that receive these null ref errors are the ones i edited during vacation.


Edit:
Luckily it was an easy fix with the FSM renaming and reassigning variables for the Run FSM action, but it would be scary if it were to happen on a much bigger scale lol...
Title: Re: Disable "Select Game Object" in editor?
Post by: Alex Chouls on August 02, 2019, 10:47:27 AM
Did some digging and it seems like there is an upper limit on the number of menu items you can add to a menu in Unity. After that, you get an error each time you try to add an item. It's these errors that cause the freeze.

In the next update, I'll either cap the menu items or just popup "Select GameObject" if the menu is too long.

In the longer term, we'll be replacing most menus in Playmaker with searchable popups like the Unity component menu.

Looking into the other issue you mentioned...
Title: Re: Disable "Select Game Object" in editor?
Post by: agelvik on August 03, 2019, 06:30:54 AM
ahh i see, i guess i'll try keep the number of FSMs in my scene to a minimum, if that's possible lol.
looking forward to the update :)


just throwing this in case it is of help:

regarding my recent issue, it reminds me of something that happen 6 months ago, and on another project 1 year ago

i had unity's collaboration feature enabled, and when i committed changes back and forth from different computers, the FSM templates started acting weird and variables lost their references where things didn't work properly. i had to reassign the exact same game objects over again in order for it to work. copy pasting the Run FSM over again also did the trick i learned recently.

but it's more tricky when your FSM component uses an template that has references attached in the "Controls" section", these sometimes get mixed or just turns to None.

exactly this happened yesterday.. instanced prefabs got variables that referred to something i did not set it to, and it automatically did so out of nowhere.


i previously had collaboration feature enabled on my project, but i've turned it off due to these issues (also the long waiting time when you launch the project lol)

now i just .zip the whole project folder because i feel it's safer.
the process goes like this:
backup project ->.zip the project-> move to external hard disk -> delete old project on new PC -> import project to folder.

the project i replace the old with contains the exact same name, so when i launch unity, the new project will automatically get listed in the launcher menu.

here's a few maybes:
-if i launch the project that automatically got listed, maybe unity overrides something which may cause something related to this?

-maybe the collaboration feature has something to do with this? i still have a ".collabignore" file on my project which always comes back if i were to delete it, so it's clearly not completely disabled.