FreeOrion

Forums for the FreeOrion project
It is currently Sun Dec 17, 2017 7:28 pm

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sun Sep 04, 2016 11:23 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4307
Location: Sol III
I've split the posts dealing in more detail with the potential replacement of FOCS with Python into a separate thread, so we can keep the more general discussion about how to organize our config/content/scripting files from the discussion dealing with the specific topic of a FOCS to Python migration. Please continue that discussion there.


Top
 Profile  
 
PostPosted: Tue Sep 06, 2016 5:52 pm 
Offline
Vacuum Dragon

Joined: Wed Aug 26, 2015 6:15 pm
Posts: 507
Vezzra wrote:
defaultuser wrote:
I see, thanks. If it were straight configuration, I would suggest XML.
Actually, IIRC game content originally had been defined by XML, before the current custom script language replaced that solution. This happened long before I joined the project, so I can only guess, but it's probably a save bet to assume XML proved to be rather unusable for that purpose.

Fair enough, it's your project. I've worked on a lot of projects in industry using XML and XML-based configuration files and messages (SOAP etc.). That worked well enough for us. Your experiences are different, and that's ok.


Top
 Profile  
 
PostPosted: Mon Sep 12, 2016 11:18 pm 
Offline
Space Kraken

Joined: Mon Nov 16, 2015 5:57 am
Posts: 105
I just wanted to add if your really going to translate focs to py files then to me it seems essentially to be a half step.

Have you guys considered just slowly writing your own .txt file parser that is specific to this game directly from c++ building up its functionality over time. One advantage of this is that as long as you load any of these file from c++ as if it were a .txt file with the proper encoding, the extension can remain the same.

Meaning you could parse a py file or focs ect... as txt, even at runtime, even after its been compiled by python and even edit it (though that's sort of just sauce for consideration to the point im making). Which is that it means you can slowly convert file types, of all the different kinds, over time. You run them as is, until your custom FO parser in c++ has the equivalent functionality and necessary capability's to take over from focs or to replace the py functionality and replace other odd file formats. After which, you rename the extensions or rewrite the files and load them from Free Orion itself. When that is complete you are then free to change the format to a newer version mark the changes translate the files over and bring it all in line uniformly to the desired txt file syntax you feel is the most appropriate for all custom files.

The end result is total control of additional functionality to custom scripting additions error handling and all aspects from the application itself. Extensions as well as directory structure then denote what responsibility files have instead of just how a file gets loaded reducing mangling and increasing the logical structure of the entire system.

I know that sounds like a ludicrous amount of work and it is and it would take a long time, but it is in fact i think proper and that's the whole point of my comment "to answer what is the ideal" that all custom game files, should be custom loaded by the game itself uniformly and that's one possible means. Though in the above manner it could possibly be done piece meal and paced.


Top
 Profile  
 
PostPosted: Tue Sep 13, 2016 6:31 am 
Offline
Programmer
User avatar

Joined: Fri Mar 01, 2013 9:52 am
Posts: 1040
Location: Germany
xlightwavex wrote:
Have you guys considered just slowly writing your own .txt file parser that is specific to this game directly from c++ building up its functionality over time.


Read the code, compare with your suggestion. Sorry, I won't invest more time to reply in depth to this.

_________________
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group