Topic: Ideas for massive numbers of buildings

What are your recommendations for generating all of the buildings from a massive space?  I am trying to capture a 23km2 area and there are a whole bunch of buildings. 

Is there a way to generate the buildings into multiple grid-style scenes for easy streaming?  I have tried generating the buildings as is and I run into a GC heap crash every time, I am assuming because it's just too much.

Re: Ideas for massive numbers of buildings

Hello.

You need to generate buildings in small pieces for each terrain separately.

If you have only one terrain or a small number of terrains, generate new temporary terrains (for example, 10x10) with minimal settings.
Then generate the buildings for the first terrains, save buildings as a prefab, and remove from the scene.
Repeat this for each terrains where buildings are needed.
If you have programming experience, this can be automated using RWT API.
In the final, you simply instantiate buildings for your main terrains from prefabs.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Ideas for massive numbers of buildings

Thanks for the response.  Since I have over 2000 terrains, I would like to automate the process.  I poked around in the RWT API, but I am not connecting how to generate buildings per RealWorldTerrainItem.  I can see that I can set the generatedBuildings property, but it looks like the only way to trigger doing any generation work needs to be done through RealWorldTerrainWindow (StartCapture())?  Any pointers on getting started would be helpful.

Re: Ideas for massive numbers of buildings

Example of how to automate the regeneration of buildings is attached.
Place the script in Editor folder, and open "Window / Infinity Code / Real World Terrain / Tools / Regenerate Buildings".

Post's attachments

Attachment icon RegenerateBuildingsWindow.cs 3.62 kb, 162 downloads since 2018-11-16 

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Ideas for massive numbers of buildings

Thank you for the script.  This looks like it will do the trick, but RealWorldTerrainBuildingGenerator.baseContainer is always null in OnCaptureComplete, so no prefabs are saved.  This is happening because in RealWorldTerrainBuildingGenerator.Generate(), ways.Count is always 0, so the function returns before setting baseContainer.

For now, I have commented out the return after setting RealWorldTerrainPhase.phaseComplete = true, and it seems to be saving.

Re: Ideas for massive numbers of buildings

Why always ways.Count == 0?
If ways .Count == 0, RWT does not generate buildings and simply skips this step.
So in that case there is nothing to save.

Or do you mean that there are terrains that do not have buildings?
In this case, it is more correct to check that baseContainer != null in the script.

Or did I miss something?

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Ideas for massive numbers of buildings

I am not sure why ways.Count == 0 always.  I thought ways was referring to streets and since I did not generate any streets I thought maybe that is why it is always 0.

I do have many terrains that do not have any buildings on them.  I first tried to just check if baseContainer is null and continue, but then I got no buildings because all of the terrains had ways.Count == 0.  After that I changed the function to continue even if ways.Count == 0.