eliasdoehne / stellaris-dashboard

A graph dashboard and event log for Stellaris.
123 stars 14 forks source link

Star Trek: New Civilization Compatibility #69

Closed bestekov closed 2 years ago

bestekov commented 2 years ago

Mod: https://steamcommunity.com/sharedfiles/filedetails/?id=1886496498

Started a new game as United Earth on Large galaxy, otherwise default settings.

Error parsing save that then crashes the entire dashboard app:

MainProcess - 2022-07-15 00:12:48,895 - stellarisdashboard.parsing.timeline - INFO - unitedearth_-301316477 2150.01.05 Adding new game unitedearth_-301316477 to database.
MainProcess - 2022-07-15 00:12:48,896 - stellarisdashboard.parsing.timeline - INFO - unitedearth_-301316477 2150.01.05   - Processing systems
MainProcess - 2022-07-15 00:12:48,985 - stellarisdashboard.parsing.timeline - ERROR - unitedearth_-301316477 2150.01.05 Rolling back changes to database... Traceback (most recent call last):
  File "stellarisdashboard\parsing\timeline.py", line 59, in process_gamestate
  File "stellarisdashboard\parsing\timeline.py", line 109, in _process_gamestate
  File "stellarisdashboard\parsing\timeline.py", line 283, in extract_data_from_gamestate
ValueError: Multiple starbases in 27 {'coordinate': {'x': -52.632, 'y': -371.75, 'origin': 4294967295, 'randomized': 'yes'}, 'type': 'star', 'name': {'key': 'Rex Callina'}, 'planet': [600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611], 'star_class': 'sc_g', 'hyperlane': [{'to': 871, 'length': 61}, {'to': 885, 'length': 59}, {'to': 109, 'length': 23}, {'to': 108, 'length': 18}, {'to': 868, 'length': 30.52635}], 'asteroid_belts': [{'type': 'rocky_asteroid_belt', 'inner_radius': 750}], 'flags': {'voth_homeworld': 62376000}, 'initializer': 'voth_homeworld', 'fleet_presence': [0, 779, 926, 927, 928, 929, 930], 'inner_radius': 335, 'outer_radius': 435, 'starbases': [64, 72], 'trade_hub': {'collected': 35.39496, 'collected_from': [27]}, 'trade_collection': {'targets': [{'target': 27, 'distance': 0}]}, 'trade_piracy': {'throughput': 0, 'total': 0, 'max': 0, 'active': 0, 'used': 0, 'targets': [{'target': 27, 'distance': 0}]}, 'sector': 48}
MainProcess - 2022-07-15 00:12:48,989 - stellarisdashboard.dashboard_app.visualization_data - WARNING - Warning: Game unitedearth_-301316477 could not be found in database!
Traceback (most recent call last):
  File "stellarisdashboard\__main__.py", line 32, in <module>
  File "stellarisdashboard\__main__.py", line 24, in main
  File "stellarisdashboard\cli.py", line 84, in f_monitor_saves
  File "stellarisdashboard\dashboard_app\visualization_data.py", line 90, in get_current_execution_plot_data
  File "stellarisdashboard\dashboard_app\visualization_data.py", line 199, in update_with_new_gamestate
  File "stellarisdashboard\datamodel.py", line 354, in get_gamestates_since
  File "sqlalchemy\orm\query.py", line 2865, in one
    return self._iter().one()
  File "sqlalchemy\engine\result.py", line 1408, in one
    return self._only_one_row(
  File "sqlalchemy\engine\result.py", line 562, in _only_one_row
    raise exc.NoResultFound(
sqlalchemy.exc.NoResultFound: No row was found when one was required
[26620] Failed to execute script '__main__' due to unhandled exception!
eliasdoehne commented 2 years ago

Hi @bestekov, generally, I cannot promise compatibility with other mods especially if they change some assumptions I made based on the main game.

But I would be happy to take a look if you could somehow share 1-2 save files that cause this error to happen, if I can fix it without rewriting too many things I will definitely do it.

Edit: Actually on a second glance, it seems like your error could be related to this https://github.com/eliasdoehne/stellaris-dashboard/issues/70

Still, it would be helpful to have a save file so I can try to reproduce it on my end

bestekov commented 2 years ago

Sure thing! Here are some saves that all exhibit the bug about multiple starbases. unitedearth_-301316477.zip

bestekov commented 2 years ago

Modlist for the above saves. Of these the ST:NC is the only really substantive mod. I am 100% sure the starbase thing is from that mod. I think you can probably reproduce the issue with just that mode + stellaris dashboard and start a brand new save game (I got the error starting on day 1 of the game so it is something about the initial state of the galaxy).

2022-07-18_123821

bestekov commented 2 years ago

Edit: Actually on a second glance, it seems like your error could be related to this #70

Still, it would be helpful to have a save file so I can try to reproduce it on my end

Oh! Good call! Yes that looks like the same bug.

eliasdoehne commented 2 years ago

Hello, I made another release that should hopefully fix this problem, it was related to the orbital ring megastructure introduced in the Overlord DLC, seems that is works like a starbase in the game.

bestekov commented 2 years ago

That fixed the save_parse issue!

Though there is a new weird issue... all the country names show up as Format.devorian solidarity ( 40 ): 2022-07-24_115823

eliasdoehne commented 2 years ago

The names showing up like that is probably related to the localization changes that were introduced in the last Stellaris patch. To display them correctly requires a bit of work if you use mods that modify or extend the name lists:

https://github.com/eliasdoehne/stellaris-dashboard/blob/master/README.md#names-and-localizations

Let me know if that works.

I'm actually not sure why I added the number in parentheses after the names, but it's the in-game ID of the country in question. I will probably make another release that removes this or makes it configurable.

eliasdoehne commented 2 years ago

Actually I decided to test it locally, I collected files from these locations some random folder:

Updated the path to that folder in the settings page: image

and your save now shows up ok for me: image

bestekov commented 2 years ago

Amazing! I'll give that try. Thank you so much for your help and awesome work on this mod!