Corona-cation (Day 1)
Git Commit: 8e3012c
"Fixed players damaging enemies, Added the ability for enemies to damage players, Added SmoothSync to players and enemies"
Fixed players damaging enemies:
This was a very odd issue that I found today. Yesterday I had only tested the damage system in the DungeonTest level which I did not realize had a different gamemode and therefore an entirely different server-client system. So today when I tested in the Island level the damage system didn't work. I was able to eventually figure out that the problem had to do with the client trying to set the enemy's health which should only be done by the server. To remedy this I added a custom event that would execute essentially the same code just on the server instead.
Added the ability for enemies to damage players:
Just a simple recreation of what we did for the creative jam game. When the enemy is close to the player it will wait an amount of time, attack with a given damage value and repeat. The only challenge here was checking the attacked player's health and making the enemy disregard any players that were dead. I think tomorrow I will try to implement this with the revive system.
Added SmoothSync to players and enemies:
This was relatively simple. I just followed the documentation for the plugin and in no time all movable characters were less jittery. I did find something interesting though to do with data compression. There is a setting on the SmoothSync component that allows you to compress the position and velocity data. At first glance I thought why would you not enable that, it would make the game take up less bandwidth and you still get smooth movement. But eventually I found why you may not want to enable those settings. Again while testing on the much smaller dungeon map it worked fine, but on the large island level the compression was making the movement exponentially more jittery. So in summary if you are working with small location values then the compression is worthwhile, but if your map is really big you will need the extra resolution that non-compressed values offer.
Comments
Post a Comment