Maximum number of units reached !
Moderator: MOD_EIA
- DCWhitworth
- Posts: 676
- Joined: Sat Dec 15, 2007 1:20 am
- Location: Norwich, England
Maximum number of units reached !
I've just hit an error trying to create a garrisonin PBEM game just updated to v1.05.03.
When I try to place a garrison it says "Maximum number of units reached ! Try reducing number of garrisons"
I do have quite a lot of garrisons down but I'm sure I've had more in previous games.
When I try to place a garrison it says "Maximum number of units reached ! Try reducing number of garrisons"
I do have quite a lot of garrisons down but I'm sure I've had more in previous games.
Regards
David
David
RE: Maximum number of units reached !
Seems odd that this would even be a problem. Why would there be a maximum number of garrisons? Am I forgetting some rule?
RE: Maximum number of units reached !
No, you're not forgetting anything. It's an error or a bug.
Dave:
Have you posted on Mantis?
best,
Mardonius/Varick
Dave:
Have you posted on Mantis?
best,
Mardonius/Varick
"Crisis is the rallying cry of the tyrant" -- James Madison
"Yes, you will win most battles, but if you loose to me you will loose oh so badly that it causes me pain (chortle) just to think of it" - P. Khan
"Yes, you will win most battles, but if you loose to me you will loose oh so badly that it causes me pain (chortle) just to think of it" - P. Khan
RE: Maximum number of units reached !
It seems there is a maximum number of garrisons, not per nation but in total. Once reached you have to destroy a garrison in order to build a new one. It can get quite gamey.
RE: Maximum number of units reached !
Why would there be a maximum? This doesn't make sense and should change.
INT_MAX is 32767, which that's to say he even used int, which would be a waste since there isn't a negative garrison. UINT should have been used which has a max of 65535.
Are you telling me there is 65535 garrisons on the board in your game!!??? WOW, that's a TON!![8|]
And this isn't even considering the fact that a long uint could have been used, among others (long long uint).
INT_MAX is 32767, which that's to say he even used int, which would be a waste since there isn't a negative garrison. UINT should have been used which has a max of 65535.
Are you telling me there is 65535 garrisons on the board in your game!!??? WOW, that's a TON!![8|]
And this isn't even considering the fact that a long uint could have been used, among others (long long uint).
RE: Maximum number of units reached !
The type is not a particularly important consideration. Generally speaking, the greater problem is simply the storage cost -- particularly if the PBEM files encode the full game state rather than deltas.
Incidentally, last I checked (which was a long time ago), PBEM files were *extremely* compressible (losslessly). Likewise, if you start a 1.05.03 solo game as France and save before you've placed any troops, the resulting sav.dat file (in my case) was 12,114,729 bytes. This is easily compressed to 94,293 bytes, implying an awful lot of redundancy. Specifically, it's mostly full of 64-bit -1s and 0s. This is suggests than that it's a dump of fixed-size records, regardless of whether these records are actually interesting. And if you're doing that, you probably have fixed-size arrays of records in memory rather than heap-based structures, which forces you to do bounds checking unless you choose a very high limit. This be very space-inefficient if the maximum limit is much higher than is likely, although it /might/ be fast to load (balance increased I/O with less dynamic memory allocation).
(In the case of EiANW, there should be a strict upper bound computable -- at most one garrison per city per possible nation (all majors -- double-count if militia and inf garrisons treated separately, all minors with corps, other minors if home or if a kingdom component, all kingdoms), ditto per depot. Addn'l units must be from counter pools, which are of fixed size.)
Incidentally, last I checked (which was a long time ago), PBEM files were *extremely* compressible (losslessly). Likewise, if you start a 1.05.03 solo game as France and save before you've placed any troops, the resulting sav.dat file (in my case) was 12,114,729 bytes. This is easily compressed to 94,293 bytes, implying an awful lot of redundancy. Specifically, it's mostly full of 64-bit -1s and 0s. This is suggests than that it's a dump of fixed-size records, regardless of whether these records are actually interesting. And if you're doing that, you probably have fixed-size arrays of records in memory rather than heap-based structures, which forces you to do bounds checking unless you choose a very high limit. This be very space-inefficient if the maximum limit is much higher than is likely, although it /might/ be fast to load (balance increased I/O with less dynamic memory allocation).
(In the case of EiANW, there should be a strict upper bound computable -- at most one garrison per city per possible nation (all majors -- double-count if militia and inf garrisons treated separately, all minors with corps, other minors if home or if a kingdom component, all kingdoms), ditto per depot. Addn'l units must be from counter pools, which are of fixed size.)
--
Not a grognard.
Not an optimizer. It's a game to me, not a job.
Not a grognard.
Not an optimizer. It's a game to me, not a job.
RE: Maximum number of units reached !
I'm don't see how the number of garrisons on the board has a more than insignificant effect on file size. It doesn't take that much extra space in a text file to go from 1 to 100, etc. Now, if we were talking about the number of places of garrisons, then that might be another story.
Any word on this Marshall?
Any word on this Marshall?
- DCWhitworth
- Posts: 676
- Joined: Sat Dec 15, 2007 1:20 am
- Location: Norwich, England
RE: Maximum number of units reached !
Well we need to stop quibbling about programming issues I think. this one is a game breaker and needs to be resolved.
Regards
David
David
RE: Maximum number of units reached !
I think the "gamebreaker" depends on what the limit is. If the limit is really high it could just be annoying and could be put on the backburner, but if it's fairly low and fairly often gets reached by games, both AI and PBEM, then it needs to come to the front.
RE: Maximum number of units reached !
I've hit this limit a few times playing against the AI, when I had conquered and garrisoned everything, built a bunch of free state corps, lots of fleets and so on. I suppose one could end up with a similar number of units on the board in a pbem game if the players have got their armies built out and have garrisoned everything among them, especially if there are garrisons in non-capitals, but I wouldn't have expected it. Or maybe the limit has decreased in 1.05.
In any case, there really shouldn't be a limit.
In any case, there really shouldn't be a limit.
- DCWhitworth
- Posts: 676
- Joined: Sat Dec 15, 2007 1:20 am
- Location: Norwich, England
RE: Maximum number of units reached !
ORIGINAL: NeverMan
I think the "gamebreaker" depends on what the limit is. If the limit is really high it could just be annoying and could be put on the backburner, but if it's fairly low and fairly often gets reached by games, both AI and PBEM, then it needs to come to the front.
The limit isn't that high. We've hit it in a game and it's breaking it. It's 1808 with serious tension between France, Prussia and Russia.
Regards
David
David
RE: Maximum number of units reached !
The limit was either basically new or significantly lowered by the time 1.04x hit -- I'm pretty sure I've run amok in single-player with an *entirely* full and on-board French army + garrisoned French provincial capitals + full COTR + full Ottoman Empire, and heavily garrisoning just about every one of those minors as well... and that I could not replicate this in 1.04x without hitting the limit. I don't think the AI got so much better at preserving corps that the difference in the AI's on-board counters would have accounted for it.
--
Not a grognard.
Not an optimizer. It's a game to me, not a job.
Not a grognard.
Not an optimizer. It's a game to me, not a job.
- MarshallEllis
- Posts: 5632
- Joined: Tue Oct 02, 2001 3:00 pm
- Location: Dallas
RE: Maximum number of units reached !
Hey guys:
We have a limit of 550 units on the board but this was given before we allowed multiple nations' garrisons in the same city. We probably need to bump this up a bit.
Does this game have garrisons in almost all cities?
We have a limit of 550 units on the board but this was given before we allowed multiple nations' garrisons in the same city. We probably need to bump this up a bit.
Does this game have garrisons in almost all cities?
- DCWhitworth
- Posts: 676
- Joined: Sat Dec 15, 2007 1:20 am
- Location: Norwich, England
RE: Maximum number of units reached !
ORIGINAL: Marshall Ellis
Hey guys:
We have a limit of 550 units on the board but this was given before we allowed multiple nations' garrisons in the same city. We probably need to bump this up a bit.
Does this game have garrisons in almost all cities?
Empty cities are certainly few and far between, and also there are multiple garrisons in several places. There are four in Lisbon (1 Spain, 1 Portugal, 1 GB, 1 Sweden)
Any chance the fix for this could go into the same hotfix as the foraging fix ?
Regards
David
David
- MarshallEllis
- Posts: 5632
- Joined: Tue Oct 02, 2001 3:00 pm
- Location: Dallas
RE: Maximum number of units reached !
I will investigate to see how difficult this might be!
RE: Maximum number of units reached !
ORIGINAL: Marshall Ellis
Hey guys:
We have a limit of 550 units on the board
WHY!!??
What was the "reasoning" behind this move?
- MarshallEllis
- Posts: 5632
- Joined: Tue Oct 02, 2001 3:00 pm
- Location: Dallas
RE: Maximum number of units reached !
I had to place a limit on the number of units in the DB layout because of the structural array.
RE: Maximum number of units reached !
Just say it's an EiH rule. [:'(]
Bill Macon
Empires in Arms Developer
Empires in Arms Developer
RE: Maximum number of units reached !
ORIGINAL: Marshall Ellis
I had to place a limit on the number of units in the DB layout because of the structural array.
Ok [&:]
Here's to hoping you can "fix" this!!
ps. Where is the damn ignore button on this forum!


