#Balatro Neuro-sama Integration
1 messages · Page 2 of 1
https://github.com/luq-dude/Neuro-Sama-Balatro/pull/28 i literally thought this would be such a hard fix but turns out its the simplest thing ever lmao
minor changes to 3 lines
I spent like an hour messing with the draw card hook cause I though the issue was there lol
same i was losing it
Before we finish this, we might need to change the execution results where we return card name to the cards description as I don't think neuro will remember the card's description from the state because the action window is ephemeral.
good shout
hmm
im wondering how much we should be making ephemeral in the first place
I think shop and use hand need to be ephemeral as we send so much in them. we might be able to get away with boosters though.
made pr, changing some context to send description.
https://github.com/luq-dude/Neuro-Sama-Balatro/pull/29
do you guys plan on making a "manual" for Balatro to Neuro? (unless this was already made and I forgot about it)
you can put whatever you want ephemeral in state and put the rest in query I think, not 100% sure though
alternatively you can send context before the force
No I personally haven't seen this until now, the main goal for me right now is to get this in a state to where its not too buggy and is playable by Neuro without much extra help given by the integration as from there adding more information depending on how well she actually understands the game while playing will probably be easier than just assuming right now. I have had an idea similar to a manual, however the main issues would be her knowing when to use it and actually using that information. Plus there is also the issue with it filling her context window then causing issues with her remembering recent game events and the game rules we send her on startup thus negatively impacting game play more than helping (That could probably be solved by just sending game rules more often). I think it would be something fun to experiment with as toggle-able option in the future though, if implemented correctly it would probably work quite well. A good implementation would benefit heavily from what KTANE uses though so we can only hope
.

does not work for playing cards packs and celestial packs
this also made me realize the voucher magic trick does not work at all
since were completely ignoring playing cards in shops
and only looking for jokers consumeables
fixed both of these, also added context for forced selection so she knows she needs to select the forced card.
merged
im not sure what else needs to be done
if a joker or playing card has an edition in shop does it say?
playing cards will. jokers probably wont though
it says what polychrome does but it doesnt say stencil is whats polychrome
also it still says the stencil cost is 8
this was just triggered by a polychrome tag
then maybe the tag that makes shop free has that issue too?
youre correct
so the cost is incorrect when overwritten by a tag and the joker modifiers arent being displayed at all
and does it say the actual cost of a reroll when using the reroll tag/free reroll joker
yes
when sending joker context as well the modifiers also arent displayed
changing card.config.center.cost to card.cost seems to fix the issue
also realized that the clearance sale voucher also wouldnt display properly either but that fixes that as well
i love srs randomly coming in and just being like "hey did you guys think of this interaction" and it turns out we had not
I had been thinking of it for a while lol, just forgot to say it
I'll come back if there's more interaction you may have missed
speaking of tags i did specifically test tags that open a booster pack and those work just fine
@somber smelt made a new pr, finishes stake action implementation
https://github.com/luq-dude/Neuro-Sama-Balatro/pull/30
lmaoooooo
I love UI
UI isnt actually that bad if youre trying to create new UI stuff
the issue is just when were trying to manually find ui stuff
it was not designed for this
looks good, gime a sec to make a few minor context adjustments like changing the select deck success message to say something else instead of the game has started when we still need to prompt her for the stake
also by default i want to disable every other stake in the config except for white
Yeah I don't think there is a way to get all of the unlocked stakes in the game as unlocked is used for the currently selected one for some reason.
also means we need to make sure perishable, eternal and rental stickers work
but since neuro definitely wont be playing a higher stake anytime soon i think its fine to not priortize that for a bit
i want to release this soon
oh we need to print these in order
done I also changed decks to sort by the order shown.
ok added some minor context changes and a little note for stakes
have you started on adding this yet or can I work on it?
you can do it
tbh im scared of messing with how we get the descriptions for everything
i get how the system works but its a lot so ima just leave it to you
yeah it's a bit of a mess right now.
at some point we can go back and clean it up but for now if it works it works
I haven't tested this too much as I'll be gone for an hour or two but it should all work
https://github.com/luq-dude/Neuro-Sama-Balatro/pull/31
the joker modifiers are always getting sent even when the jokers themselves arent getting sent
oh wait i see what it is
the send joker descriptions are getting sent in the description for the interact with joker action, but the joker editions are only sent in the state for the action force
should prob move joker descriptions into the state message
honestly this stuff is all over the place because at the start of a blind we send the jokers but without the editions
i propose just moving the joker descriptions into the regular state messages with what the editions do and then just removing the jokers entirely from the description of interact with joker, and then we could also remove the silent context messages sent when we enter a blind
so itd be like how we handle playing cards
also the counting is broken but thats an easy enough fix
ill hold off on making any changes cus i wanna hear what you think abt when we send joker context
Yeah this all looks good to me, I can work on this now.
Also looking at this again, what is your opinion on also moving the current consumables into state.
pushed the changes into the branch, let me know if there are any issues.
I also moved the context for the amount of hands, discards, cards available to be drawn and cards in deck into the action window as they should be ephemeral.
if you interact with joker while in shop then the next state message doesnt say what the editions do
or whats in the shop
not sure if this is a bug that already existed and we just didnt catch until now or if its new
oh its old
Fixed now
thats the only issue i was able to find
gimme a sec let me make some minor context changes
also idt we need to bother sending the new joker positions since we describe them again right after
so ill just remove that
ok merged!
i also just did a minor pr fixing a few unrelated typos that i just realized andmerged that
but uhhh idk what else needs to be done now
made pr to fix issue with modded tags
https://github.com/luq-dude/Neuro-Sama-Balatro/pull/33
Apart from that, I don't know anything else that needs to be fixed or added.
merged
there is another issue with neuatro i noticed, gleeb cards have an effect of counting for 10x their base chips but theres no context explaining that since its not a card modifier but instead a property of the suit itself
we'd probably just have to make a manual check for that
either that or tell the neuratro guys to remove the glorp deck and the two jokers that interact with it in their version specifically made for neuro
Yeah I think just asking them to remove it might be easier as I'd rather not include manual checks for modded suits and stuff similar to that.
yeah
@reef skiff i think we're done! any changes from now on should only be bug fixes and context changes if needed. the guys over in the neuratro thread will have to make a custom build of their mod for neuro to remove some of the custom content that can cause issues, but this does work just fine with the art only version as well
sweet! i'll test it out later 
if i missed some crazy obvious bug im gonna lose it
Exited for this
Good job everyone!
huge shoutout to panda for basically doing everything lmao
On the Neuratro side we'll have something soon. I know 1srs was think on this already.. ('twins build') so expect something soon!
lol indeed so I saw.. I'm surprise they didn't get direct repo perms lol
they do
Oh good good! I've only been watching from afar..
I will also test it this weekend and see if I can find anything! Again thank you so much for working the intergration (and in good pace too!)
btw @somber smelt , did you add wether a joker is compatible with blueprint to the context messages?
lets find out
hah
nope!
one sec
the easiest way to do this would be tell neuro the status of the compatible text here when describing what blueprint does
ill prob also add a message if its incompatible telling her to move it if its currently incompatible
you could also tell her which of her jokers is compatible with blueprint instead of just telling her if the current targeted one is
hm
I think that could be helpful. Even when being care things always slip by. Would that be too much context?
ok if she has a blueprint ill tell her whats compatible with it
if she doesnt then wont bother
sounds good
oh brainstorm exists as well
discovered a bug with some modded cards where instead of the actual joker name we display the key instead
aaaaaaaaaaaa the {C:dark_edition} is there now
fixed joker names idk why that is showing now though
We might need to ask neuroatro to remove that from the loc_txt of the joker as I'm not 100% how to fix that
i could do that
wait nevermind I think I found a solution
the reason this happened in the first place is when getting the name for modded cards we only grabbed it if card.loc_text and type(card.loc_vars) == 'function' instead of always grabbing the modded name if card.loc_text existed
also i think study-sama is the only joker with a special effects on the name
solution to this is
name = card.config.center.loc_txt.name_parsed[1][1].strings[1] kinda ugly but better than nothing
pr for the fixes
https://github.com/luq-dude/Neuro-Sama-Balatro/pull/35
the cursed as hell code we have to write for this
I love localization 
no matter how cursed it gets itll never be worse than G.OVERLAY_MENU.definition.nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[1].nodes[2].nodes[1].nodes[1].nodes[1].nodes[1].config.button_UIE:click()
In a world of nodes[1] no-one wants to be a nodes[2]
what is that even for lmao
it's for pressing the new round button on the main menu
https://github.com/luq-dude/Neuro-Sama-Balatro/pull/36 added brainstorm compatibility to joker context
What in the holy JQuery...
the new run button
thats how we click it
the hierarchy for tabs is actually so cursed
I feel bad for y'all 
some buttons are actually really easy to click cus you can just search for the id
other buttons do not have an set id you can search for
and the id just ends up being based on when they loaded in or something like that so thats when we have to be cursed
get_UIE_by_ID is really cool when it works but then you realize that it just recursively iterates over all children and their children until it finds something that matches and you can see by this how deep that hierarchy can go
lol
..it should be an easy fix
oh the vars are nested thats why
ok it is an easy fix
the only card from neuratro that had this issue was rhythm which is why it was never discovered
cus other cards like twins have their text hard coded
@vapid cloak theres an idea i want to run by you. currently we describe modifiers to neuro when they appear on a card. this means for consumables that add modifiers, neuro has no idea what they do until she uses it. we could find a way too look into the info_queue or something to fix this, but what if we instead describe all modifiers to her at the start of the game (or at the start of a run to keep it fresh) and tell her "please remember this and keep it in your context window" since neuro actually chooses what to remember (https://github.com/VedalAI/neuro-game-sdk/issues/7#issuecomment-2536405147). this way, we can clean up context a bit more while still letting her know what everything does
could also make an action called describe modifiers or something as well that just re-sends the message
If we were to do this, I would prefer this as I doubt her ability to get information from that long ago (even if we send it at the start of every run assuming it's a long run) is that good. However, an issue with this is we can't really say how much she would use an action to query information so it could cause even more issues than the current method. I think maybe just sending at the start of every run and also in the state might be best for now as I don't really trust her to keep such important information for so long.
you could tell her at the start of each run and maybe remind each one or two antes or when she finds a way to apply the enhancement
but then we send a bunch of unnecessary information which is why we send it in the state
honestly i think shed be fine with sending it just at the start of every run
every run, make an action that describes everything and then just tell her "if you don't know what a listed modifier does, run the action"
as long as its in her context window somewhere then were good and for a longer run then it might be an issue, but if its once an ante or once every other ante even i dont think its long enough for her to forget
I think doing every ante then allow changing the amount of antes in the config is probably best and the action.
that works
also unrelated but i just found a new crash found with neuratro, the noriko joker just crashes the game when we try to localize it
hm?
I think i might know
literally every other joker works
for noriko I used two lists for its description, so maybe thats causing an issue
try making it all a single one, maybe that fixes it
tried that already
nvm i may have not have actually saved the file
yeah making it one table woprked
i couldve sworn i saved it
the way we do jokers is different from everything else so idk how to actually fix this in a general case
so if you released a twin ver with it being one table thatd be great lmao
I'll keep it in mind
getting all modifiers working, gonna try to get the rest done tomorrow.
@somber smelt made pr for bulk sending modifiers, I also changed when we send the context so now it's amount of played blinds instead of played antes, the main reason for this is, it was easier to implement and it also allows for more control.
https://github.com/luq-dude/Neuro-Sama-Balatro/pull/38
lmao i gotchu
ok i got rid of the existing "heres what every modifier does" messages for cards in hand and jokers and also changed it to send all the modifiers on game boot (or rather right before she enters deck selection from the main menu but same thing in practice)
Is there anything else needed for this or is that everything?
thats everything just wanted you to take a look before i merge
maybe we change get_all_modifier_desc to be playing cards instead of card as I think we use that in other places and it's a bit clearer. But apart from that it looks good to me.
changed and merged
im gonna get to work fixing these real quick
we never even told her what edition a consumable was so thats an easy fix
hows that
definitely not a hacky solution hard coding it nope i would never do that
nope nope never.. I guess we'll find out soon™
i hate this game sometimes for spelling it G.consumeable instead of G.consumable
theres a lot more of typos in the game om
btw it says currnently
df[o0i89hgdfxhgiuhdfg

the typo was too much for it to handle
i didnt even change joker logic...
maybe a one time thing from smods
its noriko...
What has she done now? tisk tisk
yeah i downloaded the newest ver you sent to vani its still technically two tables
Oh.. this bug.
tbh there should be a way to fix that on our side... i just dont know how
What causes the error when two tables of desc are presented?
the crash happens when we call localize
A built in function? hmm. pain for sure. As long as only one card has it can be fixed in the mod.. so at least there is that.
yeah thats why im so confused cus like... the game clearly calls localize just fine since the text displays
so whats wrong with the way we call it
Does the error/debug messages say anything useful? (If this wasn't a mysterious bug in a built in func I would have suggested looking for any instance of a multi-table desc and concat to bypass..)
it's cause we don't send AUT.info inside localise so it crashes when trying to access it as it is nil. Adding it to localise seems to fix the crash and send the text.
I totally knew it meant that 
oh wow that was an easy as hell fix
thanks
even works with it being split up like this
also that should probably be added to the other localise functions just incase there is a loc_txt with multiple tables.
just testing to make sure adding it to everything doesnt break anything
if it looks good to you then ill merge
In pick_pack_card why was the check for planets removed? I assume it was because you cannot add a planet from a pack into the consumables hand?
yeah
if you had max consumables it wouldnt let you use one in the pack
but the planet packs are always used immediately
Also noriko still crashes for me when sending context as card.ability_UIBox_table is nil
wha
using card:generate_UIBox_ability_table() fixed it for that card. I haven't tested it with a bunch of other jokers though
when discarding a hand
I think the issue is the table was never made as I didn't hover over the card or doing anything else that creates it. Idk if that same effect could be triggered while neuro plays though as I spawned it in using debug
Only one week until Neuro manages to softlock herself in 5 minutes 
That's the optimism I like to hear! Let's do this! hehe
@vapid cloak is it fine now?
Seems to work fine now.
ok merging it then
Just wanted to float around the idea of resending the vouchers she currently has and their description at the same time we send the modifiers desc (or maybe less often as its less important) as I would not be surprised if she forgets vouchers she gets earlier in a run with how its currently implemented.
shes guaranteed to forget vouchers (unless action results arent ephemeral)
which is why im so tempted to make everything not ephemeral
I don't think action results are ephemeral at least the API docs dont say they are. That's why I suggested we send it in them.
oh ur right
thats fine by me
honestly id just send them alongside the modifiers, it makes easy enough to keep everything together
@somber smelt pr
https://github.com/luq-dude/Neuro-Sama-Balatro/pull/41
merged
iirc action results are considered context so they get saved
@vapid cloak https://github.com/luq-dude/Neuro-Sama-Balatro/pull/42 what do you think
Everything looks good to me, But I will say maybe crash_start_time and ran_callback could be defined in hook_game to reduce their scope to only whats necessary.
there is also a trailing space at the end of the context but that doesn't matter that much
for whatever reason i didnt think i could have it in hook game btu youre right i can oops
fixed that and megred
@somber smelt pr for json stuff
https://github.com/luq-dude/Neuro-Sama-Balatro/pull/43
wait since when was vedal joined in this thread
whats the intent of these changes
the required field seems to always be empty
It's so empty schemas will also send required as an empty array as that wasn't happening before, the required field being empty was because I changed something and forgot to double check it worked. My bad. 
watching the plague inc gameplay makes me want to consider letting neuro control the game speed
but at the same time i dont want to see balatro being played at 1x speed or anything lower than the max really
so at the same time i dont want to let her
THAT BEING SAID we can let her control the game speed in the vedal co-op version cus itd be funny
Please do lmao
i just imagine neuro setting it to 0.5 every 10s to bother the tutel
Here's the thing, though:
in Plague: Inc. you don't have to go to the settings to change the game speed. In Balatro you do.
its just modifying a number, cant be that problematic
we should just be able to just change the game speed variable internally
the game itself modifies the speed when scoring takes too long
Oh.
yeah we can just change G.SETTINGS.GAMESPEED to whatever
and then that automaticallyt changes G.SPEEDFACTOR
Why did I imagine Neuro setting it to 0.001 or 9999? XD
wed probably tell her to choose between 0.5, 1, 2 and 4
since those are the vanilla options
I know, but imagining it is still funny.
lol.. do you want. Very
of you sir
Hi, sorry I left this project for a while; is there anything I can help with? @somber smelt
youre all good. weve finished everything up, i just want to see neuro play this on stream first and make sure we fix any issues that come up and then start work on neuro/vedal co-op
for co op i want to just let neuro control the shops but all wed have to do is just delete half the game hooks for that version to work
If I get round to It I might try making some features to give neuro extra game information (Card efficacy memory between runs, Synergy memory between runs etc)
i might just start work on the vedal co-op version
and for now just give neuro access to shops
and let her choose what card from booster packs
i wanted to see neuro try to play solo first but eh should be fine
esp if vedals not even sure if neuro can even play it remotely well solo
I think it was a matter of timing. Seemed like he was extra busy today. We still have Thursday.. but if you want to start on it than feel free.
I wouldn't count anything out with the full version regardless. Just be patient
yeah im not complaining abt it not being immediately played on stream, this stuff takes time. just thinking of getting a bit of a head start considering i want to make the co op ver regardless of if neuro can actually handle playing solo
fair enough!
Yeah if you want to. You can take your time with it that way too. Even if you get it done quickly it may not be able to be used right away. Good for debugging (if needed)
(Keep in mind the direct integration has more legs as it can be used by both twins going forward.. provided they can play well enough... the co-op one could end up being used once.. but could be fun)
making the co-op one is legit just commeting stuff out i think lmao
lol.
Yup I know..
Could make it a flag in the config too.. if you want to get fancy
good idea
have it default to full mode.. and than when they want to do coop they change the value.
or make it a keybind
Here are some ideas I had for unique stuff for coop, most are probably dumb as I have put no thought into them. If you like any of them I would be fine implementing them myself when the coop version exists :)
- A boss blind that switches between Vedal and Neuro playing per hand/discard. This could be implemented neuratro side with a check that the integration is also loaded (smods has stuff for this).
- Make it so jokers and consumables can only be modified or used by Neuro, this should make it more likely for neuro to use the actions in funny ways if she knows she is the only one able to change them. Atleast I hope.
- modify card's .states so they cannot be bought by Vedal, Would probably need to modify states again in execute_action before using the card though. This could stop any race conditions from Neuro and Vedal interacting with them at the same time.
oh thats kinda smart to prevent any race conditions
i prob wont start any work on coop until at least next week
Oh last night I though of something to pass along. I recommend you use another branch until the stuff is stable just in case Vedal uses the full integration between now and when you finish the new feature set. It would suck to break it right when he's about to use it.
already was going to yea
rip this thread

i did actually start
on just the code cleanup for now
and i only did a small thing
but a start is a start
status update: somehow cleanup has turned into me rewriting half the localization stuff
so this is no longer cleanup this is a pretty big refactor lol
Localization you say? 🤔
and today is the first time ive touched this since last time
how we get the descriptions for stuff to send to neuro
we call the games localization function on whatever object then just throw the result at neuro
cus balatro only determines the text that appears when you hover over something when it actually needs to be drawn to the screen
ok why does this work for every consumable EXCEPT for rhythm
Add a Osu! seal to nil selected cards in hand . Sell value: $1
i dont get why it works for the shoomimi seal spectral but not the osu one
but this new system for getting loc vars is really cool and if i get it working i can replace like 1000 lines of code with just 80
oh its bc mitosis is a scam and doesnt actually use loc args
oh all the neuratro consumeables are a scam
so my system just straight up doesnt work w modded stuff
a
status update: it works now and i tested it with every single joker in the game + the neuratro ones and it also works for those
and its just one small guy that does everything
just ignore how it doesnt add the name of the card
putting this here so mainly i dont forget, but my next steps are:
get this new system working for vouchers and booster packsrewrite getting card modifier descriptionsdecide if you want to do the same for tags cus this should also work despite tags not being cardsrename get_run_text.lua and get_text.lua to something that makes more sensemove the context related stuff from run_functions_helper.lua to run_context.luarewrite the logic for getting query/state strings to be a bit cleaner- ~~figure out a better system for registering actions ~~
my current idea is to hook into the games update function and setup a FSM (this is what the base game does already for all the logic so well just add our own)the states can be something like in shop, in booster pack, in blind selection, in round etcwhen we enter a state, we register all the actions for that state and then set a global state_finished flag to true which will then turn off all action registering- ~~then inside the execute_actions for each action we set the global state_finished flag to false which will then register the appropriate actions again in the next call of update() ~~
rewrite the logic for verifying consumeables across actions- add in co-op mode
- configurable? hotkey
- configurable actions neuro can take
- when we register the actions for the current state, check against the config options to make sure its enabled for the given mode, otherwise just leave it up to the player
- add some text at the top of the screen or smth that says "neuro in control"/"player in control" or something like that to show whos in control for the current state
- see if we can lock player controls so the player cant crash the game by interfering with neuro
also thinking of changing how the config works a bit, cus if we add a new setting to it then git will throw a hissy fit when you try to pull the new config if youve made any local changesprob gonna tell people in the setup instructions to make a copy of config.lua called like local_config.lua or somethingadd local_config.lua to the gitignorewhen loading a config option, check if its defined in local_config and if not fallback to config.lua
- rewrite context to use markdown
i love finding comments past me wrote
Oh god. I know how that goes.
anyone wanna do a bunch of testing
A mod to let Neuro-Sama play Balatro. Contribute to luq-dude/Neuro-Sama-Balatro development by creating an account on GitHub.
if anyone wants to test this branhc
just play the game through tony and tell me if actions arent registering or if the game crashes or if theres two action forces at the same thing or context messages are misformatted? malformatted? badly formatted? or anything like that
my main focus is on action registration but other bugs are cool i guess
known issues:
- sometimes theres a few seconds of delay before some actions gets registered (booster packs), but if nothing happens after like 5 seconds then its bad
- the aura consumable sucks, it wont let you use it
after this ill fix up consumables then actually work on adding co op
everything up until this point has been prep work
@lilac wasp you help him if youre not busy
Not now
Sadly, I am busy for a little bit, so I have no idea when, but if I get a moment I'll dig out my old tony setup and give it a test
I tested for about an hour and did a few runs, these are the main issues I ran into.
Does not send context about booster pack cards, it didn't matter if the booster was opened from skipping blind or buying it. This seems to exist for all types of boosters, heres an example of the context I recieved.
[State] [Ephemeral] You currently have 0/5 jokers in your inventory.
You currently have 0/2 consumables in your inventory.
[Query] [ephemeral] You have opened a booster pack containing consumables and can now immediately pick consumables to use from the pack. Some consumables require a playing card as a target, so you have also drawn a hand of cards to use if needed.
Context about the joker cards in the shop was not sent, it did send booster and voucher context though!
registered skip_blind on boss blind after leaving shop, if you run skip_blind it sends result saying you skipped boss blind then registers the actions again correctly only registering play blind.
did not register any blind actions when skipping a booster pack from a tag, I was messing with debug stuff so that could have broken it?
Issue with colour tags in context, here is an example
- 2: {C:dark_edition}Study-Sama{}: A R andom played card gets retri G gered between 1 and 10 times. . Sells for: 4
These are also some context issues, none of them are too big but I might as well document them:
need to change blind query if cannot skip blind as it will always say "Choose to select or skip the currently selected blind"
Should probably fix issues with adding space to card context even when already having one in that space, not too important though. e.g. "+12 Mult" rather than the correct "+12 Mult"
The buy actions could also be unregistered if everything in that field is more expensive than what she can afford, but Neuro is probably smart enough to not mess that up though.
Still worth making an allowance for. the twins may not act on it, but better to be safe than risk breaking live on stream.
i guess after all the revisions i somehow missed the context stuff
thanks
registered skip_blind on boss blind after leaving shop, if you run skip_blind it sends result saying you skipped boss blind then registers the actions again correctly only registering play blind.
howd i manage to do that
Does not send context about booster pack cards, it didn't matter if the booster was opened from skipping blind or buying it. This seems to exist for all types of boosters, heres an example of the context I recieved.
i may be a little bit stupid
meant to be state_parts[#state_parts+1] = RunContext.booster()
Context about the joker cards in the shop was not sent, it did send booster and voucher context though!
oh i think im actually stupid
meant to be if #G.shop_jokers.cards
we do check to make sure she has money and tell her "you cant afford this" if she tries buying something, just we could avoid giving her the option entirely if shes poor
rerolling the shop is the only one where we dont give her the option if she cant afford it and if she doesnt have any free rerolls
we should probably make that consistent across actions
I think that's a sound idea.
theres an argument for and against not registering stuff she cant do
if she tries doing something, gets told she has no money for it, she might think "ok let me sell something so i can afford it" so maybe we shouldnt
but if she cant do it in the first place she might be like "i want to buy this why cant i"
assuming she doesnt realize the cost
When it comes down to it.. you have to balance streamlining vs. agency. Neuro and/or Evil I can see doing that yes. I think if it effects actions related to the game put it on them, but if it's a integration protection or a situation where there is zero choice (but still present it to them) than that's when you can put in some streamlineing.
Hmm wonder how they would handle credit card.. hehe (side thought)
we do take it into account
Indeed!
balance streamlining vs agency
Neuro integrations in a nutshell
registered skip_blind on boss blind after leaving shop, if you run skip_blind it sends result saying you skipped boss blind then registers the actions again correctly only registering play blind.
fixed
did not register any blind actions when skipping a booster pack from a tag, I was messing with debug stuff so that could have broken it?
cant replicate
Issue with colour tags in context, here is an example
study sama seems to be the only card in the entire game like this (see attachment for literally everything), i wonder why
hmm
like why is this fine?
"{C:dark_edition}Negative{} jokers give {X:mult,C:white}x#1#{} Mult"
}
oh i figured it out
we dont bother localizing the name
cus cards normally dont have special effects in the name itself
i have 2 ideas for reworking consumable validation:
the easy way:
in validate action, we highlight any cards that neuro selected then just call card:can_use_consumeable() which is what the game uses to determine if the use button should be grayed out. if it returns false, unhighlight the cards then return false on the action result. if it returns true, then we just return true and then in the action execute we can then use consumable.
cons:
- if neuro selects cards when they arent needed for the consumable, it'll go through anyway. this means that in the execute action at the end we have to unhighlight any cards that are still highlighted after it's been used
- if neuro tries to use a consumable but cant, we wont be able to tell her why, so shes just got to guess
the hard way:
basically what we currently have, just i do some rewriting and consolidate the validation for consumables into one big function that just determines if a consumable can be used given some highlighted cards. we can then give each failed check a reason why it failed so neuro knows why
cons:
- will have a lot of specially coded checks for certain consumables
- some modded consumables might have special conditions that we cant take into account properly (nothing from neuratro is like this so idk how much i care)
- more annoying to test and more work to implement lol
yknow writing it out like this the 2nd way sounds better
i wanted to try to get away with the easy way but after thinking abt it for longer than 5 min that sounds like a bad idea
welp tmmrw ill get on that, shouldnt be that bad aside from testing and then finally co op
so despite ankh deleting all other jokers except for the one it duplicates, you still need an extra space for it
didnt know that but this is easy enough to take into account w the new system
it does the deleting first as well
also "fun" fact, aura and cryptid dont unselect the card you use them on after use
unlike every other consumable
ive tested consumables in blind and in shop and im very confident with those
but i havent done muhc booster pack testing
as soon as i try a booster pack the game crashes
love to see it
fixed im just stupid
how we all feel after debugging for 5 hours just to fix it after 2 minutes of reading docs
ok
next up is co op finally
i already have an idea on how to implement everything just need to sit down and do ti
but the time for that is not tonight
if anyones curious heres the notes i wrote late last night for implementation details. mostly just notes for myself but comments are welcome
- add config options for each stage that determine what neuro can do in that stage (or for each action determining if neuro can call it)
- add config option for default boot mode
- add an extra wait on game boot where a keybind can be pressed to set mode
- could probably be toggleable between neuro solo and co op mid run but its much easier if we enforce a full restart to switch modes
- if were in coop mode, check the config before registering the actions
- no action forces during co op
- just send the state/query strings as regular context (add reworded versions to be more clear to neuro shes not currently in control and is just watching someone else)
- sometimes state is incremeted in the action execute, so if its instead done manually, the current state wont update.
- most action executes have one big function call they do (ex: exiting the shop calls exit shop, using a consumable calls use consumable, playing a hand calls play hand... you get the idea lol)
- for each of these, add in an argument that indicates that neuro is the one who called it
- then hook into those functions and if that argument is nil/false, we know it was done manually and can manually increment state
- alternatively, do away completely with incrementing state in the execute and just hook into the function itself
- not all actions call another function that progresses the game, an easy example is the info ones like get cards in deck so those will still have to manually change state
- these all currently decrement state which triggers them to be reregistered (alongside the other actions like play/discard hand)
- i can already see a problem where neuro performs one of these in co op as something else is manually performed potentially breaking the current state
- probably gonna have these go by their own registration logic if its co op mode (should probably be able to add them to a seperate action window that is registered on run start and then unregistered on game over)
i wonder if mods ever are just checking message logs and see me editing these long ass essay length messages
I did that with my list of things to do lol
In the mod
most action executes have one big function call they do (ex: exiting the shop calls exit shop, using a consumable calls use consumable, playing a hand calls play hand... you get the idea lol)
... this just isnt true, the first two examples here instead press a button which is gonna be a lot harder to hook into
partially have to go back to the drawing board
actually wait
every time we click a button the game just calls G.FUNCS.button_whatever with the button itself as the argument right
so we could probably just do
button.called_by_neuro = true
button:click()
and then hook into the actual function in G.FUNCS and just check e.called_by_neuro
probably
i just deleted 1515 lovely log files
nothing else really to say i just wanted to mention that
youd expect G.GAME.selected_back_key to be the center key for whatever deck was selected right?
wrong its a whole ass table lmao
G.GAME.selected_back_key.key is so stupid
But... why?
in co-op mode if neuro isnt in control of selecting deck then we need to tell her what deck was selected instead and what it does
honestly i dont understand half of the programming decisions made in this game
me when I look at any big codebase
i dont understand half of the decisions made in this mod
and im the one who made them
i hsouldve spent more time planning and learning how the game actually works at first
i have to do a bunch of testing and still add in a lot of context but im getting really close to being done with coop
then i have a few minor improvements i want to make to solo
i sya that but i got no idea when ill actually finish this ive been working at a pretty slow pace
Take as long as you need. I get the feeling that you have plenty of time before it could used anyway.
you ever accidently send context once every frame? yeah me neither
actually that was more than once a frame
I have
That was why I asked to file Pasu4/neuro-api-tony#26
@somber smelt could you please dm me in your free time?
after not touching this mod for a month i am back
i opened the project and my cursor was in the body of an empty if statement
took me a bit to just remember what i was doing
anyway co op mode is pretty close to being done
after i have some universla improvements i want to do that are mostly context related
and by pretty close i mean i think im done i just need to test a lot and see if i forgot anything
after im done with everything we'll be out with v2
were getting balatro v2 before neuro v3 voice
🎦
Good to hear!
and now all the homework i didnt do over the weekend cus i was working on this has come back to bite me lol
i got a gift sub to balatro university lmao its a sign
oh neat!
hey guys
anyone want to test a billion different things
its a lot to test
that branch
can edit config.lua directly or just throw this file in the mod folder and itll use these options and use config.lua as a backup when something isnt defined
wait nvm this is very broken
wtf did i do
ok fixed it
i should clarify the main thing is just play a bit with everything off and just make sure the context messages being sent are good, then play with everything on through tony and make sure everything works fine and actions are getting registered properly
if it can handle evertyhing off just fine and everything on just fine then were prob good
but if you want to test different combinations be my guest

