GSoC Week 4: Ready Player One
First Evaluation is here and I am (almost) done with the Gameplay Arc Phase of my GSoC! Well, ‘almost’ because there are a few tiny little fixes and adjustments here and there that can be done. As my mentor @skaldarnar states it,
"One can spend an (un-)reasonable amount (of time) on fine-tuning".
Handling General Flag Drops
As discussed in last week’s blog, the method implemented in pull request #89 worked only when a player died. We wanted to implement it in such a way that whenever a player drops a flag, due to any reason, we want to teleport it back to the base after a delay. Luckily, I was able to find event
DropItemEvent which all items receive on being thrown into the world. I wrote a receiver to check if the item being dropped is flag or not, just add delay event using
DelayManager and tada! we are done.
So this minor issue #94 showed up after merging #91 and #92. I was trying push statistics to the widget and not clearing them when the game over screen was closed. Due to this, statistics of previous rounds were still being displayed. Easy fix!
More Updates to Restart System
I added one major improvement to the restart system I added last week. It turns out that when two people had flags and one of them captures it first, if it results in a win, then we teleported all the players back to their bases. So the other player with flag still had it. I checked for all entities with
HeldFlagComponent and did the needful.
PR: Teleport Held Flags on Restart #96
After merging #91, it was decided to display restart button to only those who could interact with it. It also works only for server-client systems and not on a headless server. So I figured out that we can use the existing
PermissionManager to add a custom permission and only display button to those with the permission. We can use the core command
givePermission to allow certain users to restart in a headless server setup. However,
PermissionManager isn’t whitelisted. Once we add it to whitelist, we are done! The work is currently in progress in branch.
I will try to finish RestartPermission once the
PermissionManager is whitelisted. We are done with major gameplay features, time to add some weapons and towers!