Page 1 of 1
Unit Limit ... 64 / Side
Posted: Wed Nov 24, 2010 12:25 pm
by Merr
Gentlemen,
While creating a scenario I came across the Unit Limit ... 64 for each side
This includes units loaded onto other units .... infantry in a transport counts as 2.
This also means you can't add any units with code ... ie, reinforcements ... I tested this.
It appears the code starts looking at the UNIT_COUNT inside the BAM file, per side. If it's 64, you're at maximum, meaning you can never add more, even if the actual unit count on the map is less.
So, if you design a scenario with reinforcements, ensure your unit_count (shown in upper left corner in Editor) is less than 64.
Example, if you want 10 units to arrive later in the scenario, your intial unit_count cannot exceed 54 for that side.
The easy solution is for Slitherine to increase unit count to 128. Why? Because if we are using the Random Enemy PLUGIN and trying to create a random force of units from a total unit_count of 64 it will leave us no room to add more units later, if we wanted to. Also, being stuck with a max of 64 will limit the random generation ... think of it, using max teams of 8 teams, that's 8 units per team, total 64 units ... not much to play with.
Anyway, this post is just an advisory, not a gripe.
merr
Posted: Wed Nov 24, 2010 1:06 pm
by PirateJock_Wargamer
What would happen if you didn't place units via the BAM file but added and placed them in BSF, e.g. in the PreBattleSetup function?
Posted: Wed Nov 24, 2010 2:13 pm
by Merr
PirateJock wrote:What would happen if you didn't place units via the BAM file but added and placed them in BSF, e.g. in the PreBattleSetup function?
Good question ... hmmm.
If you don't start with units in the BAM, then the UNIT_COUNT would read 0 ... so now you can add up to 64 units via a BSF.
I tested this ... I made a scenario with 0 units for side(0), vs 5 King Tigers.
Then, I added this code in my scenario BSF ...
Code: Select all
include "functions.bsf"
FUNCTION StartTurn(side)
{
if( GetTurn() >= -1 )
{
//PlaceUnit(x, y, facing, side, team, type)
PlaceUnit(17, 17, 1, 0, 0, "sherman") ;
PlaceUnit(17, 17, 1, 0, 0, "sherman") ;
}
}
This generated 4 Shermans every turn ... Now, even though the code stated 2 (on top of the same x/y), it generated 4 for some reason. No matter, good to know though.
Anyway, it stopped generating shermans when the total side(0) count reached 64 ... including destroyed units.
In my test, the tally was 54 active shermans, and 10 destroyed shermans, totalling 64.
So, 64 is the limit ... BAM + BSF = 64.
Good test ... Thanks for asking Pirate ... validates my intial finding.
Merr
Posted: Wed Nov 24, 2010 3:30 pm
by PirateJock_Wargamer
Impressive turnaround time on testing
I assume you mean 4 Shermans appear on every Allied turn ... as the code is in the StartTurn function you're getting 2 from the intervening Axis turn as well as from the start of your Allied turn. But still confirms a 64 unit limit, including destroyed units. You could try RemoveUnit(id, flags) to get rid of killed units to possibly give you more scope for topping up units to 64.
Do you think you'd use more than 64 units a side? I have enough trouble keeping track of 30 - 40 a turn

Also how big a map would you need to be able to give them enough space. Now if it was Eastern Front with waves of infantry ....
Cheers
Posted: Wed Nov 24, 2010 6:02 pm
by Merr
PirateJock wrote:
I assume you mean 4 Shermans appear on every Allied turn ... as the code is in the StartTurn function you're getting 2 from the intervening Axis turn as well as from the start of your Allied turn. But still confirms a 64 unit limit, including destroyed units.
Ahh, yes ... double units for each sides turn ... that explains it, thanks.
You could try RemoveUnit(id, flags) to get rid of killed units to possibly give you more scope for topping up units to 64.
This won't help ...Example, Using the BULLDOZE action, which has code that will RemoveUnit ... my test show'd that even bulldozed units will count towards the 64.
Do you think you'd use more than 64 units a side? I have enough trouble keeping track of 30 - 40 a turn

Also how big a map would you need to be able to give them enough space. Now if it was Eastern Front with waves of infantry ....
Well, if it was a longwinded scenario with reinforcement's it might reach the limit. I found this limit when playing with the Random Enemy PLUGIN ... To make it more random for the choice I don't want it to be limited to 64 units when I want to generate a final random force of 20 or less.
But yes ... 64 is already a whopping amout

... anything higher might be ridiculous.
For now, it's a limit to the plugin, mostly.
Merr
Posted: Sat Mar 05, 2011 4:01 am
by junk2drive
I just ran into a new 64 limit. I added my Japan items to your Son items in the Anim folder.
I get "Too many battle meshes (campaign and core ANIM). Max is 64"
There are less than 64 items in my campaign anim folder.
Posted: Sat Mar 05, 2011 5:18 pm
by pipfromslitherine
It loads up the contents of the core and the campaign animations. One way you could overcome any limit you are hitting would be to override the animations found in the core folder with yours (it will not load up the core animation if it finds the same one in your local folder).
Are there a lot of animations in your campaign folder? It seems like 64 should be enough, but perhaps I need to increase the limit.
Cheers
Pip
Posted: Sat Mar 05, 2011 5:36 pm
by junk2drive
Merr has 26 items (s3f, s4f, dds) for his para drop, flak, bridge mod. I have 30 items in my Pacific mod for flags and planes.
I deleted the sf3, the bridge mod, and finally the Corsair to get it down to where it would work (31 items).
Posted: Sun Mar 06, 2011 1:33 pm
by Merr
pipfromslitherine wrote:I
It seems like 64 should be enough, but perhaps I need to increase the limit.
Cheers
Pip
Pip .... If it's no trouble ... Boost it to
128 please ... Would the only down side be that you'd need more memory or better graphics FX to handle the extra load?
thnx
Posted: Sun Mar 06, 2011 5:30 pm
by pipfromslitherine
I'll take a look to make sure it wouldn't break anything
Cheers
Pip
Posted: Sun Mar 06, 2011 8:53 pm
by Merr
pipfromslitherine wrote:I'll take a look to make sure it wouldn't break anything
Cheers
Pip
Ok ... Thanks Pip ... As always, it's not a big deal ... but ... I had another concept that wouldn't work unless the bar was raised ...
The idea? .... MultiPlayer Reinforcement Bonus .... Basically, when you have reincforcements it adds to the 64 cap ... The idea was to allow reinforcements to be player control using a bonus button and for large battles it would prevent that.
So, I know you wouldn't start the game with 128 units (or perhaps bump it up to 1024 !!) , but concepts like Tank Crews, Abandon Vehicle reclaiming, and such would work better if the cap was lifted. Other ideas would be like Squad Splitting or Fire Teams ... you know, like in Squad Leader ... the Half Squad concept.
Thnkx.
Posted: Sun Mar 06, 2011 10:40 pm
by pipfromslitherine
Increasing the unit count is a much larger issue. I was really only talking about the animations.
Cheers
Pip
Posted: Tue Apr 19, 2011 8:29 pm
by Larac
Would gladly test 128 Units per side change if you need it worked through.
Being able to do Half Squads could be good.
Lee