Random Map Mode

Under Construction

Unfortunately Random Map Mode has not been set in up Cossacks 2 as it was in Cossacks I and American Conquest. But you can get it back in there. If you have the game Alexander, have aswell a look how it has been set up there.
There are various things to consider when enabling this mode for Cossacks 2. You will need to change the interface, you will need to set up the random map generation, the start parameters, possibly do some changes to the nations aswell to allow for playability, create samples and a couple more things. I'll try to cover as much as possible.
First off all you need to create an interface that allows for this mode. You can choose to rebuild the entire interface, or edit the existing one. I suggest you copy the existing one and rename it.
Fire up the game and go to map editor, access the dialogs editor ( CTRL +E ) . For more information on how to use the dialogs editor see this page .
Load Data\Dialogs\v\M_Battles.dialogsystem.xml.
It will look like this:
1. Interface Child Dialogs
2. Selected Child Dialog Options
Change the interface so that the player can select random map mode besides the skirmish and battle options, and create room for start options.
This is what I'v changed it in to for the Random Map Mode:
1. Use Tab buttons & Tab Desks to switch between the game modes.
2. Start Options, if you have problems setting this up, use this file (insert link) , put it in your dialogs folder, open up, and copy ( ctrl +c ) the parts you have problems with and paste them ( ctrl+v ) in your own M_Battles.Dialogssystem.xml
Random Map Parameters use Index numbers to link to the various entries in the related files: eg:
In this case you can see to get the Victory ComboBox to show up properly you will need Index number 3 as shown on the picture.
Once you have created your new interface , save it as data\dialogs\v\MOD_Battles.dialogssystem.xml

Next: you have to "enable" this interface , so the game knows that it needs to load up this dialogsystem.
Find Data\Dialogs\MainMenu.xml and look for the line :
and change it to the name of your dialogsystem:
Start up the game, go to single player and see if your changes are present.

Next: set up the start parameters. Go to Map Editor -< CTRL +E --> RandomMap Params.
Setup the amount of starting resources for each option.
Set up the start positions.
Whatever you set up here will show up in the drop down list in the random map options:
Note that the default start positions refer to samples from Alexander, and are not present, so you will have to create your own starting samples and swop them out.
For more information about this I refer to the  Random Map Params editor page.

You should also check the textures and objects it's generating for the layers on start trough the ExTerrainEditor.
Again, because everything was set up for Alexander, so it generates the wrong trees, sometimes terrain at unexpected height ( because the global map height in Alexander is  0 and in Cossacks 2 its 50).

Next thing to consider is: Resources: how will players obtain these without the automated villages that are created on the regular skirmish maps.
You will have to add entries to the various nation.nds files to allow peasants to build mines, farms,... . For more information about NDS files see here.

Next: thing to consider is adding a button for this Random mode in the single player menu.
Again use dialogs editor to change data\dialogs\v\M_Single.dialogssystem.xml

By now you have done enough changes to allow for a test. Go to single player --> Random. Don't change any of the settings yet. Just hit the start button and see if it starts generating terrain.
Once it works, then focus on changing the options, terrain, resources,  start pieces etc...
Test all start options you have added out to see if no problems arise.

Note: the AnnihilateHero Victory Condition. It is very likely if you try to start up a game in random mode with this condition selected, you will either get a defeat or victory message on starting of the map. It is simply because no "heroes" have been defined in the game.
However you can add them if you feel like doing so. What this option does is give the player a pre-defined unit which acts as a "general - hero " or unit that has to be killed by the opponent.
You can set these up trough the Unit Type Group Editor by ticking the 'hero' button next to the related entry. As for the set up of the heroes and their abilities I refer to the UnitAbility Editor.
If you set up everything right , on generating a map with this random mode you will get something like this:
1. Player start pieces as defined in RndMapParams.
2. Heroes
3. Display of game mode.
This Map was generated with following options:

Next: thing to consider is the AI. Right now its a sitting duck and entirely dependant on its starting resources as it cannot build farms ( except Russia) and mines.
So you will have to change the various nation.ai.xml file's aswell.
For more information about the AI i refer to the pages on Started AI Script.
You should add the farms, mines, etc to the Building Folder and then in the Actions set up a "Build" Action for these buildings and its various options ( max amount, etc,...)
Again test frequently how the AI behaves on your random maps.

There are possibly more things that I have forgotten to mention. If you have problems or suggestions, leave a message in the forum.