Developer Diary #2 - Having fun with randomly generated battles

John Tiller's Campaign Series exemplifies tactical war-gaming at its finest by bringing you the entire collection of TalonSoft's award-winning campaign series. Containing TalonSoft's West Front, East Front, and Rising Sun platoon-level combat series, as well as all of the official add-ons and expansion packs, the Matrix Edition allows players to dictate the events of World War II from the tumultuous beginning to its climatic conclusion. We are working together with original programmer John Tiller to bring you this updated edition.

Moderators: Jason Petho, Peter Fisla, asiaticus, dogovich

Post Reply
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

As I wrote in Berto's Coder Diary #20, I've never really bought into randomly generated battles. And as I wrote there - my loss!

"Let's do: Battle of Java 1942"


With 2.01 you can open up the Battle Generator timelines to include time periods that previously were not available, such as the Japanese invasion of Manchuria, in 1931.

Then, you can tweak the various Campaign##.oob Order-Of-Battle files to include the correct units to use, if not previously available.
"##" refers to nation codes, for example Japan with its country code 21 has a Campaign21.oob you can tweak.

If that sounds a bit mysterious, here's a little guide to create random scenarios of your favorite operations.

So, first let us select a battle. I chose the battle of Java. As I am no expert on Pacific ToW, I need something to start with.

Wiki: http://en.wikipedia.org/wiki/Battle_of_Java_(1942)
Battle of Java takes place in a supported time period, so this is something that can be tried out with 2.00 (or 1.04) as well. [:)]


#1 - Package it as a User Modification
Warning: Changing the content of any of the data files that come with the game can cause errors that lead to a crash.

What I am doing next is altering the Japanese and Dutch Dynamic Campaign Game unit rosters to include only units that were involved in the battle of Java. In order to have the original campaign files available for any other gaming, I will deploy my files as a separate modification, that can be easily installed and uninstalled to and from the game folder. I strongly advice anyone to do the same.

As of 2.01, all the User modifications are packaged in main folder, under \Mods sub folder. To easily have them available, a mod management utility called JSGME.exe will also be located in the main folder, readily available by simply launching the exe. The utility is already included on the 2.00 install, under the \Tools folder, from where it needs to be copied to main folder.

A JSGME User Guide is available there for more information.

Using JSGME is very easy, once you've figured the basics out.

To adhere to my own warning, I will deploy my altered files with the aid of the JSGME mod management tool.

To add my little mod there, I first create a folder with the name of my mod. The end result is the following folder (see Step #3 as how it will look):

[font="Courier New"]C:\Matrix Games\John Tiller's Campaign Series\Mods\RS - Battle of Java 1942 BG Mod[/font]

Under that folder, I recreate the installation path the tool will use. This is the end result:

[font="Courier New"]C:\Matrix Games\John Tiller's Campaign Series\Mods\RS - Battle of Java 1942 BG Mod\Rising Sun[/font]

Under the \Rising Sun folder there, I will copy the two Campaign##.oob files from the actual Rising Sun folder: Campaign11.oob file for the Dutch forces, and Campaign21.oob for the Japanese forces.

It is these ones (not the original ones in actual Rising Sun folder!) that I tweak:

Image

As 12/1941 to 3/1942 is included in the Battle Generator timelines, now in a file called timelines.dat, I will not need to tweak that. Otherwise I would have copied that file under this mod package as well.
Attachments
java1942-jsgme.jpg
java1942-jsgme.jpg (79.08 KiB) Viewed 948 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

#2 - Campaign##.OOB files: Putting In The Proper Order-of-Battle!

Looking at the two Campaign##.oob files, I can see their content is very generic for the time period. I delete the content of the Dutch file first, and looking at the OoB files included in Rising Sun, I quickly locate the Dutch Java Defence Force from the Dutch Corps11.oob. I add that to Campaign11.oob in my mod folder instead.

Then, having studied the Wiki article, I will need to add the British and US formations as well. After some time looking at the British (09) and US (10) OOB files, I include the necessary lines into the Dutch Campaign file (yes, you can do this!).

I first looked at the UK Hussars armored formations, found the 7th Hussars, and included it here. Then, I looked at the AA formations of the time period, and included those units there as well. Finally, located the unit to act as the US Lost Battalion of the battle. Added it too.

The end result is as follows, with correct unit names entered where one was not available:
Campaign11.oob :

[------------------------NEI Corps Formation------------------------------]
[----------------------- Battle of Java 1942 -----------------------------]
41 12 42 03 K1152001 6 Java Defense Force
41 12 42 03 P11306 Java Defense Force HQ
41 12 42 03 D1142002 1st KNIL Infantry Division
41 12 42 03 D1142003 2nd KNIL Infantry Division
41 12 42 03 D1142004 3rd KNIL Infantry Division
41 12 42 03 B0918028 77th Heavy AA Regt
41 12 45 08 B0918024 21st Light AA Regt (Army Troops)
41 12 45 08 B0918024 48th Light AA Regt (Army Troops)
42 03 42 03 B0910005 3rd Hussars
41 12 42 03 B1011043 2/131st Field Artillery Battalion (75mm Tow Art)
41 12 42 03 B1119006 Mobiele Eenheid
41 12 42 03 B1118006 Anti-Aircraft Battalion (Mixed)
41 12 42 03 B1118007 Anti-Aircraft MG Battalion

Note the Brits (09) and US (10) organizations there as well [:)]

Then, I will need to do the same for the Japanese organizations.

Again, I read the Wiki article to learn which units were used, and again I quite easily locate their Southern Army OoB from Corps21.oob, and add it to the Campaign21.oob in my mod folder. Renaming the other division as 2nd Infantry Division, it is good to go there:
Campaign21.oob :

[------------Southern Army 1941 - 1942----------]
41 12 42 05 K2152023 8 14th Army
41 12 42 05 P21306 # Army HQ
41 12 42 05 D2142004 2nd Infantry Division
41 12 42 05 D2142008 48th Infantry Division
42 01 42 05 G2132004 65th Independent Mixed Brigade
41 12 42 05 B2110004 4th Tank Regiment
41 12 42 05 B2110004 7th Tank Regiment
41 12 42 05 B2115003 3rd Engineer Regiment
41 12 42 05 B2115003 21st Engineer Regiment
42 01 42 05 C2105014 3rd Separate Engineer Company
41 12 42 05 R2121013 1st Heavy Artillery Regiment (150mm Gun - Army Troop)
41 12 42 05 R2121009 8th Heavy Field Artillery Regiment (150mm How - Army Troop)
41 12 42 05 B2111027 9th Ind Hvy Fld Art Battalion (150mm How - Army Troop)
41 12 42 05 B2118004 45th Field Anti-Aircraft Artillery Battalion
41 12 42 05 B2118004 47th Field Anti-Aircraft Artillery Battalion
41 12 42 05 B2118004 48th Field Anti-Aircraft Artillery Battalion
41 12 42 05 C2108003 30th Ind Fld Anti-Aircraft Company (Army Troop)
41 12 42 05 C2108003 31st Ind Fld Anti-Aircraft Company (Army Troop)
41 12 42 05 B2117007 15th Med Mortar Battalion (150mm Mtr - Army Troop)
41 12 42 05 B2111030 3rd Ind Fld Artillery Battalion (75mm Fld Gun)
41 12 42 05 B2111030 8th Ind Fld Artillery Battalion (75mm Fld Gun)
41 12 42 05 B2111030 9th Ind Fld Artillery Battalion (75mm Fld Gun)
41 12 42 05 B2111030 10th Ind Fld Artillery Battalion (75mm Fld Gun)
Note to myself: I really should trim down these OOBs further more. If I play at Battalion size mostly, why would I have full Army Corps as a starting point? Then, the randomly generated battles would have a better chance to actually include the actual specific fighting units I want.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

#3 - Installing and Uninstalling the Modified Files

I double click at the JSGME.exe, and promply locate my RS - Battle of Java 1942 BG Mod mod in the left window. I select it, and move it to right window. The modified files now replace the original files of the same name for the duration the mod remains enabled.

Once I get tired of this, or want to play with original files, I simply fire up JSGME again and move the mod from the right window to left window, disabling it.

The modified files will be gone from the original Rising Sun folder, while the original files are returned there.

This is how its done:

Image
For this to work, the JSGME.exe must be located at: C:\Matrix Games\John Tiller's Campaign Series\JSGME.exe. That it is how it will be packaged in 2.01. With 2.00, you need to manually copy it from the \Tools folder into this location.
Attachments
java1942-m..91692372.jpg
java1942-m..91692372.jpg (113.29 KiB) Viewed 946 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

#4 - Battle Generator Time!

Ready to Rock and Roll!

Firing up the Rising Sun Main Menu, and selecting the Generate Battle option, I try out the following:

As the British Hussars unit within the original OoBs was not available until 3/1942, the last month of the battle of Java, I put that as the date.

Then I select Japan vs Dutch, as it was the Dutch Campaign11.oob files I put the Commonwealth and US troops in.

Then, I select Battalion size, Tropical, Delaying Action, and Lt Hills with Md Jungle to go with it.

Press the button, and there we go, our very first battle of Java 1942 generated!

Proper units, if otherwise hypothetical [&o]

Before playing, I will add one further step though...

I exit the battle without playing it. Why?
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

#5 - A Bit More Order to the (Random) Chaos

As I have generated battles before, looking at the Rising Sun folder I see the new three files having appeared there: Random5.scn (scenario file), Random5.map (map file) and Random5.org (organization file).
The file numbering will start from zero, so the very first random battle you'll generate will have Random0 as file names. Then, up it goes. This was my sixth Random Battle, hence the number 5 in file names.

I then fire up Organization editor (Edit Order of Battle, from Main Menu), and have a look at the Random5.org. The game engine has properly input all organizations there.

Per Berto's reminder, let us not forget the generated map file either. Fire up the Map Editor from Main Menu, look at the Random5.map. Modify and add details, then save it.

Then, I fire up the Scenario editor (Edit Scenario, from Main Menu), to look at the units and how they were randomly input into map, in scenario file Random5.scn. Also, any changes you did to the map file are now taken into account.

Often the generated files are not optimal, but in any case I am happy to find out the Dutch are there, together with the Lt tanks of the 3rd Hussars.

The 2./131st Artillery Regt is not there, so I input the Forgotten Battalion there myself, from the Scenario Editor's Unit Dialog. I also input a better name for the scenario, so I can easily find this when opening up the battle via the Rising Sun menus. Then: save, exit.

A long story, but simple steps to get here. And here we go:

A nice little counter attack by the ABDA Command Force taking place in the jungles of Java!

Image
Attachments
jpnvsdutch..43e86583.jpg
jpnvsdutch..43e86583.jpg (170.01 KiB) Viewed 946 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

#6 - Conclusions

It took me far longer to write this diary, than to actually come up with a nice set-up for firing up random battle after random battle of the Battle of Java [:)]

Lessons learned:

The more limited the timescale, the more precise the units you put in your parameter files, the more control you will have with the end result of the random battle.

A quick tweak with the Editors to tidy up everything will probably be worth the effort. Transports especially may end up in silly places.

Importantly:

I hope this gave you some ideas as how to get a bit more fun out from the good old battle generator. I have not tested the formations (Campaign##.oob files) thoroughly, but at least with a couple of Battalion sized battles I tried out all went well.

Being somewhat familiar with various OOB files, and having a nice text editor with a good Find tool, all this took me something like 30 minutes, including reading the Wiki article for the first time.

Now, anytime I want, I can quickly create more Java 1942 battles , using the various options on the Battle Generator menu. Any modified scenarios can also be saved and put aside for later replay fun [:D]


To battle stations! [:)]

Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

Next, to have real fun, I encourage everyone to mod the Battle Generator to include the August 1945 Russo-Japanese war.
You have not fought a hard battle until you lead your Type 95 HA-GOs against the late war Soviet armor! [8D]

Image

To be able to do that, you'd need to tweak the [font="Courier New"]timelines.dat[/font] too. So that has to wait until 2.01 is out.


Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by berto »

ORIGINAL: Crossroads

I exit the battle without playing it. Why?
I would also pause, take the opportunity to tweak the random battle map. Some of the towns and roads especially in random battles can be ... annoyingly odd.

Editing random battles before playing them -- brilliant idea.
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
Warhorse
Posts: 5373
Joined: Fri May 12, 2000 8:00 am
Location: Birdsboro, PA, USA
Contact:

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Warhorse »

I used to do this routine with every DCG scenario!!
Mike Amos

Meine Ehre heißt Treue
www.cslegion.com
User avatar
berto
Posts: 21461
Joined: Wed Mar 13, 2002 1:15 am
Location: metro Chicago, Illinois, USA
Contact:

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by berto »


This opens up new shared modding possibilities -- distributing custom random battle packs, sans .map & .scn files, but including the needed Campaign##.oob, timelines.dat (and other?) files -- for modeling all sorts of obscure "sideshow" campaigns. (For example, a "Liberation of Mindanao 1945" random battle pack.) I love it!
Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/view ... hp?f=10167
Panzer Campaigns, Panzer Battles Lead Coder https://wargameds.com
User avatar
Warhorse
Posts: 5373
Joined: Fri May 12, 2000 8:00 am
Location: Birdsboro, PA, USA
Contact:

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Warhorse »

Setting up next battle in a DCG for a friend, good stuff as well!!
Mike Amos

Meine Ehre heißt Treue
www.cslegion.com
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

ORIGINAL: berto

This opens up new shared modding possibilities -- distributing custom random battle packs, sans .map & .scn files, but including the needed Campaign##.oob, timelines.dat (and other?) files -- for modeling all sorts of obscure "sideshow" campaigns. (For example, a "Liberation of Mindanao 1945" random battle pack.) I love it!

Liberation of Mindanao 1945 Random Battle Pack

What a neat idea! I would definitively like to see them being created and shared as well [:)]

Before the write up, I never thought to combine several nations into a selected nation's Campaign##.oob

Who's the first to create the West Front: Battle of Narvik May 1940 Random Battle Pack?

On the Allied Side: The Norwegian units, together with the Allied Expeditionary Force of French, British and Polish units. That's four nations.
On the Axis Side: those particular German formations that were involved.

Packaging them as user modidifications, limiting the timeline to the specific battle, and keeping the OOB short and sweet to assist the Random Battle Generator. Possibly tidying up a few scenarios and put them in the Random Battle Pack(tm) as well.

Who's first to give it a go? [:D] [&o]
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

Regarding the JSGME (JoneSoft Generic Mod Enabler), the whole installation package is available under the /Tools folder as of 2.00. Included is the user manual as well (JSGMEUG.pdf).

The brief examples I've tried to describe in my diaries won't probably be enough to explain the tool. Please see the User Guide there for more information.

I just realised it is possible to put a little "readme.jsgme" text file into each Mod folder, to provide a quick help window when hovering the mouse over each mod available.

So when packaging the Random Battle Packs, that can be used to make the basic information available to the users.

See the pic below:

Image

I wish I would have been aware of this earlier, I could have put a little help file there to describe each of the User Mod that is included in the install. [:(]

Oh well, let us input those as of next release...
Attachments
02_jsgmeinfo.jpg
02_jsgmeinfo.jpg (81.4 KiB) Viewed 947 times
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

ORIGINAL: Crossroads

Who's first to give it a go? [:D] [&o]

Another one I would like to see: The First Indochina War Random Battle Pack

Modifying maybe the Thai and Red China oob files vs a modified French oob.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
User avatar
Crossroads
Posts: 18120
Joined: Sun Jul 05, 2009 8:57 am

RE: Developer Diary #2 - Having fun with randomly generated battles

Post by Crossroads »

Here's hoping everyone's enjoying the new 2.01 UPDATE

It took a while coming, with lots of effort put into the front end applications this time around, Random Battle Generation and Dynamic Campaign Games for most part.

With that, there's a few changes to how things played out before. Going forward, as described in the Coder Diaries, and in preparation of the coming Modern Wars titles, the error handling and logging in general is being tightened. Common code base, remember. Happened here too.

For an example, with engagement Sizes, there's been a few questions around already.

In 2.00 and before, there was code in place to fish around for different levels if the game data doesn't support the requested level. There we identified problems where the code might go into an endless loop (effectively a freeze), or crash, or create mismatches: pitting a regiment vs. a brigade or even higher.

Now, there's logic in code now for a level playing ground. No more Regiments vs Bridgades. Or whatever the game engine picked from the selected countries' unit data.

On the other hand, the data in OOBs should now allow for level engagement sizes as well.

Therefore, one can't randomly generate any battle, any combatants, any size, with a perfect chance of success where there was success with earlier versions.

Some sets of choices will fail to work now. But others will do. Try try again.

There's a commitment for continuous improvement on unit data, this will take time.

For an example; the tricky thing with the Russians in that in 1943, there weren't a lot of division organizations. For armoured forces, they were mostly Corps, which you'll be given a notification (not an error) for in DCG's, but not in the Battle generator. So if someone picks regiment and tries to generate an armoured fight with regiments, it automatically will fail because Russian forces are organized into Brigades.

So, if there's a certain era, certain nations, consider creating specific oobs for specific eras ("Random Battle Packs"). Something that adds a bit more realism to random battles, and something the community could share among themselves.

Or, keep the 1.04 around if you so prefer. The good and the bad will work as they did before.

As for the development team effort. The coding for Middle East, then Vietnam will now proceed. For CS, any code additions will have wait until 2.1 is out, after them.

If there's a need, we can easily provide hot-fixes for data, though. And what you are seeing with 2.01, are data issues. In a couple of weeks time I will post a detail Developer Diary regarding the Battle Generator / DCG unit creation. Stay tuned.
Visit us at: Campaign Series Legion
---
CS: Vietnam 1948-1967 < v2.00.01 Remastered Edition (2.00.02 Public Beta now available)
CS: Middle East 1948-1985 < v3.00.01 Remastered Edition (3.00.02 Public Beta now available)
Post Reply

Return to “John Tiller's Campaign Series”