Author Topic: Names of "Fighter, Tiny, Small, etc."  (Read 4988 times)

0 Members and 1 Guest are viewing this topic.

Offline TMaekler (OP)

  • Vice Admiral
  • **********
  • Posts: 1112
  • Thanked: 298 times
Names of "Fighter, Tiny, Small, etc."
« on: April 18, 2020, 09:56:28 AM »
I was wondering of all those techs could be renamed into proper names. I always find it very confusing which one is bigger than the other - as well as having to guess what size is added. A line of "Fuel Storage 50.000l; Fuel Storage 10.000l; Fuel Storage 5.000l" etc. and "Maintenance Storage Bay 20; Maintenance Storage Bay 80" etc. would make it quicker to build ship designs and less try and error.
 

Offline Father Tim

  • Vice Admiral
  • **********
  • Posts: 2162
  • Thanked: 531 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #1 on: April 18, 2020, 12:33:11 PM »
Well, 'Fighter' is smallest, and then the rest just follow english convention -- tiny, small, medium, large, huge, etc.

I don't suppose it would hurt anything to rename them, though I would prefer the player have the ability to rename ship components, rather than both of us having to live with one or the other.
 
The following users thanked this post: Droll, Alsadius

Offline TMaekler (OP)

  • Vice Admiral
  • **********
  • Posts: 1112
  • Thanked: 298 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #2 on: April 18, 2020, 02:12:17 PM »
Yes, if we could rename the components, that would be top ...  :D
 
The following users thanked this post: thashepherd

Offline Doren

  • Sub-Lieutenant
  • ******
  • D
  • Posts: 137
  • Thanked: 34 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #3 on: April 18, 2020, 02:52:29 PM »
I would reverse the size order for people to scream at any possible screenshot that I would post
 
The following users thanked this post: Zed 6, smoelf

Offline Droll

  • Vice Admiral
  • **********
  • D
  • Posts: 1704
  • Thanked: 599 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #4 on: April 18, 2020, 02:58:40 PM »
Well, 'Fighter' is smallest, and then the rest just follow english convention -- tiny, small, medium, large, huge, etc.

I don't suppose it would hurt anything to rename them, though I would prefer the player have the ability to rename ship components, rather than both of us having to live with one or the other.

Renaming non-designable components definitely gets a +1 from me.
 

Offline Migi

  • Captain
  • **********
  • Posts: 465
  • Thanked: 172 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #5 on: April 18, 2020, 03:14:32 PM »
You can rename components like fuel tanks and engineering spaces, if you do it from the class design window.
I reported this as a bug (on the assumption that it could screw with the DB) but either Steve didn't notice or it's implicitly working as intended.
 
The following users thanked this post: thashepherd, mike2R, serger, Alsadius, Ciphascain, skoormit

Offline skoormit

  • Rear Admiral
  • **********
  • Posts: 804
  • Thanked: 324 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #6 on: April 20, 2020, 07:19:32 AM »
Quote from: Migi link=topic=10889.  msg125389#msg125389 date=1587240872
You can rename components like fuel tanks and engineering spaces, if you do it from the class design window. 
I reported this as a bug (on the assumption that it could screw with the DB) but either Steve didn't notice or it's implicitly working as intended. 

If they re-sort by name after they are renamed, this is my new favorite hidden feature, and I hope it doesn't get patched. 
I really dislike that they are "out of order" by size, which makes comparing consecutive sizes (e.  g.   when fine-tuning fighter and FAC designs) way too fiddly. 

EDIT: Yes! After renaming, close and re-open the Class Design window.  Voila! Components are re-ordered by name.  I now have:
Fuel Storage0- Fighter
Fuel Storage1- Tiny
Fuel Storage2- Small
etc. . .

« Last Edit: April 20, 2020, 07:22:18 AM by skoormit »
 
The following users thanked this post: Alsadius

Offline db48x

  • Commodore
  • **********
  • d
  • Posts: 641
  • Thanked: 200 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #7 on: April 20, 2020, 10:34:34 AM »
These are good ideas. After perusing the database a little, I ran this SQL query:

Code: [Select]
UPDATE FCT_ShipDesignComponents SET Name = CASE WHEN instr(Name, '-') == 0 THEN Name ELSE substr(Name, 0, instr(Name, '-') - 1) END || char((SELECT char FROM (SELECT ComponentValue AS value, 8320 + row_number() OVER (ORDER BY ComponentValue) AS char FROM fct_shipdesigncomponents WHERE Name LIKE 'Fuel Storage%') WHERE value = ComponentValue)) || ' (' || substr(ComponentValue, 0, instr(ComponentValue, '.') - 3) || 't)' WHERE Name LIKE 'Fuel Storage%';
This updates all the component names for the standard fuel tanks so that they include the mass as well as an extra character to get them sorted into the right order. For the extra character I used a subscript numeral, since subscripts are frequently used as indices and because they're less obtrusive than a full-size numeral. Roman numerals might be a good choice as well. At first I wanted to use invisible characters, but there aren't a lot of those. Now I think that subscripts are probably a better idea.

These are the resulting names:

Code: [Select]
Fuel Storage? (1t)
Fuel Storage? (5t)
Fuel Storage? (10t)
Fuel Storage? (50t)
Fuel Storage? (250t)
Fuel Storage? (1000t)
Fuel Storage? (5000t)

Of course, for all I know this breaks the AI shipbuilding. I think it would be a bad idea to have written the software that way, but one never knows. No warranties, etc.
 
The following users thanked this post: The_Seeker, JuergenSchT

Offline Father Tim

  • Vice Admiral
  • **********
  • Posts: 2162
  • Thanked: 531 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #8 on: April 20, 2020, 10:42:36 AM »
In other words, you created a mod.  It's probably a good idea to edit your post to remove the code and details.
 
The following users thanked this post: Zed 6

Offline TMaekler (OP)

  • Vice Admiral
  • **********
  • Posts: 1112
  • Thanked: 298 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #9 on: April 20, 2020, 10:57:48 AM »
Well, technically, that is not a mod. A DB MODification for sure; and I guess Steve wouldn't want to have reports from tampered DBs... so: During the inofficial Beta time not a good option. And Steve should check if the renaming mentioned before is a feature or bug...
 

Offline EvadingHostileFleets

  • Petty Officer
  • **
  • E
  • Posts: 17
  • Thanked: 13 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #10 on: April 20, 2020, 11:04:37 AM »
Quote from: TMaekler link=topic=10889. msg126104#msg126104 date=1587398268
Well, technically, that is not a mod.
I saw explicit statement by Steve that DB modification is a mod as opposed to read-only web-based browsing tool which isnt.
 

Offline Migi

  • Captain
  • **********
  • Posts: 465
  • Thanked: 172 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #11 on: April 20, 2020, 11:24:15 AM »
Doing it via SQL script with non-standard characters seems like it crosses a line that using the in-game function does not.
 
The following users thanked this post: Alsadius, Pedroig

Offline thashepherd

  • Chief Petty Officer
  • ***
  • t
  • Posts: 45
  • Thanked: 13 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #12 on: April 20, 2020, 11:26:47 AM »
Doing it via SQL script with non-standard characters seems like it crosses a line that using the in-game function does not.

I think you're right about this, but I also think the poster was operating with good intentions. I'll bet they'd be happy to take this down on request by Steve. We're all on the same team here :)
 
The following users thanked this post: Alsadius

Offline db48x

  • Commodore
  • **********
  • d
  • Posts: 641
  • Thanked: 200 times
Re: Names of "Fighter, Tiny, Small, etc."
« Reply #13 on: April 20, 2020, 12:59:34 PM »
Since every version of the game comes with a new database, these edits must be made each time. That's a lot of tedium, and tedium is evil. Your computer is there to serve you; don't make the mistake of doing things by hand all of the time when you could have the computer do it for you.

One way to automate things is to write shell scripts. This is particularly good for automating the process of running programs. (It's a terrible way to automate the process of clicking on buttons though, so I'm glad we don't have to do that very often.)

Since it's probable that many people here are new to writing shell scripts, I'd like to offer some small examples. The sqlite3 program can take a database name followed by a SQL command to run (or multiple commands). It can even read those commands from standard input, exactly as if you had typed them in manually. Thus, we can write the SQL commands in our shell script and send them to sqlite3 to execute, like this:

Code: [Select]
#!/bin/sh
for prefix in "Fuel Storage" "Compressed Fuel Storage System" "Engineering Spaces"; do
    sqlite3 AuroraDB.db <<EOF
UPDATE FCT_ShipDesignComponents
SET    Name = '${prefix}'
              || (SELECT char
                  FROM   (SELECT Size AS value,
                                 char(8320 + row_number() OVER (ORDER BY Size)) AS char
                          FROM   FCT_ShipDesignComponents
                          WHERE  Name LIKE '${prefix}%')
                  WHERE  value = Size)
              || ' ('
              || cast(Size * 50 AS integer)
              || 't)'
WHERE  Name LIKE '${prefix}%';
EOF
done

I went ahead and cleaned up the query a bit; the first one worked, but it was a little bit… janky. This often happens when you're typing commands in manually. It takes more effort to polish the thing and format it nicely, so we often skip that step at first.

I should point out that we're relying on the table and field names being the same from one database version to the next. The database schema can and will change from time to time, as features are added to the game, so that could happen. Still, it seems like a safe assumption to make in this case. If they do ever change, then running this script will produce error messages, but will be harmless. It would be a simple matter to find the new names and edit the script if that happens (and even that manual action can be automated, should the need arise).

It might one day be necessary to put the old names back. Since it would be very tedious to do so by hand, I automated it like this:

Code: [Select]
#!/bin/sh
sqlite3 AuroraDB.db <<EOF
update fct_shipdesigncomponents set name = 'Fuel Storage - Fighter' where sdcomponentid = 67058;
update fct_shipdesigncomponents set name = 'Fuel Storage - Tiny' where sdcomponentid = 38117;
update fct_shipdesigncomponents set name = 'Fuel Storage - Small' where sdcomponentid = 26266;
update fct_shipdesigncomponents set name = 'Fuel Storage' where sdcomponentid = 600;
update fct_shipdesigncomponents set name = 'Fuel Storage - Large' where sdcomponentid = 43529;
update fct_shipdesigncomponents set name = 'Fuel Storage - Very Large' where sdcomponentid = 43531;
update fct_shipdesigncomponents set name = 'Fuel Storage - Ultra Large' where sdcomponentid = 43530;
update fct_shipdesigncomponents set name = 'Compressed Fuel Storage System - Small' where sdcomponentid = 65061;
update fct_shipdesigncomponents set name = 'Compressed Fuel Storage System' where sdcomponentid = 26420;
update fct_shipdesigncomponents set name = 'Compressed Fuel Storage System - Large' where sdcomponentid = 64796;
update fct_shipdesigncomponents set name = 'Compressed Fuel Storage System - Very Large' where sdcomponentid = 64797;
update fct_shipdesigncomponents set name = 'Engineering Spaces - Fighter' where sdcomponentid = 27134;
update fct_shipdesigncomponents set name = 'Engineering Spaces - Tiny' where sdcomponentid = 27133;
update fct_shipdesigncomponents set name = 'Engineering Spaces - Small' where sdcomponentid = 26267;
update fct_shipdesigncomponents set name = 'Engineering Spaces' where sdcomponentid = 25147;
EOF

This demonstrates how a single invocation of sqlite3 can execute multiple SQL commands.

I hope this little side trip into shell scripting has taught you something that you can use in your everyday life.
 
The following users thanked this post: TMaekler, The_Seeker, JuergenSchT