playMaker

Author Topic: Unexpected changes when using PlayMaker with VCS  (Read 3487 times)

plinm

  • Playmaker Newbie
  • *
  • Posts: 25
Unexpected changes when using PlayMaker with VCS
« on: August 03, 2017, 08:08:41 AM »
Hi, there

I constantly found PlayMaker would make changes to committed prefabs with PlayMakerFSM attached. For example, a git-diff here

Code: [Select]
- preprocessed: 1
+ preprocessed: 0

I have seen this in few prefabs I committed previously, while I did not touch them at all. I wonder what this "preprocessed" means, it looks like a boolean flag that used internally by PlayMaker which I cannot control. SO my question is how can avoid this, it is bit annoying to have unexpected changes now and then when you are working with version control.

Also, are there any suggestion or good practice to follow when using PlayMaker with VCS?

Many thanks.
« Last Edit: August 03, 2017, 08:10:29 AM by plinm »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: Unexpected changes when using PlayMaker with VCS
« Reply #1 on: August 11, 2017, 04:15:44 PM »
Hi, preprocessed is an internal flag used to help optimizations during building. It shouldn't change unless the FSM is edited. I'll investigate what else could change this flag...

There are no special VCS rules for Playmaker vs regular Unity projects. Playmaker components are MonoBehaviours, ScriptableObjects etc. that are serialized by Unity. Using Force Text is a good idea since it lets you diff changes a little better.
Other than that, use best practices for Unity, e.g., Visible meta files, exclude files/folders that shouldn't be committed, test a clone of the repo to make sure it works...


plinm

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Unexpected changes when using PlayMaker with VCS
« Reply #2 on: August 13, 2017, 08:56:14 AM »
Thanks, Alex

I kept my eyes on it in the last few weeks, here is what I found:

1. If I edit a FSM in a prefab, the preprocessed flag will be set to 0.

2. If I edit the prefab instance in the scene and then apply it to the prefab, the preprocessed will be set to 1, even if the prefab instance was then removed from the scene.

I wonder if this will affect the performance or behaviour of PlayMaker, and what's the proper way to edit FSM in prefab that only instantiated at runtime (since the above two output slight differently).

cheers,

Lin

plinm

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Unexpected changes when using PlayMaker with VCS
« Reply #3 on: August 20, 2017, 01:33:12 PM »
This issue is getting worse for me, I have more then 10 prefabs files across different scenes with preprocessed flag modified all the sudden, while I was working on something else and I didn't touch them at all. This is quite frustrating and resetting those changes seem not cause any trouble, please, anyone get an idea?

plinm

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Unexpected changes when using PlayMaker with VCS
« Reply #4 on: August 20, 2017, 02:10:20 PM »
Another weird thing, I have a prefab I haven't touched for a while gets changed suddenly, and I found under the prefab there is an "asset file" with the same name as the prefab (as the icon shows), and the asset file contains nothing but references to the PlayMakerFixedUpdate in PlayMaker.dll.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Unexpected changes when using PlayMaker with VCS
« Reply #5 on: August 21, 2017, 02:58:34 AM »
Hi,

 This is due to how an action or fsm can get access to FixedUpdate call in a performant way, you've likely update PlayMaker to the latest version right?

Please proceed with these changes, else PlayMaker will likely force then again.

The question is wether once you have committed these changes, the flag is again set? It seems you indicate to does in your first post, but for the 10 prefabs you mentioned is it still the same?


Bye,

 Jean

plinm

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Unexpected changes when using PlayMaker with VCS
« Reply #6 on: August 21, 2017, 03:49:44 AM »
Thanks Jean,

I am still using 1.8.4, because I got some issues with 1.8.5 that I am not sure what cause them. Are there any bug in 1.8.4 might cause this?

I really want to know if there is something I can do this "preprocess" thing manually, so I can do it before I commit any changes to avoid auto "preprocess" later.

The situation I have now is slightly different with what I experienced in my first post. In the first post, I actually did edit the FSM after the commit but I did not make any change (reverted), the preprocessed flag will change from 1 to 0 in this case. Now I just got these sudden changes in multiple prefebs with no relations or references between, and I am 100% sure I did not touch them.

Cheers,

Lin

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Unexpected changes when using PlayMaker with VCS
« Reply #7 on: August 21, 2017, 05:56:45 AM »
Hi,

 What issues did you have with 1.8.5? is it not related to having to update custom actions to use the new lateupdate registration process?

you can add the proxies to the gameobject manually yes, if PlayMaker finds that proxy is already here then it won't add it and so prefabs should remain untouched then.

Bye,

 Jean

plinm

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Unexpected changes when using PlayMaker with VCS
« Reply #8 on: August 22, 2017, 05:45:18 AM »
Hi Jean,

Sorry I don't quite understand your last post, what do you mean by "adding proxies to gameobject"? what proxies? Play Maker Proxy Base? (that's the only "proxy" I found)

Here is a temp solution I just discovered in order to keep FSM always preprocessed:

1. Try edit the FSM but don't change it (create an empty state and undo).
2. Play the scene contains the FSM, and interact with it
3. Stop the play mode and go to the FSM you just edited, CTRL/CMD + S to save it

This way will set an "un-preprocessed" (preprocessed: 0) FSM to "preprocessed" (preprocessed: 1), but it seems template FSM will always being "un-preprocessed".

Cheers,

Lin

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Unexpected changes when using PlayMaker with VCS
« Reply #9 on: August 24, 2017, 03:06:54 AM »
Hi,

 PlayMaker dll has a series of Component called proxies what interface Unity callbacks and PlayMaker system events:



normally they are hidden and handled automatically ( pre processing), and so you can add them when you know you need them and it will likely make it so that prefabs remains untouched because the pre process finds it has nothing to do.

 for templates, it should be the same if proxies are already on the gameobject at the time of execution or preprocessing.

 bye,

 Jean

plinm

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Unexpected changes when using PlayMaker with VCS
« Reply #10 on: August 24, 2017, 10:49:42 AM »
Thanks Jean,

If I understand correctly, these proxy scripts contains the event listener function (e.g. void OnMouseUpAsButton()), and dispatch the event to FSM when get called, which is the what the "preprocess" do, adding required "event listener proxy" to the game object.

However, my FSM doesn't contains any state includes those system events (I use ray cast in the background instead of system events), which means adding those proxy script to my object does not make any sense.

So, I would say the preprocessed flag does not serve its purpose in my case, since I don't use any system event that requires preprocessing.

BTW, I found the cause why my prefabs are changed suddenly, because I deleted an unused event in event manager, which probably triggers some internal logic makes PlayMaker think it needs to reprocess all the FSMs. Could this possibly be a bug?

Cheers,

Lin

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Unexpected changes when using PlayMaker with VCS
« Reply #11 on: August 25, 2017, 04:56:08 AM »
Hi,

 yes, but it's also needed for many actions, not just system events. it's definitly linked to what the Fsm needs to get from the targets gameobjects at play inside each actions or with system events ( not in your case, but in general).

 Maybe you could share the project showing the trouble? pm me if possible.

 Bye

 Jean

plinm

  • Playmaker Newbie
  • *
  • Posts: 25
Re: Unexpected changes when using PlayMaker with VCS
« Reply #12 on: August 25, 2017, 05:33:29 AM »
Thanks, Jean

Do you mean that the issues I have is not the intended behaviour of PlayMaker?

For some reason I am unable to share the project I was working on, but I'll try replicate the issue I have in a new project.