playMaker

Author Topic: FSM Templates (Playmaker 1.5 feature.) question.  (Read 14232 times)

Red

  • Hero Member
  • *****
  • Posts: 563
FSM Templates (Playmaker 1.5 feature.) question.
« on: February 19, 2013, 01:30:42 PM »
So, I have noticed the new addition of the "use template" thing here... and though i'm not sure what i would use it for yet (i have some ideas) if i use this for a common system (such as a basic timer to delete an object in the scene after a small period of time such as an explosion particle effect) would this help with the performance of the game seeing as it wouldn't have to compile X different FSMs?

Other than that, I would love to see a breakdown of new features on a video (and if you need someone to do that, i can do so but i would need a very detailed breakdown of what new features, actions and functions have been added so that i can put them in context as to how and where you'd use them.)

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3999
  • Official Playmaker Support
    • LinkedIn
Re: FSM Templates (Playmaker 1.5 feature.) question.
« Reply #1 on: February 19, 2013, 01:51:22 PM »
Performance should be the same using a Template or a regular FSM.

The main advantage of the Template is that you can edit it in one place and have those changes propagate to any FSM that uses it. It's like an FSM instance.

We hope to have some What's New videos out this week :)

Red

  • Hero Member
  • *****
  • Posts: 563
Re: FSM Templates (Playmaker 1.5 feature.) question.
« Reply #2 on: February 19, 2013, 02:51:53 PM »
Okay, so, then follow-up question.

With variables, can i expose them in the inspector and change them dependant on what it is that i'm using it for?

for example, the weapons all have a "stats manager" FSM system on them to send data to and from the various weapon manager systems, player setup systems, button and key monitor system... but they all have unique names for the other FSMs in them.

If i were to use that as a template and use a string variable that's exposed in the inspector, would i then be able to just drop on the template, change the appropriate string (to point it to, say, the "handgun mechanis" or "grenade mechanism") and it'd behave?

i know i could just try it myself i guess... but i'm sure i won't be the last person to wonder about that.

EDIT: I did a test with a basic cube holding two float variables exposed to the inspector. The did hold unique values but when it said "Click to edit template" and i click it, it doesn't open up in the editor (it just gives me the "right click to add FSM" screen.)  I tried using it from the template browser and still no dice. This is with the "use template" field in the inspector filled with the template i wanted to use (a new one saved like normal.)

EDIT2: Also did some testing with a basic template system (just a couple empty states and some variables exposed in the inspector) i added one cube with the template and kept the other original. i tried to test it to see if editing the FSM that the template was based off of would update the information to the other cube object with the instanced template used and it didn't take any new information. i tried saving the template to see if that would trigger it, all it did was the second cube that was using the instanced template dropped the template from it's "use template" field.

(please don't misunderstand. i am not doing this to cause trouble. In fact, what you're describing would be an amazing addition because it would save me a LOT of work and if this is just an issue of me not using it properly, knowing how would certainly help. i'm basically treading water here so i don't know if i'm doing something wrong or not. I'm saying this, however, because i've known some people online that took these kidns of critiques way too personally when that wasn't the intent of the critique.)
« Last Edit: February 19, 2013, 03:24:37 PM by Red »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3999
  • Official Playmaker Support
    • LinkedIn
Re: FSM Templates (Playmaker 1.5 feature.) question.
« Reply #3 on: February 19, 2013, 04:14:45 PM »
There was a bug with editing templates. It's fixed in 1.5.2 in the Asset Store now...

Don't worry about causing trouble ;) I've been doing this a long time, and I'll take feedback over no feedback any time!! We're here to make Playmaker better :)

Red

  • Hero Member
  • *****
  • Posts: 563
Re: FSM Templates (Playmaker 1.5 feature.) question.
« Reply #4 on: February 19, 2013, 08:15:57 PM »
You're right, i was back a version!

and it works perfectly!

This is going to save me a TON of time down the road... now, i wonder what i can do right now to change up the things in my game so as to take full advantage of this.

David

  • Playmaker Newbie
  • *
  • Posts: 18
Re: FSM Templates (Playmaker 1.5 feature.) question.
« Reply #5 on: February 25, 2013, 09:14:56 AM »
I played a little with the new template system and it works great, but I have a little question.

Would it be possible to edit variables default values when we use a template (like in Run FSM action) or it isn't made to work this way ?

Here's a little example :
In my application I spawn creatures. They're following a predefined path and they use a simple FSM to move and react to the environment. I made a template of this fsm so I can reuse for different types of creatures, but I want to change some parameters like their movement speed. I've already seen some solutions to this problem :

- Create a new FSM per creature then use Run FSM. This new action let us change the default FSM's variable values. But I need to have 1 FSM with only the "Run FSM" action per creature, it's efficient but it doesn't really seems the "cleanest" way to do it.

- Create a script with the variables on my prefabs, then use get property action to read them. It's a little more clean, but I'm a coder, it can be more difficult to understand for a "non-coder" guy.

- Ask here for future improvement ;D Maybe it would be possible to have editable fields in the inspector as soon as we choose "use template" ?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3999
  • Official Playmaker Support
    • LinkedIn
Re: FSM Templates (Playmaker 1.5 feature.) question.
« Reply #6 on: February 25, 2013, 11:09:37 AM »
Any FSM variables in the template with Inspector checked should appear in the PlayMakerFSM inspector.

Right now there is a bug where the inspector doesn't update exposed variables if you edit the template. The workaround is to reselect the template.

Or are you not seeing any exposed variables?

David

  • Playmaker Newbie
  • *
  • Posts: 18
Re: FSM Templates (Playmaker 1.5 feature.) question.
« Reply #7 on: February 25, 2013, 01:49:51 PM »
Oh sorry, I never seen this "Inspector" checkbox before :o... That will be very useful thanks !  ;D

digimbyte

  • Junior Playmaker
  • **
  • Posts: 52
Re: FSM Templates (Playmaker 1.5 feature.) question.
« Reply #8 on: March 14, 2013, 12:19:05 AM »
I've wanted to try the template system to develop a door system simular to sci-fi games

anyway, i want a bool available in the inspector to enable/disable triggers for the doors, but unfortunately it seems bool wasn't fixed to be displayed in the inspector

I updated to 1.5.3

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3999
  • Official Playmaker Support
    • LinkedIn
Re: FSM Templates (Playmaker 1.5 feature.) question.
« Reply #9 on: March 14, 2013, 03:56:50 AM »
I checked, and there's a bug with bool variables displaying in the Inspector. Good catch! It's fixed in the next update. PM me if you want access to the beta...