#[Graveyarded] Wraith - A mod for improving the performance of Balatro's scoring

1 messages · Page 1 of 1 (latest)

brittle urchin
#

Wanted to make a separate thread for this because there is some interest about it, and I might mess around with the scoring calculation system soon.

It's separate from Talisman because it'll be improving the actual algorithms themselves, not just disabling animations like that mod does.

Very open to merging this with Steamodded when it's stable, works well, and is opt-in (so jokers/cards that don't use its system aren't incompatible)

#

the first thing I want to do is make this not take an eternity

#

1,519,507 calculations with one king held in hand

#

and it takes like 20 seconds

#

ok this is already an improvement, but not by much
since there's not many redundancies here, it's mostly the repetitions

--Testing stuff
_RELEASE_MODE = false
function live_test()
    for i = 1, 25 do
        add_joker("j_baron")
        add_joker("j_mime")
    end
end

local cj = Card.calculate_joker
function Card:calculate_joker(context, ...)
    --yes I know this breaks Steamodded compat, I'll fix it later
    if self.config.center and self.config.center.calculate then
        return self.config.center.calculate(self, context, ...)
    end
    return cj(self, context, ...)
end

local iip = Game.init_item_prototypes
--set up all "vanilla" calculate contexts
function Game:init_item_prototypes(...)
    iip(self, ...)
    self.P_CENTERS.j_baron.calculate = function(self, context, ...)
        if context.individual and context.cardarea and context.cardarea == G.hand and context.other_card:get_id() == 13 then
            if context.other_card.debuff then
                return {
                    message = localize('k_debuffed'),
                    colour = G.C.RED,
                    card = self,
                }
            else
                return {
                    x_mult = self.ability.extra,
                    card = self
                }
            end
        end
    end
    self.P_CENTERS.j_mime.calculate = function(self, context, ...)
        if context.repetition and context.cardarea == G.hand and (next(context.card_effects[1]) or #context.card_effects > 1) then
            return {
                message = localize('k_again_ex'),
                repetitions = self.ability.extra,
                card = self
            }
        end
    end
end
#

honestly a G.FUNCS.evaluate_play override might make sense

#

because you have to replace so much to stack retriggers wherever necessary

#

but yeah this is basically how I would try to speed things up next

#

that would take a large effort and isn't worth my time right now imo

tepid saffron
#

math will eventually buy out all the other moDs with spectral names so he can own all the spectral nameD moDs

brittle urchin
#

tbh now that I think about it, this just makes more sense to merge with Talisman if I’m working on it anyway

#

as a config option

#

[Graveyarded] Wraith - A mod for improving the performance of Balatro's scoring

runic sparrow
#

lasted 6 hours and 15 minutes

#

rip