Hi, I’m trying to use Procedural Mesh tools to create a world. Using UE4.27
Everything works fine until the point that I need to save the created mesh. I would want to create the world using single or multiple procedural meshes ONCE within the world generation phase of a new game save, then somehow save the generated meshes. So, it won’t be necessary to generate over and over again every time the player loads their save.
The problem scales up with the world size, resolution, and the calculations per vertex.
I know;
there is a button in the editor to create static mesh from procedural mesh component. But I suppose this only works in the editor. I need that runtime.
there is no such node like “convert to static mesh” related to PMC.
I also wonder why it is possible to convert a static mesh into a procedural mesh, but not vise versa.
Any help, guide, or a link to a possible solution would be appreciated.
PS: This sounds like it would be a popular issue to me. I’m a little surprised about only a few topics are created on this problem, and they are not actually solved. (I feel like am blind to see the solution at this point, lol.)
Afaik there is no reliable way to save to disk without compromising your project or exposing your files and textures.
It isn’t a popular issue becase you are thinking about it as a creator, not as an end user.
End users shouldn’t be able to or have any need to access a mesh. Nor to know what a mesh is for that matter, which considering the avarage IQ of people across the globe is likely for the best.
As such, the world is recreated from code every load - which also makes more sense, since you can change items and things between versions.
Could you add a system to save and load meshes?
Sure, but how many games have you ever used that require write permissions to folders for anything but save files?
None, that’s how many…
And the why is pretty simple. Basic security.
Even if you circumvent that - say writing to app local or roaming, like save files - the file types you can save are restricted.
Youd probably end up having to export the mesh data encoded as base64, and decode it before usage, which as a whole is very likely to take 3 times the time to generate things anew.
Writing to disk is expensive. Reading not as much.
If you also have to convert you loose next to any benefits…
Is it worth it?
I doubt it, or else all AAA titles with procedural bits would do it…
As a sidenote.
A loop of 10k that adds 10k instanced meshes would probably finish loading way before a mesh comprised of 10k instances of whatever you added in.
And on top of it you now have everything in the level fighting against fustrum culling, because its a single mesh and not a bunch of instances…
Chunking - minecraft style - could end up working. But again, an hour or 2 to save a level up is not acceptabe…