Utility Program Concept - XML Code Generator for Simple Tasks

Genghis.Khan

Person
Joined
Jun 9, 2012
Messages
934
Location
Somewhere
After many boring hours writing simple XML, I came up with an obvious concept (and already existant) for an XML Code Generator. My Idea is somehow different from already existant Programs (like Chile's XML Program, with which I never really managed to work), it's a more intuitive Concept, that would allow new modders to create what they want without having to learn XML rules (even if intuitive, how many questions are asked about why isnt this XML code not working?).

My idea would be a form application (like a login forum - see spoiler for an image) that would allow you to chose what do you want to add (e.g Unit, but including all related-tables, like Unit_FreePromotions or even Civilization_UnitClassOverides (w/ warnings of course) only fill the text boxes, and the program would provide you the XML file. I am not a programmer, but this is probably doable in any language like Visual Basic or C#, C++... Is anybody intested in this or is it a stupid idea?

Spoiler :
 
A UI program could be very useful for new modders. If you're looking for a quick way to speed up the repetitive tasks involved in XML file creation though, check out this old topic on code snippets. I haven't been using them yet, but they seem quite powerful.
 
Everything I add is in quantity (like 60 units, for instance), so yes, I make my own code snippets. But it is still painfull even if I use Notepad ++ to Find and Replace Code (like replacing UNIT_AXEMAN with UNIT_MACEMAN) to code large amounts of XML. Even for experiencied Modders it would be useful to generate large amounts of XML coding, only copying values from an post, or Design Document.
 
I always found SQL easier for adding and editing in bulk:
Spoiler :
(Tutorial for how to do this here.)

It's still a pain, no doubt. I'm not sure whether you are trying to describe a GUI for beginners (with simple English translations for various tags) or something to reduce the pain for advanced modders. The first is possible but a whole lot of work. The second is, well, I don't know how you would do that...
 
There are always going to be various "issues" with any such "simple" tool. The two obvious ones being that

a) modding is a hobby and not a job. The people with the skills to write such a tool almost certainly don't need it, having other general purpose tools / skill sets they can bring to bear instead, eg XSLT and direct SQL coding, whereas the people who do need it don't have the skills to write it. Modding is a hobby, therefore would I rather be doing something for my own satisfaction (eg creating a new unit I want to play, writing a UI enhancement to make my games more fun, etc) or writing tools and associated documentation (and then providing support for those) for others to use. I've certainly done a lot of the latter, but still prefer the former ;)

b) XML creating is not actually simple - see the image in this post to understand the complexity of the relationships within the database - http://forums.civfanatics.com/showthread.php?t=497020 Take a Unit for example, does that include the associated UnitClass or is it to create a UU unit? If the latter, are the entries in the civilization_ tables needed? There are over 80 data fields on the Unit table alone, even if you ignore half of them that's still a lot of UI! Are we generating text entries, and if so for which language(s)? How about icons - do we need some way to link those? And how about unit artwork / 3d animations - even just using existing artwork is non-trivial. There are then over 15 linked tables, all of which would need not only UI space, but also instructions on what they are for. Simple it is not ;)
 
SQL, yes.

now that I've created the base code to handle all tables, I just need one line of code to add a new unit in R.E.D's mods.
 
Well, at least I learnt something new. I already knew your tutorial, Pazyrik but I forgot to add spaces between e.g Cost and Moves, so SQL was painful to write for me (still using it for some things that are only doable via SQL) . Now I feel stupid.

I was already aware of b). I had already seen the table relations graph, and looked at the XML files. My idea was to have only the most common associated tables... But now I realizaed that there isn't such thing as "common". Seems like I should have gone to sleep or finished my Portuguese Project instead...
 
but I forgot to add spaces between e.g Cost and Moves, so SQL was painful to write for me (still using it for some things that are only doable via SQL) .
Space (or tabs or line break) won't matter there, since you have a comma for the parser to see. The only time you need space (or tabs or line break) would be between words like "UPDATE Table SET". I still make comma errors though, even though they are fairly easy to see and I know all the rules. Our ape brains just aren't very good at that kind of small stuff.
 
I would have thought that creating an SQL string generator would be less of a hassle than XML given all the fiddle <> bits...but then my knowledge in creating these tools is very limited.
 
Top Bottom