The Dull Endgame Phenomenon and Logistic Functions

Started by Goddab, November 25, 2013, 03:51:44 PM

Previous topic - Next topic

Goddab

The endgame of RimWorld can be a bit dull. Once your world has hit the population cap of ten colonists, all that remains is to face of against ever larger waves of raiders until either the player is wiped out or resigns. The player cannot recruit new individuals, take prisoners or liaison with slavers. No wanderers make their way through your map and the colony population becomes static. This phenomenon, which I have nicknamed the Dull Endgame Phenomenon (DEP) is in part due to the aforementioned population cap.

However, the population cap is not the enemy. It is well intentioned, as the alternative would be a blooming colony population where tactical combat and individualized story telling would quickly become unwieldy. A limited number of colonists makes each individual more valuable and more compelling to keep alive. So instead of removing the population cap, which would lead to chaos, I instead propose a modified population cap, using a neat piece of mathematics called a logistic function.

Logistic functions are of the sigmoid function family, so named because their graph represents an S. Logistic functions are used to model population growth in a variety of fields, and their advantage arrives from being incredibly flexible. All logistic functions follow the same pattern, with the initial stage of growth being approximately exponential, which then slows as saturation is reached until maturity is reached, where all growth stops. The formula for these functions is:

f(x) = 1/(1+e^(-x))

What is particularly neat about this function is that while it is formally bound by values for x in the range of real numbers from -∞ to +∞, it is sufficient to compute x over a much smaller range, say (-5) to (+5), which just so happens to be the range of the current population cap. Now, the logistic function itself, while neat, is not strictly the most useful aspect for this application. It's more useful cousin is it's derivative which is:

d/dx f(x) = f(x) * (1 - f(x))

Derivatives are useful because they allow us to easily calculate the rate of change (slope) for a given population. Meaning, that the targeted population growth should follow the above form. In addition, this derivative can be interpreted in another way: as the probability of growth. In a perfect system, a given population's growth would be identical to it's probabilistic growth, or target growth. This means that the probability of a population growing is related to the slope of the logistic function.

So, if the probability of growth decreases towards both limits, this places a practical but not theoretical cap on population growth. Ultimately, this means that “soft” population cap will be used, and therefore there is no reason for the story teller to simply stop sending wanderers, slavers and wounded raiders your way.

There are of course some potential issues with the logistic  being used in this way. First off: if the story teller uses the logistic , wouldn't it simply have an impractically low chance of sending events your way, resulting in the same DEP? No, because the story teller does not have to use this function. This function only has to be applied to the probability of recruitment of an given individual by the warden, which is already in the game.

Second: this function provides horribly low rates of recruitment, such that even achieving ten colonists would be hugely time consuming. The beauty of this function is that by simply placing a modifier k on the value x, one can quickly compress or expand the logistic function as is needed. The modified formula would look like this:

f(x) = 1/(1+e^(-kx))

Where k is some real number between 0 and +∞. A k larger than one would expand or stretch the function, and a k of less than one would compress it. Of course, a k of one would achieve nothing a k of 0 make the function f(x) equal to 0.5 for all values of x, and so neither those values of k should be used in this instance.

Third: but if slavers keep coming I could just buy slaves indefinitely. This would require a slightly more complicated solution. For this to not be an issue, when a slave is purchased, they would have to be sent to your colony as a prisoner, forcing you to recruit them whether you are below or at the soft cap.

Ultimately, I believe that this would be a simple and elegant solution to the DEP, which should be considered for future versions of the game. If anyone has an further comments, questions or concerns with regards to the implementation of a logistic function in this manner, feel free to ask away.

P.S. Sorry for the shitty formulas, but the forum wouldn't let me post img links using bbcode.

killerx243

Unless there was a negative side to spamming recruitment propaganda at prisoners it won't be much of an issue. Just get the prisoners to 100% loyalty and then wait until they eventually sign up.

Goddab

#2
Quote from: killerx243 on November 25, 2013, 04:54:04 PM
Unless there was a negative side to spamming recruitment propaganda at prisoners it won't be much of an issue. Just get the prisoners to 100% loyalty and then wait until they eventually sign up.

Thanks Killer for mentioning this problem! I forgot to in the main body.

When I considered the math, this is an issue that came up. With all of your colonists capable of wardening, and infinite chances to persuade, you could just allow the game to idle for an extended period of time and they would eventually join you. However, this length of time can be made impractical.

Using the standard form of:

f(x) = 1/(1+e^(-x))

where x = N (number of colonists) - 5

by the time you try to recruit your 11th prisoner, that is, x = 6, the Probability per recruitment attempt is approximately equal to 0.0025.

This means that you would have to have more than 200 recruitment attempts on a given prisoner before you could expect (P > 0.5) them to join you. In order to guarantee that they would join you, the number of attempts would have to be greater than 380 (P > 0.95).

By putting a limitation of four recruitment attempts per day per prisoner, it would take 50 days to, on average, recruit your 11th colonist.

Of course, your 12th would be even less likely.

Galileus

Sorry, but I completely miss the point of this. So, instead of dull endgame because of hard cap on colonists you have a hard cap on colonists... recruiting. So everything is the same, except it's worse. You switch mechanics mid-game and pull a carpet from under player's feet. The same thing that worked last time now doesn't work. He'll try few more times and then the game will laugh at him, sending his way people you can't recruit. I can't see any reason to do that.

killerx243

Quote from: Galileus on November 25, 2013, 06:54:35 PM
Sorry, but I completely miss the point of this. So, instead of dull endgame because of hard cap on colonists you have a hard cap on colonists... recruiting. So everything is the same, except it's worse. You switch mechanics mid-game and pull a carpet from under player's feet. The same thing that worked last time now doesn't work. He'll try few more times and then the game will laugh at him, sending his way people you can't recruit. I can't see any reason to do that.

I see it kinda like more people you have in prison more chances of recruiting happen at once.

Goddab

Quote from: Galileus on November 25, 2013, 06:54:35 PMSorry, but I completely miss the point of this. So, instead of dull endgame because of hard cap on colonists you have a hard cap on colonists... recruiting.

A hard cap implies a theoretical in addition to a practical limit. That is not what this is. There is no theoretical limit to the number of colonists you can have, but there is a practical limit. Thus, it is a soft cap.

Quote from: Galileus on November 25, 2013, 06:54:35 PMSo everything is the same, except it's worse. You switch mechanics mid-game and pull a carpet from under player's feet.

This doesn't change mechanics mid-game. That is the beauty of a mathematical model for population growth. It models the whole system, and not just elements. Therefore, the mechanics early game, mid-game and end game are all the same. You must have a certain loyalty limit to attempt recruiting, and there is a certain probability of such recruitment being a success.

Quote from: Galileus on November 25, 2013, 06:54:35 PMThe same thing that worked last time now doesn't work. He'll try few more times and then the game will laugh at him, sending his way people you can't recruit. I can't see any reason to do that.

The reason for doing this is so that the game world feels less empty once you hit the population cap. Currently, once the hard cap is achieved, no wanders come, no raiders become wounded and no slave ships arrive. It is illogical. Those aspects should have nothing to do with the number of people in your colony. However, by placing a soft cap on the number of people you can recruit, you address the issue of a ballooning population while still leaving the game open to these aforementioned events.

Galileus

Hard cap is a limit that comes from mechanics and not from consequences of actions. Soft cap comes from diminishing returns or similar mechanics that make it possible to spawn/make/use more of that mechanic, but it is simply not worthwhile. You can argue, that making a recruitment chance 0.000001 instead of 0 is a soft cap... but seriously - do you really think there really is a need for that?

It's the same argument as "pay 2 win". We - as  gamers - simply don't have the chance to draw our lines in straight scientific fashion. In the end the games are as much art as entertainment and science. And while no scientist will argue 0.000001 and 0 are two different things, this does not apply in art forms nor in entertainment.

QuoteThis doesn't change mechanics mid-game. That is the beauty of a mathematical model for population growth. It models the whole system, and not just elements. Therefore, the mechanics early game, mid-game and end game are all the same. You must have a certain loyalty limit to attempt recruiting, and there is a certain probability of such recruitment being a success.

Game mechanics are not mathematical equations. Game mechanics aren't even the thing you programmed in or said in the rulebook. Game mechanics are what players perceive, and I assure you, they will not see the beauty of mathematical equations. What people will perceive is a sudden drop in chance to recruit, that they are unable to explain or understand. For them game mechanics suddenly changed... and as the day ends, this is the only opinion that matters.

QuoteThe reason for doing this is so that the game world feels less empty once you hit the population cap. Currently, once the hard cap is achieved, no wanders come, no raiders become wounded and no slave ships arrive. It is illogical. Those aspects should have nothing to do with the number of people in your colony. However, by placing a soft cap on the number of people you can recruit, you address the issue of a ballooning population while still leaving the game open to these aforementioned events.

I agree with the reason, but I don't agree with the conclusion. It would be nice to be able to cap population limit and keep travellers and such at the same time. But addition of a hidden and convoluted mechanic that works behind the scenes is not the way to go. Mathematical equations may be beautiful - but they are not fun. Players will never know what hit them, and - if you would explain - would perceive it as weird, convoluted and simply not needed. And for good reason. If hidden - it's a change in game mechanics mid-game never explained to the player. If openly stated - it's a complex and illogical mechanic. Why illogical? Because the more people live in your colony, the easier it should be to recruit new ones.

Sometimes hard cap is simply better idea. Just add counter of colonists you can manage in top right corner of the screen. No gamer will have difficulties understanding it or accepting it - they may not like it, but it's a solid rule nonetheless. It's open, it's there to see, it does not change (unless through research). Otherwise, you can soft-cap it with need of delivering a resource in a (X^n.of.colonists) amount - you can continue to build more and more resources bringing buildings, but diminishing returns will hit you hard an convince to stop that. But all the time it's clear and obvious and under your control.

Goddab

#7
I just want to preface this by thanking Galileus for two things. First, for remaining civil and two for helping me better understand my own argument. If it were possible, I'd give you an upvote!

Quote from: Galileus on November 25, 2013, 09:15:02 PMGame mechanics are not mathematical equations. Game mechanics aren't even the thing you programmed in or said in the rulebook. Game mechanics are what players perceive, and I assure you, they will not see the beauty of mathematical equations. What people will perceive is a sudden drop in chance to recruit, that they are unable to explain or understand. For them game mechanics suddenly changed... and as the day ends, this is the only opinion that matters.

I see where the confusion is arising from. I erroneously referred to my solution as a game mechanic, which it is not. My solution is better thought of as a game rule. The best way that I have to think about game mechanics is that they can be formalized as verbs. Shoot, kill, defend, recruit are all mechanics. Game rules, such as, “it will be harder to recruit individuals as population increases,” allow the player, or computer, to interact with game mechanics in certain desirable ways, which leads to the creation of strategies.

You keep making reference to a “sudden” change and I do not understand why this function would lead to a sudden change. In fact, a per-determined hard cap is distinctly more sudden, like a cliff face when compared to a steep hill. Now, I appreciate that for such a small population this function is not ideal, but if it is scaled up to deal with populations of 10 or 100 times greater magnitude, the function's shape and mathematics remains identical but the rate of change between two given whole numbers is reduced, perhaps reducing the appearance of a sudden change you are referring to.

You continue to say that, “it's a complex and illogical mechanic... because the more people live in your colony, the easier it should be to recruit new ones.” I wish to make it clear that this function is not just something I created, or borrowed from another discipline. This function is critical to our understanding of population statistics and rates of population growth in every ecosystem from bacteria to human beings. While it may seem that all population growth is exponential, it is not. In fact, as a population approaches maturity (the population cap) its growth will slow until eventually stopping.[See footnote]

Finally, you mention something incredibly interesting.

Quote from: Galileus on November 25, 2013, 09:15:02 PMOtherwise, you can soft-cap it with need of delivering a resource in a (X^n.of.colonists) amount - you can continue to build more and more resources bringing buildings, but diminishing returns will hit you hard an convince to stop that. But all the time it's clear and obvious and under your control.

This is actually a more complicated version of the same function I am proposing, and I agree with it entirely! In my initial argument I relied on mathematical compactness and simplicity, but I left out some key features of the logistic function when applied to populations. You are correct, that this soft cap does need to consider available resources, such as housing space, food, water, electricity, beds, weapons and endless others. In addition, in any system there is an ultimate hard cap, called the carrying capacity, or the maximum population the ecosystem has the resources to support. I however left out this portion of the explanation because I felt it added too many complications for a pre-alpha build.

Footnote: The tendency for us to observe population growth as being strictly exponential and not following more complex and complete forms, such as but not limited to the logistic function, can actually be interpreted, rather crudely, by an application the German Tank Problem. I will not discuss that here, but if anyone is interested feel free to ask!

Merry76

Just to throw my chip into it: The way the game handles captures and converts is a bit silly at the moment. If you have few colonists, raiders KO much more often and are capturable wich makes sense for game balancing reasons (in this early stage) but no sense whatsoever in-game-universe.

A mathematical solution may adress this, but as Galileus said its not the solution the player perceives (because to be frank: most people couldnt do any math that goes (far) beyond multiplication...) and therefore wouldnt solve anything, and not change much anyway. If the max colonists with a hard cap is 12, and you can go up to 13 with a fancy implementation of a soft cap it does not mean anything game wise.

Instead, it would be smarter that the recruiting is getting (a bit) harder alltogether - raiders shouldnt go from "I want to punch your fracking face in" to "yeah, lets build this thing together" in something like 2 days - and make it harder to KEEP the colonists. Make it harder to have a lot of colonists. Make some kind of pychological problems with too many colonists that are cramped up in a tight space. Currently, all conversation is good. There should be some bad conversations (that increase the more colonists you have, and the more weird and non-matching traits those colonists have - say a catlovers cat goes missing, and the sadistic assassin makes some comments about how he has a nice fur pillow in his room...). People that go on eachothers nerves to the point where they have to be separated by guards (with or without the use of gunfire).

TL;DR: Just putting a cap on the recruiting is bad. Making the player deceide if his colony can stomach another possible madmad is Fun!

Rhok

Quote from: Merry76 on November 26, 2013, 02:55:46 AM
Instead, it would be smarter that the recruiting is getting (a bit) harder alltogether - raiders shouldnt go from "I want to punch your fracking face in" to "yeah, lets build this thing together" in something like 2 days - and make it harder to KEEP the colonists. Make it harder to have a lot of colonists. Make some kind of pychological problems with too many colonists that are cramped up in a tight space. Currently, all conversation is good. There should be some bad conversations (that increase the more colonists you have, and the more weird and non-matching traits those colonists have - say a catlovers cat goes missing, and the sadistic assassin makes some comments about how he has a nice fur pillow in his room...). People that go on eachothers nerves to the point where they have to be separated by guards (with or without the use of gunfire).

TL;DR: Just putting a cap on the recruiting is bad. Making the player deceide if his colony can stomach another possible madmad is Fun!

I skipped a bunch of this thread... on purpose... but am glad i found the post from Merry76.... it seems to be the only post here that actually takes into account what Tynan wants to do with this game... and that is... tell stories

now the reason i skipped most of this stuff is because the title on the thread said "dull endgame".... and the first thing i thought was "well no shit... your playing a pre-alpha"... this is all foreplay.... a buildup until we really get down with this game

personally i like where Merry76 is going with this.... i dont want Tynan deciding what my pop cap is(today he says 12 tomorrow he says 20 next year he says 10).... rather... i want Tynan to create a system where the colonists decide for me... where the colonists punish me for being stupid enough to put 20 people in a mud hut sleeping together(20 beds side by side inside a sandbag square)... where the colonists punish me for asking anyone but the uncaring assassin to execute prisoners...

i really think that a good psychological model of interactions between the colonists will separate this game from anything else.... taking away as much control from both Tynan and the player as possible while still allowing the player to provide a general direction for the colonists(build this... stand guard here... kill that... here are your priorities)

this would make the cap less of a mathematical hoosker do (or hoosker dont)... and move the cap towards the players ability to manage the different personalities(keeping the cat lover away from the prepubescent psychopath)

Galileus

Goddab - I try to keep my critique constructive - there is always one of me in any community. On the other hand it's much harder to find people able to appreciate that constructive critique ;)

I was thinking about (resource^n.of.colonists). Water comes to mind as perfect resource to manage - if we're not planning to use it in more advanced ways that is. You could start with ability to build one water pump / filter with what you had in drop pods, and then build more through research. One would be able to produce enough water to support 5-6 colonists, and every additional pump would suffer diminishing returns - after all they all tap into the same source (underground around map) and compete witch each other over it. I would rather see more fluid solution (bad pun intended), and have a go at one few paragraphs later.

Then there is Merry's point - colonists are coming in too fast right now. As it is now above 5-6 you forget who is who, you get 2-for-1 deals and your population grows faster than it's ability to tell you stories you'll remember them by. I believe most people could easily keep 20 people in mind, with different amount of "knowledge" about them (main actors vs. support actors). This would need much more events and perk-like-things (this will come) as well as slower recruitment.

I'm not that big fan of a complex relations between pawns. I want it, don't get me wrong - but not in such a game-impacting way. It sounds like a lot of forced micro-management and can be overcome easily by min-maxing gamers. It can still be done - just in more flat way.

Solution would be to add a thought or even new bar describing the psychic comfort of pawns. The neutral state is described by X tiles of "rooms" existing per colonist (or in different, non-linear fashion). If there is too little tiles (a.k.a too many colonists) the comfort falls. Of course this should not be linear - 2 colonists over the limit should have a bigger impact than two times 1 colonist over the limit. Here's the chance for some math beauty, Goddab ;) And to go over all the checkpoints: soft cap, visible and understandable by player, intuitive. But most beautiful thing in this solution? It creates a self-regulating ecosystem. Go over the limit too much - some people will be too unhappy and will leave, thus bringing the overpopulation under control. Too many people left? Comfort goes into positive space (abundance of space) and gives you solid footing to rebuild. At the same time you don't need to stop visitors or mess with recruitment. Even better? If player finds someone he wants to recruit badly, he can get him into prison and start working on forceful expansion to be able to house him.