TOAWxml Editor

Post new mods and scenarios here
User avatar
76mm
Posts: 4766
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: TOAWxml Editor

Post by 76mm »

Eventually information will be swapped back and forth between the tactical and operational?
Zackly, so you can play tactical battles and have the results imported into TOAW, or play TOAW and have the results reflected in the next tactical battle. Obviously to do this you need to be able to edit saved game files, so a separate part of the program does that. The whole process is rather complex, so I doubt that most people will want to mess with it, but if I get it right, I'll enjoy it very much.

I don't actually know of any tactical games that allow the export of end-game data, so all the tactical results will have to be entered by hand. Kind of a pain, but the good news is that you could use any tactical system you want...currently I'm looking at using ASL and/or CMBB for tactical land warfare, and different sets of miniatures rules for air/naval battles.
User avatar
Lobster
Posts: 5391
Joined: Thu Aug 08, 2013 2:12 pm
Location: Third rock from the Sun.

RE: TOAWxml Editor

Post by Lobster »

ORIGINAL: 76mm
Eventually information will be swapped back and forth between the tactical and operational?
Zackly, so you can play tactical battles and have the results imported into TOAW, or play TOAW and have the results reflected in the next tactical battle. Obviously to do this you need to be able to edit saved game files, so a separate part of the program does that. The whole process is rather complex, so I doubt that most people will want to mess with it, but if I get it right, I'll enjoy it very much.

I don't actually know of any tactical games that allow the export of end-game data, so all the tactical results will have to be entered by hand. Kind of a pain, but the good news is that you could use any tactical system you want...currently I'm looking at using ASL and/or CMBB for tactical land warfare, and different sets of miniatures rules for air/naval battles.

Wow. That has so many possibilities. [8D]
ne nothi tere te deorsum (don't let the bastards grind you down)

If duct tape doesn't fix it then you are not using enough duct tape.

Two things are infinite: the universe and human stupidity and I’m not sure about the universe-Einstein.
User avatar
76mm
Posts: 4766
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: TOAWxml Editor

Post by 76mm »

ORIGINAL: Lobster
Wow. That has so many possibilities.
I've played two "meta-campaigns" like this...one on a hand-drawn hex map (and ASL) and the second in a custom VASSAL module (and CMBB). Both were by far the most interesting wargaming experience I ever had...a huge variety of tactical encounters in all terrain and weather conditions, with persistent forces/leaders, all of which had greater or lesser significance for the operational layer. I enjoy the "role-playing" aspect of watching the various leaders and units rise and fall during the course of the campaign, tracking kills and experience gains, etc.

The main problem with the previous iterations was that every single battle had to be fought at the tactical level, which means you have to create a map, etc. Rather tedious... This time, using TOAW as the op-layer I'll be able to use it to fight the boring battles and only play out the more interesting ones in the tac-layer.
User avatar
Lobster
Posts: 5391
Joined: Thu Aug 08, 2013 2:12 pm
Location: Third rock from the Sun.

RE: TOAWxml Editor

Post by Lobster »

Need some way to automate the whole thing.
ne nothi tere te deorsum (don't let the bastards grind you down)

If duct tape doesn't fix it then you are not using enough duct tape.

Two things are infinite: the universe and human stupidity and I’m not sure about the universe-Einstein.
User avatar
76mm
Posts: 4766
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: TOAWxml Editor

Post by 76mm »

Can't automate the whole thing until/unless a good tactical level game allows import/export of game data, which none do. For that matter, of operational level games only TOAW allows for it (and even then technically not for saved game data). While the JTS Panzer Campaigns games store all data in unencrypted text files, plain text is harder to work with than XML and besides Panzer Campaigns has no map editor :-(.

Unfortunately data import/export does not seem to be a feature to which game devs attach any value.
User avatar
Lobster
Posts: 5391
Joined: Thu Aug 08, 2013 2:12 pm
Location: Third rock from the Sun.

RE: TOAWxml Editor

Post by Lobster »

ORIGINAL: 76mm

I think I'll start with these options, unless someone has a better suggestion; can always change/add later if it turns out this isn't particularly useful.

Sometimes you can only remember the unit name but not the formation name. Especially when you get old...er.
ne nothi tere te deorsum (don't let the bastards grind you down)

If duct tape doesn't fix it then you are not using enough duct tape.

Two things are infinite: the universe and human stupidity and I’m not sure about the universe-Einstein.
User avatar
76mm
Posts: 4766
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: TOAWxml Editor

Post by 76mm »

ORIGINAL: Lobster
Sometimes you can only remember the unit name but not the formation name. Especially when you get old...er.
The "/" doesn't mean search for "both", but search for "either", with the result highlighted in the tree. So if you search for a unit you'll be able to see its formation in the tree. Hopefully that will be possible.

User avatar
Lobster
Posts: 5391
Joined: Thu Aug 08, 2013 2:12 pm
Location: Third rock from the Sun.

RE: TOAWxml Editor

Post by Lobster »

Ah, I see. Thanks.
ne nothi tere te deorsum (don't let the bastards grind you down)

If duct tape doesn't fix it then you are not using enough duct tape.

Two things are infinite: the universe and human stupidity and I’m not sure about the universe-Einstein.
User avatar
rhinobones
Posts: 2041
Joined: Sun Feb 17, 2002 10:00 am

RE: TOAWxml Editor

Post by rhinobones »

Instead of using the “single” page xml format, would it be possible to load the flat file into an Excel like spreadsheet? Built in sorting and searches would solve the problems you’re having with the current format and mass changes would be easier. After editing you would probably need a macro to return the file to a suitable upload configuration.

Regards
Colin Wright:
Pre Combat Air Strikes # 64 . . . I need have no concern about keeping it civil

Post by broccolini » Sun Nov 06, 2022
. . . no-one needs apologize for douchebags acting like douchebags
User avatar
76mm
Posts: 4766
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: TOAWxml Editor

Post by 76mm »

ORIGINAL: rhinobones
Instead of using the “single” page xml format, would it be possible to load the flat file into an Excel like spreadsheet? Built in sorting and searches would solve the problems you’re having with the current format and mass changes would be easier.
I'll take a look at this, but have several concerns:
1) If I only do the "flat" searches, I won't really have any problems with the current format, I think it would be relatively easy to display a flat list of a single layer in the hierarchy--I just don't think that it would be very useful; I could also easily add sorting. You can see how a "spreadsheet" style flat XML document would look like if you check out my "Equipment DB Viewer" (also in this subforum). It basically looks like a spreadsheet and acts like one to a certain extent (has sorting, but no replace function).

I'm not really eager to try importing hierarchical XML (eg, Force, Formations, Units, Equipment) into a spreadsheets, which are inherently flat. I know that Excel allows for "nested" rows, but AFAIK those don't create truly hierarchical data and are purely a graphic thing.

2) I don't think that adding a replace feature (to allow for mass changes) would be much more difficult than a search feature, so I could probably add that as well. But if you want to make mass changes right now, it is super-easy to do so with XML files in Notepad++.
ORIGINAL: rhinobones
After editing you would probably need a macro to return the file to a suitable upload configuration.
Frankly the main reason I'm hesitant to mess around with spreadsheets is that while I think it might be pretty easy to spit out a spreadsheet which was about 80% correct, dealing with all of the issues to get it to 100% could be a nightmare. Importing the data back into XML would probably be even worse--currently all data entry via TOAWxml undergoes error validation before being added to the XML file (so you can't add text where you need a number, can't add a number which is incorrect, etc.). Just importing everything from Excel to XML would bypass all of that validation, meaning that the resulting XML could be a huge, unworkable mess, especially since errors could be introduced both while exporting from, and importing to, XML. I'm not sure, but suspect that dealing with this would involve extensive, very tedious coding, which frankly, I am loath to do.

I think you've mentioned spreadsheets a couple of times...what specifically are you wanting to do? I might be able to think of something equivalent but might work better with XML.
User avatar
rhinobones
Posts: 2041
Joined: Sun Feb 17, 2002 10:00 am

RE: TOAWxml Editor

Post by rhinobones »

ORIGINAL: 76mm

...what specifically are you wanting to do? I might be able to think of something equivalent but might work better with XML.

The application isn’t important to me, it’s the visual presentation and ability to modify attributes that counts. The spreadsheet would have an entire force listed along with columns for Formation Data (proficiency, general orders, entry point, entry event, etc.) and Unit Data (icon #, equipment quantity, supply, proficiency, readiness, etc.). I find that being able to see, compare and change attributes all on one screen as an efficient way to build scenarios. I find it terribly time consuming to make changes like this one screen at a time. It would also be valuable as a quality checking tool.

Columns and rows would need to have a “hide” function to remove clutter from the work area.

I realize that this may be totally impractical, and I have little knowledge of these mysterious things, so I’ll leave it as a wish list item.

Regards
Colin Wright:
Pre Combat Air Strikes # 64 . . . I need have no concern about keeping it civil

Post by broccolini » Sun Nov 06, 2022
. . . no-one needs apologize for douchebags acting like douchebags
User avatar
76mm
Posts: 4766
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: TOAWxml Editor

Post by 76mm »

This would be fairly similar to what I've shown in posts #597 & #598, no? I made that layout for the reasons that you describe.

It would probably be impractical to have one screen showing all formation and unit data in columns--it would require too many columns and would simply take up too much screen space. And with what I'm working with (Windows forms) I'm not sure that it is possible to hide columns and rows, or at least I don't know how to do it!
User avatar
rhinobones
Posts: 2041
Joined: Sun Feb 17, 2002 10:00 am

RE: TOAWxml Editor

Post by rhinobones »

ORIGINAL: 76mm

This would be fairly similar to what I've shown in posts #597 & #598, no?

I missed reading 597 and 598 . . . very nice work. Thank you.
Colin Wright:
Pre Combat Air Strikes # 64 . . . I need have no concern about keeping it civil

Post by broccolini » Sun Nov 06, 2022
. . . no-one needs apologize for douchebags acting like douchebags
User avatar
76mm
Posts: 4766
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

RE: TOAWxml Editor

Post by 76mm »

ORIGINAL: rhinobones
I missed reading 597 and 598 . . . very nice work. Thank you.
Well, the bad news is that right now that interface is only in the "Tac-Layer" module, not the "XML Editor" module (meaning that some XML fields are added).

While the Tac-Layer is still work in progress, ultimately you'll be able to use it to edit a gam file by creating a tac file, editing, then exporting back to gam--obviously a convoluted process. So I'm also thinking about how/if to graft that interface onto the XML Editor, but haven't decided yet; that interface involved lots and lots of very tedious coding, and if I have to do it all again (rather than cut-and-pasting), not sure if I'll want to do it again. The main downside to this new interface is that there is not enough screen space to include all of the fields as in the original version, so not sure how to handle that. But it's on my list of things to look at...
gianluca74_ai
Posts: 10
Joined: Mon Feb 14, 2011 12:26 pm

Re: TOAWxml Editor

Post by gianluca74_ai »

Hi everyone,

I’m reaching out to see if anyone here has experience or tips on safely editing TOAW 4 save files (specifically the `.gam` XML files). I’m currently making automated modifications to these files, primarily for unit positions, formations, and objectives. However, I encounter a recurring issue: every time I reload a modified scenario, it resets to Turn 1.

My main questions are:

1. Are there specific fields or sections within the `.gam` file that should be left untouched to avoid disrupting the turn sequence, calendar, or any active events?
2. Has anyone managed to successfully edit these files without breaking the game’s progression? Any best practices for maintaining compatibility and preserving the current turn?
3. Are there any tools or scripts that can help verify or “sanitize” the edited file for a smoother experience?

Any guidance, resources, or suggestions would be greatly appreciated! Thanks in advance to anyone who can shed some light on this.

Best,
Gianluca
User avatar
76mm
Posts: 4766
Joined: Sun May 02, 2004 4:26 am
Location: Washington, DC

Re: TOAWxml Editor

Post by 76mm »

Sorry, I just saw this, I don't check back here very much these days.

I have been able to edit save game files, but the results are not great, although the fewer events you have, the better it works. Before losing interest in TOAW altogether, I spent quite a bit of time coding ways that would allow me to edit save game files, and while I made quite a bit of progress, the results were never perfect, which would have been necessary for this to work.

It's been a few years since I worked on this, but IIRC I created code that would point to the ongoing game's latest log file, and then extract the date/time info from this file and input it into the edited save file--otherwise the turn/date info is not correct. This part generally worked OK, other than the fact that stopping in the middle of a turn--in other words between the turns of the two sides--meant that sometimes you would have to "skip" half a turn after reloading the edited saved game file.

Events were significantly more complicated; I don't remember the details at this point, but I was able to code something that would find and delete events which had already occurred, renumber the remaining events, adjust turn # (for event triggers, etc). This was all incredibly convoluted, and IIRC by the time I stopped I had figured out how to deal with most (90%?) events, but there were a few types of event which remained problematic. I can't really be any more specific than that because I can't remember. If you know C# code, I think that all of the code should be available on Github--I open-sourced the code years ago.

One problem is that TOAW's XML export/import code is incomplete in that it doesn't cover many XML fields...also sometimes it also introduces significant errors, as previously described in this thread. And then whatever the XML says, sometimes the engine just does what the engine does, and you can't do anything about it. For instance, after editing a save game file, when you reload the game it is *always* Turn 1 again, no matter what the XML says.
Post Reply

Return to “Mods and Scenarios”