So I know most people are aware that goblin fortresses are near unplayable lagfests in adventure mode, and many people have some vague idea as to why this happens and how it can be fixed. But I've encountered so many people who have accepted it as some near game breaking bug they have to live with and I haven't seen anyone pin point what the exact reason for it happening yet is so I figured I'd put the results of what experimenting got me and the solution out in the open for as many people to see. Raiding and sneaking in goblin fortresses is such a fun part of the game and I want everyone to have the ability to experience it.
TLDR simply remove the [NO_EAT] tag under goblins in creature_standard.txt. I will explain why this is important below
So if you look up a solution for the goblin overpopulation you'll see people usually say to try a mix of removing [NO_EAT][NO_DRINK] removing goblins immortality or usually a combination of multiple things like these to limit the goblin population. The problem however actually is the troll and beakdog population, not the goblins.
I've discovered that the more livestock a site has the more population it seems to be able to grow and maintain. The game seems to record the population feeding on its livestock which in turn normally keeps the livestock number at most around 50 or so. The game even seems to take into account how much meat the animals they keep produce. I made chickens the size of dragons and the population of dwarven and human civs grew a lot more.
You can see why this is a problem with goblin civilizations. They will never "eat" their trolls and beakdogs because they don't need to. This creates a feedback loop where more goblins get added which raises the livestock to accommodate them and more goblins get added and so on.
Even if a goblin site reaches into the thousands it shouldn't lag because it'll only register like up to a hundred at your location at a time. However livestock don't follow this rule. The game will actually try to register ten thousand trolls at a time if there are supposed to be that many at the site.
Giving goblins the need to eat will fix this and goblin fortresses will become playable. The only thing is is that goblins will be just as likely to survive world gen as other races pretty much, so they'll be more likely to go extinct then they'd normally would.
The knowledge I've gathered also might present potential to fine tune the survival rates of different civs in world gen. I couldn't find a way of doing this before due to the tags that are supposed to control this being non functional currently. It may be possible to give a civilization's race NO_EAT for the world gen process and remove it after. Or you might be able to do the same with adjusting the size of a civ's livestock in proportion to how big you want their population to be. More testing needs to be done, and I'll probably be looking at that next.