Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
> 4. Add MyCustomRelic to relic array.
This would trigger the doRecieveRelic method via the RelicGetSubscriber in the main mod file. That method would change the -1 to its actual location.
int size = __instance.relics.size();
if (size != RelicOptimizationPatches.relicsSize) {
RelicOptimizationPatches.relicsSize = size;
RelicOptimizationPatches.relicLocs.values().removeIf(val -> (val.intValue() == -1));
}
The issue can occur like so:
1. Start with empty relics array
2. Call getRelic("MyCustomRelic")
3. Hashmap entry added for "MyCustomRelic" -> Integer(-1)
4. Add MyCustomRelic to relic array.
5. Call getRelic("MyCustomRelic")
6. Hashmap returns Integer(-1), so it enters into i != null logic.
7. relicSize check sees that relics.size() != 0, so it removes all -1
8. However since it has already found i = Interger(-1), it skips to the rIterSkipped case and returns null.
that will help with that for those struggling with missing letters in their text or RAM related crashes.
public class YoumuPatch {
@SpirePatch(cls = "com.megacrit.cardcrawl.characters.AbstractPlayer", method = "hasRelic")
public static class hasRelicResurrect {
@SpireInsertPatch(rloc = 0)
public static SpireReturn Insert(AbstractPlayer p, String targetID) {
if (p.name == "Youmu" && (targetID == "Blue Candle" || targetID == "Medical Kit"))
return SpireReturn.Return(Boolean.valueOf(true));
return SpireReturn.Continue();
}
}
}
This Youmu character mod starts with a relic (Half Phantom) that is supposed to allow curses and statuses to be played. Having the optimization mod installed will disable that aspect of the relic, greatly affecting the character mod's dynamics.
is there any chance you would like to fix this?
in case this helps, there is a localization mod to translate the Youmu mod to English https://sp.zhabite.com/sharedfiles/filedetails/?id=2777818594&searchtext=youmu
https://sp.zhabite.com/sharedfiles/filedetails/?id=2548274926
i can send you the modlist if you like
Either way, if it didn't help, that's too bad. Hope you can fix your performance problems.
i can always take a few out and add a few new ones in then, its ok - i must have gotten a bit greedy, trying to add all the mods i found lol :)
i can load up 23 mods, but when i tried with a lot more, it maxed out my 8GB system ram and crashed. even if the game would take longer to load, it wouldnt be so bad but im wondering why it crashes... if it loads things as it needs them, maybe there is a way to allow java to not run out of memory, but instead to simply need to access the filesystem more often?
(older versions of rimworld, used to fully scan and refresh the entire modlist, over and over, but they changed and optimised the process there too) :)
It might be worth taking a look at and doing some profiling on if you're interested.
[3 / 3]
The trivial solution would be to cache the results of the sort whenever the sorting button is pressed and store it somewhere instead of resorting every frame.
I haven't personally looked into things like the draw, discard, or exhaust piles, but there's a large chance that they have similar issues to the master deck screen (and they would theoretically be far worse, due to temporary status cards or other modifiers - even in just vanilla play, I've seen these piles reach close to 1000 cards under fortuitous circumstances, which is potentially on the magnitude where constant sorting might start to matter on low end machines).
[2 / 3]
Outside of the default ordering (which doesn't have this problem), if you select any other option it actually (re)performs the sort of all cards once per frame. Some quick googling indicates that Java's Collections.sort() implements the mergesort algorithm in the backend, which doesn't have any speedup when the collection is already sorted. I.e. you're paying the full n log n cost over and over for each frame.
[1 / 3]