CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.26k stars 4.11k forks source link

Proficiencies, crafting, failure chance, UI, etc #48981

Closed Kelenius closed 3 years ago

Kelenius commented 3 years ago

Describe the bug

I would like to collect all issues and RPs that are currently opened (there are too many, so my solution for solving that is to open one more), because there is a significant overlap between them and they boil down to the same problem:

The effect of having missing proficiencies on crafting and crafting failures in general are broken in various ways.

Existing discussions

Issues:

46662

47566

48465

48597

48925

48956

PRs:

48658

46082

46153

48673

48650

48924

And a discussion:

48912

Why I'm opening this

Because all of this is very closely related and it's essentially the same problem that should be resolved in one go, not broken up into a bunch of PRs - merging #48673 fixed one problem, but also made crafting even very simple items practically impossible without proficiencies and left missing proficiencies impossible to mitigate because that's also broken - a worse situation, in my opinion!

I'd like to bring all discussion into the same spot, because right now it's spread out and is difficult to follow.

Let's untangle the knot

Here's the full list of what's currently bugged:

How to resolve this mess

First we need to stop and asks ourselves: why am I spending my Friday evening digging through C++ code how difficult should it be for different characters to craft? There are three factors at play:

(there are also NPCs and other small factors like crafting in darkness, but let's put that aside)

I see a lot of people arguing about how math works. That is not the approach that we should take. It would be, in my opinion, best to answer these:

"A character with 8 intelligence and the skill matching craft's difficulty should succeed XX% of the time." "If that character is missing a 2x failure chance, they should succeed YY% of the time, which is halved success rate / doubled failure rate / something else, according to a formula." "If that character instead has Z or more intelligence, they should always succeed." "If that character's skill is instead W or more % higher than craft's difficulty, they should always succeed." "If that character has 4 intelligence, their success rate should be (I am running out of good letters to use)%." "If that character has skill (whatever)% lower than craft's difficulty, their success rate should be (something)%."

And then adjust the results to fit these. Failure checks should be more evenly spread across the recipe, and failures themselves should be more manageable. Right now they send you into a death spiral where you can't finish the craft because you keep getting set back by failures.

Second, and this is important, there needs to be one unified function for getting the penalties. Right now it's in four different places: recipe.cpp, proficiency_time_maluses and proficiency_failure_maluses; crafting.cpp, crafting_success_roll; recipe.cpp, time_to_craft_moves; recipe.cpp, missing_proficiencies_string.

Third, there needs to be a clear UI that shows what your actual failure chance is and how the proficiencies missing are affecting it. "Missing this proficiency makes you twice as likely to fail" isn't useful information when you don't know the base failure rate and how that 2x is applied to it. Showing how much proficiency progression you'd get from crafting the item is also something to consider.

ghost commented 3 years ago

Die rolls cannot be simulated in normal distributions because they should always be discrete distributions.

https://corporatefinanceinstitute.com/resources/knowledge/other/discrete-distribution/#:~:text=A%20discrete%20distribution%20is%20a,%2C%2010%2C%2015%2C%20etc.

It must store the value of your failure somewhere and force the failure outcome, if you have a die at some point it will fail, the value of that failure must be stored.

It seems like no one understands what the code does even when they look at it, so when it's tweaked, no one understands the effects of what is supposed to happen.

A binary interpretation of results can never exist in a continuous die that simply rolls until the end of item completion, that is what you see on the item progress bar (display) from 0 to 100%. There are always rolls being done and adding to your progression bar bit by bit. Some of the effects of the failures are completely mitigated by your skill level against the higher difficulty, but as it continues you are forced into higher difficult rolls that you should not pass.

NEVER use a binary interpretation of this to simulate the chain of events.

It can never be a normal distribution because it takes place in discrete mathematics, if you force it to be a normal distribution it simply will not ever work as you expect it to be.

Perhaps the change should stay, that way at least people would understand how the probability of thing work. You kept picking failure outcomes before and after but the "time multiplier" was just scaling up the frequency of events through the "length" of time tied to the game.

The code is set up to be a "set it and forget it", if you want a binary interpretation you finish the craft, if you look back and the frequency of things it must always stay the same with no probability involved.

Monte Carlo simulations do come close to this but the effects of the continuous die-rolling are tied to the ingame crafting system itself, if you do not use the right numbers with the right settings you can not replicate the same simulation.

A doing simulation of a simulation is innately going to give you erroneous results if you do not set up the values to be exactly the same. That's why I'm at a great deal of confusion about how everyone is pushing their results and expectations into the game.

The person who showed me the code said it was the "right" answer even when it wasn't respecting how the base numbers work and how they should tie together. Naturally, it means no one has an idea about how it should work and how it should be coded to work.

We should respect how this "right" answer from calculating values from the code shifts everything towards a certain "skewedness" in discrete mathematics in order to simulate probability. The "skewedness" is the failure rate multiplier that you see at the top of each recipe if you do not have a proficiency set.

No one seems to respect what the numbers means and jam in their own numbers which can keep doing more of. That in essence could be seen as a continuous die roll as well.

You can continue seeing it rolling towards the end and find there exists no probability anywhere in the world. How high can you jump?

Roll for it.

How high did you jump?

The upper limit is always capped.

If you can see the world as math you can see probability can exist nowhere and everywhere. some probabilities represent events that should never happen, they are a frequency of events that are seen within a certain amount of "rolls" where the world is always "rolling" forward. It is continuous and you cannot cut it in half, you cannot cut it by 1/3, you cannot cut it anywhere.

The way the world changes from the evolution of life to the development of culture is a continuous die. In each section and segment, you will observe different frequencies of events that are simply tied to that set of "rolls" or "time".

You always use discrete math for the simulation of die rolls in coding, naturally, by definition, it cannot be allowed to have normal distributions.

You can use discrete math and simulate a Monte Carlo simulation that will have results in complete contradiction to the game values because the initial rolls and "skewedness" are tied to each other between each die roll.

That's why I'm at a great deal of confusion when everyone is trying to do a skill roll (1) or simulate the events of the game, the code does the discrete math for you based on its own settings and variables and enforces events accordingly.

What is wrong is a player's expectation and a coder's expectations and interpretation.

There are bugs everywhere in the game, if I had to say, the game and code is the definition of broken already but we can accept a broken state. The code isn't broken because it's broken already, nothing should work as intended and any value you input should shift it all around. These were my own set of interpretations of events from everyone jamming in wrong numbers and flipping values in the code when they didn't know what they were tied to.

Everyone should get rid of the delusion that it is the probability at work in the game and they can simulate the same set of events, if you can jump high enough to reach the moon in the real world, perhaps you can start believing in probability, but that's never how it works.

In physics we learn that events that are taken place from "probability" are not really probability at all, things like quantum tunneling can happen due to the high frequency of events that leads to lower energy barriers that particles are allowed "clearance" to pass through.

There should be no single bit of probability that exists in the world, that includes the code itself.

I'm forced to do this because I have no probability of not doing this.

The mathematical procedures of the world do not let me do something different and I am who I am because of it.

The same goes for everyone here, you are allowed to accept or reject it, that too is predetermined by the procedures of the world that affect you. You have your own normal point of reference.

It's a normal occurrence for the code and game state to be broken and we'll keep rolling forward. Do people really use a binary interpretation of events to see the world around them?

Everything that has occurred is built from the past, the past segments you have completed can be tied to that. I'm saying this change is very good in order for players to understand what probability is supposed to do.

If someone can prove to me that there is a chance you can jump from earth to the moon we can continue trying to force it into a normal distribution.

Eventually in the future, someone might actually have a "probability" of being able to, but in the past and present, it cannot occur.

Don't set your expectations on something that cannot exist, the "skewness" of events is already shown in the rates above each recipe. Since it is shown I no longer think it is a bug but a feature, you can still think of it as a bug that needs fixing, every feature can be a bug, every fix can break things further.

In the end, the world is an amalgamation of contradictions where everything can be said to be correct and incorrect. I'm just saying that the code is giving me the results I expect so nothing is wrong. For everyone else, it will look wrong and needs more fixing.

As an open-source project, it is a great expression of the continuous die being cast. I'm just seeing no consistency between each part and people can only interpret one side at a time, some people are better at the grammar portions and some better at coding and math. All in all, with everyone working together to interfere with each other while simultaneously helping to create a new game state is just how it works.

It's creating an effect of no one really knowing what's what and where the problem is, because it shifted into everyone's "solution" of the problem.

Solution = problem Success = failure fix = broken feature = bug

These are the trends that should be expected to be defined as interchangeable and the continuous die in the current game shows these trends that can continually be broken. You break a fix that broke the game to fix things.

I would in fact say everything is in place already, I myself know I have no free will but having no free will is an expression of free will. If everything is working properly in the code to my expectations, nothing that should be happening in sections of the code should be working together as intended.

What ties the code together is the game itself. If you have a calculator and set it to operate under the wrong mathematical order, you can expect the results to work backward from how it outputs the values. At the same time, the calculator still works, you can set that as your new standard and just say it's a function instead of a calculator.

That's what I'm saying with the new "failure crafting" system that players should never do a skill roll (1) on. Since it operates in reverse to what players are used to, the failure points are just passing by as the die are continually being rolled.

To me, it seems much more "realistic" of what continuous dies are supposed to do. Eventually, those failure rolls allow for the "clearance" of the item through the item counter if the frequency of events is at the range of acceptance. You use frequency to compensate for success, keep trying and you succeed in the end.

I myself know that this is an unpopular opinion and should, and have to lurk around as "ghost" to interfere with you guys.

Fuck you guys.

You keep fucking up the code because you don't know what you're doing.

I've just been ranting and giving myself amusement because I'm feeling a great deal of frustration from looking through everything. In the end, I did get some laughs out of it at least.

Please do sets of "continuous die rolls" if you would like to simulate the procedures of the game and set it towards the same frequency of events.

The code should be set so that if you do 1% of a craft, every time you "savescum" you can expect the same frequency of events to occur as long as the triggers and counters aren't removed.

Running the code in the reverse order of operations by inverting what the proficiency modifier does is a great idea to show the functionality in both directions. It might not be scaled for both directions, but it works in both directions, maybe we should keep flipping the switch and allow it to work both ways with our fixes.

ghost commented 3 years ago

For anyone who can actually do the calculations and want to, the bottom of the recipe is for a lognormal distribution from the normal point you should be calculated from. There could be negative values as well that can modify it or positive ones to represent direction from either side.

Apparently, most people don't know what the "negative time" multiplier is for. It's for the other side of this distribution. They go both ways.

It is not a normal distribution because it has the elements of skewness involved.

It was "x2 long as normal" and "x1 more likely to incur failure" and you can see this as binary logarithm, or log base 2.

But it's from the normal value. It can give you binary interpretation, you have to go further from that.

Skewness has to be represented, which can only occur in lognormal distributions. If you're ever using a normal distribution it's not going to work.

In general, the code can is seen as a calculator that outputs a function that seems consistent enough. I don't know what you expect.

ghost commented 3 years ago

If people haven't realized how inverted how the prof_multipliers affect the skewness of gearing everything towards failure I don't know what to say.

Technically it's just making everything harder with no benefit for the players except that stop them, which is great in some ways if that's what you're looking for.

The "right answer" that was given to me enforces failures, so I don't know what to expect, when the rates already showed how skewed the distributions are I'm not sure why people are still trying to do skill rolls like it was before.

There have never been any right answers though and only answers people are willing to accept as right.

The guy who took the inverse of the prof_multiplier to multiply to the skill roll had no clue what he was doing or what he was affecting.

The distributions are fucked up because of that to push everything to failures rates instead of compensation with "time" like it was before.

Now you are forced to do a "failure compensation" instead of a "time compensation", it still works the same way but with a different compensation system.

I don't think it's balanced, but at the same time it does cut down on the rolls you do, he did intend to make everything harder. It does have that effect.

All in all the end result is achieved even though he wasn't sure what he was doing. No one is sure what they're doing apparently.

Until you do your "failure compensation" with more rolls you should not be allowed to finish crafting currently, which is what he seems to have wanted to do....

Why do you see it as a problem when you set it up to work that way?

I guess the work people do is the problem. Then they don't see a problem in their work, I suppose we can all treat this as a learning experience.

I'm ok with the failure compensation system and people have been playing on it for a while, yes the skewness leans towards failures because technically the outcome of a normal event is supposed to be set to:

75% success and 25% failure

You start your rolls at 100% and then end on 25% towards the end of the craft due to the skewness that has to be expressed. This was how the distribution always occurred just due to the crafting system itself.

What the guy had no clue about is the rates also define each other, .25 failure chance is 1/3 of .75 success chance, success chance is 3x failure chance.

The log distributions are fucked now because of it, technically it could just be fine to accept it as is, the item counter will always make you fail more than you need by spawning impossible to clear failure points to meet with its expectations.

This sets a very high difficulty settings for players at the end and in the beginning especially before they have proficiencies. The normal event of occurrence are always failures like the guy intended to lean things towards. Your failure point counter now has a multiplier to help you reach your failure rolls faster between 0-100% of the craft especially at the last parts.

ghost commented 3 years ago

If you go to the casino and play the slots, you can expect to always lose more money than you put in.

The house always wins, it's rigged that way.

What happens if you win a million-dollar jackpot?

Even if the machine says you do, people are going to stop you. They'll pass it off as the machine malfunctioning and give you $100 dollars and a free meal at the buffet.

You can rig your own slot machine to give you more money than you put in, that works too if it feels satisfying for you. In the end, the money in the machine is yours to play with. If someone else uses it naturally you'll just be burning your own money.

You can do a virtual slot machine and keeps giving your virtual money and success and have it print out as much as you like. I'm just saying if they skew the rates too much in your favor you don't feel any effects at all. The skewness of the failure rates due to the "faster" rolls you have to make now just sets you up for it.

I'm just being the person that says, oh if you actually succeeding at the end then the slot machine is malfunctioning or you cheated the system.

Just flip the switch and put it back to being a multiplier and don't invert it as a multiplier.

There is a huge different between x and (x)^-1.

This is a base operation of multiplication and division.

Since the numbers are lumped together like that you can do anything to them.

It's called a multiplier for a reason but the guy took the inverse of it, or essentially divided it and multiplied it to the skill roll.

If we go by casino rules, it's going by the house always wins. You must fail, but at least the game has the decency to show your failure rates, just fail in the end x5 times the normal rates where you expect it to be a 50-50 chance at the normal rates.

Since there are so many contradictory values that a failure rate and success rate can influence it to be a 50-50 chance there should be impossible to do a skill roll the ways you guys have been trying to do things.

Even the people that are coding it don't even know what it does apparently adding more confusion to the mix that's being continually passed along to everyone at every section.

Everyone is trying to fix it in their right way creating a very interesting lump of problems. We can just let it go back to being a multiplier that isn't multiplicative inverse.

Everyone is actually falling for the "gambler's fallacy" if they think they can pass what they cannot pass. You'll always get stopped somewhere along the way. Technically speaking, there was never any "success crafting", so you guys have always been using the wrong skill roll method to see the actual outcome of events.

Even before the change you failed a fuck ton with messages that "you lose progress" that meant the tick didn't succeed into adding progress but your skills mitigated the effect. Someone removed it and the system shifted towards what we have now, it's actually hard to keep track of your failures now but I can assure you, you're failing a fuck ton more if you're segmented, you just don't see how it rolled. Multiple failures at higher difficulties are assured for progression lost and additional material with item destruction because you cannot mitigate the failure outcome penalties at the end.

If you don't see how it's rolled how can you even put it into a simulation or graph or interpret it?

You literally failed a fuck ton and ignored it all in the beginning segments, the last segments have the highest difficult and you expect to succeed?

You are literally ticking down your success when the rates are skewed by definition.

People are trying to say to me that "that literally not how it works" just makes them seem retarded to me. They don't even understand what I'm trying to say, I'm saying the average failures have to be the same. They are segmented as an expectation, "consecutive success" is translated into failure rates to affect the failure chance of the proceeding rolls.

How else do you think the slot machines are rigged. Every time you succeed it's rigged to make you fail more, the guy who coded the program initially just set you up for success, now it's set for failure.

We can stop going by casino rules if we revert, to not inversing the multiplier as the easiest fix or we adjust the casino rules. Just know that it works in both directions if you flip the switch.

It simply seems like no one has the right interpretation of what is supposed to occur and enforces their own. Anyone who knows what a "failure quota" implied should have linked it all together.

Why do you think the probability is preserved between each roll with each being independent of the other? They literally have to be linked together in order for probability to even be expressed. They mutually exclusive and must be, but at the same time affected by any rates and modifiers that can skew them towards both directions.

If one is triggered the other isn't, why the fuck are some people trying to do it all in one roll and treating it as a binary event?

Since the guy implied the original coder of the proficiency system doesn't know what he's doing, I'm just saying I have to do it to everyone around here as well, especially for people who look at the code but at the same time don't seem to understand rates and probabilities.

Fix your delusions to how things really work, please. Do not inflate what your rolls are and should be doing. The probability exists because it is enforced, if you don't know the rules, you don't know the rates, you don't know the settings, you don't know anything.

In general, that's why it's best to go by frequency and work back from there because can have expectations of how it is enforced and work backward. But it will never actually give you an absolutely correct answer, just an expectation, because you don't know what it really is calculating it all based on.

If you want to jam in more numbers into the machine for it to work technically it should just already be set to do that, and jam in more until it works in the way you think it should work.

See the solution?

See the problem?

It's the same.

ghost commented 3 years ago

What people are trying to treat as their skill roll from both players and programmers are actually "negative skill rolls" right now.

You set your expectations to be able to do it, but it should never occur.

You know each die has a set mathematical pattern that it expresses and cannot be broken as that is an enforcement of the rules as well. You use the wrong die, you use the wrong rules, you rolls have broken the rules of what should be allowed. That die isn't going to give you the same results at some point.

To compensate, you use frequency of events of counter failures, consecutive fails are rewarded with the ability to succeed. It's simply how the rates are skewed that the ability to succeed seems less. High-frequency failures let you have your success rolls faster because they're treated as completed.

The rates are allowed to regenerate or deplete depending on how the rates were initially skewed, rates always affect predetermined numbers that affect the current failure and success chances.

Usually, it should be set to a rate x1 for success chance the same as a rate x1 for failure chance from the normal 50-50 value. Since the "time multiplier" was initially for frequency, but now it inverted, it means the frequency of failures required, naturally you just end up with high-speed failure rolls.

It should be impossible to do a skill roll, that is the illusion it should be giving players and programmers. So it seems to all be working properly but at the same time creates so much confusion on how it should be working. It's already the improper intention of the original code to run towards a failure rate skew. It was keeping a success rate skew by spreading it out before. The frequency was kept the same, but compensated by your success rolls. Technically it did trigger more failures, but it was all ok since your successes were also 1x, the incurred penalties weren't as massive.

Since someone didn't feel the effect was greater enough and rigged it up to go by casino rules, there must be barriers to what you can ever do with your rolls at a higher difficulty which should spawn directly on the tick you triggered it on the item's progression, then you get rolled back and the counter starts ticking again.

Seems reasonable to me.

The setbacks are unavoidable with little rewards after you succeed, in the end, you always lose more.

That's if you want to go by casino rules though. Technically no rules actually exist if you can change them so might as well, might as well change the rule sets.

In the end, if everyone enforces their own rule sets it's hard to keep track of, naturally experimental versions are always expected to be broken, even stable is broken.

It isn't broken if you shift a variable or multiplier and it affects everything that ties to it. The current state of the game has probably the easiest fix. All that had to be done is use the original log distribution of success and failure rates rather than going by casino rules "downward" towards failure.

Failures are literally the only option for item completion to allow for a smaller degree of success.

Let players have an ability to see themselves do a "skill roll" and succeed rather than a "negative skill roll". They're just spreading out their failures in the end in different ways or compressing them into high-frequency failure rolls.

You should be able to calculate your real probability of passing with a "negative skill roll" with how the current system works. Any positive value for a skill roll does not and will not exist if you want to do probability.

Look at the distribution on the other side, that's the "negative skill roll" that you guys keep ignoring. Look at the other fucking side of the distribution.

That's what you have to work against.,

Mom-Bun commented 3 years ago

Locked for now as this issue seems to be getting spammed by one user in particular.

Raikiri commented 3 years ago

The experimental has lived for almost half a year with failure chances doing practically nothing and it worked just alright. Isnt it safer to release 0.F with failure chances just completely disabled until the issue is addressed properly?

The reasoning is that the current proficiency system still makes crafting quite hard (as in, way harder than it used to be) even from time penalties alone.

I-am-Erk commented 3 years ago

There's no need to disable them, they're working pretty well at this point. Only the book fix needs to be merged now.

Raikiri commented 3 years ago

I understand that it's probably fixed now, but if during a feature freeze time, certain bug fixes can have dramatic impact on the gameplay (such as when it turns out certain stats had no effect in practice), then fixing them would produce more work (because now somebody needs to actually make those stats work). It's just natural to leave those types of can-of-worm bugs until after a milestone is reached.

Imagine if today somebody discovered: hey, turns out, vitamins have log messages about impacting your health, but their actual effects are disabled! Let's fix it now and re-enable them. While it's obviously unfinished content, in reality there's a good reason why it's disabled for now.

But it's just me hoping the next stable will be reached more smoothly.

I-am-Erk commented 3 years ago

It was a bit of a debatable choice to fix the failure rate bug in the first place rather than just disabling it, but despite the kerfuffle over it, it was not in fact a big deal at all to smooth it back out. Once it was done it made more sense to finish it off than to backtrack.

I-am-Erk commented 3 years ago

I believe this is ready to close, any objectors?

Kelenius commented 3 years ago

I agree, the big issues have been fixed.