Author Topic: Removing starting NPRs?  (Read 1677 times)

0 Members and 1 Guest are viewing this topic.

Offline seinwave (OP)

  • Petty Officer
  • **
  • s
  • Posts: 21
  • Thanked: 3 times
Removing starting NPRs?
« on: April 22, 2011, 02:08:56 PM »
Is there some way, involving SM mode or Design mode, to remove some of the starting NPRs? I started with 16 because I wanted plenty of developed enemies, but 30 years in the game is running pretty slow. I'd like to get rid of the least-developed ones so that I can get through a 30-day increment in less than 5 minutes (other games with 3 or 4 NPRs have run much faster on this computer).
 

Offline mckamx

  • Chief Petty Officer
  • ***
  • m
  • Posts: 32
Re: Removing starting NPRs?
« Reply #1 on: April 22, 2011, 02:53:35 PM »
I don't remember seeing any such function.   It is probably possible with Database edits, but Steve doesnt like giving out the DB password, and chances are that editing the NPRs out of the DB would mess the game up pretty bad (too many interrelated tables referencing the NPR list).

I sympathize: I am currently in a game where a 6 hour pulse can take about 10 minutes to process.   My strategy is to reduce the NPR count by killing them off.
 

Offline Deoxy

  • Warrant Officer, Class 2
  • ****
  • D
  • Posts: 50
Re: Removing starting NPRs?
« Reply #2 on: April 22, 2011, 04:19:50 PM »
Somehow, I ended up with an NPR on the same world I had just created an empire on... not sure how that happened.  Anyway, I went into the database, opened the Race table, and unchecked the "NPR" column checkbox.

Voila, it's now a player race... meaning that you can look at it in the "Race Details" screen... which has a "delete" function.  Yay, all done.

Now, do beware that I don't know what that will do in a game that's well-along.  I did it before I started, before I had gone 5 seconds into the game.

Also, 16?  Ouch.  I tried 10 with this game, it's taking a while, and I'm only in my 15th year....
 

Offline sloanjh

  • Global Moderator
  • Admiral of the Fleet
  • *****
  • Posts: 2805
  • Thanked: 112 times
  • 2020 Supporter 2020 Supporter : Donate for 2020
    2021 Supporter 2021 Supporter : Donate for 2021
Re: Removing starting NPRs?
« Reply #3 on: April 22, 2011, 07:51:56 PM »
Somehow, I ended up with an NPR on the same world I had just created an empire on... not sure how that happened.  Anyway, I went into the database, opened the Race table, and unchecked the "NPR" column checkbox.

Voila, it's now a player race... meaning that you can look at it in the "Race Details" screen... which has a "delete" function.  Yay, all done.

Now, do beware that I don't know what that will do in a game that's well-along.  I did it before I started, before I had gone 5 seconds into the game.

And this ("I don't know...", plus the previous reply about removing the race from the DB by hand) is why Steve is reluctant to provide widespread access to the DB (or designer mode) password - if you did it in the opposite direction (trying to make a human-controlled race into a computer-controlled NPR) it would cause big trouble. 

That being said, what you did is probably safe, even after the game has been going for a while.  The important part is (as you did) to delete the race by using the delete function in the program - this should ensure that the links and secondary data in the DB are cleaned up gracefully.  Under no circumstances should anyone try to delete a race by hand in the DB (i.e. mckamx's suggestion) - things are so intertwined that's there's no way one could get it right.

The best way to do this (if you have the designer mode pw) is to simply enter designer mode and delete the race using the same "delete" function.  All designer mode does, actually, is to make computer-controlled races visible so you can look at and edit them as you would a player-controlled race.  Caution:  One must still be VERY careful in designer mode - the AI makes assumptions about the way that the empire is being run, so if you changes something you might break the AI.  So logging weird bugs after messing with designer mode is strongly discouraged; Steve's recent post about logging bugs after changing the DB applies to designer mode as well.

John
 

Offline Deoxy

  • Warrant Officer, Class 2
  • ****
  • D
  • Posts: 50
Re: Removing starting NPRs?
« Reply #4 on: April 22, 2011, 09:54:26 PM »
That being said, what you did is probably safe, even after the game has been going for a while.  The important part is (as you did) to delete the race by using the delete function in the program - this should ensure that the links and secondary data in the DB are cleaned up gracefully.  Under no circumstances should anyone try to delete a race by hand in the DB (i.e. mckamx's suggestion) - things are so intertwined that's there's no way one could get it right.

I'm actually 99.9+% sure I could get it right... but then, I'm a programmer by profession, and a significant part of my job is work in MS Access, so I'm probably not the best person to compare to.

The back end design actually seems decent.  Considering what I can see of the development history on this board (by one guy, in his spare time, with significant design-level changes along the way), that's quite a compliment.
 

Offline Steve Walmsley

  • Aurora Designer
  • Star Marshal
  • S
  • Posts: 11675
  • Thanked: 20466 times
Re: Removing starting NPRs?
« Reply #5 on: April 27, 2011, 06:55:43 PM »
I'm actually 99.9+% sure I could get it right... but then, I'm a programmer by profession, and a significant part of my job is work in MS Access, so I'm probably not the best person to compare to.

The back end design actually seems decent.  Considering what I can see of the development history on this board (by one guy, in his spare time, with significant design-level changes along the way), that's quite a compliment.

As in so many things, it's not knowing what you don't know that will cause problems. The database has been hacked all over the place in the last few years and there is key data in some very weird places. I will get around to tidying things up eventually :). Please don't assume you know what is going on as you would need in-depth knowledge of the code to understand how to delete things in the database. For example, when you delete a race using the UI, in addition to the expected cascade deletes, the code manually deletes matching AlienRace records, updates references to ControlRaceIDs in the RaceSysSurvey tables, removes appropriate GameLog entries and CurrentDesign entries, fixes race references in TechSystem and deletes records from EventColour, RaceClassName, HideEvents and RaceSysMapDisplay. None of this will happen if you simply delete a race from the database. Because that hasn't happened, the game will throw errors and those will get reported as bugs and I will spend my time chasing non-existent problems. Similar issues exist with other key tables. This is why I password the database.

It isn't great design or coding practice and I would shoot someone for coding this way in a multi-developer environment. However, its a hobby, it's fun, I know what is happening (most of the time anyway) and I don't take it too seriously, although I do comment my code very heavily. So please don't assume you can simply delete things out of the database and everything will be fine. It almost certainly won't be.

Steve
 

Offline Deoxy

  • Warrant Officer, Class 2
  • ****
  • D
  • Posts: 50
Re: Removing starting NPRs?
« Reply #6 on: April 27, 2011, 09:41:32 PM »
For example, when you delete a race using the UI, in addition to the expected cascade deletes, the code manually deletes matching AlienRace records, updates references to ControlRaceIDs in the RaceSysSurvey tables, removes appropriate GameLog entries and CurrentDesign entries, fixes race references in TechSystem and deletes records from EventColour, RaceClassName, HideEvents and RaceSysMapDisplay.

The only ones of those I didn't already know of from a cursory look through the database was EventColour and HideEvents, but that's because I haven't opened them at all yet (and they certainly don't surprise me).  As I said, I'm an MS Access programmer by profession, and I've done a LOT of work in databases that have no key constraints (meaning no cascading deletes of any kind), so none of this is really all that complex compared to my "day job".

I've performed several database data changes now, several of them just for fun, and I haven't seen any errors from them, nor would I report an error that could possibly be related until I repeated it in an unmodified game.  You've actually done a lot of this is a very straightforward manner (that's a GOOD thing).

That's not to say that I don't recognize that it's a ton of work, or that I don't appreciate how much work went into it.

(Having taught myself VBA many years ago by writing Tetris in Excel, I fully understand that "building a game to learn the language" is both a great way to motivate yourself to learn a language AND a great way to spend WAY more time on a project than the final result would indicate.)