playMaker

Author Topic: Multi-level Best Practices?[SOLVED]  (Read 2826 times)

marcos

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 199
Multi-level Best Practices?[SOLVED]
« on: September 20, 2012, 09:16:04 AM »
Hello!
I’ve finally found some time and motivation to get back into my game, so on that note I’ve a question regarding the next step of its development.

What is the best practice for automating the process of working across multiple levels or scenes?

In the future I will likely add other gameplay elements in the form of a new FSM on the Engine empty object. Is there a way I can update only one level’s Engine object and have it feed the new FSM to all of the other levels? I had a go with prefabs, but it seemed to lose a lot of the FSM Game Object connections and so on.

Cheers,

Mark
« Last Edit: September 24, 2012, 03:03:30 AM by jeanfabre »

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • Permaximum Betty
Re: Multi-level Best Practices?
« Reply #1 on: September 20, 2012, 09:32:19 AM »
Hello!
I’ve finally found some time and motivation to get back into my game, so on that note I’ve a question regarding the next step of its development.

What is the best practice for automating the process of working across multiple levels or scenes?

In the future I will likely add other gameplay elements in the form of a new FSM on the Engine empty object. Is there a way I can update only one level’s Engine object and have it feed the new FSM to all of the other levels? I had a go with prefabs, but it seemed to lose a lot of the FSM Game Object connections and so on.

Cheers,

Mark

If i not wrong then all stuff in the scene will be in default values when the scene start.
You can tackle this in different ways.
One is to use Global variable that you store things in. They will not change when you load a new scene.
You could also save all your game data on the scene you come from and the reload them in the scene you are in now.

marcos

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 199
Re: Multi-level Best Practices?
« Reply #2 on: September 23, 2012, 12:52:33 AM »
Hey!
Thanks for the reply, global variables ended up being the way to tackle it.
Still migrating some things over to it, and my animation FSM is behaving strangely, but I'll figure that out.

I just added a simple FSM to each object I needed to refer to that saves itself as a global variable when the level starts, then just referred to that global rather than the object itself, as I was doing prior to migrating everything to prefabs.

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • Permaximum Betty
Re: Multi-level Best Practices?
« Reply #3 on: September 23, 2012, 02:50:14 PM »
Hey!
Thanks for the reply, global variables ended up being the way to tackle it.
Still migrating some things over to it, and my animation FSM is behaving strangely, but I'll figure that out.

I just added a simple FSM to each object I needed to refer to that saves itself as a global variable when the level starts, then just referred to that global rather than the object itself, as I was doing prior to migrating everything to prefabs.

Glad you fixed the problem.
Some times there is an easy way to fix hard things. hihi