What Got Done
- This week was mostly spent on refactoring the current setup for handling attacks between entities. The reasoning for this was because we wanted attacks to only do damage when they hit an enemy target, instead of instantaneous raycast attacks. This makes confrontations look a lot better.
- While I was refactoring how attacking was handled, I made target selection host authoritative. Before we would just keep units in roughly the same position on every client and hope that they would all pick the same target to attack. This worked 95% of the time but other times you would watch a battle where each hit is doing nothing to the target's health (because the host was attacking something else). Now the host picks a target to attack and relays it to the clients and it works perfectly.
- Another reason for this refactor was that we had 5 unit classes and 5 tower classes with essentially the same code in each class. The only major difference was the projectile that they fired. So I got rid of that duplicate code and all of the individual scripts used for projectiles. Now we have one class that replicate the functionality of each of the other projectile scripts and we can use the same code to instantiate it from each tower/unit/superunit. These projectiles have their own prefab and easy to change parameters for the artists.
- I also starting working on the code for switching to Kail and using the Brigade and Gatling. Most of that is done. Next will be setting up the prefabs when I get the models.
What's Next
- Kail's units added to the game
Total time: 45 hours
No comments:
Post a Comment