Pike Re-Balance Workshop

Field of Glory II is a turn-based tactical game set during the Rise of Rome from 280 BC to 25 BC.
Paul59
General - King Tiger
General - King Tiger
Posts: 3863
Joined: Tue Jul 21, 2015 11:26 pm

Re: Pike Re-Balance Workshop

Post by Paul59 »

Schweetness101 wrote: Wed Apr 01, 2020 5:57 pm
Geffalrus wrote: Wed Apr 01, 2020 2:56 am I second Schweetness's question about how easy it would be to mod this so that some of these changes could be tested out.
So from looking at the modding guides so far, here's what I've been able to figure out:

I want to make a singleplayer custom battles mod only at first. So, I made a new folder in:

C:\Users\MyName\Documents\My Games\FieldOfGlory2\CAMPAIGNS

called:

PIKE_MOD

inside PIKE_MOD folder I have a TEXT1.TXT with a single line that says:

IDS_CAMPAIGN_NAME,"Test Pike Mod",

which allows me to 'launch' the mod from the custom battles module window where it shows as having the name Test Pike Mod

also inside of PIKE_MOD folder I have a "Data" folder, and inside of Data I have pasted the

Squads.csv
Squads.xlsx
Actually, I have read your post again, and I can see where you have gone wrong.

The Squads.csv file should sit directly in the main mod folder, NOT in the Data sub folder. Confusingly the file structure for mods is often different than the main game, and this is one example.

If you have my TT Mod, just open the folder and see where I have put all the files.

Obviously, the other points I made in my first post are still relevant.
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
Schweetness101
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 928
Joined: Tue Nov 29, 2016 6:12 am

Re: Pike Re-Balance Workshop

Post by Schweetness101 »

Thanks for the response Paul!?

I do have the #REPLACE text in A1, but I only edited ManCount before, now I've tried editing all three of them for the Pike unit on the 3rd row here:

https://imgur.com/hzbiqAt

with these values for TotalMen and UnitSize:
TotalMen UnitSize
720 900

but it is not yet having any effect in game after launching the module. Is that Pike line the wrong one?

You can see here my file structure with the weird lock file:

https://imgur.com/a/HMA1FT9

I've also tried editing the values in notepad and deleting the lock file in case openoffice is messing it up but I haven't managed to get it to work with that either.

*I just saw your new post and tried putting Squads.csv in the main mod folder and not in Data but still that hasn't gotten it to take hold. Do I need Squads.xslx? I now have it like this:

https://imgur.com/WTGU6iO

Thanks for any help.
My Mods:
Ancient Greek https://www.slitherine.com/forum/viewtopic.php?p=977908#p977908
Dark Ages Britain https://www.slitherine.com/forum/viewtopic.php?t=106417
Anarchy (Medieval) https://www.slitherine.com/forum/viewtopic.php?p=987488#p987488
Paul59
General - King Tiger
General - King Tiger
Posts: 3863
Joined: Tue Jul 21, 2015 11:26 pm

Re: Pike Re-Balance Workshop

Post by Paul59 »

Schweetness101 wrote: Wed Apr 01, 2020 7:18 pm
*I just saw your new post and tried putting Squads.csv in the main mod folder and not in Data but still that hasn't gotten it to take hold. Do I need Squads.xslx? I now have it like this:

https://imgur.com/WTGU6iO

Thanks for any help.
No, Squads.xslx is not read by the game at all. It is only there because some prefer to edit the Squads.xslx and then save it as the Squads.csv. Apparently it is easier, but I have always just edited the Squads.csv directly.

I cannot see what is wrong now, it should work. Maybe the Open Office Calc is the problem. Your best bet is to send the mod folder to me via a link in a pm, and I will have a look at it for you.
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
Schweetness101
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 928
Joined: Tue Nov 29, 2016 6:12 am

Re: Pike Re-Balance Workshop

Post by Schweetness101 »

It worked finally! I just deleted all the squads files and recopied over and re-edited without using openoffice.

How do I decrease the number of models/rows in the pike unit?

Also, can I make altogether new units just by adding a row to squads.csv? Would I then have to add that new unit to army lists for it to show up?

Is there a comprehensive explanation of all the values in squads.csv somewhere?

thanks
My Mods:
Ancient Greek https://www.slitherine.com/forum/viewtopic.php?p=977908#p977908
Dark Ages Britain https://www.slitherine.com/forum/viewtopic.php?t=106417
Anarchy (Medieval) https://www.slitherine.com/forum/viewtopic.php?p=987488#p987488
Paul59
General - King Tiger
General - King Tiger
Posts: 3863
Joined: Tue Jul 21, 2015 11:26 pm

Re: Pike Re-Balance Workshop

Post by Paul59 »

Schweetness101 wrote: Wed Apr 01, 2020 7:55 pm It worked finally! I just deleted all the squads files and recopied over and re-edited without using openoffice.

How do I decrease the number of models/rows in the pike unit?

Also, can I make altogether new units just by adding a row to squads.csv? Would I then have to add that new unit to army lists for it to show up?

Is there a comprehensive explanation of all the values in squads.csv somewhere?

thanks
It must have been Open Office then.

To change the number of models in a unit you alter the ManCount value. But you don't get a choice in how many ranks they deploy, the game allocates that automatically based upon how many figures/models there are in a unit. So 13-16 models deploy in 4 ranks, 9-12 in three, 6-8 in two, 5 in a wedge, 4 and less in one. You can only ever have a unit 4 models wide.

You can make new units by adding a row in the squads.csv, you will need to give it a unique ID number (column B) and squads name (column A).

You then need to give it a name and UI information strings by adding those to the mods text files, you can see how that's done if you have the TT Mod or Silk Road Mod.

For the new unit to work in Custom Battles you will have to add it to the ArmyList.txt. So copy that into your Mod folder, it goes straight into the main mod folder (NOT a Core sub folder), you should be able to figure out how the ArmyList.txt works, it's not too hard!

Here is a description from Richard on all the Squads.csv values;

https://www.slitherine.com/forum/viewto ... 92&t=80096


cheers
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
Schweetness101
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 928
Joined: Tue Nov 29, 2016 6:12 am

Re: Pike Re-Balance Workshop

Post by Schweetness101 »

Thanks again Paul!

And a few more questions:

Where do I edit POAs? I see there are unit type columns like offensive_spearmen that have the value 100 under them for offensive spearmen and 0 for non offensive spearmen. Is 100 there a POA or just acting as a boolean?

Also, where could I edit:

the deep pike effect?
cohesion test modifiers by unit?
terrain modifiers by unit?
effect on POAs of cohesion and order states (like remove POA for being on rough terrain or fragmented etc...)
pushback chance
altering POAs of other units (like how units lose impact POA vs lancers in open kind of thing)

thanks
My Mods:
Ancient Greek https://www.slitherine.com/forum/viewtopic.php?p=977908#p977908
Dark Ages Britain https://www.slitherine.com/forum/viewtopic.php?t=106417
Anarchy (Medieval) https://www.slitherine.com/forum/viewtopic.php?p=987488#p987488
Paul59
General - King Tiger
General - King Tiger
Posts: 3863
Joined: Tue Jul 21, 2015 11:26 pm

Re: Pike Re-Balance Workshop

Post by Paul59 »

Schweetness101 wrote: Wed Apr 01, 2020 8:43 pm Thanks again Paul!

And a few more questions:

Where do I edit POAs? I see there are unit type columns like offensive_spearmen that have the value 100 under them for offensive spearmen and 0 for non offensive spearmen. Is 100 there a POA or just acting as a boolean?
The numbers in the weapon columns denote what percentage of the unit has that capability. So 100 in the Offensive Spear column means that 100% of the unit is Offensive Spear.

To change the POAs you would have to edit the script files. I am not an expert on these, but I think they are in the CombatTools.bsf.
Schweetness101 wrote: Wed Apr 01, 2020 8:43 pm

Also, where could I edit:

the deep pike effect?
cohesion test modifiers by unit?
terrain modifiers by unit?
effect on POAs of cohesion and order states (like remove POA for being on rough terrain or fragmented etc...)
pushback chance
altering POAs of other units (like how units lose impact POA vs lancers in open kind of thing)

thanks
Again, I'm not an expert on scripting, but all these things are governed by the .bsf files. Sometimes what you want to modify can be quite easy, like changing a number, but you need to have experience of working with scripts to be able to do anything more complex.

Here is a basic list of what all the script files do:

https://www.slitherine.com/forum/viewto ... 92&t=80109
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
MVP7
Colonel - Fallschirmjäger
Colonel - Fallschirmjäger
Posts: 1401
Joined: Sun Aug 02, 2015 3:40 pm

Re: Pike Re-Balance Workshop

Post by MVP7 »

Schweetness101 wrote: Wed Apr 01, 2020 8:43 pm Thanks again Paul!

And a few more questions:

Where do I edit POAs? I see there are unit type columns like offensive_spearmen that have the value 100 under them for offensive spearmen and 0 for non offensive spearmen. Is 100 there a POA or just acting as a boolean?

Also, where could I edit:

the deep pike effect?
cohesion test modifiers by unit?
terrain modifiers by unit?
effect on POAs of cohesion and order states (like remove POA for being on rough terrain or fragmented etc...)
pushback chance
altering POAs of other units (like how units lose impact POA vs lancers in open kind of thing)

thanks
Squads.cvs file only allows changing and adding units and nothing more. The values from 0 to 100 under unit types mean the proportion of such unit in the said unit. 100 offensive_spearmen means the unit is 100% offensive spearmen. Byzantine Skutatoi and Archers would be 50 defensive spearmen, 50 bow and 0 for everything else. Irregular foot is 100 light spear and 50 swordsmen etc.

To change the game rules you'll need to know some programming. You can edit the hard coded values from the BSF script files located in Field of Glory II\Data\scripts (and possibly Field of Glory II\Data\Battle\Scripts). Don't change the original files though.
Schweetness101
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 928
Joined: Tue Nov 29, 2016 6:12 am

Re: Pike Re-Balance Workshop

Post by Schweetness101 »

ok thanks again

I do know some programming so I am going to try my hand at the .bsf files. Is there a preferred editor for editing those? Any problem with notepadd++?

And to do so should I place them in the same file structure but inside of the mod folder, aka make folders like:

...Documents\My Games\FieldOfGlory2\CAMPAIGNS\PIKE_MOD\Data\Battle\Scripts
and
...Documents\My Games\FieldOfGlory2\CAMPAIGNS\PIKE_MOD\Data\scripts

?

and is there some equivalent #REPLACE comment that will tell FOG to overwrite with these new values when launching the new module?
My Mods:
Ancient Greek https://www.slitherine.com/forum/viewtopic.php?p=977908#p977908
Dark Ages Britain https://www.slitherine.com/forum/viewtopic.php?t=106417
Anarchy (Medieval) https://www.slitherine.com/forum/viewtopic.php?p=987488#p987488
Paul59
General - King Tiger
General - King Tiger
Posts: 3863
Joined: Tue Jul 21, 2015 11:26 pm

Re: Pike Re-Balance Workshop

Post by Paul59 »

Schweetness101 wrote: Wed Apr 01, 2020 9:34 pm ok thanks again

I do know some programming so I am going to try my hand at the .bsf files. Is there a preferred editor for editing those? Any problem with notepadd++?

And to do so should I place them in the same file structure but inside of the mod folder, aka make folders like:

...Documents\My Games\FieldOfGlory2\CAMPAIGNS\PIKE_MOD\Data\Battle\Scripts
and
...Documents\My Games\FieldOfGlory2\CAMPAIGNS\PIKE_MOD\Data\scripts

?

and is there some equivalent #REPLACE comment that will tell FOG to overwrite with these new values when launching the new module?
Notepad++ is excellent for editing the scripts.

The script files do follow the same file structure when put in mods, so yes, you will need to create those sub folders for the .bsf files that you edit.

There is no equivalent to the #REPLACE comment.
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
Schweetness101
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 928
Joined: Tue Nov 29, 2016 6:12 am

Re: Pike Re-Balance Workshop

Post by Schweetness101 »

great thanks! and I'm off searching through bsf files for the logic I want lol.

I'll be sure to update with my inevitable further questions!
My Mods:
Ancient Greek https://www.slitherine.com/forum/viewtopic.php?p=977908#p977908
Dark Ages Britain https://www.slitherine.com/forum/viewtopic.php?t=106417
Anarchy (Medieval) https://www.slitherine.com/forum/viewtopic.php?p=987488#p987488
Schweetness101
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 928
Joined: Tue Nov 29, 2016 6:12 am

Re: Pike Re-Balance Workshop

Post by Schweetness101 »

here's a few questions:

1) inside of CombatTools.bsf there are a number of functions referenced that must be in some other file, so far I haven't found the definitions for:

Code: Select all

GetUnitX/Y()
GetAttribArray()
do you know where these (and presumably other functions that are used in CombatTools but not defined there) are defined? Do bsf files have some standard reference syntax somewhere?

2) Inside of GetImpactPOA() in CombatTools.BSF, under the Pike section

there are some percent disordered variables near line 4419 like so:

Code: Select all

percent_disordered = Min(PercentDisordered(me, enemy, charging), 100);
percent_severely_disordered = Max(PercentDisordered(me, enemy, charging) - 100, 0);
and the referenced PercentDisordered() function is on line 646 and appears to return whichever disordered state is worse, your terrain or the enemy's terrain if you attacked them, or disorder from elephant proximity

What does it mean to have a percent of disorder? I thought those were discrete values? or are they on a gradient under the hood?

Also, what do GetUnitX() and GetUnitY() do? just get a reference to a unit? it looks like 'me' and 'enemy' can have both an X and Y?

2b) If I wanted to get rid of the pike ranks deep effect in here I could just test for terrain disorder and morale disruption and get rid of references to (percent_12ranks > 0) and (percent_16ranks > 0)? Or I guess I could just comment out the lines like:
increment *= percent_12ranks;
which seem to be responsible for scaling down POAs based on losses

It also checks if enemy = -1, where enemy is a parameter passed into GetImpactPOA(). What does it mean for enemy to be -1? Like if this is being called on yours or an enemy unit? If the enemy unit exists?
It seems to do something similar either way but just print something different?

There's also a check for if percent > 0 where:
percent = GetAttrib(me,"Pike");
what is that percent? percent men remaining or lost? Oh wait I think that's actually the Squads.csv value for percent? As in if a unit is 100% pikes or not?

3) what is all the print stuff all over the place? like, for example:

Code: Select all

  PrintStringIndexedX(1, test, "IDS_CAPABILITY", 11);
  PrintStringLiteralX(1, test, " +");
  PrintIntX(1, test, increment);
  any_printed = 1;
4) in the offensive spearmen section of impact poa we see this:

Code: Select all

// Only get POA if not FRAGMENTED or Severely Disordered
if (GetAttrib(me,"MoraleState") < 2) // If not FRAGMENTED
{
	increment = 100;
        multiplier = Max(0, percent - percent_severely_disordered);
	increment *= multiplier;
	increment /= 100;
}
so it looks like if (GetAttrib(me,"MoraleState") < 2) checks that the unit is not fragmented(2 = fragmented and 1=disrupted and 0=steady it seems)
But where is severely disordered checked? in this line:

Code: Select all

multiplier = Max(0, percent - percent_severely_disordered);
?

Percent should be 100 if it's a normal 100% offensive spear unit I guess, but what sort of values do you get from percent_severely_disordered? because it seems like it should just be discrete values corresponding to slightly, moderately or severely disordered like how morale is 0,1, or 2, but instead it's a percent? what percent range corresponds to slight, moderate, and severe disorder?

Also based on this offensive spear section it looks like (enemy == -1) means that the enemy is charging you? Because for offensive spears if enemy ==-1 then the offensive spears get their normal 100 POA (scaled for disorder and negated for fragmentation) but otherwise they only get their POA if the enemy is not a mounted shocktroop. But then there are also calls to if(charging == 1) so I dunno.

5) in sections like the below for offensive spearmen:

Code: Select all

if (IsMounted(enemy) == 1)
{
	if ((IsShockTroops(enemy) == 1) && (charging == 1))
	{
		increment = 0;
	}
}
the POA is cancelled if charging a certain unit type (in this case IsShockTroops and IsMounted, so basically lancers and I think heavy chariots), that is increment is set to 0, and increment is what's added to POA

I think I would like to do something like that to negate POAs on both sides for Pikes in order to make early disruptions unlikely, but also to prevent pikes from inflicting much damage either. Any ideas for what those values should be and against who? Like should impact foot and pikes cancel each other's POAs?
And on that point, is there a difference between both sides having +200 POA on impact and both sides having +0 POA on impact? Is the disparity and thus the result the same?

sorry this response is already over long so I'll wrap it up even though I have more questions
My Mods:
Ancient Greek https://www.slitherine.com/forum/viewtopic.php?p=977908#p977908
Dark Ages Britain https://www.slitherine.com/forum/viewtopic.php?t=106417
Anarchy (Medieval) https://www.slitherine.com/forum/viewtopic.php?p=987488#p987488
Schweetness101
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 928
Joined: Tue Nov 29, 2016 6:12 am

Re: Pike Re-Balance Workshop

Post by Schweetness101 »

looking at it in further depth now for the pike section within the GetMeleePOA() I think I could alter this section:

Code: Select all


percent_disordered = Min(PercentDisordered(me, enemy, attacking), 100);
percent_severely_disordered = Max(PercentDisordered(me, enemy, attacking) - 100, 0);

// Pike
	percent = GetAttrib(me,"Pike");
	if (percent > 0)
		{
			percent_12ranks = Percent12RanksPike(me);
			percent_16ranks = Percent16RanksPike(me);

			if (percent_12ranks > 0)
				{
					if (enemy == -1)
						{
							if (print == 1)
								{
									any_printed = 1;
									PrintStringIndexedX(1, test, "IDS_CAPABILITY", 18);
									PrintStringLiteralX(1, test, ": +");
									PrintIntX(1, test, percent_12ranks);
									PrintStringLiteralX(1, test, " ");
									PrintStringX(1, test, "IDS_UI_INFO_MELEE_PIKE");
									PrintStringLiteralX(1, test, "\n");
								}

							if (GetAttrib(me,"MoraleState") < 2) // If not FRAGMENTED
								{
									increment = 100 - percent_severely_disordered;  // average vs horse and foot
									increment *= percent_12ranks; // Basic POA only for pikes over 12 ranks deep (equivalent to 3 FOGAM ranks).
									increment /= 100;
									POA += increment;
								}
						}
					else
						{
							if (GetAttrib(me,"MoraleState") < 2) // If not FRAGMENTED
								{
									increment = 100 - percent_severely_disordered;
									increment *= percent_12ranks; // Basic POA only for pikes over 12 ranks deep (equivalent to 3 FOGAM ranks).
									increment /= 100;
									POA += increment;
									if ((print == 1) && (increment > 0))
										{
											if (any_printed == 1)
												{
													PrintStringLiteralX(1, test, ", ");
												}
											PrintStringIndexedX(1, test, "IDS_CAPABILITY", 18);
											PrintStringLiteralX(1, test, " +");
											PrintIntX(1, test, increment);
											any_printed = 1;
										}
								}
						}

					if (percent_16ranks > 0)
						{
							if (enemy == -1)
								{
									if (print == 1)
										{
											any_printed = 1;
											PrintStringX(1, test, "IDS_UNIT_DEEP_PIKE");
											PrintStringLiteralX(1, test, ": +");
											PrintIntX(1, test, percent_16ranks);
											PrintStringLiteralX(1, test, " ");
											PrintStringX(1, test, "IDS_UI_INFO_MELEE_DEEP_PIKE");
											PrintStringLiteralX(1, test, "\n");
										}

									// If unit has large block of pike/heavy weapon/swordsmen and is not disrupted or disordered
									if (GetAttrib(me,"MoraleState") < 1)
										{
											if (percent_disordered == 0)
												{
													increment = percent_16ranks;
													POA += increment;
												}
										}
								}
							else
								{
									if (GetAttrib(me,"MoraleState") < 1) // If not DISRUPTED
										{
											// If unit has large block of pike/heavy weapon/swordsmen, and not disordered
											if (percent_disordered == 0)
												{
													increment = percent_16ranks;
													POA += increment;
													if ((print == 1) && (increment > 0))
														{
															if (any_printed == 1)
																{
																	PrintStringLiteralX(1, test, ", ");
																}
															PrintStringX(1, test, "IDS_UNIT_DEEP_PIKE");
															PrintStringLiteralX(1, test, " +");
															PrintIntX(1, test, increment);
															any_printed = 1;
														}
												}
										}
								}
						}
				}
		}

to just be the following, where I've got a simplistic but perhaps justified implementation for pikes where all of their POA is cancelled by being disrupted or disordered at all:
*I still don't understand how percent_disordered and percent_severely_disordered are being determined/used exactly and why they aren't discrete values like morale.
*Below assuming you want 100 for pike POA just as an example (could do similar to below for impact or melee or both)

Code: Select all

percent_disordered = Min(PercentDisordered(me, enemy, attacking), 100);
percent_severely_disordered = Max(PercentDisordered(me, enemy, attacking) - 100, 0);

// Only get POA If not DISRUPTED or DISORDERED at all
if (GetAttrib(me,"MoraleState") < 1) // if NOT disrupted or fragmented (aka steady)
{
	//and then to account for disorder
	increment = 100 - percent_disordered; //or should do "percent - percent_disordered"? percent should always be 100 for pikes?
	//and would that above remove the whole increment if disordered at all? or would I need to use percent_severely_disordered ? or both?
	increment /= 100;
}
POA += increment;
OR:

Code: Select all

percent_disordered = Min(PercentDisordered(me, enemy, attacking), 100);
percent_severely_disordered = Max(PercentDisordered(me, enemy, attacking) - 100, 0);

// Only get POA If not DISRUPTED or DISORDERED at all
if (GetAttrib(me,"MoraleState") < 1) // if NOT disrupted or fragmented (aka steady)
{
	if(percent_disordered == 0 && percent_severely_disordered == 0)
	{
		increment = 100 ;
		increment /= 100;
	}
}
POA += increment;
should I check both percent_disordered and percent_severely_disordered to make sure a unit is not disordered at all, or if percent_disordered is zero then implicitly percent_severely_disordered is zero?

I didn't include the enemy == -1 and printing bits, just the relevant part for the POA change.

thanks
My Mods:
Ancient Greek https://www.slitherine.com/forum/viewtopic.php?p=977908#p977908
Dark Ages Britain https://www.slitherine.com/forum/viewtopic.php?t=106417
Anarchy (Medieval) https://www.slitherine.com/forum/viewtopic.php?p=987488#p987488
Geffalrus
Lieutenant Colonel - Panther D
Lieutenant Colonel - Panther D
Posts: 1205
Joined: Sun Jan 20, 2019 3:06 pm
Location: Virginia, USA

Re: Pike Re-Balance Workshop

Post by Geffalrus »

Excellent stuff Schweetness. I'm happy to hold off on any additional theorizing until you're ready to implement some testing. :)
We should all Stand With Ukraine. 🇺🇦 ✊
Cunningcairn
Sr. Colonel - Wirbelwind
Sr. Colonel - Wirbelwind
Posts: 1723
Joined: Mon Mar 11, 2013 6:05 am
Location: Christchurch, New Zealand

Re: Pike Re-Balance Workshop

Post by Cunningcairn »

Geffalrus wrote: Thu Apr 02, 2020 2:11 am Excellent stuff Schweetness. I'm happy to hold off on any additional theorizing until you're ready to implement some testing. :)
What a great discussion. Fantastic input from everyone.
Paul59
General - King Tiger
General - King Tiger
Posts: 3863
Joined: Tue Jul 21, 2015 11:26 pm

Re: Pike Re-Balance Workshop

Post by Paul59 »

Schweetness101 wrote: Thu Apr 02, 2020 1:28 am looking at it in further depth now for the pike section within the GetMeleePOA() I think I could alter this section:

Code: Select all


percent_disordered = Min(PercentDisordered(me, enemy, attacking), 100);
percent_severely_disordered = Max(PercentDisordered(me, enemy, attacking) - 100, 0);

// Pike
	percent = GetAttrib(me,"Pike");
	if (percent > 0)
		{
			percent_12ranks = Percent12RanksPike(me);
			percent_16ranks = Percent16RanksPike(me);

			if (percent_12ranks > 0)
				{
					if (enemy == -1)
						{
							if (print == 1)
								{
									any_printed = 1;
									PrintStringIndexedX(1, test, "IDS_CAPABILITY", 18);
									PrintStringLiteralX(1, test, ": +");
									PrintIntX(1, test, percent_12ranks);
									PrintStringLiteralX(1, test, " ");
									PrintStringX(1, test, "IDS_UI_INFO_MELEE_PIKE");
									PrintStringLiteralX(1, test, "\n");
								}

							if (GetAttrib(me,"MoraleState") < 2) // If not FRAGMENTED
								{
									increment = 100 - percent_severely_disordered;  // average vs horse and foot
									increment *= percent_12ranks; // Basic POA only for pikes over 12 ranks deep (equivalent to 3 FOGAM ranks).
									increment /= 100;
									POA += increment;
								}
						}
					else
						{
							if (GetAttrib(me,"MoraleState") < 2) // If not FRAGMENTED
								{
									increment = 100 - percent_severely_disordered;
									increment *= percent_12ranks; // Basic POA only for pikes over 12 ranks deep (equivalent to 3 FOGAM ranks).
									increment /= 100;
									POA += increment;
									if ((print == 1) && (increment > 0))
										{
											if (any_printed == 1)
												{
													PrintStringLiteralX(1, test, ", ");
												}
											PrintStringIndexedX(1, test, "IDS_CAPABILITY", 18);
											PrintStringLiteralX(1, test, " +");
											PrintIntX(1, test, increment);
											any_printed = 1;
										}
								}
						}

					if (percent_16ranks > 0)
						{
							if (enemy == -1)
								{
									if (print == 1)
										{
											any_printed = 1;
											PrintStringX(1, test, "IDS_UNIT_DEEP_PIKE");
											PrintStringLiteralX(1, test, ": +");
											PrintIntX(1, test, percent_16ranks);
											PrintStringLiteralX(1, test, " ");
											PrintStringX(1, test, "IDS_UI_INFO_MELEE_DEEP_PIKE");
											PrintStringLiteralX(1, test, "\n");
										}

									// If unit has large block of pike/heavy weapon/swordsmen and is not disrupted or disordered
									if (GetAttrib(me,"MoraleState") < 1)
										{
											if (percent_disordered == 0)
												{
													increment = percent_16ranks;
													POA += increment;
												}
										}
								}
							else
								{
									if (GetAttrib(me,"MoraleState") < 1) // If not DISRUPTED
										{
											// If unit has large block of pike/heavy weapon/swordsmen, and not disordered
											if (percent_disordered == 0)
												{
													increment = percent_16ranks;
													POA += increment;
													if ((print == 1) && (increment > 0))
														{
															if (any_printed == 1)
																{
																	PrintStringLiteralX(1, test, ", ");
																}
															PrintStringX(1, test, "IDS_UNIT_DEEP_PIKE");
															PrintStringLiteralX(1, test, " +");
															PrintIntX(1, test, increment);
															any_printed = 1;
														}
												}
										}
								}
						}
				}
		}

to just be the following, where I've got a simplistic but perhaps justified implementation for pikes where all of their POA is cancelled by being disrupted or disordered at all:
*I still don't understand how percent_disordered and percent_severely_disordered are being determined/used exactly and why they aren't discrete values like morale.
*Below assuming you want 100 for pike POA just as an example (could do similar to below for impact or melee or both)

Code: Select all

percent_disordered = Min(PercentDisordered(me, enemy, attacking), 100);
percent_severely_disordered = Max(PercentDisordered(me, enemy, attacking) - 100, 0);

// Only get POA If not DISRUPTED or DISORDERED at all
if (GetAttrib(me,"MoraleState") < 1) // if NOT disrupted or fragmented (aka steady)
{
	//and then to account for disorder
	increment = 100 - percent_disordered; //or should do "percent - percent_disordered"? percent should always be 100 for pikes?
	//and would that above remove the whole increment if disordered at all? or would I need to use percent_severely_disordered ? or both?
	increment /= 100;
}
POA += increment;
OR:

Code: Select all

percent_disordered = Min(PercentDisordered(me, enemy, attacking), 100);
percent_severely_disordered = Max(PercentDisordered(me, enemy, attacking) - 100, 0);

// Only get POA If not DISRUPTED or DISORDERED at all
if (GetAttrib(me,"MoraleState") < 1) // if NOT disrupted or fragmented (aka steady)
{
	if(percent_disordered == 0 && percent_severely_disordered == 0)
	{
		increment = 100 ;
		increment /= 100;
	}
}
POA += increment;
should I check both percent_disordered and percent_severely_disordered to make sure a unit is not disordered at all, or if percent_disordered is zero then implicitly percent_severely_disordered is zero?

I didn't include the enemy == -1 and printing bits, just the relevant part for the POA change.

thanks
Sorry, I don't have much of a clue when it comes to the complex scripting. You probably know far more than me!
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
Schweetness101
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 928
Joined: Tue Nov 29, 2016 6:12 am

Re: Pike Re-Balance Workshop

Post by Schweetness101 »

Paul59 wrote: Thu Apr 02, 2020 9:35 am Sorry, I don't have much of a clue when it comes to the complex scripting. You probably know far more than me!
no problem! is there a scripter who visits the forums regularly and knows a little about these bsf files? anyone I could send a pm to?

thanks
My Mods:
Ancient Greek https://www.slitherine.com/forum/viewtopic.php?p=977908#p977908
Dark Ages Britain https://www.slitherine.com/forum/viewtopic.php?t=106417
Anarchy (Medieval) https://www.slitherine.com/forum/viewtopic.php?p=987488#p987488
Paul59
General - King Tiger
General - King Tiger
Posts: 3863
Joined: Tue Jul 21, 2015 11:26 pm

Re: Pike Re-Balance Workshop

Post by Paul59 »

Schweetness101 wrote: Thu Apr 02, 2020 3:45 pm
Paul59 wrote: Thu Apr 02, 2020 9:35 am Sorry, I don't have much of a clue when it comes to the complex scripting. You probably know far more than me!
no problem! is there a scripter who visits the forums regularly and knows a little about these bsf files? anyone I could send a pm to?

thanks
Well of course Richard is the expert, he works with these scripts all the time. Otherwise amongst the modders Cronos09 seems to be very capable with scripts.
Field of Glory II Scenario Designer - Age of Belisarius, Rise of Persia, Wolves at the Gate and Swifter than Eagles.

Field of Glory II Medieval Scenario Designer.

FOGII TT Mod Creator

Warhammer 40,000: Sanctus Reach Tournament Scenario Designer.
Schweetness101
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 928
Joined: Tue Nov 29, 2016 6:12 am

Re: Pike Re-Balance Workshop

Post by Schweetness101 »

Ok great!

one other thing, how can I use the editor to make a simple 1 pike vs 1 other unit battle using a mod just to test changes incrementally?
My Mods:
Ancient Greek https://www.slitherine.com/forum/viewtopic.php?p=977908#p977908
Dark Ages Britain https://www.slitherine.com/forum/viewtopic.php?t=106417
Anarchy (Medieval) https://www.slitherine.com/forum/viewtopic.php?p=987488#p987488
Schweetness101
Captain - Heavy Cruiser
Captain - Heavy Cruiser
Posts: 928
Joined: Tue Nov 29, 2016 6:12 am

Re: Pike Re-Balance Workshop

Post by Schweetness101 »

Geffalrus wrote: Thu Apr 02, 2020 2:11 am Excellent stuff Schweetness. I'm happy to hold off on any additional theorizing until you're ready to implement some testing. :)
I could do with some suggestions now. I've been testing a few things and have realized/need design help on:

1) If I reduce pike unit size to 480 and models to 8 then they automatically become maneuverable, so maybe that is attached to unit size somewhere, or like if size = 480 and not tagged as undrilled then maneuverable, something like that, I'll look around. They also automatically lose ability to go into square, so that must also be tied to unit size. That also brings up, should pikes be maneuverable?
2) also with such a reduction in size all of the impact and melee POAs are nullified, so if we want to reduce the pike unit size that much then I think I would also have to get rid of any filters on percent_12ranks and percent_16ranks at all to make their POAs work, so the question is, before I proceed, what should the pike unit size be?
3) Also, should pikes have gradually reduced effectiveness from open to rough to difficult terrain, or only get POAs in open terrain and lose all of them if disordered at all?
4) same story as 3 for morale state.
5) what should the special cases be for pikes negating others or their own POAs on making or receiving charges from other unit types? I assume keep their loss of POA on charging lancers, but perhaps they lose their POA against one another and mutually against impact foot or what?
6) I'm not sure how to do it yet, but what should special cohesion test effects for pikes be? Extra -1 to CT on being flanked? extra -1 in rough terrain? extra + 1 in open? etc...
7) Should I still look around for square and get rid of it even if we keep larger unit size?
eight) should I change unit quality or push back chances?


I'm in a position where I now know how to edit a lot of the things that have been discussed, but some edits are dependent on doing or not doing others, so we need to address the design considerations before proceeding, or I could just pick something and do it.
My Mods:
Ancient Greek https://www.slitherine.com/forum/viewtopic.php?p=977908#p977908
Dark Ages Britain https://www.slitherine.com/forum/viewtopic.php?t=106417
Anarchy (Medieval) https://www.slitherine.com/forum/viewtopic.php?p=987488#p987488
Post Reply

Return to “Field of Glory II”