Opened 13 years ago

Closed 11 years ago

Last modified 11 years ago

#862 closed defect (needsinfo)

[NEEDS INFO] Max pop limit gets raised when unit with more than 1 pop is created

Reported by: Erik Johansson Owned by:
Priority: Should Have Milestone:
Component: Core engine Keywords:
Cc: Patch:

Description

(9:43:18 PM) erik_feneur: hmmm, seems like there's a housing bug somewhere. when I have less pop left than necessary for a unit, but haven't filled up the limit it gets raised when the unit is created. (9:43:18 PM) erik_feneur: eg if I have 232 max pop, but units fill up to 230, then a 4 pop unit is created and the max is raised to 234 automagically

I'll try and reproduce it and write a better description/title tomorrow, but I just wanted to post this so I wouldn't forget about it.

Change History (8)

comment:1 by historic_bruno, 13 years ago

Think I've found the source of this bug, or if not, it's a related bug. The terminology is a bit confusing because "population limit" is being used to mean both maximum population and also the current limit based on bonuses (from houses, civ centres, etc.), which leads to the maximum limit being ignored, as you say. I'm testing a fix for this.

comment:2 by ben, 13 years ago

(In [9659]) Enforces max population limit, cleans up population variables in Player component. See #862 Max population defaults to 200

comment:3 by historic_bruno, 13 years ago

Is this still a problem?

comment:4 by Erik Johansson, 13 years ago

I haven't seen it since. I tried to reproduce it now, but couldn't. (First time I played a more serious game and somehow managed to get the game window to close down. I think I pressed Ctrl+Pause, had paused the game because I was a bit away from where things happened and intended to garrison a couple of units. I could have accidentally pressed Ctrl+Delete or something, which would make more sense to have that effect though I cannot really see why either would shut down the game :P I didn't get any error or confirmation dialog or anything it just shut down immediately.)

Second time I tested I was able to get 296/295, but that was because I made sure I was at 300 pop exactly and then deleted a house while the unit was being created. I guess that's a bug as well though, though I'm not sure what's necessarily the best behaviour in those situations. It's rarely going to be a problem for any longer amount of time.

in reply to:  4 comment:5 by historic_bruno, 13 years ago

Replying to feneur:

Second time I tested I was able to get 296/295, but that was because I made sure I was at 300 pop exactly and then deleted a house while the unit was being created. I guess that's a bug as well though, though I'm not sure what's necessarily the best behaviour in those situations. It's rarely going to be a problem for any longer amount of time.

Well of course it's possible to have more units than the current population limit, if houses or some other buildings get destroyed. I guess it comes down to how we define unit "training". Currently when a batch is added to the training queue, the reserved population is adjusted, before the batch is finished and spawned in world. It can't start training unless the population limit is higher than the current population.

Should we check the limit again before spawning, and what would we gain? (I guess it would be useful to cripple your enemies by destroying their houses since they'd potentially lose the ability to train units).

comment:6 by Erik Johansson, 13 years ago

On closer thought I don't think it's worth checking the limit before spawning. The crippling would still occur, just not necessarily immediately.

comment:7 by zoot, 11 years ago

Resolution: needsinfo
Status: newclosed

Can you still reproduce this? I can't.

comment:8 by historic_bruno, 11 years ago

Milestone: Backlog
Summary: Max pop limit gets raised when unit with more than 1 pop is created[NEEDS INFO] Max pop limit gets raised when unit with more than 1 pop is created
Note: See TracTickets for help on using tickets.