Author Topic: Slow down reasons and possible fixes - An Aurora C# guide  (Read 14434 times)

0 Members and 1 Guest are viewing this topic.

Offline Froggiest1982 (OP)

  • Gold Supporter
  • Vice Admiral
  • *****
  • F
  • Posts: 1391
  • Thanked: 649 times
  • 2023 Supporter 2023 Supporter : Supporter of the forum in 2023
    2024 Supporter 2024 Supporter : Supporter of the forum for 2024
    Gold Supporter Gold Supporter :
Slow down reasons and possible fixes - An Aurora C# guide
« on: September 04, 2021, 07:08:51 PM »
There are several reasons for you game to run slow.

The most common are:

  • Too many days and events displayed on your event window
  • Too many civilian shipping lines and ships
  • Too many DB lines

Here is a list of fixes you can apply to your game and get your game back to an acceptable speed. Some of these fixes require a DB edit which will make your game not eligible for bug reporting. While these fixes have been performed successfully by many players I cannot guarantee 100% you will not experience any issues, however, in the 99.99% of cases they will not break your game.

Please note that so far nobody has encountered a situation where the game is unplayable as it was the VB6 version but still, some would like to have consistent performances as the game progresses and this guide is an attempt to helping you with that.



Too many days and events displayed on your event window
As the game advance this setting, which doesn't influence much the beginning in its standard settings, may require adjustment to cope with the inevitable lagging caused by other issues highlighted later in this post.

Cause: Too many lines to update in the Event Window
Responsible: Player Settings

How to fix: Open Aurora C# Event Window of your game and change the below settings with 60 event days and 100 max events. After multiple attempts, this is the lesser amount the game can handle. Even at smaller numbers there is no change in performances.





Too many civilian shipping lines and ships
If you are playing with the civilian shipping lines activated, these can get out of hand quite fast quite soon. In fact, once you have a lot of them, the game will take longer times to perform all the checks prior completing cycles resulting in slower calculations. There are 2 ways to fix this issue, one is to cancel some ships or entire lines from time to time and the other is to avoid new ships or lines to be created.

Cause: Too many civilian ships
Responsible: Player and Game settings

How to fix (cancelling ships or shipping lines): Open Aurora C# Naval Organization window of your game and check how many shipping lines and ships you have. If required, delete some via the delete button. Make sure the Show Civilian flag is active. Usually the Civilian Lines are all listed at the bottom of the Naval Organization.



How to fix (avoid new ships or shipping lines to be created): Open the Aurora C# Game Information window of your game and uncheck the flags relative to civilians. Push the button save on the setting screens and save your game. Exit and restart for the change to be active.





Too many DB lines
Aurora C# SQL database is not able to delete empty lines and pages by itself and for most areas it is better to do not mess with the DB. However, especially after ground battles (or particularly large space battles) the amount of events generated starts to clutter the DB making it heavy and longer to read and update. This can result in slower reaction during cycles (lag) or longer load/save time.

Cause: Too many DB lines and large DB dimension on disk
Responsible: Aurora C# DB file

How to fix: The easiest way to limit this issue is to limit your DB to one game. Multiple games on same DB will double many of the existing structural lines: techs, commanders, population, spoiler, and more are just a few examples. By having only one game in each DB you are already limiting the amount of new lines generated. Although, even with one game only, soon you may need to "clean" your DB from time to time. To do so you are going to need an SQL reader and basic if none shell commanding skills.
I use DB Browser for SQLite available here: https://sqlitebrowser.org/
To perform the event log clean, open the Aurora DB (always make a backup first!) and then under the Browse Data slide select FCT_GameLog. Here is the list of the game events which you can sort by kind if you wish to delete only some of them (not recommended). I usually copy them on an excel file prior deleting in case I want to create an AAR after. It is also easier to find what is required for your story this way.



Once all the lines have been deleted, the empty pages will still be there though. To clear the pages and also shrink the DB size you need to perform a command called VACUUM. To do so head under the Execute SQL slider and insert the command VACUUM; . Once done run the Play button and reply yes to the PRAGMA alert message. Remember to go under File and select Save All to make the DB change effective.



If all went well, your DB file will be smaller and your game will run faster. Below an example of a database before and after the VACUUM. You can see the big difference in size. It's an old game of mine so the date is a month apart.


before VACUUM


after VACUUM
« Last Edit: September 05, 2021, 07:09:36 AM by Steve Walmsley »
 

Offline Garfunkel

  • Registered
  • Admiral of the Fleet
  • ***********
  • Posts: 2944
  • Thanked: 1192 times
Re: Slow down reasons and possible fixes - An Aurora C# guide
« Reply #1 on: September 05, 2021, 02:49:40 AM »
Excellent guide mate, thanks!
 
The following users thanked this post: Froggiest1982, Warer

Offline ardem

  • Rear Admiral
  • **********
  • a
  • Posts: 814
  • Thanked: 44 times
Re: Slow down reasons and possible fixes - An Aurora C# guide
« Reply #2 on: September 05, 2021, 06:22:10 AM »
This is great it should be stickyed if it is not already.
 
The following users thanked this post: Froggiest1982

AuraNoob

  • Guest
Re: Slow down reasons and possible fixes - An Aurora C# guide
« Reply #3 on: November 20, 2021, 04:54:38 PM »
ty for guide

as ships count has exploded in my game (947 civilian ships atm) would it be relatively safe to open the ship page in db editor and filter out the class names i want to clear out
 

Offline Garfunkel

  • Registered
  • Admiral of the Fleet
  • ***********
  • Posts: 2944
  • Thanked: 1192 times
Re: Slow down reasons and possible fixes - An Aurora C# guide
« Reply #4 on: November 20, 2021, 07:13:16 PM »
Please register your account so that you can post normally. Currently we have to manually approve each post you make.
 

Offline d.rodin

  • Warrant Officer, Class 2
  • ****
  • d
  • Posts: 59
  • Thanked: 9 times
Re: Slow down reasons and possible fixes - An Aurora C# guide
« Reply #5 on: August 21, 2022, 07:03:11 AM »
from reddit:
https://www.reddit.com/r/aurora/comments/ucz1l1/how_is_your_slowdown/

by AbsolutelyNoFires

I ran these on your DB and got a small improvement.

delete from FCT_CommanderHistory where gametime < 6536426535;
delete from FCT_fleetHistory where gametime < 6536426535;
delete from fct_wealthdata where timeused <6536426535;
VACUUM

can confirm, my DB shrank from 240mb to 40mb. Got some improvement in performance and saving game is now much more faster.
 

Offline Vandermeer

  • Rear Admiral
  • **********
  • Posts: 961
  • Thanked: 128 times
Re: Slow down reasons and possible fixes - An Aurora C# guide
« Reply #6 on: August 21, 2022, 11:02:16 AM »
from reddit:
https://www.reddit.com/r/aurora/comments/ucz1l1/how_is_your_slowdown/

by AbsolutelyNoFires

I ran these on your DB and got a small improvement.

delete from FCT_CommanderHistory where gametime < 6536426535;
delete from FCT_fleetHistory where gametime < 6536426535;
delete from fct_wealthdata where timeused <6536426535;
VACUUM

can confirm, my DB shrank from 240mb to 40mb. Got some improvement in performance and saving game is now much more faster.
Good tips.
I really like that there is finally a Commander graveyard, because before when they died, every record about them just vanished and you couldn't even say goodbye and remember who they were if they had some renown role in your empire. If keeping their data causes this much of a bloat however, maybe their information should either be archived (since this information is rarely looked up, a bit of loading time upon selecting a commander is permissible), or the graveyard should be temporary for maybe 1-10 years before deletion, unless you trigger perhaps some checkmark like the "story character" one, that will function as a morgue and keep them embalmed and fresh as a memory for those few you'd want to keep.(but you will have to make that decision consciously after death)

Fleethistory and wealthdata should just be deleted once the fleet is no more, or after some time for wealth.(maybe those things are already done) I can't find a reason to keep this otherwise.
playing Aurora as swarm fleet: Zen Nomadic Hive Fantasy
 
The following users thanked this post: Droll, Gabrote42

Offline IWST

  • Able Ordinary Rate
  • I
  • Posts: 1
Re: Slow down reasons and possible fixes - An Aurora C# guide
« Reply #7 on: February 08, 2023, 12:34:58 PM »
So: Game was running quite smoothly until recently. 
Then I discovered 3 alien civilizations in one system, apearantly with all 3 of them having colonies on the same planet. 
They were at peace with each other when I discovered them.   Game performance dropped somewhat but it was still playable. 
About a year later they went to war with each other, and game performance stated to get really really bad (as in: sometimes a day would take an hour, even if the game didn't slow down to 5 second intervals due to active battles). 

I already deleted my civilian shipping lines, and also cleand up the event DB (cutting my save from 89mb to 40m) but I suspect the main issue is those 3 nations sitting on top of each other. 

Anything I can do?
« Last Edit: February 08, 2023, 02:00:28 PM by IWST »
 

Offline Garfunkel

  • Registered
  • Admiral of the Fleet
  • ***********
  • Posts: 2944
  • Thanked: 1192 times
Re: Slow down reasons and possible fixes - An Aurora C# guide
« Reply #8 on: February 09, 2023, 05:47:01 AM »
Turn off detection which prevents the NPRs from fighting each other since they won't be able to see each other. Then send your Fleet of Doom over and turn detection back on once you're ready to enter the system to subjugate them.
 

Offline superstrijder15

  • Warrant Officer, Class 2
  • ****
  • s
  • Posts: 73
  • Thanked: 22 times
Re: Slow down reasons and possible fixes - An Aurora C# guide
« Reply #9 on: July 31, 2023, 09:39:48 AM »
If you have a DB and you have an old game in there for some reason, you can delete all other games from your current one by doing this in python:

import sqlite3
import pandas as pd

dbfile =  "AuroraDB.db"
con = sqlite3.connect(dbfile)

cur = con.cursor()
cur.execute("SELECT name FROM sqlite_master WHERE type = 'table';")
tables = [a[0] for a in cur.fetchall()]

gametables = pd.read_sql_query("""SELECT m.name as tableName,
       p.name as columnName
FROM sqlite_master m, pragma_table_info((m.name)) p
WHERE m.name <> p.name and p.name = 'GameID'
order by tableName, p.cid
;""", con)
con.close()


con = sqlite3.connect(dbfile)
cur = con.cursor()
total_rowcount = 0
for table in gametables["tableName"]:
    cur.execute(f"DELETE FROM {table} WHERE {table}.GameID <> Your Game ID here")
    total_rowcount += cur.rowcount
    print(cur.rowcount)

con.commit()
print("Total", total_rowcount, "Records updated successfully")
cur.close()
con.close()


Find your gameID by making sure you ran some eventful turns of your desired game, and using the browser above or running a query to find the last item in your FCT_GameLog table and its gameID
 
The following users thanked this post: dystopian_settings