-
Notifications
You must be signed in to change notification settings - Fork 19
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
Optimize bulk TC shattering #64
Merged
bloodrizer
merged 2 commits into
nuclear-unicorn:dev/beta
from
Brent-Call:optimizeTCShatter
Jun 11, 2024
Merged
Optimize bulk TC shattering #64
bloodrizer
merged 2 commits into
nuclear-unicorn:dev/beta
from
Brent-Call:optimizeTCShatter
Jun 11, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bloodrizer
approved these changes
Jun 11, 2024
bloodrizer
added a commit
that referenced
this pull request
Dec 12, 2024
* Rework Temporal Paradox trigger mechanism to update in real-time * Fix bug: "No void is generated on first day of temporal paradox" * Added Foreign Policies: Relations * spiderChemist effect placed in calculateEffects so it only runs when it has to. Unlock realtion tied to calculateEffects so MP diplomacy can upgrade it and run it on load. Race Standing requirement removed. Added a few comments. * Added Lizard diplomats, changed Nagas and sharks * Added Shark Botanists and Merchants Removed Shark Shipwrights Change: Lizard Priests * Shark Scribes buy double the iron. Embassy requirement and policy costs adjusted. * Added Naga Architects * Changed two policies Changed Dragon Astrologers and Lizard Ecologists. Removed some unused code. * Added Spider Paleontologists - Added Spider Paleontologists - Changed Spider Geologists - Nerfed Griffin Machinists * Improved relation descriptions * Bug fixes * Add new policy: Scientific Communism * fix to holy genocide production multiplier Originally was supposed to be a linear uncapped increase, but it had a LDR limiting it to a 2x boost * Balance changes - Spider Geologists are now based on embassies - Shark Botanists refine bonus in IW is now instead wood bonus * Fix the thing I broke in science.js Fix error with meta being undefined--oopsie, that was my bad * Balance changes * Scaling policy changes Spider Geologists and Lizard Diplomats no longer have a default bonus. The description of policies scaling with embassies now includes the calculation. * Policy description change Changed two policy descriptions to second person, so they are line with all other policies. * Relation description change Changed the new relation policies to use second person. Changed Ship potential bonus to Reactor Vessel bonus. * Spider Chemist bug fix When importing a save, spiders sold multiple instances of kerosene. * Fix that bug where extra game-ticks would occur when the player clicked on UI elements. * Added loadout system * Small fixes leader job is now saved On deleting the loadout name is displayed * loadout anarchy fix You could assign a leader with existing loadouts * changes and New dragon policy Added Dragon Relations: Dynamicists Effect: hunt catpower cost -10, trade catpower cost -5, Orbital launch catpower cost -50% Changed Lizard Priests: Manuscripts give some faith while reducing manuscript from them. Removed uneeded comments * Sorting and favorite system - Kittens can be sorted - There are pages in the census - Kittens can be favorited, and favorite kittens are prioritized when you reset with cryochambers - If a kitten is an engineer census now also lists what they are crafting. * Loadout update (#57) * Loadout sorting and description - When loadouts are assigning a leader, the most experienced kittens will be prioritized. - Loadout description now shows leader job saved. - Comment cleanup * Fix Comments assing is replaced with assign * Hide wood separately in normal resources vs. crafted resources panel (#59) * Prepare the Challenges system to be more elegantly extendable. (#61) * Import Tick Bugfixes (#62) * Fix offline kitten arrival ignoring Hydroponics * Fix bug where we get 1 tick of production while importing a save. Hopefully less hacky than previous solution. * Optimize bulk TC shattering (#64) * Make compareShatterTime easier to read * Make bulk TC shattering approximately 30% faster * Limit unicorn-related resources in a Unicorn Tears Challenge (#63) * Limit storage capacity for unicorn-related resources * Improvements to the religious resource refining system * Temporal Press fixes, queue features, & small UI changes (#66) * Fix Temporal Presses consuming energy after reset * Don't call getPricesMultiple multiple times * Write a faster function to get multiple TC shatter prices * Remove lag in the time tab from having lots of Temporal Presses * Simplify getPrices for shattering 1 TC at a time * Fix Temporal Press carryover not properly limited by 1kY completions * Fix Temporal Press not updating custom shatter link handler * Remove queue itemType label, turn items red if storage limited, fix incorrect caption * Make red queue items respect the game settings * Don't gray out completed Challenges * Fix a bug where custom shatter link was visible when it wasn't supposed to be * Fix necrocorn per day being affected by Tempus Fugit * Clarify that synergies care about active AI cores, not AI level * Holding SHIFT no longer squares the active HGs as shown in the tooltip * Add test suite for bulk TC shatter prices * Fix math error with bulk shatter TC prices * Rewrite queue logic to not have setState in componentDidUpdate * Unicorn Tears Challenge changes the prices of items in the Bonfire & Workshop tabs * Add tests for price weighting algorithm * New achievements & basges (#71) * Add flag to track if the current run was started without benefit of Chronospheres * Add silly things that happen if the player shatters 500 TCs during a temporal paradox. * Add a bunch of new achievements & basges * Don't count unethical starred achievements * Update the achievements panel live whenever anything changes. * Update badges panel live whenever anything changes. * Make the basges panel much more readable * Silly formatting for some basges * Make Fantastic Fur Color work in all color themes & fix issue with current leader overlapping their own crown. * Add achievement for Challenge completions. * Achievements UI improvement: Handle text overflow cleanly (usually using ellipses). * Census improvements: Better filtering, rendering improvements, render live-updates, fix bugs, promote individual kittens, bulk mass promote (#81) * Unicorn tears science costs (#70) * Overcapping unicorn tears results in pollution * Technologies cost unicorn-related resources in a Unicorn Tears Challenge * Add test case for enforcement of resource caps * Prevent overcap from triggering due to floating-point precision limitations * Set temporal paradox chance effect to be hidden * fix: Leading spaces in i18n literals (#89) * Unicorn Tears Challenge reward (#91) * Add reward of Unicorn Tears Challenge * Add challenge unlock condition, clear condition, & description * Add feature flag for unicorn tears challenge --------- Co-authored-by: Brent-Call <[email protected]> Co-authored-by: Brent Call <[email protected]> Co-authored-by: Brent-Call <[email protected]> Co-authored-by: SilenceFactor <[email protected]> Co-authored-by: ZigguratV <[email protected]> Co-authored-by: Antipatience <[email protected]> Co-authored-by: Oliver Salzburg <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I spent some time optimizing the code. From the data I collected on my machine, it shattering 50-100 TCs approximately 30% faster. The benefit for shattering less than 50 TCs is smaller (closer to 15%), I didn't test batch sizes above 100 (I didn't have the patience for that), & I used small sample sizes (50 samples). So there's a high degree of uncertainty in how much faster the code actually is. Nevertheless, the code is slightly faster.
Oh, it's probably also worth mentioning that all three shattering methods are improved by this. Normal shattering, shattering with Temporal Accelerator automation on, & also shattering using the (now deprecated) "shatter in cycles" method.
Admittedly, these optimizations make the code harder to read, so I added a few comments to compensate.
yarn test
looks good--all tests passing.