Solution for Vanishing Vessels - New Database

Discussion in 'General Discussion' started by byo13, Jul 27, 2020.

  1. byo13

    byo13 Captain

    Joined:
    Jul 13, 2020
    Messages:
    417
    Likes Received:
    641
    Hello empyrioneers.

    I have a simple solution to have my ships and bases safe from disappearing in Single Player mode. This helps you to keep a list of everything that's important and also avoid the vanishing ships bug that seems connected to teleporting to a lot of destinations before returning home and finding a missing vessel. It happened to me several times in a couple of days so I'd like to share a simple method to have your stuff under your control and make them safe when they choose to randomly warp to distant locations of the galaxy.

    I am a newbie so there may be a better way or another way (like "setposition" or "spawn" in the debug console).

    We know that the new database system is actually an SQLite database. So this method requires a bit of SQL knowledge.


    Exporting a list of your stuff

    1. First things first, you'll need to install a free/opensource SQL Editor. I recommend DBeaver which makes connecting to SQLite databases an easy task. Download DBeaver Community Edition here.

    2. Inside DBeaver, create a new connection. Click the Database menu -> New Database Connection. Choose SQLite as your database type.

    3. Next, DBeaver will ask the path of your database file. Click "Browse", then navigate to your save folder. It must be a save file that still has your ships in their right positions (before any of them vanished). (ie: "C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Galactic Survival\Saves\Games\NewGame_1-200726-1546"). Make a backup the "global.db" file that you'll find in there and then choose it as the database connection.

    [​IMG]

    4. Make sure you are not playing the game using that save file. You can leave Empyrion at the title screen if you wish while you connect to the database. Now it's time to type in some SQL. Click on the "SQL Editor" menu, and then "New SQL Editor". In the new SQL window, type in the code below:

    Code:
    SELECT E.entityid, E.name, E.etype, E.facid,
           E.posx, E.posy, E.posz, E.pfid,
           P.name AS playfield_name
      FROM Entities AS E
     INNER JOIN Playfields AS P ON E.pfid = P.pfid
     WHERE E.etype <= 8
       AND E.belongstoentityid = (SELECT entityid
                                    FROM Entities
                                   WHERE name = 'byo13');
    
    You need to replace "byo13" there with your username. Execute it with CTRL+RETURN and a list of your bases and your ships will be returned.

    [​IMG]

    5. You can export that list in any way you want. Copy and paste to an Excel sheet, take notes or use DBeaver export to INSERT. The important thing here is to keep track of the ids (entityid, pfid) and positions (posx, posy, posz).

    Now you can save that list, exit DBeaver and keep playing the game. Whenever you face that bug and your ship is far far away from where you left it, you can send it right back to the list's start position.


    Update your ship location and playfield

    1. Before connecting to your save database, make sure you backup your "global.db" file and that you are not running the game in that same save file (leave the game in the title screen or exit).

    2. Your missing ship may be in a different playfield now. So let's update the ship's location to its starting point. In my example (and it was a real one) my Merc-MX5E was inside (as in beneath the surface of) my starting planet.

    Code:
    UPDATE Entities
       SET pfid = 12,
           posx = -513.765869140625,
           posy = 145.0758514404297,
           posz = 490.7525634765625
     WHERE name = 'Merc-MX5E';
    
    COMMIT;
    
    Those X, Y, Z coordinates and the playfield id are all found in your saved list.

    3. Now you can load your save game and see that your ship is there, exactly where you left it when you saved that list. Remember to disconnect from the database or to exit DBeaver before.

    You can edit locations at your will. Just make you sure you are relocating vessels to a safe spot, that means not inside a moon or overlapping other entities.

    It's just a workaround. Hope that helps. ;-)
     
    #1
    Last edited: Aug 5, 2020
    Mikiy, nonsense, sulferon and 3 others like this.
  2. Kassonnade

    Kassonnade Rear Admiral

    Joined:
    May 13, 2017
    Messages:
    2,819
    Likes Received:
    4,114
    Real nice work. Thanks!
     
    #2
    byo13 likes this.
  3. byo13

    byo13 Captain

    Joined:
    Jul 13, 2020
    Messages:
    417
    Likes Received:
    641
    Thank you, @Kassonnade.
    There are many things that we can do by investigating the db file without breaking the game.
    I came up with this when I couldn't use the "setposition" command. The ship traveled alone to a different playfield. :D
     
    #3
    sulferon and Kassonnade like this.
  4. Myrmidon

    Myrmidon Rear Admiral

    Joined:
    Mar 26, 2016
    Messages:
    1,737
    Likes Received:
    2,067
    In my case, according to the console prompts, it was not set in another playfield. The console prompted that the ship was out of the playfield and it was removed, in yellow colored message. Nice guide though, thank you for sharing.
     
    #4
    byo13 likes this.
  5. byo13

    byo13 Captain

    Joined:
    Jul 13, 2020
    Messages:
    417
    Likes Received:
    641
    @Myrmidon, That's interesting. I had to do all this because console insisted that my ship didn't exist anymore (no entity id found or something). So it couldn't be moved. But it was there in my database with the exact same id the console was rejecting.
     
    #5
    sulferon and Kassonnade like this.
  6. sulferon

    sulferon Lieutenant

    Joined:
    Aug 24, 2016
    Messages:
    30
    Likes Received:
    72
    Delightfully... So I won't have to suffer with frequent saving of "still working saves" before each sneeze. Ahah, what the new player would think... In this game, saves are so often ruined that you need to learn SQL...
     
    #6
    byo13 likes this.
  7. Myrmidon

    Myrmidon Rear Admiral

    Joined:
    Mar 26, 2016
    Messages:
    1,737
    Likes Received:
    2,067
    I think the problem is solved now. On the other hand, in any game, a save for backup purposes is a medicine for the nerves :D
     
    #7
    byo13 likes this.
  8. IndigoWyrd

    IndigoWyrd Rear Admiral

    Joined:
    Jun 19, 2018
    Messages:
    1,028
    Likes Received:
    1,416
    I like DBeaver, and classical music, which is why I always finish on d' Bach, never on Debussy.

    [​IMG]
    Alright!
     
    #8
    Arguro and byo13 like this.
  9. scapino

    scapino Ensign

    Joined:
    Jul 22, 2018
    Messages:
    10
    Likes Received:
    12
    Giggity!
     
    #9
    byo13 likes this.
  10. Mikiy

    Mikiy Lieutenant

    Joined:
    Sep 6, 2015
    Messages:
    18
    Likes Received:
    23
    Ah nice, so thats how it works.

    Out of curiosity.. have you happen to have tried copying vessels or bases with their inventory across save games yet? As the old approach of just copying the few files from the shared folder doesn't seem to work anymore i would guess one needs to export/import all the related entries in the database now but i haven't seen a guide anywhere yet for it.
     
    #10
    byo13 likes this.
  11. Myrmidon

    Myrmidon Rear Admiral

    Joined:
    Mar 26, 2016
    Messages:
    1,737
    Likes Received:
    2,067
    The old copy method still works perfectly fine.;)
     
    #11
    byo13 likes this.
  12. byo13

    byo13 Captain

    Joined:
    Jul 13, 2020
    Messages:
    417
    Likes Received:
    641
    I'm a new player so I'm not too familiarized with that. I work with databases for more than a decade now so I'm more comfortable with that.

    Fortunately for us, with the newer alpha builds, my vessels are not vanishing anymore. It's been a while since I last had to mess with the database. Life is good again. Haha.
     
    #12
  13. Tarc Novar

    Tarc Novar Commander

    Joined:
    Nov 14, 2017
    Messages:
    72
    Likes Received:
    37
    I'm just glad the old bug where my SV parts would randomly shrink and stick to my CV is gone.
     
    #13
    byo13 likes this.
  14. Mikiy

    Mikiy Lieutenant

    Joined:
    Sep 6, 2015
    Messages:
    18
    Likes Received:
    23
    Hmm not for me, the old copy method im refering to goes as far as i remember like this:
    1) in the new save game, create same type of vessel with a starter, write down new ID.
    2) in the old save game, find ID of the vessel you want to port over.
    3) copy contents of OldSaveGame/shared/oldID to NewSaveGame/shared/newID while the game/server isn't running.
    And then the old asset with everything in it should be exactly where you put the new core in the new save game. When i try this in the current version of the game theres just nothing there and i assume thats because lots of stuff is in the database now rather then in the files in shared.
     
    #14
  15. Myrmidon

    Myrmidon Rear Admiral

    Joined:
    Mar 26, 2016
    Messages:
    1,737
    Likes Received:
    2,067
    In SP games works. Just copy the .area file. I do not play MP games.

    The general procedure is described here.. https://empyriononline.com/threads/help-topic-how-to-recover-lost-or-stuck-vessels.38357/
     
    #15
    Last edited: Aug 1, 2020
    byo13 likes this.
  16. Myrmidon

    Myrmidon Rear Admiral

    Joined:
    Mar 26, 2016
    Messages:
    1,737
    Likes Received:
    2,067

    Where I do type that? After I have connected with the db I see this :

    Screenshot from 2020-08-05 18-05-04.png
     
    #16
    byo13 likes this.
  17. byo13

    byo13 Captain

    Joined:
    Jul 13, 2020
    Messages:
    417
    Likes Received:
    641
    Click on the "SQL Editor" menu, and then "New SQL Editor".

    I updated the main post. Thanks.
     
    #17
    Myrmidon likes this.
  18. Myrmidon

    Myrmidon Rear Admiral

    Joined:
    Mar 26, 2016
    Messages:
    1,737
    Likes Received:
    2,067

    You are welcome. I suppose you haven't test yet to copy i.e. a CV from one game to another , in order to get your inventory to the new game.
     
    #18
    byo13 and Tarc Novar like this.
  19. byo13

    byo13 Captain

    Joined:
    Jul 13, 2020
    Messages:
    417
    Likes Received:
    641
    I was afraid the ships required more than a database entry so I didn't venture into that area.
    If we can do that easily I might be able to develop a simple tool to achieve that. :)
     
    #19
    Myrmidon likes this.
  20. Myrmidon

    Myrmidon Rear Admiral

    Joined:
    Mar 26, 2016
    Messages:
    1,737
    Likes Received:
    2,067
    Does this method still work? I am unable to open the global.db of a save game.


    [​IMG]
     
    #20

Share This Page