Game Development | Eight Hours To Fix A Bug

in Game Development3 years ago

get player stats.jpg

Some days in game development are tougher than other days. This story happens to be around one of those days. I recently migrated a redesigned inventory system which I’ve shorted the scope on to meet more of my short-term needs. It’s the most complex thing I’ve dealt with and at every turn, it kicks me in the balls.

The system itself has quite a wide range of effects that touch on just about everything in the game. From each zone, all the monsters, the player’s character, the player control, UI elements, object interaction, and so on.

Just to put things into some kind of perspective of the size of this inventory system. 26 data tables contain around 40k words. Over 35 blueprints of varying different types. Over 500 icons. Along with over 200 functions and more variables than I even want to attempt to count.

The issue was some of the item data was being properly displayed from the mouse hover over event of the item in inventory. While the majority of the data either was not being displayed or was wrong. Which in itself was quite confusing of how that was even happening.

Attempt 1: Checking All Blueprints For A Compile Error

playing the game.png

Unreal Engine 4 (UE4) itself was also not giving a single error when playing or checking each blueprint. Many times when things are not working you luck out and you get a nice little pop-up of things that are going wrong. The game was playable and for the most part, things were working out as they should be.

Attempt 2: Inspecting Some Items In The Data Table

crafting item.png

Early on I thought this was going to be an easy issue to resolve. The couple of items that had the data issues that I looked into also had the wrong data in the table. With that wrong information when I building out the items, it would have told the rest of the system to not bother displaying any further data about the item to the player.

Item variables.png

Once it was fixed however and larger samples were tested by adding different zone data tables to monsters in a testing area the overlying issue persisted. I at least got a bigger picture of what was going wrong-- kind of.

In some instances, default variables were being displayed on the items. This however for some strange reason was not 100% of the time which left me more confused than anything. Even more, so that some data like the item names, quality, and type were displaying just fine.

Attempt 3: Restarting And Rebooting

A Short break.jpg

My next couple of fixes involved restarted the project several times. I don’t know how many times there was not a real issue and all that was required was a restart. This also included me relaxing a bit while I wait for things. Hence the photo above.

When you have odd things working and not working my past experiences told me to just exit out of UE4 and reboot my system. With how much data got migrated over it was possible there was some kind of caching or similar error that was going on. That sadly did not resolve it.

Attempt 4: Fixing Redirectors

fix up redirectors.png

I thought perhaps something was still getting stored wrong in memory. So I fixed up redirectors and retested with the issue still not being resolved.

I knew it wishful thinking. The universe is just not that kind on this day.

Attempt 5: Delete All The Things!

delete the things.png

I then went into the projects folder itself and deleted around 20 gigs of data from the saved and intermediate data folders. Again the issue persisted and this no longer seemed like it was a memory or an outdated file issue.

Attempt 6: Rechecking My Work

compile and save.png

Since my testing project where I build out the more complex things is a stripped-down version of my project. It gets wipe a lot as I don’t want to be dealing with hundreds of gigs of files. This also means I needed to make quite a few changes to get it integrated into my main project when it was migrated over.

I went through all my changes just to be on the safe side of things to make sure everything that I thought should be changed was done so correctly. Since a change in one blueprint can have rippling changes elsewhere with variables being changed I also went through and recompiled and saved all of them since that could also be what was causing the issue. Still nothing.

Attempt 7: Checking More Critial Blueprints

funcitions.png

Since I was looking at the issue more from a macro standpoint I decided to just hyper-focus on a couple of blueprints and functions that could be the root of the issue. Hoping to either spot the issue or notice some common characteristic between them that perhaps could be the culprit. No such luck.

Attempt 8: Oh Mighty Google Save Me

At this point, I’m several hours into not resolving the issue and I’m feeling quite defeated. That is when I turn to one of my favorite tools for such an occasion-- google. I try a few different search quarries to see if I can find any kind of comparable to the issue I’m getting related to tooltips.

Endless results were dating back over five years with lots of people asking for help. More times than not a solution was never found and some people would even come back every few months re-asking for help or stating what did not work. This is not uncommon and I often wonder how many projects hit a bug and the developer just gives up entirely.

I was at least hoping it would give me some kind of spark of inspiration that would lead me to discover my issue and fix it. That is usually how it goes as there is not going to be something quite exactly like what you are dealing with. That sadly was not the case.

Attempt 9: Just the Dexterity

Dexterity.png

My next thought process was if I just focus on a single item stat and try to find where or how it broke. I then could fix all the others where it occurred. So I went through the painful process of scanning for a single variable and checking many hundreds of results in every blueprint.

I even deleted, added it back, and tested it to see if that would resolve the issue in many blueprints. Making a game in a game engine can have some of the strangest quarks ever. This however was not one of its times. I also did not find any reasons why the single stat I was checking was not being displayed correctly.

Attempt 10. This Is A Basic Founction

a basic function.png

This is a basic function. It’s not doing a lot and you could say it's not doing much of anything like it should be. Many short functions like this are sometimes nothing more than an input node and an output node. It from the surface was quickly looked at and skipped over without paying much attention to it.

If there was anything wrong with this function from it being migrated over there are a few expectations I would expect have to indicate to me something broke. Just any one of these would have caused me to look harder at it. Such as the blueprint showing it needs to be re-complied. The nodes are not being connected. Objects unconnected in the function but UE4 connected the nodes without it. A compiling error from something that broke.

What should not have happened was UE4 deletes something out of it entirely. Reconnects the pins because I guess it knows better than I do. Along with not displaying that the blueprint this function is in needs to be recompiled. It also did not leave the disconnected part behind to give a content clue that something amiss occurred. It also should have given a none error when running the game.

Due to all of that, I did not think much of things in this function as it looked not that important. This alone is a large system I don’t have everything mesmerized exactly how it should be and it takes a while to go through things.

what should have been.png

This is what should have happened if when things went wrong. I recreated the condition manually and not shockingly it tossed up a bunch of warnings. I’ve added red arrows to emphasize one of the many possible outcomes that should have occurred. Lots of warnings something is not right. There are even other things that could have happened to indicate to me-- LOOK HERE.

how it should look.png

This is how it’s supposed to look. What happened to the data table? No one knows. The void of UE4 must have eaten it. Along with my sanity for that day.

Final Thoughts

item showing the right stats.png

After many choice words towards the screen, I called it a night. Along this process, there were some very minor bug fixes. Many of them had to do with things the player would have never noticed with the expectation of a couple of details of items being wrong or needing some cleaning up.

Other Posts:

Information

Screenshots were taken and content was written by @Enjar. Screenshots are from Nightly Dungeon and Unreal Engine 4.

Game roadmap.

Sort:  

damn, that sucks... nothing more annoying, when something does not work as it should and I can't figure out why...

!PIZZA

Least it's working now. Off to a million and one other things now lol.

Connect

Trade


@enjar! I sent you a slice of $PIZZA on behalf of @dksart.

Learn more about $PIZZA Token at hive.pizza (1/10)

Shared on Twitter.