#quick convert menu not appearing on trading post sometimes
78 messages · Page 1 of 1 (latest)
do you have any way of reproducing this issue?
And sending your !logs after it happens would be helpful 🙏
%userprofile%\appdata\locallow\Fire Sword Studios\The Perfect Tower II
Current log: perfect.log
Previous log: perfect.1.log
yeah for sure, i had to go right after sending that
and no but i think i remember reporting the same thing years ago haha
Any way to reproduce it from your side?
There was a bug related to that which happened when a trade was selected and a worker or AI performed the trade, it was stuck with an invalid trade preview which resulted in errors when right clicking one of the trades "+" symbols.
Is the issue happening on the main "+" symbol, on the trade "+" symbols or both?
It's this thing #infinity-phase message
So, the root one, from trading post itself, not the trade
k, that narrows it down at least^^
have you checked my corner? I'm working on this too
not yet, the last thing I saw was the RNG manipulation stuff
It's just baffling because the conversion dial (the one next to the resources) is the exact same one that is used in any other building. The only special case are the two from the trade. So I have no idea how and why this is connected to the trading post at all
Actually, wait. We know that the button circled red fails... but do we know if the buttons circled in black work?
The black ones actually had a bug that I could fix years ago which was related to AI or workers trading a trade offer that was currently selected
but the red one is constant
it never changes during runtime just like the ones in the other buildings
Well yea, they all use the same component, the trading post just wants to be cursed and have the button fail sometimes
yea, it's never been reproducible. For all the time we've been trying to figure out why this happens, we never know what sequence of events lead to the bug
it was just the conversion symbol from what I saw
Also sorry, I don't know
it just happened randomly and when I went back from Tower Testing and reinitialized it, it worked again
yeah idk this bug has been around for a while, sorry i can’t help narrow it down more
Okay, let's try to narrow it further down together:
The next time someone encounters please check the following things:
- Did this happen in your first session since you started the game or did you load multiple saves? (Basically did you go back to the main menu at any point in time during this session?)
- Was the AI or a worker interacting with the trading post while this happened?
- Were the two other conversion dials affected as well?
- Does closing and opening the building again fix the issue?
- Did the bug disappear after leaving town and re-entering it? (For example by tower testing or doing a boss fight.)
I can tell you that, when I got it to happen last year, I didn't have Facility AI on, nor did I have a worker on trading post (I still have the pdf) XD
Closing and opening the building didn't fix it.
As far as I remember, reloading the scene does fix it.
Oh, and this thing coming in handy XD
I had the bug happen again the next day, first thing when opening the game, I went to check the trading post, and yup, it was bugged
I doubt it's save persistent, so it just happened again
closing out of the building does not fix
first session
going to tower testing and back does fix it, however
AI/Workers?
none
^
Okay, so happens within the same scene (no global references cached anywhere) which means it has to be fixable within the scope of the scene. Did you check the other two conversion dials in the building by any chance?
when I had this bug, it was only for the bottom dial
I FINALLY FOUND IT! The shipyard conversion dial had an invalid reference to the trading post dial (copy paste issue apparently). When you open the shipyard conversion dial as the first thing in town and then go to the trading post (make sure to not open it before visiting the shipyard) the conversion dial will not open and throw an exception

-
I only used one session at the time and don't remember loading any additional saves.
-
No AI or workers were involved as I had none of them performing trades
-
Can't really remember that the other conversion dials were affected cause I didn't check
-
Closing and opening the building did not fix the issue, but if I reloaded the town entirely from Tower Testing or going to the seasonal event it would work.
-
I think it just happened randomly when I was in town. I was doing other stuff like Factory and looking at Military Perks or something before the bug happened.
oh nvm he fixed it
😔
This is an EXTREMELY niche interaction though
Programming does the darndest things
No wonder it felt so random lol
Yeah, in this case its more a "Unity workflow" thing since Unity allows you to expose events to the inspector to basically drag & drop other scripts into them and execute stuff when the event happens. The pointer up event of the shipyard conversion dial called OnPointerUp of the trading post conversion dial due to the buildings usually being copy-pasted (because most of the core components are the same)
^^
Couldn't this behavior be generalized with a class structure? Like a generic Building class that all of the other components inherit from, so that they can override the behavior of the OpenDial() function to point to the specific building resource and conversion rate?
I don't know how the game is laid out or if that is really hard to do in Unity, I've never worked in it before, but I work in C# pretty much daily. The workflow might not allow that to work like that.
That's exactly how it works on the code side. There is a UITownBuilding base class for all town building windows with each of them having their own subclass like UIFactory, UIMine, etc.
Unity encourages you to build modular components with its component based system so the pointer up/pointer down component is not aware of how it is being used. You basically put everything together inside the editor once you are done building the components (and this is usually where most of the bugs come from). A quick brain-afk moment and you are dragging in the wrong reference without noting (or you are copy pasting something because you want to build a new component that is based off of another one) and you might miss some references.
Since the conversion dials are part of the oldest components in the game (probably around 6 years old) they don't follow all of the guidelines we have set up in the meantime so they are especially vulnerable to such errors.
huh, that actually sounds similar to what gpt concluded, just through something I didn't even know could be connected XD
I think AI might be not bad at detecting this kind of things, since it's like anomaly detection (though might raise a lot of false positives)
That makes a lot of sense. I have to remember that this codebase is old and has probably been subject to a lot of refactoring and tuning over the years
To be honest, I really wouldn't like to leave AI to up to this type of thing because you can't really be sure that what it's saying is correct and could be applied in that context.
Even if it isn't AI, this is why I'm deathly afraid of Visual Studio "solution-wide" changes like Find+Replace because it could introduce unforeseen consequences that you have to revert back to the previous version to resolve.
I am not saying to listen to everything it says, but it could narrow down the search space
it'd not be like find+replace, more like just showing an info/warning message that you could ignore
Seems more reasonable
I think it's how google searches security breaches
That's really how AI could be more of a "coding assistant" than a full on replacement for software engineering. If it was a smarter version of Intellisense where it would be able to spot anomalous references and names that don't fit your schema, or catch errors that would cascade further down into the stack trace, I'd find things like that very valuable.
perhaps this discussion should be moved to #programming instead
lol
yeah, one thing I have said it could be great for is deciding if you are just trying to reinvent a bicycle and offer already working code from libs installed on your PC or in some popular libs
the usage of AI in this case was to observe the components being interacted with and try to determine how and why something with this description could happen in this space. Work toward having something that can be explained with how the code behaves, and then providing it to someone knowledgeable (like matt) with a cause that appears to correlate with what's observed
I have the same issue. Have the developers figured out a way to fix this in the next patch? It's a bit annoying, to be honest.
It still happens on v1.0.7?
(You can check your version in the bottom right corner of settings or in the bottom left corner of the Debug Overlay [F2].)
I have 1.0.6, I haven't logged in for over a day, if they fixed it in 1.0.7, this probably won't happen.
Should be fixed in v1.0.7.