View Issue Details

IDProjectCategoryLast Update
0025327AI War 2Bug - OtherJun 26, 2021 2:52 pm
ReporterMetrekec Assigned ToChris_McElligottPark  
Status resolvedResolutionfixed 
Product Version3.304 Coilbeams No Longer Tickle 
Fixed in Version3.305 Fruits Of A Snipe Hunt 
Summary0025327: Turning on or off mods softlocks the game
DescriptionTurning on or off mods softlocks the game. A bunch of errors appear while reloading the game and it gets stuck on a specific error "Could not find the fleet design template of type 'ClassicStartingFleet' referenced in a tutorial."

Attaching debug log. Repro steps are just to turn on or off any mod for me. After the game is rebooted the mod seems to be turned on or off succesfully.

TagsNo tags attached.

Relationships

related to 0025328 resolvedChris_McElligottPark Game not loading upon start. 

Activities

Metrekec

Jun 23, 2021 8:36 pm

reporter  

ArcenDebugLog.txt (1,448,154 bytes)

BadgerBadger

Jun 23, 2021 11:24 pm

manager   ~0062270

I strongly suspect this change:
    * Fixed a bug that could happen when reloading all the xml from disk after changing mods or expansions that are installed.

BadgerBadger

Jun 23, 2021 11:37 pm

manager   ~0062271

It looks like we start reading from the XML reasonably, and then at some point things just fall apart for no obvious reason. This makes me think we're racing against another thread.

My first thought is the change from a Dictionary to a ConcurrentDictionary in the XML parsing code, but I don't know this code at all I'm afraid.

Chris_McElligottPark

Jun 24, 2021 11:03 am

administrator   ~0062284

So, the core of the problem here is that concurrent dictionaries are not ordered, which I neglected to remember before. So when it does a reload now, it's batshot crazy out of order.

The original issue that I was trying to fix was much more rare and I can solve in a different way, I think. That one is possibly just related to surrogate tables.

Chris_McElligottPark

Jun 26, 2021 2:52 pm

administrator   ~0062303

Thanks!

* After 12+ hours of work trying to make the game loading more asynchronous (and mostly succeeding, minus some very odd niggles like UI windows refusing to go anywhere near the right part of the screen)), that work has been thrown aside and I'm going to approach the whole "certain things don't load right for some people" from the prior build via another avenue. Secondary benefits scavenged from the giant mass of scrapped work include:
** The uniterm console, which is an ancient thing from alpha we were using, has been removed from the codebase. We have our own console now, and have for years.
*** This actually speeds loading up external dlls quite a bit.
** Also made improvements to our internal ObjectDumper, so that it is more robust when it has a failure due to us needing to update some internal code, etc.
*** We use this tool to programmatically verify that data has not changed when we change the parser that loads in data.
** Our "delayed log messages" from background threads are now ordered in the precise order they were logged.
*** This is possible thanks to using System.Threading.Interlocked to add ordered IDs to them, since the data structures we must use across threads like this are unordered.
** In general, our debug logging has seen a number of upgrades and improvements, including making all of the general log-writers go to the delayed channel (so they definitely show up) when being written-to from background threads.
** Since multithreading is being done more and more casually in here even by modders -- which is great! -- we needed extra robustness in here. Also, for general purposes, there are too many places now that might run on one thread or many at once, so there's also that.

* Simply reverted a change from June 23rd which was intended to fix a (very very) rare exception with how xml reloading could throw an error.
** The fix that I had implemented caused some processors not to be able to load the game at all, and the 12-hour snipe hunt resulted.
** The 12 hour snipe hunt was in many respects a waste, since it almost all had to be reverted, but it did provide some really interesting data on what matters and what does not matter in terms of load speed improvements. So some further minor improvements will certainly result from that.

Issue History

Date Modified Username Field Change
Jun 23, 2021 8:36 pm Metrekec New Issue
Jun 23, 2021 8:36 pm Metrekec File Added: ArcenDebugLog.txt
Jun 23, 2021 11:24 pm BadgerBadger Relationship added related to 0025328
Jun 23, 2021 11:24 pm BadgerBadger Note Added: 0062270
Jun 23, 2021 11:25 pm BadgerBadger Assigned To => Chris_McElligottPark
Jun 23, 2021 11:25 pm BadgerBadger Status new => assigned
Jun 23, 2021 11:37 pm BadgerBadger Note Added: 0062271
Jun 24, 2021 11:03 am Chris_McElligottPark Note Added: 0062284
Jun 26, 2021 2:52 pm Chris_McElligottPark Status assigned => resolved
Jun 26, 2021 2:52 pm Chris_McElligottPark Resolution open => fixed
Jun 26, 2021 2:52 pm Chris_McElligottPark Fixed in Version => 3.305 Fruits Of A Snipe Hunt
Jun 26, 2021 2:52 pm Chris_McElligottPark Note Added: 0062303