Announcement

Collapse
No announcement yet.

Save procedural generated map as *.umap?

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

    Save procedural generated map as *.umap?

    Hey folks,

    I want to create some procedural generated maps so that I can save time to manual create levels. But that can only work for me if I'm able to save these maps after generation.

    How I plan to do that:
    • Create workflow for procedural generation
    • Run the game which automatically runs the workflow
    • Save the procedural generated map as *.umap so I can use it to expand/place stuff on it
    The first two points will work for sure but I don't know if it is possible to save the procedural generated map as *.umap during runtime / or if it is even possible at all with UE4.
    Last edited by SirMorokei; 07-10-2019, 08:11 PM.

    #2
    Why do you want to generate them in game?
    Do this in level editor.
    Rocketeer

    my portfolio
    my youtube

    Camera Volumes System
    Procedurally Instanced Meshes
    Simple Portals
    Water Flow For UDK
    Setup Swarm

    Comment


      #3
      Originally posted by redbox View Post
      Why do you want to generate them in game?
      Do this in level editor.
      To generate 'unlimited' maps and use the level streaming feature to get a better environment / world that can expand over time.

      Comment


        #4
        Only editor modules can generate assets.
        | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

        Comment


          #5
          Originally posted by BrUnO XaVIeR View Post
          Only editor modules can generate assets.
          So I couldn't just run:

          1.
          Code:
          UEditorLoadingAndSavingUtils::NewMapFromTemplate(const FString & PathToTemplateLevel, bool bSaveExistingMap)
          2. run my generation functions and after that run
          3.
          Code:
          UEditorLoadingAndSavingUtils::SaveMap(UWorld * World, const FString & AssetPath)
          https://api.unrealengine.com/INT/API...ils/index.html

          Comment


            #6
            If you want to do that in Editor, that's fine.
            That can't be done in packaged games tho. If you want to do that in shipped games you need a custom map serializer, Unreal has a built-in JSON module that works in runtime modules and you could save any info to Json format and write/read that to/from a text file.
            | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

            Comment


              #7
              Originally posted by BrUnO XaVIeR View Post
              If you want to do that in Editor, that's fine.
              That can't be done in packaged games tho. If you want to do that in shipped games you need a custom map serializer, Unreal has a built-in JSON module that works in runtime modules and you could save any info to Json format and write/read that to/from a text file.
              Okay, good to know.
              Do you have a link to that module?

              Comment


                #8
                You don't even need to get that far, if all you want is save some data like which models and their locations, you can just create a custom struct or UObject class and serialize it to disk. Easier to use than dealing with json serialization.

                Comment


                  #9
                  Originally posted by Manoel.Neto View Post
                  You don't even need to get that far, if all you want is save some data like which models and their locations, you can just create a custom struct or UObject class and serialize it to disk. Easier to use than dealing with json serialization.
                  Depends, I worked with json often so it isn't a big deal for me.

                  Comment


                    #10
                    Originally posted by SirMorokei View Post

                    Okay, good to know.
                    Do you have a link to that module?
                    It's in Json folder from Runtime source code: Runtime/Json/Public/Dom/JsonObject.h

                    http://api.unrealengine.com/INT/API/...Dom/index.html
                    | Finite State Machine | Savior | USQLite | Object-Pool | Sound-Occlusion | Property Transfer | Magic Nodes | MORE |

                    Comment


                      #11
                      Originally posted by redbox View Post
                      Why do you want to generate them in game?
                      Do this in level editor.
                      How exactly would I do this?
                      I can't spawn actors during the construction script (tested it):
                      Code:
                      [2019.07.12-19.58.19:404][537]LogSpawn: Warning: SpawnActor failed because we are running a ConstructionScript (Actor)

                      Comment

                      Working...
                      X