playMaker

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

marcos

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 199
    • View Profile
Multi-level Best Practices?[SOLVED]
« on: September 20, 2012, 06: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, 12:03:30 AM by jeanfabre »

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Re: Multi-level Best Practices?
« Reply #1 on: September 20, 2012, 06: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
    • View Profile
Re: Multi-level Best Practices?
« Reply #2 on: September 22, 2012, 09:52:33 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.

Damian

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 188
    • View Profile
    • Permaximum Betty
Re: Multi-level Best Practices?
« Reply #3 on: September 23, 2012, 11:50:14 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.

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