Population Achievement too early - possible reason

I don’t know if this is fixed already. I noticed that many (most? all?) people get the population achievement too early. I also received mine (I think all of them) too early. The 20k one I received before I even had 10k, but something that I noticed is that many people receive the achievement at about half of the required pop.

I suspect that the problem could be in Market.cs’s method Market.UpdateFrameUnity():

Edit: I think my assumption regarding this is wrong, but I’ll leave it here anyway.

	public void UpdateFrameUnity()
		foreach (Worker item in workersToAdd)
		foreach (Worker worker in workersToRemove)
			if (!unemployedWorkers.Remove(worker))
				worker.workplace.workers.RemoveAll((Worker x) => x == worker);
				worker.workplace = null;

If there are any new workers then it will add them, and afterwards it will remove workers that have somehow left the city. I think swapping the order of those two things may fix the problem. If the query for the current population comes in from another thread right after new workers were added but before old ones were removed, it would see a number that is too high (I am talking about Market.GetPopulation(), which is what the achievement tracker uses). I don’t know about the thread allocation, so it’s more of a guess.

Now even if this was true, this would only trigger the achievement at about half pop if there were stupidly many new workers and to-be-removed workers at the same time. Well, guess what I found when randomly inspecting my log:

fixed workers: noHome: 60, fakeHomes: 9946

This was after loading. Not sure if people get the early achievements after loading, but maybe so. Something is not quite right with the worker assignment at the start of the game (and maybe also some other times?), which causes the whole worker numbers to be almost completely recalculated. I don’t even have 9k workers btw, but I have more than 10k habitat space. I guess the achievement happens around the point when your total workers plus available habitat space surpasses the achievement requirement, which will always be when your true pop is less than or equal half the requirement.

Maybe it’s not actually something with the order of the Update method, maybe the numbers are just completely off at some point (especially after loading), like actual pop and available space roughly added together. Why this happens I have not investigated.

yes, some bug sneaked in with the worker handling and we added the super dirty hotfix for it in all the release chaos. The reason for the achievement bug was that it was triggered before the fix ran.

This is fixed with the new update, but ofc ideally we should fix the original bug

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.