Page 1 of 1

Modding Map Generation?

Posted: Mon May 09, 2016 6:22 pm
by Miletus
Hi chaps,

Further to my question on the main forum about creating more 'open' battlefield maps in Skirmish mode, i.e. battlefields with fewer terrain features, I'm wondering whether this is something that I could do myself...

This leads to a couple of basic questions:

i) Are the Skirmish battlefield maps taken from a folder at random, or are they dynamically generated by the program itself?

ii) If the former, is it possible to edit the folder, by deleting or adding maps?

iii) If the latter, is it possible for users to tweak the map generation algorithm ourselves?

Thanks in advance for any help/advice...

Re: Modding Map Generation?

Posted: Wed May 11, 2016 7:22 am
by pipfromslitherine
The short answer is that yes, the maps are generated by the program when you start a skirmish, and you can indeed tweak the algorithms yourself in a mod. I will leave it to Richard to give you details of where you would alter the logic to change the density of the maps, but the system is set up to allow you to over-ride the default map generation scripting.

Cheers

Pip

Re: Modding Map Generation?

Posted: Wed May 11, 2016 1:10 pm
by Miletus
Thanks Pip, that's good to know.

Over to you, Richard... :D :D :D

Re: Modding Map Generation?

Posted: Thu May 12, 2016 10:53 am
by rbodleyscott
You would first need to go into the Editor and create a new custom campaign, using one of the existing campaigns as a model.

Assuming you are using Pike and Shot: Campaigns and you named your campaign "MyCampaign" it would be saved in

/My Documents/My Games/PSCAMP/CAMPAIGNS/MyCampaign

You then need to look in your main Pike and Shot installation in /Data/Battle/Scripts

Copy the following two files to

/My Documents/My Games/PSCAMP/CAMPAIGNS/MyCampaign/Data/Battle/Scripts

$DEFAULT.BSF
MapGenerateBattle2.BSF

That latter file contains the actual random map generator code.

If you make changes to the copy in your campaign, it will affect battles and skirmishes played using your campaign.

For example, depending on which campaign you copied, changing the value in line 53, 65 or 77 will alter the amount of woods in non-woodland terrain. (Note that some woodland may be placed on the map even if the value of open is 100).

Changing the second value on line 112, which is currently hills = Rand(0,8);, would affect the frequency of hills in agricultural and woodland terrain.

Re: Modding Map Generation?

Posted: Thu May 12, 2016 3:51 pm
by Miletus
Thanks Richard, I'll give it a go!