XML reader notepad++ and Visual studio hanging while reading save?

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
zdan30
Posts: 262
Joined: Mon, 29. Jan 07, 14:20
x4

XML reader notepad++ and Visual studio hanging while reading save?

Post by zdan30 »

Been using Notepad++ as its simple but it keeps freezing/hanging for 5 seconds and works for 5 then hangs again so i downloaded Visual studio to try that but thats even worse as it goes to not responding for 5-10 seconds and works for only a few?

I cant imagine its my PC and im a very new user to it so has anyone got any tips or ideas that would help as its making editing anything infuriating


System Information
------------------
Time of this report: 1/24/2019, 10:50:41
Machine name: DESKTOP-INO229K
Machine Id: {A48F546F-9CDC-4E84-BF63-C16960F06566}
Operating System: Windows 10 Pro 64-bit (10.0, Build 17134) (17134.rs4_release.180410-1804)
Language: English (Regional Setting: English)
System Manufacturer: Gigabyte Technology Co., Ltd.
System Model: To be filled by O.E.M.
BIOS: BIOS Date: 03/18/13 20:36:05 Ver: 04.06.05 (type: BIOS)
Processor: Intel(R) Core(TM) i5-3330 CPU @ 3.00GHz (4 CPUs), ~3.2GHz
Memory: 16384MB RAM
Available OS Memory: 16346MB RAM
Page File: 5852MB used, 15869MB available
Windows Dir: C:\Windows
DirectX Version: DirectX 12
DX Setup Parameters: Not found
User DPI Setting: 144 DPI (150 percent)
System DPI Setting: 144 DPI (150 percent)
DWM DPI Scaling: UnKnown
Miracast: Available, with HDCP
Microsoft Graphics Hybrid: Not Supported
DxDiag Version: 10.00.17134.0001 64bit Unicode
User avatar
MegaJohnny
Posts: 2239
Joined: Wed, 4. Jun 08, 22:30
x4

Re: XML reader notepad++ and Visual studio hanging while reading save?

Post by MegaJohnny »

Save files are more than 100MB in size in X4, and I remember having trouble using Notepad++ for saves in XR. So it could just be near the limit of what Notepad++ can handle in terms of file size.

Have you tried using Visual Studio Code? That one opens saves no problem for me - even searching seems pretty fast.
User avatar
zdan30
Posts: 262
Joined: Mon, 29. Jan 07, 14:20
x4

Re: XML reader notepad++ and Visual studio hanging while reading save?

Post by zdan30 »

I havent tried using Visual studio code ,i am very new to it and i opened a new project to view the XML file and went from there,i`ll have a look at how to use the `code` feature and see how i get on

Edit: Yes thats 100x better many thanks :D
User avatar
Baconnaise
Posts: 766
Joined: Sat, 23. Nov 13, 15:50
x4

Re: XML reader notepad++ and Visual studio hanging while reading save?

Post by Baconnaise »

MegaJohnny wrote: Thu, 24. Jan 19, 13:02 Save files are more than 100MB in size in X4, and I remember having trouble using Notepad++ for saves in XR. So it could just be near the limit of what Notepad++ can handle in terms of file size.

Have you tried using Visual Studio Code? That one opens saves no problem for me - even searching seems pretty fast.
This. I use Visual Studio Code and the saves open instantly for me despite the size. Notepad++ is great and I have it installed as well. It just doesn't like large files like that though.
UniTrader
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 14571
Joined: Sun, 20. Nov 05, 22:45
x4

Re: XML reader notepad++ and Visual studio hanging while reading save?

Post by UniTrader »

I might be mistaken but I think npp has an option to open big files which can load saves fine. it disables syntax highlighting and maybe node folding though.
if not stated otherwise everything i post is licensed under WTFPL

Ich mache keine S&M-Auftragsarbeiten, aber wenn es fragen gibt wie man etwas umsetzen kann helfe ich gerne weiter ;)

I wont do Script&Mod Request work, but if there are questions how to do something i will GLaDly help ;)
Antaran
Posts: 166
Joined: Wed, 6. Nov 02, 20:31
x3tc

Re: XML reader notepad++ and Visual studio hanging while reading save?

Post by Antaran »

MegaJohnny wrote: Thu, 24. Jan 19, 13:02 Save files are more than 100MB in size in X4, and I remember having trouble using Notepad++ for saves in XR. So it could just be near the limit of what Notepad++ can handle in terms of file size.

Have you tried using Visual Studio Code? That one opens saves no problem for me - even searching seems pretty fast.
Indeed VS Code is an excellent editor when it comes to big files and just in general.
LegionOfOne
Posts: 122
Joined: Sun, 16. Dec 18, 13:16
x4

Re: XML reader notepad++ and Visual studio hanging while reading save?

Post by LegionOfOne »

UniTrader wrote: Thu, 24. Jan 19, 16:30 I might be mistaken but I think npp has an option to open big files which can load saves fine. it disables syntax highlighting and maybe node folding though.
Exactly, NP++ works just fine with large files if you disable syntax highlighting, and by extension node folding as well.
I also used the save editor from CheatHappens, it works great, opening files fast and giving warnings about syntax errors, on top of offering an UI to make some simple changes without going into the XML.
But it is behind a paywall, so for most people NP++ is just fine.
wanderer
Posts: 279
Joined: Wed, 6. Nov 02, 20:31
x3tc

Re: XML reader notepad++ and Visual studio hanging while reading save?

Post by wanderer »

As unitrader and LegionOfOne correctly pointed out. At least change the settings before loading such big files so that node folding or parsing is off. In this case (such large files) the xml files will be read line-by-line, as soon as you browse them.

Still, the same problem occures if you use eg. oxygen xml editor (tried it while using the licensed one in our office) I encountered the same problems. The problem here are the xml parsing and (xml editor internal) building up the xml structure, for eg. autocorrection/highlighting/node operations/... Even while the save files are better to handle with oxygen xml, its a hell of cpu and time consuming to work with. So I recommend - do it line by line... (Or use scripts to find and manipulate the content)

But, this points to a more severe problem. While most (I assume) are opening the save xmls for eg. manipulation of 'money' or to delete mods, its hard to do more deeper work. Like resetting the sector fog-of-war for as selected sector! And Yes, that can be done!
I cannot see what should be positive in such a big save-xml. Well, yes it is in one place...

So, when you browse the save file, you'll see the sections for eg. the sectors exploration - to say its self explaining is an understatement. These nodes/entries are very-very-large AND growing with your exploring a sector. Same goes for the job of eg. ships (all, not only yours). These nodes are growing! Meaning, for example when using mods who expand the universe, or expand jobs, or so - it will be influencing the save file xml size even more. And in doing so, the loading/saving/memory usage and handling will increase as well.
As pointed out, I cannot imagine why egosoft mad it in this way. It would be logically better to - as last - use 2 or 3 parts for one save point. Like one xml for the jobs, one for the sector developnment and one for the rest.
Example: If you play the x3 universe (made with help form the tool here in the forum), you'll have hundreds of sectors. That surely will explode the save file...
User avatar
Futabamaster
Posts: 17
Joined: Sun, 2. Dec 18, 14:24
x4

Re: XML reader notepad++ and Visual studio hanging while reading save?

Post by Futabamaster »

I myself do use XML Marker 2 - it's not free, but it handles such large files no prob, can display nodes and overall makes xml editing less pain. The question i have - does anyone know filediff that can handle such large xmls?
wanderer
Posts: 279
Joined: Wed, 6. Nov 02, 20:31
x3tc

Re: XML reader notepad++ and Visual studio hanging while reading save?

Post by wanderer »

@Futabamaster: I am using Beyond compare - works, while it is a line-by-line reader. Still needs some time to read/compare the file, but does the job.

Return to “X4: Foundations - Scripts and Modding”