[1.0] Maneuver_Scratch_MeleeHit InvalidCastException (Any Wildlife)

Started by jecrell, June 17, 2018, 02:23:02 AM

Previous topic - Next topic

jecrell

Firstly, I will say I did try to log into Mantis to see if this was a known issue, but I could not for whatever reason.

What the circumstances were.
- Started a new game using the RimWorld Unstable Build 1.0.1936
- Played for several days until wildlife began predator routines.

What happened.
- Wildlife preyed on each other as expected (red fox eats a rat).
- During autosave, red error messages appeared, disrupting the game flow.
- Saves further create more errors when loaded.

What you expected to happen.
- No error messages expected.

Steps we can follow to make the bug appear on our machine.
- Load this save file ( https://drive.google.com/file/d/1tlEY5PGxNEtM09RceEP4qgckXygEN0-M/view?usp=sharing )
- Wait for autosave or try to save
- Receive errors.

Primary exception
Exception while saving Maneuver_Scratch_MeleeHit: red fox->rat: System.InvalidCastException: Cannot cast from source type to destination type.
  at Verse.Scribe_Collections.Look[BodyPartRecord] (System.Collections.Generic.List`1& list, Boolean saveDestroyedThings, System.String label, LookMode lookMode, System.Object[] ctorArgs) [0x0022f] in C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:77
  at Verse.Scribe_Collections.Look[BodyPartRecord] (System.Collections.Generic.List`1& list, System.String label, LookMode lookMode, System.Object[] ctorArgs) [0x00006] in C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:13
  at Verse.BattleLogEntry_MeleeCombat.ExposeData () [0x0007b] in C:\Dev\RimWorld\Assets\Scripts\Verse\Game\BattleLog\BattleLogEntry_MeleeCombat.cs:166
  at Verse.Scribe_Deep.Look[LogEntry] (Verse.LogEntry& target, Boolean saveDestroyedThings, System.String label, System.Object[] ctorArgs) [0x0019f] in C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:68
Verse.Log:Error(String, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:78)
Verse.Scribe_Deep:Look(LogEntry&, Boolean, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:72)
Verse.Scribe_Collections:Look(List`1&, Boolean, String, LookMode, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:88)
Verse.Scribe_Collections:Look(List`1&, String, LookMode, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:13)
Verse.Battle:ExposeData() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\BattleLog\Battle.cs:142)
Verse.Scribe_Deep:Look(Battle&, Boolean, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:68)
Verse.Scribe_Collections:Look(List`1&, Boolean, String, LookMode, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:88)
Verse.Scribe_Collections:Look(List`1&, String, LookMode, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:13)
Verse.BattleLog:ExposeData() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\BattleLog\BattleLog.cs:81)
Verse.Scribe_Deep:Look(BattleLog&, Boolean, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:68)
Verse.Scribe_Deep:Look(BattleLog&, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:14)
Verse.Game:ExposeSmallComponents() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Game.cs:245)
Verse.Game:ExposeData() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Game.cs:218)
Verse.Scribe_Deep:Look(Game&, Boolean, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:68)
Verse.Scribe_Deep:Look(Game&, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:14)
Verse.GameDataSaveLoader:<SaveGame>m__0() (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\GameDataSaveLoader.cs:115)
Verse.SafeSaver:DoSave(String, String, Action) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\SafeSaver.cs:95)
Verse.SafeSaver:Save(String, String, Action) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\SafeSaver.cs:35)
Verse.GameDataSaveLoader:SaveGame(String) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\GameDataSaveLoader.cs:110)
RimWorld.Autosaver:DoAutosave() (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\Utility\Autosaver.cs:59)
Verse.LongEventHandler:UpdateCurrentSynchronousEvent(Boolean&) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\LongEventHandler.cs:419)
Verse.LongEventHandler:LongEventsUpdate(Boolean&) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\LongEventHandler.cs:259)
Verse.Root:Update() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root.cs:102)
Verse.Root_Play:Update() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root_Play.cs:83)


Output Log
-Attached below

[attachment deleted due to age]
...Psst. Still there? If you'd like to support
me and my works, do check out my Patreon.
Someday, I could work for RimWorld full time!

https://www.patreon.com/jecrell

ReZpawner


Mitz

mantis says it's "fixed", my apologies but i have a brand new game that was newly updated and yet i still get this. this isn't fixed.
updated @ ~9:30AM EST, today, ~1 hour ago. ZorbaTHut says it is "fixed". ???
It's sad autism's an insult, then i must be an insult.
and my cat also must be an insult, as well as every other cat in the universe.
space cats.

Audorn

I just updated to 1.0 and started a new game a few minutes ago and had the same exact problem when the game autosaved, but with Maneuver_Bite_MeleeHit, between a fox and a squirrel.  There were no successful scratches in the fight.

Exception while saving Maneuver_Bite_MeleeHit: red fox->squirrel: System.InvalidCastException: Cannot cast from source type to destination type.
  at Verse.Scribe_Collections.Look[BodyPartRecord] (System.Collections.Generic.List`1& list, Boolean saveDestroyedThings, System.String label, LookMode lookMode, System.Object[] ctorArgs) [0x0022f] in C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:77
  at Verse.Scribe_Collections.Look[BodyPartRecord] (System.Collections.Generic.List`1& list, System.String label, LookMode lookMode, System.Object[] ctorArgs) [0x00006] in C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:13
  at Verse.BattleLogEntry_MeleeCombat.ExposeData () [0x0007b] in C:\Dev\RimWorld\Assets\Scripts\Verse\Game\BattleLog\BattleLogEntry_MeleeCombat.cs:166
  at Verse.Scribe_Deep.Look[LogEntry] (Verse.LogEntry& target, Boolean saveDestroyedThings, System.String label, System.Object[] ctorArgs) [0x0019f] in C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:68
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:LogError(Object)
Verse.Log:Error(String, Boolean) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Utility\Debug\Log\Log.cs:68)
Verse.Scribe_Deep:Look(LogEntry&, Boolean, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:72)
Verse.Scribe_Collections:Look(List`1&, Boolean, String, LookMode, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:88)
Verse.Scribe_Collections:Look(List`1&, String, LookMode, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:13)
Verse.Battle:ExposeData() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\BattleLog\Battle.cs:142)
Verse.Scribe_Deep:Look(Battle&, Boolean, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:68)
Verse.Scribe_Collections:Look(List`1&, Boolean, String, LookMode, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:88)
Verse.Scribe_Collections:Look(List`1&, String, LookMode, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Collections.cs:13)
Verse.BattleLog:ExposeData() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\BattleLog\BattleLog.cs:81)
Verse.Scribe_Deep:Look(BattleLog&, Boolean, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:68)
Verse.Scribe_Deep:Look(BattleLog&, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:14)
Verse.Game:ExposeSmallComponents() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Game.cs:245)
Verse.Game:ExposeData() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Game\Game.cs:218)
Verse.Scribe_Deep:Look(Game&, Boolean, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:68)
Verse.Scribe_Deep:Look(Game&, String, Object[]) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\Scribe\Scribe_Deep.cs:14)
Verse.GameDataSaveLoader:<SaveGame>m__0() (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\GameDataSaveLoader.cs:115)
Verse.SafeSaver:DoSave(String, String, Action) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\SafeSaver.cs:95)
Verse.SafeSaver:Save(String, String, Action) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\SafeSaver.cs:31)
Verse.GameDataSaveLoader:SaveGame(String) (at C:\Dev\RimWorld\Assets\Scripts\Verse\SaveLoad\GameDataSaveLoader.cs:110)
RimWorld.Autosaver:DoAutosave() (at C:\Dev\RimWorld\Assets\Scripts\RimWorld\Utility\Autosaver.cs:59)
Verse.LongEventHandler:UpdateCurrentSynchronousEvent(Boolean&) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\LongEventHandler.cs:419)
Verse.LongEventHandler:LongEventsUpdate(Boolean&) (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\LongEventHandler.cs:259)
Verse.Root:Update() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root.cs:102)
Verse.Root_Play:Update() (at C:\Dev\RimWorld\Assets\Scripts\Verse\Global\Root\Root_Play.cs:83)


On Mantis, I found 0003436 Exception while saving Maneuver_Smash_MeleeHit, which was marked as resolved today, but no Scratch or Bite.

Edit: A couple days, and a couple wildlife fights later, Maneuver_Poke_MeleeHit and Maneuver_Smash_MeleeHit are all throwing this error.  If it matters - The log file was in the RimWorldWin_Data, not RimWorldWin64_Data for me, so it looks like I'm running the x86 version?

ison

The savefile is no longer causing errors, so it looks like it's fixed. Thanks for reporting.