GSoC Week 3: Sherlock

Written on June 16, 2019

Last week was quite frustrating! You must have noticed by now that I am naming my GSoC weekly blogs after movies. So, I decided to name it after my favorite fictional detective’s movie to symbolize all the detective work it took this week to hunt down the source of bugs.

The Incorrect Visual Entity

So, it turned out that player skinning method did not work for one specific test case. This problem had me scratching my head for quite some days. The code seemed to be correct but did not seem to work. So after lots of logging, debugging and sleepless nights, I was finally able to trace down the root of the issue! There was a minor mistake in game engine’s implementation for visual entity which I immediately corrected and I finally took a breathe of relief!

Issue: VisualCharacter Entity is being set for local character too for clients #3685
PR: Fix for Incorrect VisualCharacter entity #3686

The Trailing Whitespace

Sometimes, it is the tiny things that do matter a lot. A missing semicolon can make you busy with hours of debugging. Another big issue showed up, which led to game not being loaded correctly if a saved game was present. I really liked debugging this one. It turned out a recent change in UI widget was returning an extra trailing whitespace character which broke a lot of systems. Lesson learnt: Pay attention to the tiny details!

Issue: Terrible things happen when starting a second game without a game restart #3688 PR: Fix getText() function in UIText #3689

Fixing Health Hud

It turned out that event based method to change Health Hud wasn’t working well. The Hud would only change only when the event was recieved. Hence, when a player leaves the game and rejoins, aur loads a saved game, the Health hud would go back to white. Hence I implemented a fix similar last week’s skeletal mesh fix #80 based a persisting LASTeam component.

PR: Health hud fix for reconnects and restarts #90

Fixing Game Restart and Player Statistics

I finally figured out how multiplayer systems work and got quite comfortable with it. I refactored the code for restart implemented in a correct way and created a new pull request. There was a minor issue in player statistics wherein the remote clients were not being able to see other players’ details. I tested it out and it turned out be an engine issue. I was fortunately able to find a workaround the same.

Issue: ‘entityManager.getEntitiesWith(ClientComponent.class)’ not working on Remote Clients #3693
PR: Game Restart Implementation #91
PR: Player Statistics Implementation #92

Handling Item Drops

This was another issue I worked on, this week. When items are dropped after a player’s death, they should be destroyed after some delay and flag should be teleported back to base. However, after some discussion it was decided that there should be a general implementation such that whenever an item is dropped or thrown, above mentioned things should happedn. Hence, this pr will be closed and I will try to find an alternative.

PR: Destroy dropped items on death after a delay #89

What’s Next?

This almost completes my first month of work for GSoC. I will try to find an alternate solution #89 and implement auto restart and other minor issues. I will also try to refactor and document the entire LightandShadow code before the First Evaluation!