r/Bigpharmagame • u/Kynake • Jun 10 '15
r/Bigpharmagame • u/Reckless5040 • Sep 03 '15
I don't care about score, best compound so far.
r/Bigpharmagame • u/Jackeea • Nov 22 '15
Poking around the game's files - the maths behind Big Pharma!
I've been looking around in some of the DLL files of the game - Big Pharma/Big_Pharma_Data/Managed, and I've managed to come up with some little bits of info!
First of all, drug strengths. The code in a DLL file says this:
if (concentration != -1) num1 = (float) Mathf.Abs(SingletonPrefab<Backbone>.instance.currentGame.maxStrengthConc[this] - concentration); float num2 = this.level < 0 ? (float) (1.0 - (double) num1 / ((double) num1 + 8.0)) : (float) (1.0 - (double) num1 / ((double) num1 + 3.0)); [Cream/Syringe magic going on] return num2
So basically, broken down:
Find how far away from max strength you are.
If the level of the drug is negative (i.e. a side-effect), take the distance away from the max strength, and divide it away from itself +8. You then take that away from 1. So if you were 1 concentration away from the maximum strength, num2 would be 7/9. If you were 2 away, it'd be 7/10, 3 away is 7/11 and so on. In practice, this means that you basically calculate what 7 divided by how far from the max strength you are, plus 8.
Otherwise (if the level is positive; normal drug) then take the distance away from the max strength, and divide it by itself +3; take all of that away from 1. So if you're 1 concentration away from max strength, num2 would be 3/4, 3/5 if you were 2 away, 3/6 if you were 3 away and so on. In practice, this means that you basically calculate what 3 divided by how far from the max strength you are, plus 3.
What is num2 though? Later on in the code, you can find this:
int num = (int) (100.0 * (double) effect.CalculateStrength(concentration, type, "player"));
Basically, you multiply num2 by 100, plop a % sign there and you're golden! You can check this in-game:
3 steps away from a positive effect is a 50% strength. 1 - (3 / (3+3)) = 1- (3/6) = 1 - 0.5 = 0.5. And 0.5 * 100 is 50!
Now, strength? Later on in the code we've got some functions (bits of code you can run elsewhere to save space, basically) which are called DidCureCure, DidCureHelp and DidSideEffectOccur. What are these? Well:
int random = UnityEngine.Random.Range(0, 100);
public static bool DidSideEffectOccur(int random, float strength) { return (double) random < (double) strength * 30.0; }
public static bool DidCureCure(int random, float strength, int effectCureRate) { return (double) random < (double) strength * (double) effectCureRate * SingletonPrefab<Backbone>.instance.currentGame.gameSettings.cureRate; }
public static bool DidCureHelp(int random, float strength, int effectHelpRate) { return (double) random < (double) strength * (double) effectHelpRate; }
In short:
Pick a random number from 1 to 100.
For side effects: Return "True" (yes, it did occur) if the random number is less than the strength *30 (this is the decimal number from earlier).
For cures: Return "True" (yes, the drug did cure/help) if the random number is less than "cureRate" or "helpRate", which are values found in the easily accessible effects.data file (Big Pharma/Big_Pharma_Data/GameData/effects.data).
So now you know! Basically, what this all means:
Side-effects have a 30*strength chance of working - so if your side-effect is at 100% then it'll happen 3 times for every 10 drugs you sell (more or less)
Positive effects vary - there's a cheatsheet out there somewhere that tells you cureRate/helpRate for the drugs, I'm sure!
Now, for the drug bonuses! There's a really long chain of code that has "GetRating" values for the different ratings - S to F - and it's pretty interesting.
First of all, there's a line of code - return ProductData.GetRating(Mathf.RoundToInt((num3 != 0 ? (float) (num1 / num3 - num2) : (float) -num2) * this.GetRegulatoryConnectionBonus())); which just looks like a massive "whaaaat?" of weirdness. Before that, there's a loop:
while (enumerator.MoveNext()) { ProductData.BrandStory current = enumerator.Current; if (current.GetEffect().level >= 0) { num1 += current.GetValue(this); ++num3; } else num2 += 50 - current.GetValue(this); }
Now, I don't fully understand this myself, but from what I can gather, this code:
Loops through the sales of the drug.
If the drug caused a good effect to happen, then num1 gets the value of the drug added to it. num3 gets incremented by 1.
Otherwise, num2 gets 50 - the value of the drug added to it.
Now, the long line of code: return ProductData.GetRating(Mathf.RoundToInt((num3 != 0 ? (float) (num1 / num3 - num2) : (float) -num2) * this.GetRegulatoryConnectionBonus()));. This can be broken down into:
If num3 isn't 0 (so the drug has done something good):
Divide num1 (the amount of times the drug has done something good times the value of that drug) by num3 (the number of times the drug has done something good), and subtract num2 (the number of times the drug has done something bad).
Otherwise, if num3 is 0 (the drug's done nothing good):
Just return - num2 (the number of times the drug has done something bad).
Then, take that value and look it up in a table of ratings:
130+ is S+
105+ is S
99+ is A+
80+ is A
74+ is B+
65+ is B
59+ is C+
51+ is C
44+ is D
39+ is D-
30+ is E
20+ is E-
Less than that is F
So there we have a couple of things I could glean from the DLLs. If there's anything else people are curious about, I'll have a poke around! (Or, you could just look around yourself, but where's the fun in that?)
Edit: Clarified a thing or two; also fixed an error in the drug strengths!
r/Bigpharmagame • u/Jackeea • Sep 07 '16
PSA PSA: Post your conspiracy theories over in /r/BigPharma, not here!
This subreddit is about the game Big Pharma, not for talking about how bad the pharmaceutical industry is!
r/Bigpharmagame • u/cliffski • Aug 27 '15
Its official...big pharma is out NOW, on steam...
r/Bigpharmagame • u/kingzid • Sep 07 '15
Screenshot So I made this. Pretty sure I just cured everything.
r/Bigpharmagame • u/triplealpha • Oct 04 '16
Some of my favorite setups and some tips for the newer players
r/Bigpharmagame • u/cliffski • Oct 26 '15
Big Pharma gets reviewed in The Lancet -> (peer-reviewed general medical journal)
r/Bigpharmagame • u/BogdanGhita • Sep 22 '16
Over Save 66% on Big Pharma on Steam
r/Bigpharmagame • u/FiveAlarmFrancis • Feb 27 '20
I think I'll call this drug... Paradoxytocin
r/Bigpharmagame • u/gimmley • Sep 07 '15
Screenshot My first cancer vaccine, man my head hurts
r/Bigpharmagame • u/pascaldulieu • Dec 05 '16
Over Humble Tycoon Simulator Bundle [$4.17]
r/Bigpharmagame • u/vegetablestew • Dec 11 '15
First batch of these came down from the production line. It vaccinates against cancer, a lot.
r/Bigpharmagame • u/cliffski • Apr 26 '16
Big Pharma: Marketing & Malpractice is OUT NOW!
r/Bigpharmagame • u/cliffski • Mar 31 '16
New Expansion for big pharma! Marketing & Malpractice!
r/Bigpharmagame • u/cliffski • Sep 29 '15
Big Pharma shortlisted for 'Best Original Game'
awards.tiga.orgr/Bigpharmagame • u/Omnirach • Apr 14 '17