Page 1 of 1

Maximum number of units reached !

Posted: Mon Jan 26, 2009 9:58 pm
by DCWhitworth
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.

RE: Maximum number of units reached !

Posted: Mon Jan 26, 2009 11:03 pm
by NeverMan
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 !

Posted: Mon Jan 26, 2009 11:32 pm
by Mardonius
No, you're not forgetting anything. It's an error or a bug.


Dave:

Have you posted on Mantis?
best,
Mardonius/Varick

RE: Maximum number of units reached !

Posted: Mon Jan 26, 2009 11:39 pm
by Trax
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 !

Posted: Tue Jan 27, 2009 1:40 am
by NeverMan
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).

RE: Maximum number of units reached !

Posted: Tue Jan 27, 2009 3:46 pm
by Grognot
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.)


RE: Maximum number of units reached !

Posted: Tue Jan 27, 2009 6:29 pm
by NeverMan
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?

RE: Maximum number of units reached !

Posted: Tue Jan 27, 2009 10:14 pm
by DCWhitworth
Well we need to stop quibbling about programming issues I think. this one is a game breaker and needs to be resolved.

RE: Maximum number of units reached !

Posted: Tue Jan 27, 2009 11:03 pm
by 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.

RE: Maximum number of units reached !

Posted: Tue Jan 27, 2009 11:25 pm
by ndrose
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.

RE: Maximum number of units reached !

Posted: Tue Jan 27, 2009 11:27 pm
by DCWhitworth
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.

RE: Maximum number of units reached !

Posted: Wed Jan 28, 2009 1:32 am
by Grognot
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.

RE: Maximum number of units reached !

Posted: Wed Jan 28, 2009 12:32 pm
by MarshallEllis
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?
 
 

RE: Maximum number of units reached !

Posted: Wed Jan 28, 2009 12:54 pm
by DCWhitworth
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 ?

RE: Maximum number of units reached !

Posted: Wed Jan 28, 2009 2:59 pm
by MarshallEllis
I will investigate to see how difficult this might be!
 
 

RE: Maximum number of units reached !

Posted: Wed Jan 28, 2009 3:14 pm
by NeverMan
ORIGINAL: Marshall Ellis

Hey guys:

We have a limit of 550 units on the board

WHY!!??

What was the "reasoning" behind this move?

RE: Maximum number of units reached !

Posted: Wed Jan 28, 2009 6:38 pm
by MarshallEllis
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 !

Posted: Wed Jan 28, 2009 6:47 pm
by pzgndr
Just say it's an EiH rule. [:'(]

RE: Maximum number of units reached !

Posted: Wed Jan 28, 2009 9:56 pm
by NeverMan
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!