Well, *sigh*. You're right of course, the current state of things in that department isn't exactly exhilarating. The result of many people working over the course of many years and throwing in temporary solutions when they wanted something to be configurable but didn't have the time to implement a proper config solution plus corresponding GUI.LGM-Doyle wrote:Speaking of "configuration files", there are at least 8 locations for/types of "configuration files": FOCS, config.xml, persistent_config.xml, universe_tables.py, AIDependencies.py, EnumsAI.py, buildings.inf and config.ini. They use at least 4 different syntaxes: FOCS, XML, python, ini and line terminated double quote delineated file of strings. Some are not visible to the server. And some duplicate or override information from other configuration files or the server.
Are things supposed to be moving in one direction or another?
It's bothering me too, and we definitely need to do something to consolidate this mess. That said, all these "config" files/mechanics address very different things, so even after a proper cleanup/consolidation we will have several different types of them.
FOCS serves the purpose of defining the game content. The "config.xml" is a storage for all kinds of parameters like GUI/appearance etc., so we most likely won't be able to unify these two.
But, for example, one thing I mulled over a lot in the past is if we really need both FOCS and Python. While it's obviously impossible to use FOCS to implement the AI (or even universe generation as it's done now), it would certainly be possible to do all the content definitions in Python. We could throw out the entire parser code (for all its power the Boosts parser lib is a template nightmare after all) and scripters would have one language less to worry about when customizing FO.
But then again, OTOH, there are probably good reasons to stick with both. FOCS is supposed to be easily readable, understandable and learnable even for non-coders. Now, I can't really tell if that's true, because for me Python is easier to read and understand than FOCS. But apparently most other people do better with FOCS, and it seems that it won't be easy to set content definition up in Python in a way that's as easily comprehensible to non-coders. And that's just the minor obstacle here - the main advantage FOCS has over Python is performance I guess. The FOCS scripts are read and parsed once, and transformed into data structures that can be processed very efficiently. If all the content was implemented in Python, that Python code would have to be executed (and this means interpreted) each time it's invoked, and I don't even want to imagine the hit on performance this means (*shudder* ). (Geoff, correct me if I'm wrong.)
So, because of the very different purposes these languages serve, we probably have to keep both of them (unless someone comes up with some ingenious idea how to do all the FOCS stuff in Python without the performance hit).
If you have ideas how to simplify our current config file maze, you're certainly welcome to share them.