Jump to content
  • RWG - DivideByZero - Wilderness POIs


    zztong

    Summary: (a short description of the bug)

     

    There appears to be a new XML element "PrefabSize" that is not present until you save the POI in the Prefab Editor. World Generation throws a DivideByZeroException when placing Wilderness POIs.

     

    Game Version: A20 B231

    Platform: PC

    OS/Version: Windows 11

    CPU Model: Not relevant

    System Memory: Not relevant

    GPU Model and VRAM: Not relevant

    Screen Resolution: Not relevant

    Video Settings: Not relevant

    Game mode: RWG

     

    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 - Custom POIs

    EAC on or off? ON

     

    Status: NEW

     

    Bug Description:

     

    There appears to be a new XML element "PrefabSize" that is not present until you save the POI in the Prefab Editor. World Generation throws a DivideByZeroException when placing Wilderness POIs. My guess is the code for non-Wilderness POIs still checks for the POI size in the old location if the XML element PrefabSize is not found. But, that the Wilderness placement code only tries to find the POI size in the XML file. And, since the element is new, our existing XML files for custom POIs does not contain the new element. Loading and Saving the custom POI does generate the new element, though I suspect y'all don't want bad XML to crash RWG.

     

    Detailed steps to reproduce the bug:

     

    1) Attempt to build a world using Wilderness POIs that do not have the PrefabSize element in the XML file.

    2) If one of those POIs is selected for placement, you should see the DivideByZeroException.

    3) Have a nice day.

     

    Actual result: (description of what is occurring)

     

    RWG throws an exception and then appears to the user to be stuck. You have to kill it with the Task Manager.

     

    Expected result:

     

    World Generation or a nice error message saying "Cannot find the PrefabSize element in <xml-file-name>." Listing the name of the file is important for folks who have lots of custom POIs. Imagine somebody with the CompoPack installed, for instance.

     

    Rock on folks. Y'all are doing great.


    User Feedback

    Recommended Comments

    Crap. forgot the stack trace...

     

    DivideByZeroException: Attempted to divide by zero. at WorldGenerationEngineFinal.WorldBuilder.spawnWildernessPrefab (PrefabData _prefab, Vector2i _prefabPos, System.Boolean _isTrader, System.Boolean _checkTownshipSafeBounds) [0x002df] in <a70e13923c11440db6ee31eb8c04b409>:0 at WorldGenerationEngineFinal.WorldBuilder+<generateWilderness>d__77.MoveNext () [0x00386] in <a70e13923c11440db6ee31eb8c04b409>:0 at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <544fca0986d54eca88fc7c56e2a8b4b4>:0

    Link to comment
    Share on other sites

    2 hours ago, Hated said:

    I'd like the outputlog for this.

     

    Here's two...

     

    https://drive.google.com/drive/folders/1St0zhFlBMMK8WJZq3SVH6__9xaaXZxWj?usp=sharing

     

    I could probably reproduce this, if needed. I just need to keep a copy of my custom POIs from the previous build where that XML element isn't included. Then put that folder in Prefabs and generate a 8192 world with the seed "Wilderness" with many Towns and many Wilderness POIs, rest default. It was throwing the error every time until I edited the POIs with the new version and saving updated the XML.

    In the same google drive shared folder you'll find a folder with custom POIs in it. Put that folder in your prefabs folder, then generate a world using B231.

     

    Seed: Wilderness

    Size: 8192

    Towns: Many

    Wilderness POIs: Many

     

    ... and you should see the same exception.

    Link to comment
    Share on other sites

    3 hours ago, zztong said:

    Crap. forgot the stack trace...

     

    DivideByZeroException: Attempted to divide by zero. at WorldGenerationEngineFinal.WorldBuilder.spawnWildernessPrefab (PrefabData _prefab, Vector2i _prefabPos, System.Boolean _isTrader, System.Boolean _checkTownshipSafeBounds) [0x002df] in <a70e13923c11440db6ee31eb8c04b409>:0 at WorldGenerationEngineFinal.WorldBuilder+<generateWilderness>d__77.MoveNext () [0x00386] in <a70e13923c11440db6ee31eb8c04b409>:0 at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00026] in <544fca0986d54eca88fc7c56e2a8b4b4>:0

    I'm getting the divide by zero exception as well, and I'm not using custom POIs maybe something in the patch is messing with a mod I'm using? Idk. It lets me get into my alread generated world from yesterday.

     

    Link to comment
    Share on other sites

    1 hour ago, unholyjoe said:

    I fixed it awhile back, mod update fixed it.. thanks for checking though, glad I saw the notifications. :)
    ***************************************
    @Arch-Sage @zztong this has been fixed for some time. are you free of the issue or still have it?



    Thanks  :)
    QA Tester-unholyjoe
    ***************************************

     

    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...