Issue Divide by 0 errors

AntLorien

Newcomer
Platform Windows
Game version 1.5.6 (Latest as of 4/24/22 if that's not it)
SMAPI log Log
Steps to reproduce Did some map editing for SVE, haven't been able to get past the intro since.
Expected vs Actual results I expected the game to run, with the edited maps. It did have the new maps (of bus stop and Grandpa's Farm) but crashed after Robin and Lewis left. If I skip the intro, the same thing happens.

Last Error:
Code:
   An error occurred in the overridden draw loop: DivideByZeroException: Attempted to divide by zero.
   at xTile.Tiles.TileSheet.GetTileImageBounds(Int32 tileIndex) in stardewvalley\Farmer\xTileSource\xTile\Tiles\TileSheet.cs:line 254
   at PyTK.Types.PyDisplayDevice.DrawTile_PatchedBy<aedenthorn.ExtraMapLayers>(PyDisplayDevice this, Tile tile, Location location, Single layerDepth)
   at xTile.Layers.Layer.DrawNormal_PatchedBy<aedenthorn.ExtraMapLayers>(Layer this, IDisplayDevice displayDevice, Rectangle mapViewport, Location displayOffset, Int32 pixelZoom)
   at xTile.Layers.Layer.Draw_PatchedBy<aedenthorn.ExtraMapLayers>(Layer this, IDisplayDevice displayDevice, Rectangle mapViewport, Location displayOffset, Boolean wrapAround, Int32 pixelZoom)
   at StardewModdingAPI.Framework.SGame.DrawImpl(GameTime gameTime, RenderTarget2D target_screen) in SMAPI\Framework\SGame.cs:line 655
   at StardewModdingAPI.Framework.SGame._draw(GameTime gameTime, RenderTarget2D target_screen) in SMAPI\Framework\SGame.cs:line 216

15:04:26    CRITICAL  SMAPI    The game crashed when drawing, and SMAPI was unable to recover the game.
If I need to post more info or upload stuff lmk, I just wanted to make minor map changes and now I have put a week of work into this
 
Last edited:
Thanks for the log. I'm not seeing the Divide by Zero error in this current log. But, there's a lot of Map related issues.

It's a bit more visible in this filtered version of your log: https://smapi.io/log/af8083c2a60b4a...warn~error~alert~critical&Mods=ContentPatcher

Did you delete some files? If not, it might be some sort of pathing errors. As there's lots of 'file doesn't exist' warnings/errors.

Just a few examples:
Code:
12:17:49    WARN    Content Patcher    Ignored Stardew Valley Expanded > custom location 'Custom_GrampletonCoast': the FromMapFile field specifies a file 'assets/Maps/NewLocations/GrampletonCoast.tmx' which doesn't exist in the content pack.
12:17:50    ERROR    Content Patcher    Patch error: Stardew Valley Expanded > Load Maps/Forest-FlowerFestival has a FromFile which matches non-existent file 'Assets/Maps/FestivalMaps/Forest-FlowerFestival.tbin'.

12:19:27    ERROR    Content Patcher    Patch error: Stardew Valley Expanded > Load Maps/Town-Halloween #1 has a FromFile which matches non-existent file 'Assets/Maps/FestivalMaps/Town-Halloween.tbin'.
12:19:29    WARN    Content Patcher    Can't apply map patch "Stardew Valley Expanded > EditMap Maps/Town #3" to Maps/Town: the FromFile file 'assets/Maps/MapPatches/Garden_Town.tbin' doesn't exist.

12:19:31    ERROR    Content Patcher    Mod crashed when loading asset 'Maps/Summit'. SMAPI will use the default asset instead. Error details:
SContentLoadException: The content manager failed loading content asset 'assets/Maps/Locations/Summit.tmx' from SMAPI\flashshifter.stardewvalleyexpandedcp.
 ---> System.Exception: Unable to load map with file path 'C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Mods\Stardew Valley Expanded\[CP] Stardew Valley Expanded\assets\Maps\Locations\Summit.tmx'
 ---> System.Exception: Invalid tile gid: 6841
   at TMXTile.TMXFormat.LoadTile(Layer layer, TMXMap tmxMap, UInt32 gid)
   at TMXTile.TMXFormat.LoadLayers(TMXMap tmxMap, Map& map)
   at TMXTile.TMXFormat.Load(TMXMap tmxMap)
   at TMXTile.TMXFormat.Load(Stream stream)
   at xTile.Format.FormatManager.LoadMap(String filePath) in stardewvalley\Farmer\xTileSource\xTile\Format\FormatManager.cs:line 122
   --- End of inner exception stack trace ---
   at xTile.Format.FormatManager.LoadMap(String filePath) in stardewvalley\Farmer\xTileSource\xTile\Format\FormatManager.cs:line 134
   at StardewModdingAPI.Framework.ContentManagers.ModContentManager.Load[T](String assetName, LanguageCode language, Boolean useCache) in SMAPI\Framework\ContentManagers\ModContentManager.cs:line 170
   --- End of inner exception stack trace ---
   at StardewModdingAPI.Framework.ContentManagers.ModContentManager.Load[T](String assetName, LanguageCode language, Boolean useCache) in SMAPI\Framework\ContentManagers\ModContentManager.cs:line 188
   at StardewModdingAPI.Framework.ModHelpers.ContentHelper.Load[T](String key, ContentSource source) in SMAPI\Framework\ModHelpers\ContentHelper.cs:line 92
   at ContentPatcher.Framework.PatchManager.Load[T](IAssetInfo asset) in E:\source\_Stardew\Mods.Pathoschild\ContentPatcher\Framework\PatchManager.cs:line 146
   at StardewModdingAPI.Framework.ContentManagers.GameContentManager.ApplyLoader[T](IAssetInfo info) in SMAPI\Framework\ContentManagers\GameContentManager.cs:line 302
 
Top