Jump to content

Biome/Spawner Saving


Mike P
 Share

Go to solution Solved by Peter,

Recommended Posts

Have been running into this issue since the start now and it's truly beginning to 'pmo' to no extent.

After initialing creating 'x' tiles and either using world designer or stamper, mainly stamper, I go through a lot cumbersome tasks to modify pre-selected biome textures to add/change new/existing textures. After several tasks to achieve what I want for the biome(s) texturing, I modify the spawning rules for grass, trees, etc..  When all is said and done and I'm happy with the changes I click on the actual Biome Controller GaemObject in the Scene Hierarchy and then select the advanced tab and select to save the biome.  Upon saving(creating new copies initially and then overwriting after 1st save), and it's a 50/50 change this error happens, I receive the following error:

NullReferenceException: Object reference not set to an instance of an object
Gaia.Spawner.SaveSettings (System.String saveFilePath) (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:6795)
Gaia.BiomeControllerEditor.DrawSaveAndLoad (System.Boolean helpEnabled) (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Editor/BiomeControllerEditor.cs:892)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, UnityEngine.GUIStyle labelStyle, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (System.String nameKey, System.Action`1[T] contentMethod, System.Boolean defaultStatus, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
Gaia.BiomeControllerEditor.DrawAdvanced (System.Boolean helpEnabled) (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Editor/BiomeControllerEditor.cs:652)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, UnityEngine.GUIStyle labelStyle, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (UnityEngine.GUIContent panelLabel, System.String helpKey, System.Action`1[T] contentMethod, System.Boolean ignoreGuiChange, System.Boolean defaultStatus, System.Boolean showVersionNumber, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
PWCommon5.EditorUtils.Panel (System.String nameKey, System.Action`1[T] contentMethod, System.Boolean defaultStatus, UnityEngine.GUILayoutOption[] options) (at <5e780e565d3b4b63836c767b4e8e9d7f>:0)
Gaia.BiomeControllerEditor.OnInspectorGUI () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Editor/BiomeControllerEditor.cs:552)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <2758fd44916644e3a3b65c9d4809b7f9>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

When this error happens, it will jump into the folder where the biomes spawners are saved and it will flash one of the spawners it had the issue with. Usually by the time you see the error and read it the "flashed" spawner it had issues with is no longer highlighted so you don't know which one had the issue.  However, if you jump back one level in the folders so you can click on the actual biome controller it just saved it will then show you the spawners within that Biome controller.  All or some of the spawners are now missing.

Another issues I've had with this, all of the above still takes place, is that sometimes the save actually removes all the settings for all or some spawner rules of any given spawner. I've had it happen now at least 6-7 times for my grass spawner and tree spawner.  Just to mention that none of these spawners(grasss, trees, etc..) where changed other than a probability or jitter setting.

 

Here is an example: Just did some work on Biome and texturing and then re-spawned the entire biome to populate the world for final visual confirmations.  Prior to doing any of this I optioned to "Clear Spawns" of everything on all terrains.

 

Got this 3 times:

Exception while spawning: Object reference not set to an instance of an object Stack Trace:   at ProceduralWorlds.Flora.FloraAutomationAPI.AddToTerrain (ProceduralWorlds.Flora.FloraTerrainTile floraTile, System.Collections.Generic.List`1[T] details, System.Boolean skipPrototypeCheck) [0x0002a] in D:\UnityProjects\FromTheLake\Assets\Procedural Worlds\Flora\Scripts\Editor\FloraAutomationAPI.cs:2502 
  at Gaia.FloraUtils.AddFloraToTerrain (UnityEngine.Terrain terrain, System.Collections.Generic.List`1[T] floraLODs, System.Int32 terrainSourceDataIndex, ProceduralWorlds.Flora.CoreCommonFloraData+SourceDataType sourceDataType) [0x000e3] in D:\UnityProjects\FromTheLake\Assets\Procedural Worlds\Gaia\Scripts\ResourcesSystem\FloraUtils.cs:274 
  at Gaia.GaiaMultiTerrainOperation.SetTerrainDetails (UnityEngine.RenderTexture targetDetailTexture, Gaia.SpawnerSettings spawnerSettings, Gaia.Spawner spawner, Gaia.SpawnRule spawnRule, System.Int32 randomSeed, System.Boolean centerTerrainOnly) [0x003e0] in D:\UnityProjects\FromTheLake\Assets\Procedural Worlds\Gaia\Scripts\MultiTerrainSystem\GaiaMultiTerrainOperation.cs:824 
  at Gaia.Spawner.ExecuteSpawn (Gaia.GaiaMultiTerrainOperation operation, Gaia.BakedMaskCache collisionMaskCache, System.Int32 totalSpawns, System.Int32& totalSpawsCompleted, System.Boolean allowStatic) [0x002c3] in D:\UnityProjects\FromTheLake\Assets\Procedural Worlds\Gaia\Scripts\SpawningSystem\Spawner.cs:2741 
UnityEngine.Debug:LogError (object)
Gaia.Spawner:ExecuteSpawn (Gaia.GaiaMultiTerrainOperation,Gaia.BakedMaskCache,int,int&,bool) (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:2904)
Gaia.Spawner/<AreaSpawn>d__217:MoveNext () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:2339)
Gaia.Spawner:EditorUpdate () (at Assets/Procedural Worlds/Gaia/Scripts/SpawningSystem/Spawner.cs:1009)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()

This was the end-result after the errors that results in no runtime grass: Well can't upload the image for some reason, so here is a link to image.

https://www.dropbox.com/s/9v3ep4bkqffbr6l/no_grass.jpg?dl=0

 

 

Edited by Mike P
additional content added
Link to comment
Share on other sites

  • Solution

Hi thanks for reporting this. I looked into those error messages a bit, and it looks like they are being caused by missing flora data in the spawners. (Missing in the sense of "there is information / objects missing in the datasets", not in the sense of "Flora was not set up for a grass item". We did not run into these issues when we e.g. created our own biomes for the nature spawner pack or the recent Fields of Color micro biome pack, but the difference is that those were created from scratch rather than by changing the existing spawners.
It looks like there is a constellation where you edit our existing spawners into a new biome that can cause these errors, we need to review this to see if we can reproduce this issues. The errors that you reported we should be able to fix in any case, the effects that you describe afterwards like the biomes losing their reference to the spawners sound like that are follow-up errors from these errors interrupting the regular saving / loading.

Link to comment
Share on other sites

Hey Peter. Thanks for the response. Yes indeed.  I can tell you that in every event when I have saved a Biome after making changes to it specific spawners, this is when it happens.  Coincidentally, never made any changes to the grass spawner so not sure how the data "leaked" away from it's settings. 99.85% of the time this happens. If it does not happen eventually the grass for flora just vanishes, even without making changes to the grass spawner, ever, as I mentioned above.  Have had to re-do my biomes I've made as well as modifyed and saved from Gaia's pre-made biome/spawners, over and over again...

Link to comment
Share on other sites

On 1/2/2022 at 11:56 AM, Peter said:

Hi thanks for reporting this. I looked into those error messages a bit, and it looks like they are being caused by missing flora data in the spawners. (Missing in the sense of "there is information / objects missing in the datasets", not in the sense of "Flora was not set up for a grass item". We did not run into these issues when we e.g. created our own biomes for the nature spawner pack or the recent Fields of Color micro biome pack, but the difference is that those were created from scratch rather than by changing the existing spawners.
It looks like there is a constellation where you edit our existing spawners into a new biome that can cause these errors, we need to review this to see if we can reproduce this issues. The errors that you reported we should be able to fix in any case, the effects that you describe afterwards like the biomes losing their reference to the spawners sound like that are follow-up errors from these errors interrupting the regular saving / loading.

Thank you.  Please take a look also as what the "clear details" is doing from within the resource management as well as any of the spawner clearing settings.  I've seen it happen, over and over, that when clearing the details(grass), the flora data gets corrupt or changes its materials which then lead to further problems down the road.

 

Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...