@All Why do we/you use xml?

This forum is the ideal place for all discussion relating to X4. You will also find additional information from developers here.

Moderator: Moderators for English X Forum

User avatar
Perahoky
Posts: 501
Joined: Fri, 22. Aug 08, 16:04
x4

@All Why do we/you use xml?

Post by Perahoky »

Hello together,

(Thats not a bad criticism.)
I'm just wondering about why xml is used for content and savegames saving? :gruebel:
I would use json - it's fast and much smaller than xml.
*starting xml vs json fractions war* :mrgreen:

The biggger the content becomes, the smaller a json is in relation to its true content. And i dont edit the actual xmls this often, they're just a data storage.
Special xml features were not used as far as i can see.
And i would remove the line endings, they are not required, cost space and performance IMHO.

What do you think about it? Am i wrong?

Greetings

PS: maybe move this to modding forum, but it's also a technical topic. thanks.

#edit removed egosoft from title as they have probably not the time to discuss
Last edited by Perahoky on Mon, 3. Dec 18, 11:54, edited 1 time in total.
"Hope is the last force i have"
"This is how liberty dies, with thounderous applause"
***Modified***
CBJ
EGOSOFT
EGOSOFT
Posts: 54205
Joined: Tue, 29. Apr 03, 00:56
x4

Re: @All @Egosoft Why do we/you use xml?

Post by CBJ »

When we started using XML, JSON wasn't widely used outside JavaScript, and a lot of the tools that give the advantages that led us to choose XML didn't exist for JSON. That situation may have changed now, but it wouldn't have been a great use of time and resources to re-engineer the game just to save a little disk space. :)
User avatar
Perahoky
Posts: 501
Joined: Fri, 22. Aug 08, 16:04
x4

Re: @All Why do we/you use xml?

Post by Perahoky »

How is that implemented? :)
Is the file interface independend from the remaining games logic?
Or would that affect the performance? (But, thats a part which isnt very frequently executed...)

At our company, every technology we are using is abstracted to a single point of control (probably except the game engine which would be a mammouth task) ;)

So, as someday a technology gets outdated, we can just click "format to json" and

Code: Select all

config.xml 
<ioc><mapping type="IFileInterface" target="JsonFileInterface"/> </>
save it, done it (yes, its probably a bit more, updating old files for example. But that could happen in a fail-save, testing for a "<" or seomething else...).

(Even the ioc isn't required at all, i just wanted to show the thought.)
"Hope is the last force i have"
"This is how liberty dies, with thounderous applause"
***Modified***
CBJ
EGOSOFT
EGOSOFT
Posts: 54205
Joined: Tue, 29. Apr 03, 00:56
x4

Re: @All Why do we/you use xml?

Post by CBJ »

We do a lot of abstracting, but some areas are easier to do this with than others. Adding an abstraction layer for this paritcular case falls into the same category as switching to a different file format: not worth it for the possible benefits. Not to mention that all the development workflow tools that produce most of the XML files used by the game would also have to be converted, adding even more work. Oh, and I'm not even sure that JSON has support for all the features of XML that we use, such as stylesheets for displaying schemas, and XML patching.

Return to “X4: Foundations”