Jump to content
  • RWG - Mountain Stamp - Exception


    zztong

    Summary: (a short description of the bug)

     

    Game Version: A20.6 b9
    Platform: PC
    OS/Version: Windows
    CPU Model: 12th Gen Intel(R) Core(TM) i7-12700K   3.61 GHz
    System Memory: 32 GB
    GPU Model and VRAM: nVidia GeForce RTX 3060
    Screen Resolution: 3440 x 1440
    Video Settings: High
    Game mode: SP

    Did you wipe old saves? Yes
    Did you start a new game? Yes
    Did you validate your files? Yes
    Are you using any mods? Yes - The POI Mod I Develop.
    EAC on or off? On

    Status: NEW

    Bug Description:

    I am trying to make custom mountain stamps. I successfully made a PNG that worked as a crater with the file being located in a Stamps folder of my modlet. Now I'm trying to make a mountain. This combination throws an exception. Generation appears to continue, then another exception.


    Detailed steps to reproduce the bug:


    1) Use Gimp to make a PNG, Grayscale 16-bit.
    2) Place file in my modlet's Stamps folder.
    3) Attempt to generate a world.

    Actual result: (description of what is occurring)

     

    NullReferenceException: Object reference not set to an instance of an object
      at WorldGenerationEngineFinal.WorldBuilder.drawStampGroup (WorldGenerationEngineFinal.StampGroup _group, UnityEngine.Color[] _image, System.Int32 size) [0x00043] in <ffc99a688d2b435db53bb46aed82ca49>:0 
      at WorldGenerationEngineFinal.WorldBuilder+<>c__DisplayClass75_0.<generateTerrain>b__2 () [0x00022] in <ffc99a688d2b435db53bb46aed82ca49>:0 
      at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00014] in <695d1cc93cca45069c528c15c9fdd749>:0 
      at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <695d1cc93cca45069c528c15c9fdd749>:0 
      at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0 
      at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x0002b] in <695d1cc93cca45069c528c15c9fdd749>:0 
      at System.Threading.ThreadHelper.ThreadStart () [0x00008] in <695d1cc93cca45069c528c15c9fdd749>:0 
    UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    UnityEngine.Logger:LogException(Exception, Object)
    UnityEngine.Debug:LogException(Exception)
    UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs)

     

    2022-12-14T20:03:30 252.361 INF Writing data files time passed: 22.9140527 seconds
    NullReferenceException: Object reference not set to an instance of an object
      at WorldGenerationEngineFinal.WorldBuilder.PrepPrefabAndRoadGeneration () [0x001ef] in <ffc99a688d2b435db53bb46aed82ca49>:0 
      at WorldGenerationEngineFinal.WorldBuilder+<Generate>d__72.MoveNext () [0x001d7] in <ffc99a688d2b435db53bb46aed82ca49>:0 
      at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <544fca0986d54eca88fc7c56e2a8b4b4>:0 
     

    Expected result: (what you expect to occur)

     

    I'd like to see my mountain stamps appear in a world. Since I'm just figuring out how stamps work there's a good chance I'm giving garbage to RWG to use. Thus, along with my log files you will find some PNGs that I have been using. I'm pretty sure I've gotten exceptions with all of them. The exception shown was using the file named mountains_zztong_02.png.

     

    If you name that same file crater_zztong_01.png then RWG will try to use it as a crater. It does show up on maps, though not without its problems in how it affected the world, but it didn't throw an exception. In that case, I am clearly not giving it a heightmap that will make a crater -- probably since it is mountains.

     

    You can find the log file, and the stamps here:

     

    https://drive.google.com/drive/folders/18t4CtoGvQ3fcMkJJam4wKFBUOjD1iFEw?usp=sharing


    User Feedback

    Recommended Comments

    The exception happens when "Writing Stamps to Map" if that helps.

     

    Make a PNG:

    1. Make the image Grayscale in Gimp
    2. Make part of the image 255,255,255 (white)
    3. Make the rest of the image 32,32,32 (ground level gray)
    4. Export as PNG, 16 bit PC byte order.
    5. Put file into modlet's "Stamps" folder.

     

    Expected result would be whatever you made to be white in step 2 would be a very noticable mountain. Instead, exception.

     

    Other possibility is I'm not making a valid image. However, that same approach, but with step 2 being done in Black, makes for a working crater.

    Link to comment
    Share on other sites

    Attached is a test file you can use to recreate the issue. Put this file in a modlet's Stamps folder. Your modlet files would look like this:

     

    testmod/

        ModInfo.xml

        Stamps/

            mountains_zztong_01.png

     

    I did learn that I was not exporting my PNGs correctly, however the problem persists with correctly exported PNGs too, like the one that is attached.

    mountains_zztong_01.png

    In case it isn't clear, this exception happens when using RWG to generate a new world.

    Link to comment
    Share on other sites

    I'm very much completely naive and un-knowledgeable in any stamp-making, ZZ, but in looking at my own "Stamps" folder - all mountains, craters, lakes, etc., - appear as "raw" formatted files...  Maybe a possible reason?

    pj

    Link to comment
    Share on other sites

    16 minutes ago, paulj_3 said:

    I'm very much completely naive and un-knowledgeable in any stamp-making, ZZ, but in looking at my own "Stamps" folder - all mountains, craters, lakes, etc., - appear as "raw" formatted files...  Maybe a possible reason?

    pj

     

    Is near as I can tell, TFP used RAW files, but made a comment on the boards that PNGs would work using Greyscale, 16 Bit PC Byte Order. So far, PNGs are working for canyons, craters, and lakes (I've not yet tried rivers) ... all of the things that lower terrain ... but my attempt to use a PNG for a mountain (raising terrain) threw the Null Reference Exception.

    Link to comment
    Share on other sites

    and all are 1526k in size.

     

    That reminds me of the RWG problem that I see on my pc - (and it's maybe my eyes), but once it gets around to producing an on-screen preview of the new map - all mountains "appear" to be inverted. Is this just me?

    1536 kB

    Link to comment
    Share on other sites

    6 minutes ago, paulj_3 said:

    all mountains "appear" to be inverted. Is this just me?

     

    I think that's a quirk of shading. Tall things appear deep and the reverse unless you fly down and look at them.

    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

×
×
  • Create New...