Page 1 of 1

[v1.10.05b] Crash on accepting leader

Posted: Wed Feb 23, 2022 8:44 pm
by Voker57
Save: https://tinystash.undef.im/dl/5DM4xdwk2 ... rNhP1x.se1

Reproduce: Load, accept RU candidate.

Code: Select all

************** Exception Text **************
System.ArgumentOutOfRangeException: 'minValue' cannot be greater than maxValue.
Parameter name: minValue
  at System.Random.Next(Int32 minValue, Int32 maxValue)
  at WindowsApplication1.EventRelatedClass.Helper_RollCharacter(Int32 cultureId, Int32 regimeNr, String dataLib, Int32 minAge, Int32 fixedSex, String extraLine, Int32 finalAge, Int32 finalCapCategory, Int32 finalCareerId, Boolean thirdparty, Int32 languageOverride, Int32 fixedRandySeed, Boolean justForTempGfxUse) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\SE1_specific\EventRelatedClass_SE1_ZoneEconomy.vb:line 24781
  at WindowsApplication1.EventRelatedClass.ExecHardcodedDecision_Faction_Job(Int32 storyId, Boolean isHidden) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\SE1_specific\EventRelatedClass_SE1_StoryScripts.vb:line 12714
  at WindowsApplication1.EventRelatedClass.execHardcodedDecision(Int32 dat1, Int32 dat2, Int32 dat3, Int32 dat4, String datastring) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\SE1_specific\EventRelatedClass_SE1_StoryScripts.vb:line 1508
  at WindowsApplication1.EventRelatedClass.DoExec(Int32 enr, Int32 t1, String val1, String val2, String val3, String val4, String datastring) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 2855
  at WindowsApplication1.EventRelatedClass.ExecuteExec(Int32 enr, Int32 linenr) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 2460
  at WindowsApplication1.EventRelatedClass.DoCheckSpecificEvent(Int32 enr, Int32 tv0, Int32 tv1, Int32 tv2, Int32 tv3, Int32 tv9, Int32 tv7, Int32 tv8, Int32 tv10, Boolean skipSettingTempVars) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 536
  at WindowsApplication1.TabManagementWindowClass2.HandleMouseClick(Int32 x, Int32 y, Int32 b) in G:\VR\VRDevelopment\WindowsApplication1\GUI\Windows\NewWindows\Tabs\TabManagementWindow2.vb:line 616
  at WindowsApplication1.PlayScreenClass2.HandleMouseClick(Int32 x, Int32 y, Int32 b) in G:\VR\VRDevelopment\WindowsApplication1\GUI\Screens\NewScreens\PlayScreenClass2.vb:line 469
  at WindowsApplication1.Form1.Form1_Mousedown(Object sender, MouseEventArgs e) in G:\VR\VRDevelopment\WindowsApplication1\Form1.vb:line 1574
  at System.Windows.Forms.Control.OnMouseDown(MouseEventArgs e)
  at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.Form.WndProc(Message& m)
  at WindowsApplication1.ImmoveableForm.WndProc(Message& m) in G:\VR\VRDevelopment\WindowsApplication1\ImmoveableForm.vb:line 68
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
   Assembly Version: 4.0.0.0
   Win32 Version: 4.7.3062.0 built by: NET472REL1
   CodeBase: file:///C:/windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
WindowsApplication1
   Assembly Version: 1.0.8075.29579
   Win32 Version: 1.0.8075.29579
   CodeBase: file:///C:/se/ShadowEmpire.exe
----------------------------------------
Microsoft.VisualBasic
   Assembly Version: 10.0.0.0
   Win32 Version: 14.7.3062.0 built by: NET472REL1
   CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System.Windows.Forms
   Assembly Version: 4.0.0.0
   Win32 Version: 4.7.3062.0 built by: NET472REL1
   CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
   Assembly Version: 4.0.0.0
   Win32 Version: 4.7.3062.0 built by: NET472REL1
   CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
   Assembly Version: 4.0.0.0
   Win32 Version: 4.7.3062.0 built by: NET472REL1
   CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
   Assembly Version: 4.0.0.0
   Win32 Version: 4.7.3062.0 built by: NET472REL1
   CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
   Assembly Version: 4.0.0.0
   Win32 Version: 4.7.3062.0 built by: NET472REL1
   CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
   Assembly Version: 4.0.0.0
   Win32 Version: 4.7.3062.0 built by: NET472REL1
   CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
System.Runtime.Remoting
   Assembly Version: 4.0.0.0
   Win32 Version: 4.7.3062.0 built by: NET472REL1
   CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
irrKlang.NET4
   Assembly Version: 1.0.6617.18847
   Win32 Version: 
   CodeBase: file:///C:/se/irrKlang.NET4.DLL
----------------------------------------
ICSharpCode.SharpZipLib
   Assembly Version: 0.84.0.0
   Win32 Version: 0.84.0.0
   CodeBase: file:///C:/se/ICSharpCode.SharpZipLib.DLL
----------------------------------------
System.Core
   Assembly Version: 4.0.0.0
   Win32 Version: 4.7.3081.0 built by: NET472REL1
   CodeBase: file:///C:/windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------

Re: [v1.10.05b] Crash on accepting leader

Posted: Thu Feb 24, 2022 1:45 am
by nscrutable
<file now removed>

Reproduce: load, execute strategem "Recruit Civilian"

Alternate reproduction: scrap a bunch of strategems, craft a new stratagem, get corrupt trader, play it, get the same crash

Could this have something to do with playing PBEM with different players running different versions? I was running 04b.

Code: Select all

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ArgumentOutOfRangeException: 'minValue' cannot be greater than maxValue.
Parameter name: minValue
   at System.Random.Next(Int32 minValue, Int32 maxValue)
   at WindowsApplication1.EventRelatedClass.Helper_RollCharacter(Int32 cultureId, Int32 regimeNr, String dataLib, Int32 minAge, Int32 fixedSex, String extraLine, Int32 finalAge, Int32 finalCapCategory, Int32 finalCareerId, Boolean thirdparty, Int32 languageOverride, Int32 fixedRandySeed, Boolean justForTempGfxUse) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\SE1_specific\EventRelatedClass_SE1_ZoneEconomy.vb:line 24474
   at WindowsApplication1.EventRelatedClass.ExecHardcodedSet(Int32 dat1, Int32 dat2, Int32 dat3, Int32 dat4, String datastring) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\SE1_specific\EventRelatedClass_SE1_ZoneEconomy.vb:line 1418
   at WindowsApplication1.EventRelatedClass.DoExec(Int32 enr, Int32 t1, String val1, String val2, String val3, String val4, String datastring) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 2880
   at WindowsApplication1.EventRelatedClass.CheckLogicString2(Int32 dat1, Int32 dat2, String logicString, Int32 nestedCall, Random& tempRA) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 1763
   at WindowsApplication1.EventRelatedClass.CheckLogicStringStart(Int32 dat1, Int32 dat2, String logicString, Int32 nestedCall, Random& tempRA) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 1206
   at WindowsApplication1.EventRelatedClass.ExecSetLogic2(Int32 flagId, Int32 flagInstructionsId, String logicString, Random& tempRA) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 18481
   at WindowsApplication1.EventRelatedClass.ExecSetLogic(Int32 flagId, Int32 flagInstructionsId, String logicString, Int32 dat4, String datastring) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 18441
   at WindowsApplication1.EventRelatedClass.Hardcoded_Gui_CardPlay(Int32 feedback) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\SE1_specific\EventRelatedClass_SE1_HardcodedScript.vb:line 894
   at WindowsApplication1.EventRelatedClass.ExecHardcodedScript(Int32 hardcodedScriptNr, Int32 feedback, Int32 dat3, Int32 dat4, String datastring) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\SE1_specific\EventRelatedClass_SE1_HardcodedScript.vb:line 82
   at WindowsApplication1.EventRelatedClass.DoExec(Int32 enr, Int32 t1, String val1, String val2, String val3, String val4, String datastring) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 2845
   at WindowsApplication1.EventRelatedClass.ExecuteExec(Int32 enr, Int32 linenr) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 2460
   at WindowsApplication1.EventRelatedClass.DoCheckSpecificEvent(Int32 enr, Int32 tv0, Int32 tv1, Int32 tv2, Int32 tv3, Int32 tv9, Int32 tv7, Int32 tv8, Int32 tv10, Boolean skipSettingTempVars) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\EventRelatedClass.vb:line 536
   at WindowsApplication1.ProcessingClass.PlayCard(Int32 regnr, Int32 cardinhandnr, Boolean dontDelete) in G:\VR\VRDevelopment\WindowsApplication1\Game\Calculations\ProcessingClass.vb:line 1384
   at WindowsApplication1.TabCardsWindowClass2.HandleMouseClick(Int32 x, Int32 y, Int32 b) in G:\VR\VRDevelopment\WindowsApplication1\GUI\Windows\Se1_Windows\Se1_TabCardsWindow2.vb:line 3606
   at WindowsApplication1.PlayScreenClass2.HandleMouseClick(Int32 x, Int32 y, Int32 b) in G:\VR\VRDevelopment\WindowsApplication1\GUI\Screens\NewScreens\PlayScreenClass2.vb:line 469
   at WindowsApplication1.Form1.Form1_Mousedown(Object sender, MouseEventArgs e) in G:\VR\VRDevelopment\WindowsApplication1\Form1.vb:line 1557
   at System.Windows.Forms.Control.OnMouseDown(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at WindowsApplication1.ImmoveableForm.WndProc(Message& m) in G:\VR\VRDevelopment\WindowsApplication1\ImmoveableForm.vb:line 68
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4470.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
WindowsApplication1
    Assembly Version: 1.0.8020.28903
    Win32 Version: 1.0.8020.28903
    CodeBase: file:///C:/Program%20Files%20(x86)/Steam/steamapps/common/Shadow%20Empire/ShadowEmpire.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 14.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4360.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4470.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4390.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4084.0 built by: NET48REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
irrKlang.NET4
    Assembly Version: 1.0.6617.18847
    Win32 Version: 
    CodeBase: file:///C:/Program%20Files%20(x86)/Steam/steamapps/common/Shadow%20Empire/irrKlang.NET4.DLL
----------------------------------------
ICSharpCode.SharpZipLib
    Assembly Version: 0.84.0.0
    Win32 Version: 0.84.0.0
    CodeBase: file:///C:/Program%20Files%20(x86)/Steam/steamapps/common/Shadow%20Empire/ICSharpCode.SharpZipLib.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Re: [v1.10.05b] Crash on accepting leader

Posted: Thu Feb 24, 2022 4:47 pm
by zgrssd
nscrutable wrote: Thu Feb 24, 2022 1:45 am
Could this have something to do with playing PBEM with different players running different versions? I was running 04b.
If you are running different versions, that is basically always the 1st culptript.
And usually the last, because trying to debug issues caused by mixing versions just is not worth the time.

No game I know off is designed to have different people run different versions. In fact, most games wich actively prevent you from doing that.
Just because SE does not go out of the way to stop you, does not mean this is supported. But it realy should go more out of it's way to stop you.

Re: [v1.10.05b] Crash on accepting leader

Posted: Thu Feb 24, 2022 6:33 pm
by nscrutable
If it wasn't clear, it took me a few hours of troubleshooting to ascertain that we didn't have everyone on the same version, I just edited it in ^^; I didn't initially post it with that understanding.

Re: [v1.10.05b] Crash on accepting leader

Posted: Thu Feb 24, 2022 7:23 pm
by zgrssd
nscrutable wrote: Thu Feb 24, 2022 6:33 pm If it wasn't clear, it took me a few hours of troubleshooting to ascertain that we didn't have everyone on the same version, I just edited it in ^^; I didn't initially post it with that understanding.
I did not mean it as a attack. Apollogies if that did not came across.
I was just tyring to point out that there is a very slim chance of there being a fix, or even a fix being looked at. Once you mix versions, any prediction and asumptions about the games behavior goes out the window.

As I said, the game realy should do more to prevent you from doing that.
At minimum, a popup saying "this game was last opened in another version" every time you open it.
It should not be hard to implement.
It would be minimally disruptive for people using the beta versions. And then once for every time a new live version comes out.

Re: [v1.10.05b] Crash on accepting leader

Posted: Thu Feb 24, 2022 7:37 pm
by nscrutable
zgrssd wrote: Thu Feb 24, 2022 7:23 pm
nscrutable wrote: Thu Feb 24, 2022 6:33 pm If it wasn't clear, it took me a few hours of troubleshooting to ascertain that we didn't have everyone on the same version, I just edited it in ^^; I didn't initially post it with that understanding.
I did not mean it as a attack. Apollogies if that did not came across.
I was just tyring to point out that there is a very slim chance of there being a fix, or even a fix being looked at. Once you mix versions, any prediction and asumptions about the games behavior goes out the window.

As I said, the game realy should do more to prevent you from doing that.
At minimum, a popup saying "this game was last opened in another version" every time you open it.
It should not be hard to implement.
It would be minimally disruptive for people using the beta versions. And then once for every time a new live version comes out.
It didn't come off as an attack, I just noticed that my message could be misunderstood since I didn't include any indication that I'd troubleshooted and come back to edit my post!

I agree that a popup would help a lot. Adding a history vid for anyone who opens the savegame with a different version than it was created in, perhaps?

Re: [v1.10.05b] Crash on accepting leader

Posted: Thu Feb 24, 2022 7:44 pm
by zgrssd
nscrutable wrote: Thu Feb 24, 2022 7:37 pm
zgrssd wrote: Thu Feb 24, 2022 7:23 pm
nscrutable wrote: Thu Feb 24, 2022 6:33 pm If it wasn't clear, it took me a few hours of troubleshooting to ascertain that we didn't have everyone on the same version, I just edited it in ^^; I didn't initially post it with that understanding.
I did not mean it as a attack. Apollogies if that did not came across.
I was just tyring to point out that there is a very slim chance of there being a fix, or even a fix being looked at. Once you mix versions, any prediction and asumptions about the games behavior goes out the window.

As I said, the game realy should do more to prevent you from doing that.
At minimum, a popup saying "this game was last opened in another version" every time you open it.
It should not be hard to implement.
It would be minimally disruptive for people using the beta versions. And then once for every time a new live version comes out.
It didn't come off as an attack, I just noticed that my message could be misunderstood since I didn't include any indication that I'd troubleshooted and come back to edit my post!

I agree that a popup would help a lot. Adding a history vid for anyone who opens the savegame with a different version than it was created in, perhaps?
VID Messages could be missed or interpreted as Flavor Text. So I do not think they would be the right place.

I am for a simple, old Popup Window with a Ok Button.
button. Maybe Ok+Cancel,so you can stop loading that savegame.

Re: [v1.10.05b] Crash on accepting leader

Posted: Thu Feb 24, 2022 10:43 pm
by nscrutable
I don't think this issue is related to version conflicts. It's been replicated in 1.09.07 as well as in 10.04b. On decompilation, it's revealed to be an int32 overflow error in the random number generation.

The following code comes from Helper_RollCharacter.
SE-exception.png
SE-exception.png (129.54 KiB) Viewed 744 times
The exception occurs in the last call to random.Next in the screenshot. The max parameter was clocked once at 4294967246 (0xFFFFFFCE), though it wasn't scraped on the run that triggered the exception.

Props to ma44 on The War of the Worlds discord server for putting in the hard work here.

Re: [v1.10.05b] Crash on accepting leader

Posted: Thu Feb 24, 2022 11:17 pm
by nscrutable
The plot thickens:

When this bug is reproduced, num7 in the following code snippet is 105.

Code: Select all

num71 = 1000;
num71 = (int)Math.Round((double)(num71 * (100 - num7)) / 100.0);
=> num71 = (1000 * (100 - 105)) / 100.0
=> -50
if (this.game.Data.RegimeObj[regimeNr].AI)
{
   num71 *= num71;
}
simpleStringList2.Add(text, random.Next(0, num71), 0, 0, 0, 0, 0, true, false);

Re: [v1.10.06b] Crash on accepting leader

Posted: Fri Feb 25, 2022 2:03 pm
by Voker57
Still not fixed in 1.10.06

Re: [v1.10.05b] Crash on accepting leader

Posted: Fri Feb 25, 2022 2:57 pm
by Vic
Will pick up on this bug next week. It just missed the window for the last open beta v1.06. Sry there ; bad timing. But thanks for report!

Re: [v1.10.05b] Crash on accepting leader

Posted: Tue Mar 01, 2022 9:17 am
by Vic
This should be fixed now in upcoming v1.10.07
thanks for insisting guys!