playMaker

Author Topic: Implementing MVC in your Playmaker design pattern?  (Read 247 times)

rechronicle

  • Junior Playmaker
  • **
  • Posts: 56
  • Medievaliant
    • View Profile
    • Indie RPG Creator
Implementing MVC in your Playmaker design pattern?
« on: May 08, 2019, 02:40:38 AM »
Hello,
I was reading about MVC pattern today, and still quite unsure about how to use it in my Unity project with Playmaker.
Can anyone explain it in a simple and understandable way for non-coder?


Maybe a Unity sample package as an example of the design pattern will help a lot.
Thank you!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4519
    • View Profile
    • jinxtergames
Re: Implementing MVC in your Playmaker design pattern?
« Reply #1 on: May 08, 2019, 05:02:40 AM »
Hi.
Here is a good explanation for unity : https://www.toptal.com/unity-unity3d/unity-with-mvc-how-to-level-up-your-game-development

you could compare the scripts a bit as fsms.

for example have a separate fsm handling button presses.
When a button is pressed send an event to a different fsm, or on another fsm you can do a bool test to check if a button is pressed.

have separate fsms for horizontal/vertical movement, jump/crouch shoot, etc.

To Get/Set variable from/to other fsms : there are several Get/Set Fsm actions that you can use, and there are a bunch more on the Ecosystem

Also have a look at this wiki page : https://hutonggames.fogbugz.com/default.asp?W1462
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

rechronicle

  • Junior Playmaker
  • **
  • Posts: 56
  • Medievaliant
    • View Profile
    • Indie RPG Creator
Re: Implementing MVC in your Playmaker design pattern?
« Reply #2 on: May 09, 2019, 11:18:18 AM »
Hello,
thank you for the article about MVC. Need to re-read it before I can understand most of the parts.

One question,

Is the responder/receiver of the sender always have to know what type of data it received? Or at least, already have a container to store the data it will receive. (In the case of 'Model' mostly updated by 'Controller').

Sorry for the trouble.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4519
    • View Profile
    • jinxtergames
Re: Implementing MVC in your Playmaker design pattern?
« Reply #3 on: May 09, 2019, 04:32:02 PM »
Hi.
I am not sure what you mean, but an fsm will need some preset variables to receive data in ti.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions