Tuesday Update #2: Network issues & chests
I can safely say that this week was a little bit slowed down by some Unity bugs. I was working on network stuff, e.g. “If player A drops an item, every other player sees that item” and added a throw animation. I was in good spirits when I discovered a small bug of mine that caused improper disconnection of clients when the host decides to exit the lobby. I quickly fixed it, went for a test run and – the game crashed inexplicably when I tried to host a game. Bug searching ensued, but to no avail. I couldn’t bring myself to restore the GIT repository to a previous version (i.e. reset all code progress) because before the bugfix, I changed several small details and did not want them to be lost. So I decided to lay off network and work on other stuff in the game, hoping it was just a Unity hickup and itI’d magically fix itself.
So one minor thing I did was rearrange the order of input buttons. I added them as I progressed so they were semantically incoherent: First, you’d have to set the button for walking right, then for throwing, the for jumping etc. I wanted to make blocks of “movement” and “action”. But Unity does not allow reordering. You’d have to redefine the key settings from scratch. I was lazy and didn’t want to do that, so I looked up alternative ways. One way to do it was to set Unity to store metadata in text files instead of binary files, and then rearrange the keys in the text file. I did that, Unity serialized all metadata in text, and…. suddenly, all network errors were fixed and the build no longer crashed! Well, that was today. I will now be able to continue working on network. 😉
So apart from many many small optimizations and fixes, there’s a new feature I have added. Storage! Now when you activate a storage deco item, a nice circle will tell you what’s inside. Who doesn’t like to scrabble in chests and find some land mi…ce!