Corona-cation (Day 3)

Git Commit: 6646905

"Added revive system, Minor fixes and changes"

Added revive system: 

    Building off yesterday I figured out what was the problem. All of the characters do have owning connections but only the server can access them. Once I figured that out it seemed like a no-brainer but I eventually figured out how to make the heal aura work again. The only change I had to make was to have the actual actor be spawned from the server. This is what that looks like:


After that I got on to doing the thing I initially set out to do; the revive system. The hardest part of this was, without a doubt, figuring out the architecture. Trying to wrap my head around what scope was needed for everything, where code will be executed, and at the same time trying to make it as general as possible was quite difficult. I started out thinking that I wanted to do it with an interface that would do the same thing on both the reviver and the revivee player. I eventually figured out that I ran into the same problem as with the heal aura. The reviver was trying to heal the other player but because of the multiplayer model the client cannot set a replicated variable (health). Because of this I would need to call a server function, but the revive event was happening on both players involved in the revive so you would get conflicting information. It was becoming a nightmare. 
    I eventually scrapped the interface in favor of calling one event running on the server from the player doing the reviving. This event would just set the necessary variables on both players (mainly ReviveTime which will be used for UI later). This is the final system:


    With the revive system I also needed to rework some old code. This was to make sure the players couldn't attack, move, etc. when reviving. This was just really time consuming and I'm sure there's a better way to do it than what I did. I just put ifs before all of these events making sure that certain booleans were correct. 


Minor fixes and changes:

    Very descriptive, I know. Most of these were just removing annoying print strings, fixing numerical values, cleaning up blueprints, and just making the overall experience better. The biggest of these small fixes though was a bug I found with the class select that I thought I had squashed long ago. This bug being that if a player (player2) joined the session after another player (player1) had already chosen a class and was in game, player2 would see player1's class as available. This was simply fixed by adding a delay to the update.

Comments

Popular posts from this blog

Polishing the Foundation

Progress Update #13

A New Chapter