Army Lists

rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28323
Joined: Sun Dec 04, 2005 6:25 pm

Re: Army Lists

Post by rbodleyscott »

kronenblatt wrote: Tue Jul 29, 2025 7:25 am
rbodleyscott wrote: Tue Jul 29, 2025 7:22 am
kronenblatt wrote: Tue Jul 29, 2025 6:35 am There also seems to be a cap (256) to the total number of units that are loaded/shown for unit selection. All the unit types and their maximum numbers show fine in the army selection stage (see first picture below), but when having created the battle, at unit selection stage (see second picture) the interface only shows 256 units in total, cutting off in the order set in armylist.txt. (Please note the Nubian Archers cutoff: Nubian Archers is the 13th unit type in an army list of 21 unit types (each with a max of 20 units), so cuts them off at 16 units to sum up to 256 units in total, 12*20 + 16 = 256.)

Can this be altered or is it hardcoded?
Not exactly hardcoded, but the problem is that the game stores units prior to unit selection in the border of the map behind the player's table-edge. There simply aren't enough squares in the border to store unlimited number of units.
Aha, I see. So can't really be altered by me in any way? (I'd ideally like twice that amount, e.g., 512, or at least something around 400.)
Well you might be able to increase it somewhat.

Try altering MAX_BATTLE_UNITS in Macros.bsf until it falls over. I think 512 would probably be doable.

The absolute maximum (I think) would be 896 and then only if the playable map width isn't less than 32.
Richard Bodley Scott

Image
kronenblatt
General - Carrier
General - Carrier
Posts: 4691
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Army Lists

Post by kronenblatt »

rbodleyscott wrote: Tue Jul 29, 2025 8:18 am
kronenblatt wrote: Tue Jul 29, 2025 7:25 am
rbodleyscott wrote: Tue Jul 29, 2025 7:22 am

Not exactly hardcoded, but the problem is that the game stores units prior to unit selection in the border of the map behind the player's table-edge. There simply aren't enough squares in the border to store unlimited number of units.
Aha, I see. So can't really be altered by me in any way? (I'd ideally like twice that amount, e.g., 512, or at least something around 400.)
Well you might be able to increase it somewhat.

Try altering MAX_BATTLE_UNITS in Macros.bsf until it falls over. I think 512 would probably be doable.

The absolute maximum (I think) would be 896 and then only if the playable map width isn't less than 32.
Tried 400 and 512, but unfortunately neither seems to work. :(
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
rbodleyscott
Field of Glory 2
Field of Glory 2
Posts: 28323
Joined: Sun Dec 04, 2005 6:25 pm

Re: Army Lists

Post by rbodleyscott »

kronenblatt wrote: Tue Jul 29, 2025 8:46 am
rbodleyscott wrote: Tue Jul 29, 2025 8:18 am
kronenblatt wrote: Tue Jul 29, 2025 7:25 am

Aha, I see. So can't really be altered by me in any way? (I'd ideally like twice that amount, e.g., 512, or at least something around 400.)
Well you might be able to increase it somewhat.

Try altering MAX_BATTLE_UNITS in Macros.bsf until it falls over. I think 512 would probably be doable.

The absolute maximum (I think) would be 896 and then only if the playable map width isn't less than 32.
Tried 400 and 512, but unfortunately neither seems to work. :(
It is probably because some of the functions involved make use of the system Array SetArray() and GetArray() functions which use the system array that only has 256 elements.

This could be got around by substituting a global array, but that might be a lot of work. (Which I don't really have time to do).
Richard Bodley Scott

Image
kronenblatt
General - Carrier
General - Carrier
Posts: 4691
Joined: Mon Jun 03, 2019 4:17 pm
Location: Stockholm, SWEDEN

Re: Army Lists

Post by kronenblatt »

rbodleyscott wrote: Thu Jul 31, 2025 9:38 am
kronenblatt wrote: Tue Jul 29, 2025 8:46 am
rbodleyscott wrote: Tue Jul 29, 2025 8:18 am

Well you might be able to increase it somewhat.

Try altering MAX_BATTLE_UNITS in Macros.bsf until it falls over. I think 512 would probably be doable.

The absolute maximum (I think) would be 896 and then only if the playable map width isn't less than 32.
Tried 400 and 512, but unfortunately neither seems to work. :(
It is probably because some of the functions involved make use of the system Array SetArray() and GetArray() functions which use the system array that only has 256 elements.

This could be got around by substituting a global array, but that might be a lot of work. (Which I don't really have time to do).
That’s fine, Richard. I will work with what I have, in this case 256 units in each army list: good sometimes to have scarce resources. Thanks for having looked into this anyway! :)
kronenblatt's campaign and tournament thread hub:

https://www.slitherine.com/forum/viewtopic.php?t=108643
Post Reply

Return to “Field of Glory II: Modding”