Author Topic: How to delete NPRs with step by step guide?  (Read 6627 times)

0 Members and 1 Guest are viewing this topic.

Offline Stormtrooper (OP)

  • Captain
  • **********
  • S
  • Posts: 431
  • Thanked: 230 times
  • The universe is a Dark Forest
How to delete NPRs with step by step guide?
« on: December 30, 2020, 12:08:08 PM »
So I made a mistake of setting up my game with 3 damn starting NPRs and now I want to remove them since I figured out it doesn't affect my gameplay but probably does affect my performance badly and the game could run much faster without them clogging my cpu.

Heard it's not possible to do using spacemaster, anyone willing to share step by step db editing guide so that I don' wreck my save?
 

Offline nuclearslurpee

  • Admiral of the Fleet
  • ***********
  • Posts: 2976
  • Thanked: 2238 times
  • Radioactive frozen beverage.
Re: How to delete NPRs with step by step guide?
« Reply #1 on: December 30, 2020, 12:44:12 PM »
So I made a mistake of setting up my game with 3 damn starting NPRs and now I want to remove them since I figured out it doesn't affect my gameplay but probably does affect my performance badly and the game could run much faster without them clogging my cpu.

Heard it's not possible to do using spacemaster, anyone willing to share step by step db editing guide so that I don' wreck my save?

While it's possible to do this, there's no step-by-step way to do it, as you basically need to delete numerous entries in dozens of database tables.

You may be able to do this by setting the race to be a player race instead of an NPR and then deleting the race in SM, though. I'm not sure how to do the first bit in-game, but it shouldn't be too hard to do with a DB edit.
 

Offline TheTalkingMeowth

  • Captain
  • **********
  • T
  • Posts: 494
  • Thanked: 203 times
  • Gold Supporter Gold Supporter : Support the forums with a Gold subscription
    2021 Supporter 2021 Supporter : Donate for 2021
    2022 Supporter 2022 Supporter : Donate for 2022
Re: How to delete NPRs with step by step guide?
« Reply #2 on: December 30, 2020, 01:15:05 PM »
So I made a mistake of setting up my game with 3 damn starting NPRs and now I want to remove them since I figured out it doesn't affect my gameplay but probably does affect my performance badly and the game could run much faster without them clogging my cpu.

Heard it's not possible to do using spacemaster, anyone willing to share step by step db editing guide so that I don' wreck my save?

Keep a backup of the db and you can muck about to your heart's content without risk of breaking anything.

That said, one option to avoid DB edits is to add a SM race, give it max tech, SM explore until they find the NPRs, then spawn super ships and murder the poor suckers.

In other words, nukes are the solution to all of your problems. You can even SM out the radiation and dust afterwards!
 

Offline Garfunkel

  • Registered
  • Admiral of the Fleet
  • ***********
  • Posts: 2787
  • Thanked: 1051 times
Re: How to delete NPRs with step by step guide?
« Reply #3 on: December 30, 2020, 05:02:35 PM »
Start a new game. It is faster and easier and more convenient.
 

Offline Stormtrooper (OP)

  • Captain
  • **********
  • S
  • Posts: 431
  • Thanked: 230 times
  • The universe is a Dark Forest
Re: How to delete NPRs with step by step guide?
« Reply #4 on: December 30, 2020, 06:22:03 PM »
I won't comment much on the two last replies (especially the last one, just please don't bother with such useless answers in the future), but as for the first one.  .  .   How would I do that? This whole "do a DB edit" is the core of my question, I don't know how this database looks like, what is there etc etc, so how the hell am I supposed to figure out which "db edit" I'm supposed to do, not to mention how to perform it? Otherwise thanks, changing the npr to a player race seems like a good point if sm allows easy deletion of it, much simpler than "deleting dozens of entries".

Also, to clarify: of course I can do backup, my fear of screwing things up isn't about blowing my save up in obvious ways but rather small but significant errors that might resurface at some point after I'll invest more hours into my save.
« Last Edit: December 30, 2020, 06:24:36 PM by Stormtrooper »
 

Offline TheTalkingMeowth

  • Captain
  • **********
  • T
  • Posts: 494
  • Thanked: 203 times
  • Gold Supporter Gold Supporter : Support the forums with a Gold subscription
    2021 Supporter 2021 Supporter : Donate for 2021
    2022 Supporter 2022 Supporter : Donate for 2022
Re: How to delete NPRs with step by step guide?
« Reply #5 on: December 30, 2020, 06:27:33 PM »
I won't comment much on the two last replies (especially the last one, just please don't bother with such useless answers in the future), but as for the first one. . .  How would I do that? This whole "do a DB edit" is the core of my question, I don't know how this database looks like, what is there etc etc, so how the hell am I supposed to figure out which "db edit" I'm supposed to do, not to mention how to perform it? Otherwise thanks, changing the npr to a player race seems like a good point if sm allows easy deletion of it, much simpler than "deleting dozens of entries".
None of us know exactly how to accomplish what you are asking to do. But between a backup of the save file and the suggestion from nuclearslurpee, you have a path forward that can't harm anything.

You need a SQL database browser (I use dbbrowser, which is free and pretty user friendly.). You DON'T need any existing experience with SQL, as the database browser turns this into just poking around in a spreadsheet.

Open up the database and start looking at the different tables (basically, different sheets in the spreadsheet). Everything has fairly explicit names, and you may recognize entries from the games you have played which will help you figure out what does what.

There's no guide to the database, and I'm not sure Steve would be happy if anyone made one. But it's really not that intimidating!
 

Offline Stormtrooper (OP)

  • Captain
  • **********
  • S
  • Posts: 431
  • Thanked: 230 times
  • The universe is a Dark Forest
Re: How to delete NPRs with step by step guide?
« Reply #6 on: December 30, 2020, 06:56:02 PM »
The most ironic thing is that as a programmer and IT student I learned some stuff about SQL, it's just I don't know anything about this particular db, nor schema whatsoever, let alone source code of the program that reads and modifies it.  :P
 

Offline Zap0

  • Captain
  • **********
  • Posts: 404
  • Thanked: 503 times
Re: How to delete NPRs with step by step guide?
« Reply #7 on: December 30, 2020, 07:19:21 PM »
Steve doesn't even use most features of SQL, like foreign keys or relations between tables, so the spreadsheet comparison is apt. That said, there's too many tables and entries there that will pertain to a given NPR, it's not worth the effort to try and excise one through db editing.

SM has a "delete race" button in the race information screen for the own empire. Who knows what that one does, but you'll probably have to make the NPRs selectable as a normal race ingame to find out. That's only one or two flags in the DB.
 

Offline Droll

  • Vice Admiral
  • **********
  • D
  • Posts: 1704
  • Thanked: 599 times
Re: How to delete NPRs with step by step guide?
« Reply #8 on: December 30, 2020, 07:22:24 PM »
The most ironic thing is that as a programmer and IT student I learned some stuff about SQL, it's just I don't know anything about this particular db, nor schema whatsoever, let alone source code of the program that reads and modifies it.  :P

I'm pretty much in the same position, however with SQLiteStudio I found it quite easy to just read column names and figure out what needs to change and what needs to stay the same.
If you are asking for a whole description of the schema or detailed instructions on how to use a DB reading problem I don't think you'll find much willing participants to spend time writing that post.

Just muck about in a backup of the save with your DB of choice.

A couple pointers that might help - FCT_AlienRace sounds like it might be useful, any of the FCT tables that have "Alien" in their name are probably related to an NPR. You can also search for "RaceID" and find the actual ID of the NPR race which could also help find other relevant tables.
 

Offline Stormtrooper (OP)

  • Captain
  • **********
  • S
  • Posts: 431
  • Thanked: 230 times
  • The universe is a Dark Forest
Re: How to delete NPRs with step by step guide?
« Reply #9 on: December 30, 2020, 07:30:16 PM »
UPDATE: so far I've cleared FCT_GameLog since I've been told deleting the log boosts performance and identified the race ids of what appears to be my 3 unfortunate npr empires generated at game start and I'm 99% that's what I want to purge.    Now wondering whether to just run some sqol queries on each table to identify the ids of their ships and whatnot and then delete all the references etc etc or try to find that magic switch that'll make them player-controlled so I could test whether it is indeed possible to then just remove them with SM.

UPDATE 2: wait a sec it appears to be a flag in the column titled "NPR" that is set to 0 under my race.  Fingers crossed it works.
« Last Edit: December 30, 2020, 07:33:29 PM by Stormtrooper »
 

Offline nuclearslurpee

  • Admiral of the Fleet
  • ***********
  • Posts: 2976
  • Thanked: 2238 times
  • Radioactive frozen beverage.
Re: How to delete NPRs with step by step guide?
« Reply #10 on: December 30, 2020, 07:32:29 PM »
I won't comment much on the two last replies (especially the last one, just please don't bother with such useless answers in the future), but as for the first one.  .  .   How would I do that? This whole "do a DB edit" is the core of my question, I don't know how this database looks like, what is there etc etc, so how the hell am I supposed to figure out which "db edit" I'm supposed to do, not to mention how to perform it? Otherwise thanks, changing the npr to a player race seems like a good point if sm allows easy deletion of it, much simpler than "deleting dozens of entries".

Also, to clarify: of course I can do backup, my fear of screwing things up isn't about blowing my save up in obvious ways but rather small but significant errors that might resurface at some point after I'll invest more hours into my save.

Disclaimer: I have never done this before and make no guarantee that it will work, but I see no reason why it would not after poking around in the DB to figure it out.

Open the Aurora DB with DB Browser or any other SQL tool of your choice. Find the table "FCT_Race". Scroll to find the row with the race you want to get rid of (if you're not sure which this is you'd have to muck about in some other tables and cross-reference with your racial intelligence in-game; in this case, you just want to blanket-delete the non-spoiler NPRs so it should not be a problem). In the column "NPR" change the value '1' to '0'.

This should allow you to select that race in-game from any of the racial drop-downs. In-game, select that race in the Race window and click the Delete Race button (you might need SM Mode active for this).

DO NOT try to delete the race in the SQL editor, as this will break references to that race in any other tables (ships, fleets, research, colonies...) and probably break your save. Delete the race in-game so it will be handled correctly.

Be careful not to edit or delete the Precursors, Invaders, or any Swarm races (plus Rakhas in 1.13+ once they are fixed) as these races must be present in the table or else you will break the spoiler races.

If it is possible to set a race as a player race in-game, I do not know how. I do know that it is not possible to set a player race as an NPR in-game due to AI problems, but the reverse is supposedly possible. In any case, the DB solution does (or should) exist.

EDIT:
A couple pointers that might help - FCT_AlienRace sounds like it might be useful, any of the FCT tables that have "Alien" in their name are probably related to an NPR. You can also search for "RaceID" and find the actual ID of the NPR race which could also help find other relevant tables.
The "FCT_Alien..." tables usually are related to intel data, i.e. information each race has about other races. The "Alien" in the name refers to the fact that the data is about one race's knowledge of another.
« Last Edit: December 30, 2020, 07:34:24 PM by nuclearslurpee »
 

Offline Stormtrooper (OP)

  • Captain
  • **********
  • S
  • Posts: 431
  • Thanked: 230 times
  • The universe is a Dark Forest
Re: How to delete NPRs with step by step guide?
« Reply #11 on: December 30, 2020, 07:42:44 PM »
AAAAAND theeere we go, all three racess accessible in-game, all three races deleted.  They discovered A LOT of systems and had a LOT of colonies even though their populations were only a few bilions. . .  Honestly I wish I could keep them in my game, deleting them caused a sad feeling of missed content, but it had to be done for the sake of performance. . .  I hope I'll feel that thrill once more when I'll discover some generated nprs or precusors, swarm or invaders or whatever.
 

Offline nuclearslurpee

  • Admiral of the Fleet
  • ***********
  • Posts: 2976
  • Thanked: 2238 times
  • Radioactive frozen beverage.
Re: How to delete NPRs with step by step guide?
« Reply #12 on: December 30, 2020, 07:46:29 PM »
AAAAAND theeere we go, all three racess accessible in-game, all three races deleted.  They discovered A LOT of systems and had a LOT of colonies even though their populations were only a few bilions. . .  Honestly I wish I could keep them in my game, deleting them caused a sad feeling of missed content, but it had to be done for the sake of performance. . .  I hope I'll feel that thrill once more when I'll discover some generated nprs or precusors, swarm or invaders or whatever.

I'd bet you could probably get good performance out of a single NPR if you wanted to leave them in for a more "alive" galaxy. A lot of the NPR performance slowdown comes from the interactions between them - not only combat but also sensor detection when they are in the same system together. Might be worth trying sometime.
 

Offline Erik L

  • Administrator
  • Admiral of the Fleet
  • *****
  • Posts: 5656
  • Thanked: 366 times
  • Forum Admin
  • Discord Username: icehawke
  • 2020 Supporter 2020 Supporter : Donate for 2020
    2022 Supporter 2022 Supporter : Donate for 2022
    Gold Supporter Gold Supporter : Support the forums with a Gold subscription
    2021 Supporter 2021 Supporter : Donate for 2021
Re: How to delete NPRs with step by step guide?
« Reply #13 on: December 30, 2020, 08:32:39 PM »
Regarding database bloat and performance.

In your favorite sqlite manager (I use Valentina Studio), use the PRAGMA VACUUM command. It will compress all of the empty free space out of the database making it more manageable. Now if Steve were to put a command like that in the Aurora interface, that'd be nice :D
 
The following users thanked this post: BAGrimm

Offline Droll

  • Vice Admiral
  • **********
  • D
  • Posts: 1704
  • Thanked: 599 times
Re: How to delete NPRs with step by step guide?
« Reply #14 on: December 31, 2020, 08:26:12 PM »
I recommend you all use this method to get rid of NPRs that have been conquered and effectively no longer exist on the game space.
Getting rid of a single NPR shrunk my save file by 20-25MB.
Part of it might be all the escape routes that the AI plans for its fleets. There were more waypoints than I can count that were just filling up the tactical map.

The only unfortunate thing is that you will lose their intel screen.