Download

Offline map generation

Hi, I have searched around for answers and found partial things but I am not sure I am doing this the right way. Anyhow I am making a mobile game, the level design is based on a grid, within this grid I will be placing actors at different grid coordinates to make the level. I was thinking of creating the level from a text file, that maps actors to grid coordinates. Simple file, easy to modify, and actors would be placed accordingly.

I have a library of actors, most of the “decoration” actors being a composition of static meshes. some have small animations. Then there are the gameplay actors.

I thought I should do this offline to benefit from baked lighting on static objects, and to avoid having to spawn all these objects at run time. Unfortunately it doesn’t seem like the level file format is exposed, so I cannot generate the .umap. I found this function though FEditorFileUtils::SaveMap , haven’t tried it yet, but could be promising, even if it would require to create specific code to read the text files, spawn the objects and the save the newly made map ( and I have doubts as to whether I can make spawned objects be considered “normal” objects with respect to map saving )

It seems fairly easy to “spawn” instanced static meshes at construction time, but this might prove complicated with object composition, and does not take in account animation.

Am I going at this the wrong way ? Is all this overkill and I should just spawn everything ? Anyone in the same situation?

Ok so I am thinking of doing this in an editor plugin

Yeah, the built game doesn’t have the ability to build map files and lighting.
You could do something similar though, if you have level components you can place them and use dynamic lighting just fine, you don’t need to create a new map file, so if you make a system that will allow you to place the objects it can do it dynamically in game.

Thanks for the reply, so you’re saying level components would work with lightmaps ?

Well, for mobile there’s not dynamic shadows support so with dynamically created objects you wouldn’t be able to get static lightmaps or dynamic shadows since that’s not supported on mobile. On PC you could get some pretty good dynamic lighting.
There’s no way to build static lighting outside of the editor.