playMaker

Author Topic: newbie: using FSMs as master scene managers  (Read 2007 times)

hariedo

  • Playmaker Newbie
  • *
  • Posts: 2
newbie: using FSMs as master scene managers
« on: March 30, 2018, 05:08:22 AM »
I bought Playmaker quite a long time ago and am getting back into Unity dev for a project idea.  However, I never got much further than a single-scene project previously.  For my project idea, in concept it should have different scenes in much the same way many games do.  A splash, a main menu, a world map, an inventory popup, etc., and various choices or encounters in one scene should make it obvious to the game scene manager on what should get loaded next.

This is a generic overview of what scenes the user should see.  As I said, you can imagine Mario or Zelda or Darkest Dungeon or many other games working on a similar skeleton.



The thing is, even though this diagram LOOKS like it would translate to a FSM pretty readily, I don't understand how to achieve it with Playmaker and Unity.  I have fumbled around with scripts that do a bunch of LoadSceneAdditively() calls, which kinda works but is clunky, and does not handle the "LOADING..." interstitial case at all.  Unity seems to tell your script that the next scene has been loaded before it has really been fully loaded, there are warnings about two audio listeners when you're trying to transition from one camera to the next scene's camera, etc.

So I guess I would like to see a tutorial or a sample project which can implement even a portion of this kind of basic game structure cleanly with an FSM.  I kept the overview super-generic so that you might be able to post the project for other people to get help also.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: newbie: using FSMs as master scene managers
« Reply #1 on: March 30, 2018, 02:11:15 PM »
Hi.
For the parts that you want to load additive you should remove the camera.

If you need to do changes on a scene without a camera, you can drag the scene into a active scene (in the hierarchy)  with a camera (main Scene for example) then save and unload it (right click on a scene in the hierarchy and select to unload)

I can see to make a tutorial/sample for scene loading but i will be out for the weekend and no laptop allowed  :-\

i will try to make something on Tuesday or Wednesday.

hariedo

  • Playmaker Newbie
  • *
  • Posts: 2
Re: newbie: using FSMs as master scene managers
« Reply #2 on: April 01, 2018, 06:54:29 PM »
Thanks, I would really appreciate any sample or fragment you could work up.

I understand the advice about one camera, but don't see how you manage all the per-scene differences between camera needs. Each scene has to decide camera type, settings, position, orientation, special components etc. Or a camera controller in the scene has to find and configure the shared camera.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: newbie: using FSMs as master scene managers
« Reply #3 on: April 02, 2018, 04:19:23 AM »
Hi.
For the camera. Maybe you can disable the camera on the additive scene and when the camera is needed, disable on the main scene and enable the one on the additive scene.

I will do some testing with that when i get home.