Fixing The Big Bug!

Fixing The Big Bug!

This update has been a beast. I’ve had to rewrite basically all the code in the game in search of several errors that only appeared on Say’s computer!

Here’s what it looked like: EWWWW BUG!

At first, we noticed some orange blocks in the splash screen for MGZ and that the clothing was the wrong color. After seeing that two things were wrong and only on some machines, I had a tough time looking for what the problem was. 

I had created a “Sprite Helper” class, a new sprite system to fix a previous memory leak. Trying a few more small tweaks, I found out the bug showed up around the time I started using unity’s Sprite System to manage in game assets I would write my own version just to eliminate that as the potential cause. I split up the assets into atlas sheets of various sizes and indexed them based on name. Turns out there are 365 different types of sprites in the game and I had to place each one of them into the correct sheet in the correct order and reprogram the game to grab a Sprite Helper from my new manager whenever it wants to display a sprite. This actually unified a great deal of code because for a long time I had the UI system on its own using a different system than the rest of the game’s sprites. 

Now, if you want a 2D object in MGZ you ask for a sprite from the sprite manager. This has been shown to make the load time faster just due to being organized better than the way unity does it, and the game organizes the same kind of sprites into batches so its not heavy on the rendering. Furthermore, if I feel the need to drop Unity, it’ll be easy to take my perfectly organized sprites elsewhere!

That’s a lotta sprites!

However, this did not solve THE BIG BUG on Say’s machine. So I decided to turn the tables and bug her a bit and force her to do several test builds a day. My first set of tests I created a debug layer so I could tell if the glitched layer was even in the game layers or elsewhere.

No one gets past DEBUG LAYER.

I sent several builds moving the debug layer forward and back looking for exactly where the visual glitches were, and I did narrow it down to the layer with the coins. In fact, the stacks of coins were where the problem was to be specific.

After a few more builds, I was convinced the coins were getting bogus values to their positions, but how? I had them read in from a text asset just so they would have fixed positions and then it hit me: both the clothing and the coin stacks use a “ReadVector3” code that I wrote. So I went and looked at that and of course, the code was using “Single.parse” instead of “Float.parse” and it all became clear: there must be something with Say’s version of .net that causes the Single.parse code to read in a garbage value which doesn’t happen on other machines. So I removed the parsing code and it worked correctly finally! I was running out of build letters, we did one all the way up to ‘x’ and the final build for this version might be a few after that!

Glad I could get that taken care of after months of coding work. But besides this big problem, there are other new improvements coming with this build:

  • MatchyMart™ notifications will be more clear and easier to dismiss. Easier to understand buy/sell times.
  • Better sugar rush times. Optimizing negative effects.
  • More UI feedback for games to tell you how well you are doing. It will help people understand and enjoy the game better.
  • Thought gear for between star actions. It will be helpful for training personalities.
  • Ships fly off to the left instead of flying on top of star. Visual aesthetic suggestions we are taking care of now.
  • And the big economy overhaul: different food has muuuuuuch bigger impact on the value of the ships you produce, so there is a reason to buy!

So sorry it took forever to get this one out, I do wish it were easier to take care of this kind of issue and thank you so much for being patient. Hopefully we’ll have a LOT of updates this year and we can just crank them out one after the other now that everything is organized!

-BIG CHEESE, Michael

Follow me on twitter!