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...
Modding Map Generation?
Moderators: rbodleyscott, Slitherine Core, Gothic Labs
Modding Map Generation?
Cheers,
Miletus.
"Ask not for whom the bell tolls -
just answer the door already!"
Miletus.
"Ask not for whom the bell tolls -
just answer the door already!"
-
- Site Admin
- Posts: 9872
- Joined: Wed Mar 23, 2005 10:35 pm
Re: Modding Map Generation?
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
Cheers
Pip
follow me on Twitter here
Re: Modding Map Generation?
Thanks Pip, that's good to know.
Over to you, Richard...

Over to you, Richard...



Cheers,
Miletus.
"Ask not for whom the bell tolls -
just answer the door already!"
Miletus.
"Ask not for whom the bell tolls -
just answer the door already!"
-
- Field of Glory 2
- Posts: 28294
- Joined: Sun Dec 04, 2005 6:25 pm
Re: Modding Map Generation?
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.
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.
Richard Bodley Scott


Re: Modding Map Generation?
Thanks Richard, I'll give it a go!
Cheers,
Miletus.
"Ask not for whom the bell tolls -
just answer the door already!"
Miletus.
"Ask not for whom the bell tolls -
just answer the door already!"