Handle missing / default material properties gracefully
Apr 25, 2017 2:20:45 GMT
Rocket Witch and subunit like this
Post by someusername6 on Apr 25, 2017 2:20:45 GMT
I was having fun testing / modding in the Actinium element from Rocket Witch 's thread here but, once I modded Actinium in, I was not able to open the railgun or coilgun screens anymore. The crash logs look like this:
My understanding is that the missing value of resistivity for the modded material is read as 0, *and* because it comes up early in the alphabet, it is the first element selected by default on the editor for a new railgun or coilgun. Rather than making the material unavailable, the game selects it by default, fails its validation, and crashes.
For now we can mod in a placeholder value for this material (or try to estimate it!), but I'd rather have the game just not make a material available if its properties are invalid. (A more explicit way to mark a property as "unknown", whether or not that is the default value, would also be nice).
Assertion at Logistic\Modules\WeaponModules\RailgunModules.cpp(251): Armature.Composition->Resistivity_Ohm_m > 0
Error: EXCEPTION_BREAKPOINT
0 0x74f448a2 DebugBreak Line Info Error 487
1 0x00cc4dcf RailgunModule::GetPressureOnRailAtLengthAlong_Pa \\mac\home\documents\code\cde\cde\logistic\modules\weaponmodules\railgunmodules.cpp(470)
2 0x00cc90b5 RailgunModule::SetCachedData \\mac\home\documents\code\cde\cde\logistic\modules\weaponmodules\railgunmodules.cpp(787)
3 0x00c0fcb2 ModuleDesignManager::SelectModule \\mac\home\documents\code\cde\cde\logistic\moduledesign\moduledesign.cpp(359)
4 0x00c12de2 ModuleDesignManager::NewModule \\mac\home\documents\code\cde\cde\logistic\moduledesign\moduledesign.cpp(671)
5 0x00c13805 util::DelegateFactory<ModuleDesignManager,void,util::tuple2<util::Str<char>,void (__cdecl*)(void)> >::MethodCaller<&ModuleDesignManager::NewModule> \\mac\home\documents\code\utilities\utilities\core\delegates.h(84)
6 0x00c16133 NewModuleButton::Select \\mac\home\documents\code\cde\cde\logistic\moduledesign\moduledesignui.cpp(197)
7 0x00b53785 UISimpleButton::OnAction \\mac\home\documents\code\cde\cde\common\uiframework\buttonui.cpp(156)
8 0x00b534f8 UISimpleButton::MouseUp \\mac\home\documents\code\cde\cde\common\uiframework\buttonui.cpp(128)
9 0x00b6d7de Interface::TriggerMouseUp \\mac\home\documents\code\cde\cde\common\uiframework\interface.cpp(407)
10 0x00b6ccec Interface::HandleMouseInput \\mac\home\documents\code\cde\cde\common\uiframework\interface.cpp(226)
11 0x00adcb12 GameManager::HandleMouseInput \\mac\home\documents\code\cde\cde\common\gameplay.cpp(359)
12 0x00acdde7 MouseCallback \\mac\home\documents\code\cde\cde\common\engine.cpp(183)
My understanding is that the missing value of resistivity for the modded material is read as 0, *and* because it comes up early in the alphabet, it is the first element selected by default on the editor for a new railgun or coilgun. Rather than making the material unavailable, the game selects it by default, fails its validation, and crashes.
For now we can mod in a placeholder value for this material (or try to estimate it!), but I'd rather have the game just not make a material available if its properties are invalid. (A more explicit way to mark a property as "unknown", whether or not that is the default value, would also be nice).