New Utility project in the works... YAModXMLEditor!

Everyone who has dealt with Civ4 XML knows that there are a lot of InfoTypes and instances of those info types.

So far the Schema table has the ability to identify the tags (variables/properties... whatever you want to call them) within the schema as one of 6 possible types:

Unknown (rarely used), Boolean (i.e. a variable that can be true or false), Integer, Floating point*, String (text), and Container**)

The reason this comes in handy is that it will make editing (and programming the editor) very easy:

If a variable is boolean it gets a True/False selection box.
If a variable is an integer it gets an edit box in which you can only enter numbers (and the negative sign)
If a variable is a floating point number it gets a box similiar to the integer but also accepts a decimal point.
Strings will get a text box... etc

Now for the kicker:
My next mini-project is to expand the type classification system to include all Info types.

By allowing the variables within the schema to be more strongly typed (i.e. using the InfoTypes as a variable type), the editor will be able to prevent XML errors for string fields that refer to a specific Info type by providing a drop down selection box of ALL DEFINED VALUES for a certain info type. This will include Text Info types (although whether drop down boxes are used for these will depend on user settings since there are SO MANY text defines).

For example. Lets say we have loaded up the Civ4UnitInfos.xml file up in the editor and we want to change (or add) a Unit Class. Instead of having a textbox for the Unit class, the editor will recognize (using the schema and some rules defined in a settings file) that the Class tag in the said file can only have values defined within the Civ4UnitClassInfos.xml file and will provide a dropdown list for you to select the desired Unit Class.

This should not take very much time to add since it mainly involves importing data that is already being used by the program.

NOTES:
*floating point numbers are not native to Civ4 XML schema's but recognizing them is fairly easy since all floating point numbers defined by firaxis start with a lower case f. If modders stick to this convention, all variables that start with a lower case f can be identified as floating point numbers. The option of using this convention can be changed by the modder in the program options to on or off. If set to off, floating point numbers will be treated as strings (like they normally are).

**Containers are not variables with a given value. Instead, they represent an expandable branch or placeholder for a collection of values (more variables). These are analogous to a class or structure in programming.
 
Well it is good to hear that you are making progress. And yes it would make it a lot easier for modders. I will just have to see it in action to really know how it would work.
 
Ok. We are basically done the inheritance capability. Schema values that refer to an info type can now be classified as InfoType values. This will enable the editor to quickly look up and create a dropdown list of all selectable values for the particular info type.

The only exception: I have to come up a way for the schema analysis routines to recognize what class is being referred to for generic tags such as "class" and "type" (when not used to give a name to an info itself).

At this point I am guessing that I am not quite halfway done having a working, presentable product. Only three major hurdles left: Importing the data itself (pretty easy), designing the interface algorithm that will allow you to edit an info file (biggest hurdle but only because of container types which must present a tree view which I have yet to design), and then programming the ability to save modified schema's and info files (somewhat challenging but only because I have never done anything like this before).
 
The basic importing functionality is finished. Though untested, I am fairly confident that it will work with normal Info files used in Civ4. Exceptions of course exist. Files that have additional tags besides infos in their the main container tag will not work yet. I will add functionality for those during testing

I am now working on the UI since it will make testing easier AND get the next major hurdle done at the same time.
 
Hello, I just wanted to update everyone and this time provide some screen shots. It's going slowly but surely. The basic editor is finally starting to take shape. Here's what we got so far:


Screenshots

First... the info file list (one of the menus). Here is where you can load any XML file in a mod:
attachment.php



Here's the basic interface with CIV4CommandInfos.xml loaded:
attachment.php



The column on the left lists all available infos in a file in alphabetical order and lets you shortcut to them:
attachment.php



Selecting a node in the xml property view gives you a little tool to the right of the node. Edit, Copy or Paste anyone?
attachment.php



Edit controls are specific to the type of value you are editing. Here is an example of editing a boolean property:

Before:
attachment.php


During:
attachment.php


After:
attachment.php



An integer editbox:
attachment.php



Progress
I would say that about 70% of the XML files load successfully at the current time. The biggest loading problem at the moment is loading files that do not have a unique root node. Files that share root nodes crash the program right now because I did not notice the issue before I tried loading them. I should be able to correct and all other loading issues by next weekend.

Hopefully people will find this type of editor useful. I aim to give it lots of features. Feel free to state your opinion... Feedback on the interface (both critical and supportive) is always welcome.

More to come!
 

Attachments

  • infomenu.JPG
    infomenu.JPG
    63.8 KB · Views: 224
  • commandinfos.jpg
    commandinfos.jpg
    69.6 KB · Views: 235
  • aterraininfo.JPG
    aterraininfo.JPG
    68.9 KB · Views: 223
  • simple editing.JPG
    simple editing.JPG
    75 KB · Views: 235
  • intValue.JPG
    intValue.JPG
    7 KB · Views: 225
  • beforeedit.JPG
    beforeedit.JPG
    8 KB · Views: 222
  • editing.JPG
    editing.JPG
    8.1 KB · Views: 226
  • afteredit.JPG
    afteredit.JPG
    8 KB · Views: 213
Wow .... I want it now :D

Well done ... it looks like a useful tool.
 
The column on the left lists all available infos in a file in alphabetical order and lets you shortcut to them

Except that it doesn't. In the screenshot immediately preceding this quote, showing the COMMAND_x values, the quick jump list has one fewer elements than there actually are - the COMMAND_WAKE is missing from the list. In the first (FORCECONTROL_x) screenshot one is also missing (5 on the list to the left, 6 on the right), although the dropdown menu obscures it so you can't tell which. In the terrain screenshot, where are TERRAIN_SNOW and TERRAIN_TUNDRA?
 
Except that it doesn't. In the screenshot immediately preceding this quote, showing the COMMAND_x values, the quick jump list has one fewer elements than there actually are - the COMMAND_WAKE is missing from the list. In the first (FORCECONTROL_x) screenshot one is also missing (5 on the list to the left, 6 on the right), although the dropdown menu obscures it so you can't tell which. In the terrain screenshot, where are TERRAIN_SNOW and TERRAIN_TUNDRA?

You are right. I noticed this aspect with another file soon after posting it. There was a wrong sign in the routine that sorts and inserts items into the list. It is fixed now. Here is a link to a terrain screen shot with the fixed algorithm.
 

Attachments

  • fixed.jpg
    fixed.jpg
    95.9 KB · Views: 140
Obviously I stopped working on this project for a while when I found out that Civ 5 would be released. I am considering starting it up again because I miss playing Civ and as of yet I have not really been able to get into civ 5 for the following reasons:
  1. my computer runs Civ 5 rather slowly.
  2. i don't like dealing with Steam AT ALL.
  3. since I last checked (which was a while ago) futuristic and CTP related mods are limited in their scope since they don't have any real programmers helping.

I looked at the code some very recently and may continue developing if 1) there is anyone else interested, and 2) I decide that the civ5 SDK learning curve is more than I want to deal with presently (given my other issues with the game). If not... i might join Procylon's Call to Power Project for Civ 5.
 
Obviously I stopped working on this project for a while when I found out that Civ 5 would be released. I am considering starting it up again because I miss playing Civ and as of yet I have not really been able to get into civ 5 for the following reasons:
  1. my computer runs Civ 5 rather slowly.
  2. i don't like dealing with Steam AT ALL.
  3. since I last checked (which was a while ago) futuristic and CTP related mods are limited in their scope since they don't have any real programmers helping.

I looked at the code some very recently and may continue developing if 1) there is anyone else interested, and 2) I decide that the civ5 SDK learning curve is more than I want to deal with presently (given my other issues with the game). If not... i might join Procylon's Call to Power Project for Civ 5.

It doesn't really matter, Civ5 isn't that good.
 
I never even considered looking at CiV, and I really loathe having to edit the XML, so count me in also. :D
 
This program looks great. These programs help develop mods so much faster! I currently use Xml marker and Civ4xml editor. I know you said it has no graphical interface, but I wish there was a way to combine some of the utilities such as the tech tree editor, worldbuilder editor, and this program.
 
I just looked at Civ4 XML Editor. Nice basic editor but I can't figure out how to do things like copy an info... supposedly it has that ability. Anyway, If I continue this project it will be much more than the basic editor. It already is capable of analyzing schema's and creating object types from them with a strictly defined structure. This capability will give the editor a lot of potential if I can get the change tracking functionality to work (so that differences between editions of the games and mods can be marked and worked with).
 
Progress on the editor is moving along. I am hoping that with some luck, I might be able to post an "alpha" testing version next week. The editor will now open all but 6 files for both the vanilla version and for mods.

Those 6 files are going to be a long time coming because 1) there are some significant issues with their formats and 2) because they aren't used (modded) all that often.

I may in the long run (and possibly for the short run) just have them open in a "raw" mode where the schema is ignored. There are some distinct disadvantages to this (at least in terms of the editor's capability) but at least then they can open and will be able to be modified.

Meanwhile, I have a created a "poll" thread in connection with this project so that I can ask the general public questions about what people would prefer or like (or even not like) in a mod XML editor. If you have a moment, please take the time to answer the latest pole question.
 
One thing I'd really like is the ability to edit any text for the civilopedia entries in a seperate box to make it easy to cut and paste similar to Civ4XML editor.

An edit box already opens if you select to edit something. The edit box only allows you to enter the type of data that is appropriate for the box. For example, if you are editing an integer tag (as defined by the schema) you can only enter integers. No characters will go into the box.

However, anytime you select a tag that contains text (which is for Civilopedia entries) you can cut/copy/paste any characters into the box if you wish. However, currently the edit boxes are not programmed to handle large amounts of text. (Only one line edit text boxes are available at the moment).

I will eventually add this capability (I was already planning on it).
 
Back
Top Bottom