Author Topic: Finding lost ships on crashes and fixing sector crashes  (Read 6295 times)

Gabeux

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    6
    • View Profile
I've posted this on Steam, but I'm gonna move it here. It's relevant only as long as the crashes occur - hopefully it will all be fixed soon.  :D
If there's a better way to do/explain things, do let me know. I'm not sure on the effects of deleting a sector or a faction, but I did manage to play for hours on that save with no issues.

Thanks!



I have survived a hundred server crashes and an instant crash issue due to my sector being bugged - it would CTD immediately after loading. Here's two tips (mostly for singleplayer).

Finding your ship

Go to your save game folder (%/Appdata/Roaming/Avorion/Galaxies/[Your save game]). and choose your method below.

Method 1: Check the logfiles for coordinates
- Open the logfile from when the crash occured / when you last had your ship.
- Scroll to the end of the file.
- Look for lines that refer to "saving sector". It will show coordinates. Take note.
- Sometimes, the coordinate is your previous system, sometimes it's the system you were trying to jump to (calculating route) and sometimes it's the right system. Such info is useful for different types of crashes. Use your judgement to prevent unnecessary trips and jumps.

Method 2: Search the Sector files for your ship
- Go to the sectors folder.
- Search for text in files: faction="1"
- The newest file that has this text is where your ship is
Files that have the searched text are the position of your ship(s) in the universe.
The filename is the sector coordinates.


Fixing instant sector crashes

BEFORE YOU DO THIS:
- Close the game and server.
- BACKUP YOUR SAVE!!! And do the changes on a copy.
- I did not read the game code, so I don't know the full effects of these changes. It's rather extreme.

Go to your save game folder (%/Appdata/Roaming/Avorion/Galaxies/[Your save game]). And choose the method that suits your issue:

If you (or someone) are crashing on load / stuck on a corrupt sector:
- If you are instantly CTDing and don't know what sector you are, use the previous tip to find your ship/location.
- Go to the /<galaxy_name>/sectors folder
- Open the sector xml file (from the sector that causes CTD). The filename ends with a "v". Example: 100_100v.
- Check below the "shipNumbers" tag. There will be a few items, ending with a faction="<number>" in them.
- Go to the /<galaxy_name>/factions folder.
- Delete the faction .dat files that are present on the <sector>v file ONE BY ONE to prevent unnecessary butchering. That means: Delete a faction, test the save.
You might want to open the faction file and look for the faction name (ctrl+f "name") before deleting its file, to assure you're not deleting something important..Or at least to know who you are deleting.
(Singleplayer) Faction_1 is you and there's no file for that.


If you crash when jumping to a sector, and no one / nothing important is present on that sector:
- Go to the /<galaxy_name>/sectors folder.
- Open the sector xml file (from the sector that causes CTD). The filename ends with a "v". Example: 100_100v.
- Verify that there are no player ships in that sector (under the "shipNames" tag, verify that there are no ships with faction="1"). If there are, then you'll be deleting your own ship(s).
- Delete/move both sector files (i.e.: 100_100 and 100_100v). This will make the game regen the sector the next time you jump in.
- If issue persists, you can keep deleting the sector until it fixes. Or you can delete the factions present in that sector. Check the above method (Crashing on load) to learn how to do that.

Final notes

NOTE: I don't know how the game handles player faction IDs in multiplayer servers. Also, you'd need access to the galaxy files anyway.

NOTE: I haven't tested the sector fix extensively - but I did recover 2 hours of playtime by doing it, and I played for over two hours with no issues. I also had to delete a sector that would crash my game when I jumped in - no issues.
I have no idea how the game handles ships from deleted factions and if this causes any instability or weirdness.
I just fixed my save and moved on - this might not be enough for you.

NOTE: You will need to open the files manually with a text editor. I recommend Notepad++.

PRO TIP: /Save, /save, /save. Backup your save, ESPECIALLY after doing time consuming quests. CTDs and connection losses are but a few jumps away.

Good luck, and may the RNG smile upon you.



ViChi

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    2
    • View Profile
on: February 23, 2017, 08:35:17 AM
Hey,

Nice to see u figured that out, the sector crashing upon load/generation crash..
i use another more simple method, but its not a proper fix either.

whenever a sector crash on me when i jump into it, i just delete that sector
easy way to do so is , simply go to >

\Users\current_user\AppData\Roaming\Avorion\galaxies\default_galaxy\sectors

then sort them files by date and time, delete the last sector made
each sector has 2 files  for example ''-123_-123 and 123_-123v'' delete them both.

(if your not sure check the server logs like stated in the above post)
it should not affect the player , or galaxy/sector state.
deleting the sector the player came from however will revert u back to a saved state
and u will respawn in the last sector that had a ship or station that allows it.
your ships however, will always stay in the sector u came from, or was trying to get to,
or the last server saved state...  player.data related

i'm not entirely sure, but almost all server crash issue's are memory related
whenever the sector load gets too high, so i tend to stay around in a system,
until it unloads previous ones, if the tread count and server load gets too high,
it fails to proper enumerate the new sector.

i can sit around in systems for days, leaving the server running,
and my a.i army stacking insane amounts of npc and loot without issue's,
but when jumping faction owned system's too fast,
the server module will crash on me.

i found more severe crashes too,
the only simple way to make sure the gamestate does not get corrupt,
is by backing up your galaxy files often, so u can replace them.

one of these is when the game crash on loading server/galaxy or abrupt exit.
or when u don't fix this, it can even end up duplicating your ships or deleting them
once u have a cloned ship with the same names u get other issue's a.i related.
it might seem cool to have that uber pimped out xsotan artifact ship cloned
but my game seemed to be allot more buggy.
also,
if u know the server module froze up again, always proper exit from the game
allowing it to save your player status, and when making backups.

always make sure when u apply a backup, to remove the entire corrupted galaxy.
or else u might end up with duplicate data.
 


hope u found this usefull.

« Last Edit: February 23, 2017, 08:55:53 AM by ViChi »



seumas

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    13
    • View Profile
on: May 22, 2018, 01:55:53 AM
I have crashes on our server drives us crazy. Nothing seems to help. We reinstalled the server and that worked for a time.

This post is great. At least we now know to delete the old sectors. That helps at least get us back playing.

Bump for new people who buy and play the game. God help them.



Roderik

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    3
    • View Profile
on: August 23, 2019, 11:32:32 PM
Had that problem (freeze on jump) and got it mostly solved with the above explanation.

Only, my home sector is now empty and this does not work for the home sector. There is nothing there anymore. I can delete the 35_448 files over and over again, but when I jump there it stays empty. so no more Shipyard and hence no possibility to  reconstruct the ship when Broken.
I also tried replacing the 35_448 files with the one from the after-crash backup or with one from a newly generated galaxy (same seed)
Nothing seem to work for "Resetting" the home sector to a functional state.

Anyone has any experience with that?