Announcement

Collapse
No announcement yet.

How do you setup and work with multiple levels in a single-player game ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do you setup and work with multiple levels in a single-player game ?

    Posted elsewhere, but I think maybe my question pertains to Blueprints more than to anything else.

    Up until now I had only one persistent level with several sub-levels in my projects. I'd load one "main" sub-level and then stream (load/unload) other sub-levels as needed. My projects were of a small scale and it worked fine for me.

    Now I am wondering how does one go about setting up level structure for a single-player game with let's say 20 levels. I'd like to have one or two hub levels where player comes back after beating other levels (let's say a town from which player can go into caves, catacombs, another districts, etc.)

    Do I still keep it in the same format with one persistent level and bunch of streaming sub-levels ?

    Do I need to make each level to be a persistent level? In this case, how do I unload level once players beats it and how do I load next persistent level ?

    How do I transfer stats (opened/unlocked doors, some dead enemies, solved puzzles, etc.) from one persistent level to another ?

    Thanks beforehand

    #2
    I think you should create a widget with a button for each level

    Comment


      #3
      Originally posted by motorsep View Post
      Posted elsewhere, but I think maybe my question pertains to Blueprints more than to anything else.

      Up until now I had only one persistent level with several sub-levels in my projects. I'd load one "main" sub-level and then stream (load/unload) other sub-levels as needed. My projects were of a small scale and it worked fine for me.

      Now I am wondering how does one go about setting up level structure for a single-player game with let's say 20 levels. I'd like to have one or two hub levels where player comes back after beating other levels (let's say a town from which player can go into caves, catacombs, another districts, etc.)

      Do I still keep it in the same format with one persistent level and bunch of streaming sub-levels ?

      Do I need to make each level to be a persistent level? In this case, how do I unload level once players beats it and how do I load next persistent level ?

      How do I transfer stats (opened/unlocked doors, some dead enemies, solved puzzles, etc.) from one persistent level to another ?

      Thanks beforehand
      Hey motorsep ,

      I think it depends on the type of game you are making. If you are making a full open-world game without any "loading" then you probably want to have all your levels as sublevels and stream them in. However, if you can have loading, I would suggest this structure:

      Create a separate map for each discreet level
      Create Overworld (like a town in your example) that serves as a hub for the Player - once Player leaves town, load the new map (OpenLevel node).
      Break up your map (level) into several sublevels and load/unload those sections as the Player goes around your level

      This means that your big maps are nicely separated in different maps, yet the maps load fast because you only load the first sub-level on the map, and then dynamically load/unload parts of the map as needed.

      As far as saving data from level to level, use a class like Game Instance. Any variables saved in that Blueprint will persist from level to level. You just have to create a system to save variables and load variables to Game Instance on Begin Play.

      Hope this helps!
      [WIP] Procedural City Generator | RPG AI
      [MARKETPLACE] Animal Behavior Kit | Space Shooter Template | Procedural Foliage Tool | Procedural Park
      [FREE] Modular Road Tool | Action Platformer Template | Radar BP | Free Birds | Procedural Buildings
      Join our Discord

      Comment


        #4
        CoquiGames

        ​​​​​​​Thanks!

        What's the downside of having one persistent level and the rest of the areas to be sub-levels ? (besides being unwieldy for baking lighting)
        Last edited by motorsep; 07-23-2018, 03:48 PM.

        Comment


          #5
          Originally posted by motorsep View Post
          CoquiGames

          Thanks!

          What's the downside of having one persistent level and the rest of the areas to be sub-levels ? (besides being unwieldy for baking lighting)
          Tbh, I dont think there is a downside besides it can get messy with so many sublevels (say you have 20 main "levels" and each level has 20 sublevels or more). I would just be really organized in how you set up your sublevels to keep them manageable
          [WIP] Procedural City Generator | RPG AI
          [MARKETPLACE] Animal Behavior Kit | Space Shooter Template | Procedural Foliage Tool | Procedural Park
          [FREE] Modular Road Tool | Action Platformer Template | Radar BP | Free Birds | Procedural Buildings
          Join our Discord

          Comment

          Working...
          X