TOAW batch processing

Post discussions and advice on TOAW scenario design here.

Moderators: ralphtricky, JAMiAM

Post Reply
Martin_Goliath
Posts: 98
Joined: Fri Jul 27, 2007 3:54 pm

TOAW batch processing

Post by Martin_Goliath »

A feature that I think could be very useful in scenario validation and when verifying the behaviour of the TOAW engine is an ability to run TOAW from a command line without invoking a graphical window. Let me exemplify:

>"Opart 3.exe" -nographics Test1.sce
would run the scenario Test1 in Elmer vs. Elmer mode from beginning to end, producing whatever output files that are set in the ini file (sitrep logs, toaw_log.txt and/or screen dumps).

>"Opart 3.exe" -nographics Test1.sal
would resolve all planned attacks (if any) in the save file Test1.sal and quit, producing output as above.

Given these features, it is simple to write a script that has the computer run any number of replications of a whole scenario or setup situation, and then performs whatever post-processing you want. For instance, someone more skilled in image processing than I would probably be able to produce images of average forward edge of battle advance from the screen dumps generated from repeated Elmer vs Elmer runs. If VP information were included in the sitrep log, it would be easy to produce statistics for victory points as a function of turn.

As an example, I have written a crude script that (assuming that the above feature exists) would work in the following manner:

> TOAWbatch Test1 1000
  • resolves attacks planned in the save file Test1.sal (provided it exists) 1000 times
  • stores the sitrep logs and toaw_log.txt in consecutively numbered directories, Run0 through Run999
  • Collects information about force 1 losses of rifle squads from all runs
  • Outputs, e.g.: "Mean losses of Rifle Squad for 1st Force: 345.7 +-21.34"

Attachments
TOAWbatch.zip
(1023 Bytes) Downloaded 5 times
User avatar
ralphtricky
Posts: 6675
Joined: Sun Jul 27, 2003 4:05 am
Location: Colorado Springs
Contact:

RE: TOAW batch processing

Post by ralphtricky »

Try "Opart 3.exe" -p2 -noupdate test1.sce

noupdate turns off most of the graphics updating.

I think you can also put sitreplog and most other options on the command-line.

It doesn't exit when done, which is a drawback to automating, but please let me know if it works otherwise.

Ralph

ORIGINAL: MarGol

A feature that I think could be very useful in scenario validation and when verifying the behaviour of the TOAW engine is an ability to run TOAW from a command line without invoking a graphical window. Let me exemplify:

>"Opart 3.exe" -nographics Test1.sce
would run the scenario Test1 in Elmer vs. Elmer mode from beginning to end, producing whatever output files that are set in the ini file (sitrep logs, toaw_log.txt and/or screen dumps).

>"Opart 3.exe" -nographics Test1.sal
would resolve all planned attacks (if any) in the save file Test1.sal and quit, producing output as above.

Given these features, it is simple to write a script that has the computer run any number of replications of a whole scenario or setup situation, and then performs whatever post-processing you want. For instance, someone more skilled in image processing than I would probably be able to produce images of average forward edge of battle advance from the screen dumps generated from repeated Elmer vs Elmer runs. If VP information were included in the sitrep log, it would be easy to produce statistics for victory points as a function of turn.

As an example, I have written a crude script that (assuming that the above feature exists) would work in the following manner:

> TOAWbatch Test1 1000
  • resolves attacks planned in the save file Test1.sal (provided it exists) 1000 times
  • stores the sitrep logs and toaw_log.txt in consecutively numbered directories, Run0 through Run999
  • Collects information about force 1 losses of rifle squads from all runs
  • Outputs, e.g.: "Mean losses of Rifle Squad for 1st Force: 345.7 +-21.34"

Ralph Trickey
TOAW IV Programmer
Blog: http://operationalwarfare.com
---
My comments are my own, and do not represent the views of any other person or entity. Nothing that I say should be construed in any way as a promise of anything.
Martin_Goliath
Posts: 98
Joined: Fri Jul 27, 2007 3:54 pm

RE: TOAW batch processing

Post by Martin_Goliath »

Ralph,

Thanks for the reply. I seem to have some trouble launching TOAW from a command line in that it does not automatically take me beyond the opening screen. That is,
"Opart 3.exe" test1.sal
does not open the save file, but double-clicking the sal file in Explorer does, etc. I don't see why this is so, since the command invoked when double-clicking to my knowledge is what I type on the command line [X(]

"Opart 3.exe" -p2 -noupdate test1.sce partially works as intended: TOAW does not automatically jump into the scenario, but manually opening a scenario from the opening screen will result in an Elmer vs Elmer duel with minimal graphics updates to the bitter end. However, what I am really after is the ability to run the TOAW engine without ever launching a graphical window at all.

Regards,
Martin
User avatar
ralphtricky
Posts: 6675
Joined: Sun Jul 27, 2003 4:05 am
Location: Colorado Springs
Contact:

RE: TOAW batch processing

Post by ralphtricky »

Martin,
If you put the filename in "" like "auto.sal" it will open the file in play mode. It looks like the p2 is overwritten when you load the scenario, so I'll have to move some code around and test it. I'll look into that for 3.5, I'm trying to make only critical changes for 3.4. I'll look into adding a -auto or something to open minimized and close when done.

If you do that for a .sce file right now, it should open it in the editor, some scenarios need the po option set correctly on first open, so this was safer.

Unfortunately, the code right now doesn't have a clear separation between the business logic and the display logic, but if you change it to start minimized, or for now, minimize it after starting, it will do even less display that the -noupdate option in Elmer v Elmer mode, so it should be pretty fast.

Ralph

Ralph Trickey
TOAW IV Programmer
Blog: http://operationalwarfare.com
---
My comments are my own, and do not represent the views of any other person or entity. Nothing that I say should be construed in any way as a promise of anything.
Post Reply

Return to “Scenario Design”