Custom RCG Tutorial

Please post here for questions and discussion about unit modeling and general game modding. You can also post your new units and modifications here.

Moderator: EagleMountainDK

Post Reply
WhiteOwl
Posts: 122
Joined: Fri Jun 09, 2006 2:04 am
Location: Sydney, Australia

Custom RCG Tutorial

Post by WhiteOwl »

Hi,

Since reading about the random campaign feature I wanted to create my own for a couple of reasons. Firstly, I used Robert Oleson's Quick Campaign Generator for CMBB/CMAK and loved it, and it had a campaign template for a PzIIIF platoon in it which I liked generating small battles around. Secondly, I like small battles which are not terribly challenging (I know... pretty lame...) as to me this is a fun way to play for a short while and unwind. Think of WWII solitaire...[:'(]

So, to cut a long story short, I decided to create my own RCG campaign and thought I might describe my steps here thus providing a little tutorial. Here goes then.

The first step for me was to pick a campaign to copy. I chose the 1st Infantry Div 1941 Short.xml (under the "Random Campaigns" subdirectory) to begin with as it had the right timeline, and I wanted my core force to be a tank platoon, but to have supporting infantry rather than more tanks. I copied this file and called it German Tank Company.xml - yes it is a bad name [:)] I also edited it in a text editor and changed the campaign ID to "German Tank Company".

Now, looking inside the XML file I saw that the scenario list is basically a list of references to battle plan files and the number of their repetitions. So, I went over to the "Battles" subdirectory and saw the German Summer 41 (First) - 1st Inf Div.xml and German Summer 41 (Mix) - 1st Inf Div.xml files. I copied them as German Summer 41 (First) - TankCoy.xml and German Summer 41 (Mix) - TankCoy.xml. I also edited their id and name attributes appropriately.

I then loaded the campaign file in the RCG editor (don't forget to switch to random campaign mode), and deleted all the battle references, then added my First battle with a 1 multiplier and the Mix battle with a 5 multipler (for a total of 6 battles). I also made them key battles as I wanted my campaign to have exactly 6 battles in it.

The first battle plan in your campaign dictates your core force (hence the First in the name). This file now needed to be edited and the new core force specified. As mentioned above I wanted to have a single platoon of 3 PzIIIFs. So, I loaded the scenario editor and created a dummy scenario with the germans having this unit as core and saved it. It gets saved in the "Scenarios" subdirectory. Now, if you open the XML files generated by any of the programs in a regular text editor, you will not be able to read their contents because all text is generated as XML entities with their ASCII codes (if you don't know what this means, don't worry about it, just follow the next steps). To overcome this, use Internet explorer, by loading it, and the File->Open your XML file. IE will translate the XML entities and you can copy the text from the display. This is the most simple way of doing this (you can of course use XML editor, etc.) but I don't have one. Looking in the file I found the line that started with <unit unitid="Pz Kpfw IIIF" unitname="Hartmann" exp="Veteran" number="3" max="3" and had more stuff inside it. I copied that part only (you don'y need the other stuff for a battle plan), and terminated the XML element correctly with the result being <unit unitid="Pz Kpfw IIIF" unitname="Hartmann" exp="Veteran" number="3" max="3"></unit>. This line I pasted into the battle plan files (both First and Mix variants) to get a single unit core force.

Almost done. Now I wanted to have a low number of Soviet forces (remember I wanted very easy battles). So I changed the points attribute for the germans to "200 + RAND(150)" and for the soviets to "100 + RAND(50)", which, if I understand the RAND function correctly will give a total force value o 200-350 points for the germans and 100-150 for the sovs.

That's it. I then loaded my campaign in the RCG and it works a charm.

A note on how auxiliary forces are generated. The type of forces you will get for your auxilliary forces is controlled by the preset attribute. I left mine with the "1st Infantry Div 1941" value because I wanted infantry type forces to accompany my tanks. You can change this to other presets as listed in the "Presets" subdirectory.

Anyway, I hope this (not very well structured) tutorial can help someone get running with their own campaigns.

Edit: the attachment contains the three files I modified.

Cheers
Attachments
RCG_Tut.zip
(2.01 KiB) Downloaded 36 times
kam99
Posts: 146
Joined: Fri Jun 09, 2006 7:49 am
Location: UK

RE: Custom RCG Tutorial

Post by kam99 »

Whiteowl,

This is brilliant. I prefer small battles for the very reasons you have quoted. I too have dabbled with Robert Oleson's excellent (but complicated) Campaign Generator.

Many thanks for this very valuable tutorial and idea.

kam
User avatar
Stridor
Posts: 1391
Joined: Sat Sep 08, 2007 11:01 am

RE: Custom RCG Tutorial

Post by Stridor »

Thanks White Owl for doing this. It seems like you got the hang of it pretty quickly.

As a short cut in generating your core force, you can go into the scenario editor, put down the core units you want. Save the scenario as "test" or whatever, then open the xml up in notepad and cut out the core forces. The just paste them into the battle plan. You may want to remove some of the info which fixes unit position (like x,z,heading, etc) otherwise your placements won't be very random.

Essentially the rule for a battle plan is that at the very least you need an id and a name. Everything else will be randomised according to the settings in the battle plan. Usually it is a good idea to spec a max, you can then add as much as you want to "fix" the platoon all the way down to specifiying the starting location if you want for some specific key battle.

RAND(x) produces random number between 0..(x-1) (eg RAND(10))
RAND(x,y) produced random number between x..y (eg RAND(-10,10))

There are other variables which are found in the documentation (see page 18 of the supplement) but these are really if you are trying to do advanced stuff like auto points balance games without you having to play test them first

points="(%OM * %RM) + (RAND(%ON * %RM *0.25) ?] RAND(%ON * %RM *0.15)) + (%OA * RAND(%ON * %RM * 0.33))"
points="((%EP + %EM + %EN)/3) + (%OA * ((RAND(%EM) + RAND(%EN) + RAND (%EP)) /3) * 0.5) ?] (%OD * RAND(%EP * 0.33))"

These are Erik's GOD equations

Clear as mud?
User avatar
z1812
Posts: 1575
Joined: Wed Sep 01, 2004 12:45 pm

RE: Custom RCG Tutorial

Post by z1812 »

Hi All,

Thanks for your work WhiteOwl. But where do I place this campaign in the folder and will it overwrite anything else.

Thanks John
WhiteOwl
Posts: 122
Joined: Fri Jun 09, 2006 2:04 am
Location: Sydney, Australia

RE: Custom RCG Tutorial

Post by WhiteOwl »

Hi z1812,

You place the random campaign xml file in the <GAME_INSTALL_DIRECTORY>\Data\Random Campaigns directory, and the battle files in the ..\Data\Battles directory. Now, as long as you don't have other files in those directories with the same name, nothing will be overwritten. If you do the above to the three files I attached, i.e. place the campaign file and the two battle files in the above directories, you will see another option called "German Tank Company" in RCG campaign name dropdown. Once you get those files installed, and if you are so inclined, I recommend you make incremental changes to the campaign file first, and then to the battle files and see how this affects the generated campaigns.

Cheers
Post Reply

Return to “Maps, Models and Mods”