Inventory UI Glitch

OK I really don’t want to open further topics yet, but I have an Inventory glitch in my game, where my Inventory Slots are invisible in-game and in-scene (as you can see in the image below):

Inventory Glitch

How do I fix this without messing things up? (Yes, it’s visible under the UI Canvas PREFAB, but not properly visible in the game scene or the scene view either). If it helps in anyway, my inventory used to glitch out in the past multiple times (Logical error), and I accidentally saved my file with my inventory in this state (with no reverse versions to return to unfortunately)

And the same goes for my bank too…:

Edit: I fixed it by rolling back to an older version, but I’m still curious to know what went wrong for me

Edit 2: Mini Update on this problem: Yes, I used an old copy of my project and spent hours re-coding all the new stuff, but save a copy of your project in your Asset files. That way when it randomly happens, you open that copy, reopen this file, and the issue (temporarily) goes away

There’s not enough information to know what went wrong, except that UI is tempermental.
As in I never touch Unity UI without committing to source control first.
Additionally, make absolutely sure while you are editing UI that you turn Auto Saving OFF. The undo doesn’t work well in a prefab referenced by a prefab referenced by a scene…

Generally, when I’ve gotten in a state like this, I just rebuild it from the ground up, if I don’t have it committed to source control.

This is one bug that I see once in a blue moon, so it’s hard to get proof or catch it again. For some reason, I did notice that my inventory keeps glitching out whenever there’s a large item transfer between inventories (be it the shop <-> player inventory, or the player inventory <-> bank), and the only way to make it stop glitching, is to click on an inventory slot. I just didn’t want to bring this problem up yet because I am deep stuck in other bugs that needed fixing first, but now that I bring it up, then I have 2 questions:

  • if my inventory glitches massively when there’s a huge item transfer, how can we potentially avoid this from happening in the final game?
  • how do I speed up the transfer between inventories? As mentioned, right now it’s incredibly slow (would literally take 30-60 seconds for transferring 10 items for example) and glitchy. I want to make the process a bit faster :slight_smile:

I’m not sure what you mean by glitching massively… like the image above? (shouldn’t, because it never saves back to the UI prefab).

That does seem unusual. How large is the Inventory size? The more slots to be searched, the longer the Linq expression will take to gather the items for transfer.

I have 50 slots in my inventory, and 273 in the bank (bank isn’t the problem (as long as the player inventory isn’t a problem, since the bank is a clone/prefab variant of the player inventory), player inventory is)

Well… this one was a rare bug. But it glitches out similar to cyberpunk style for some reason (i.e: it keeps zooming up and down at wild fast speed that the slots can’t keep up, which can eventually lead to the images above)

bulk transfers from the bank to the player will require a long filtering operation, but… 30 seconds seems long. I’ll look into it.

Which doesn’t explain how they get saved that wa, as we shouldn’t be modifying the actual prefabs through code…

When this insanity happens, are there any annoying error codes or even more annoying yellow messages?

well, it does act up, sometimes it’s 30 seconds… sometimes it’s longer than that unfortunately

When the insanity happens… usually not, it seems like a runtime glitch over a code bug. This makes it significantly harder for me to identify where the issue is coming from. Any idea where can we start debugging this from?

Most of the errors come from the Respawner from the moment, where I have a hard time choosing between ‘Destroy’ and ‘DestroyImmediate’ (both solutions don’t satisfy Unity), and some missing references to the respawners (I’ll investigate this when I am home :sweat_smile: )

At this point, since bulk inventory transfers from bank to inventory and back are completely out of the course context, I need to step away from this… If the issue is being caused by this feature, then remove the feature until you are futher along in your learning experience. I cannot reproduce it on my end with the provided code, and as it’s out of the course context, I have to deprioritize or I won’t be helping the most students possible.

Fully understandable. Thank you for at least trying Brian, I truly appreciate this :smiley: (I’m just hoping the final game somehow doesn’t have this problem)

If you disable the transfer all button, it shouldn’t.

ehh even normal item transfers would take 3 seconds sometimes. My guess is, my hierarchy isn’t the cleanest and that’s just giving me personal performance issues (probably)

Or there are too many slots in the bank. Whenever an item is transferred, the UI is redrawn. This involves destroying all of the InventorySlotUI and then re-creating them. You mentioned several hundred…

well unless we have a procedural bank slot generating mechanism (that would be amazing… no funny ideas though), I’ll probably stick to a couple hundred to ensure this game has enough slots for all amazing players :stuck_out_tongue_winking_eye:

It’s worth careful consideration that RPGS like World of Warcraft, Final Fantasy XIV, etc do not provide a massive amount of slots for their character’s bank…

Part of the game is also characters managing for themselves to decide which items to keep and which to discard as the game progresses.

as an ex-RuneScaper myself (you can guess where I get my wild ideas from now… :stuck_out_tongue_winking_eye: ), I used to purchase memberships as a child just because of the extra slots. Back then we had 438 slots for members (and about 168 for free players or so…), and somehow no bank transfer issues. I’m still not sure how they optimized that, but I can absolutely appreciate their work now

With teams of programmers to tackle the issue…

legend has it, this game was developed by 2 brothers from 1999 - 2001 (believe it or not, that’s where my motivation for this project came from). Their story is honestly wild

Meanwhile here we have the amazing teaching assistant, and the (temporarily) lost student with wild ideas :stuck_out_tongue_winking_eye:

While it was started by 2 brothers, in it’s height they had over 500 employees (they still have 450)

fair enough I suppose… for now I just want to get something out of the gate as a start. and bumping into this whole thing was one of my personal best investments ever (to me). It’s hard to find a mix this good on the internet of both content and support, and if someone asked me about the support for this project, I’d say it’s the biggest reason to buy it!

Privacy & Terms