-
-
Notifications
You must be signed in to change notification settings - Fork 595
Changed cell specialisation calculation #6800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 3 commits
30a9996
f36185d
54ff465
0a005a0
49dbad2
f5cd750
65318e7
5a9949b
199bf6e
4ede9c1
2c22f7f
10f8464
434b9ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -836,7 +836,7 @@ public static void GetBindingAndSignalling(IReadOnlyList<OrganelleTemplate> orga | |
| public static float CalculateSpecializationBonus(IReadOnlyList<IReadOnlyOrganelleTemplate> organelles, | ||
| Dictionary<OrganelleDefinition, int> tempWorkMemory) | ||
| { | ||
| int totalOrganelles = 0; | ||
| int totalHexCount = 0; | ||
| tempWorkMemory.Clear(); | ||
|
|
||
| var count = organelles.Count; | ||
|
|
@@ -846,33 +846,38 @@ public static float CalculateSpecializationBonus(IReadOnlyList<IReadOnlyOrganell | |
|
|
||
| var definition = organelle.Definition; | ||
|
|
||
| // Don't count the nucleus, because of its omnipresence and large size | ||
| if (definition.InternalName == "nucleus") | ||
| { | ||
| continue; | ||
| } | ||
|
|
||
| var hexCount = definition.HexCount; | ||
|
|
||
| tempWorkMemory.TryGetValue(definition, out var existingCount); | ||
| tempWorkMemory[definition] = existingCount + 1; | ||
| tempWorkMemory[definition] = existingCount + hexCount; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updating this count like this will break the tooltip (just commenting to remember about this as you said you didn't touch the tooltip side yet for this PR) as the tooltip will claim the player has way more organelles than they actually do.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very true! I was planning to either count the organelles themselves separately for the tooltip, or actually referring to organelle hexes (or size in some way) in the tooltip, since that would also inform the player of what is going on. That makes me realise that in Master, the tooltip is now already a little bit off because it counts for example thylakoids in the number of chloroplasts. When I work on the tooltip, that's probably worth an "(or simpler equivalent)", or something like that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not counting the organelle / part tooltips, this is already one of the longest tooltips in the game... so I think we are quickly reaching the point where any player seeing the tooltip will mentally give up before managing to read it. Edit: just wanted to say why I didn't change it. The advice is still right that you should be adding more of the most common organelle even when it is said to be the eukaryotic equivalent. |
||
|
|
||
| ++totalOrganelles; | ||
| totalHexCount += hexCount; | ||
| } | ||
|
|
||
| if (totalOrganelles < 1) | ||
| return 1; | ||
|
|
||
| if (totalOrganelles < Constants.CELL_SPECIALIZATION_APPLIES_AFTER_SIZE) | ||
| if (totalHexCount < 1) | ||
| return 1; | ||
|
|
||
| int maxOrganelleCount = 0; | ||
| int maxHexCount = 0; | ||
|
|
||
| foreach (var entry in tempWorkMemory) | ||
| { | ||
| if (entry.Value > maxOrganelleCount) | ||
| if (entry.Value > maxHexCount) | ||
| { | ||
| maxOrganelleCount = entry.Value; | ||
| maxHexCount = entry.Value; | ||
| } | ||
| } | ||
|
|
||
| // The raw bonus is just the ratio of the main organelle type | ||
| var bonus = (float)maxOrganelleCount / totalOrganelles; | ||
| var bonus = (float)maxHexCount / totalHexCount; | ||
|
|
||
| // Calculate a strength factor that adjusts things | ||
| var strength = Math.Min((float)totalOrganelles / Constants.CELL_SPECIALIZATION_STRENGTH_FULL_AT, 1); | ||
| var strength = Math.Min((float)totalHexCount / Constants.CELL_SPECIALIZATION_STRENGTH_FULL_AT, 1); | ||
| strength *= Constants.CELL_SPECIALIZATION_STRENGTH_MULTIPLIER; | ||
|
|
||
| // Then return the final result as the bonus being anything above 1 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.