SevenSeasToGlory - Sprint 3

   SevenSeasToGlory - Programmer Sprint 3


Pirate Ship AI(Sailing, Collisions, and Combat)

This is what I was working on the most during this sprint, I was focusing on the patrolling states for the ships, make sure they don't collide with other during sailing, and combat for ship pvp. 


MiniMap (Fixing)

With the MiniMap I was tasked to do some debugging because when we all pushed to dev at the same time for some reason the only part that bugged out was the map. It looks like the MiniMap Camera got destroyed but the script didn't get deleted or removed so all I had to do was remake the camera and everything fixed itself.


PvP Pirate AI Combat(Blocking)

For this mechanic It was kinid of long over due just because we were preparing for the eletronic prototype but I am glad that I got done better late than never. This gives the player a sense of combat awareness to have better engagement during combat with other enemy pirates.


Fixing All Animations

For fixing all the animations for some reason each individual animation had its own control rig and it was interfearing with the players control rig, so for this fix I went into each individual animatino and in their rig settings I made sure to copy from other avatar and made the source the player or the enemy,



Some problems I encountered on the way

A few problems I encountered on the way were definetely the collisions, the team and I made it very clear that we do not want the ships colliding with each other, not spawning on each other. I tried to tackle this a few ways buy adjusting the colliders but they were set as triggers so I had to find another way around that. Another problem I encountered on the way was combat, I wanted the combat to feel realistic so I wanted the cannon balls to shoot from the left side and right side of the Pirate AI Ship. This was my main concern and was stuck on this for a couple days. 

Logic 


So first I started off with States for the Ship AI, on the top is the listed variables and they're pretty much self-explanatory. For the states, I have Patrolling, AvoidingObstacles, and Attacking.



For Patrolling State there is a raycast hit detecting if there is any obstacles infront of the ship to avoid also checks if the playership is around and if it is, it will trigger the attacking state, if not it keep patrolling pretty much and occasionally drift in a different direction. For Avoiding Obstacles State this is basically avoiding collisions with other pirate ships. It will rotate the pirate ai ship away from the obstacle(the obstacles is another pirate ship to avoid colliding) and move forward. To resume back to Patrolling State the timer needs to be greater or equal to 0 and if the isPathClear() has nothing infront of the ship then the current state becomes Patrolling State. For Attacking State.  If the bool isInHandToHandCombat is true, then it stops shooting it's cannonballs due to pvp is now handtohand instead of shippvp. if not,  then the player is within the ships radius and checks which side of the ship it's on and starts shooting cannonballs from which side of the ship the player is near. The Pirate Ship AI came out really good and I am very proud of myself. The function inside of Attacking() is what kept me up day and night figuring out how to implement this smoothly.


For the Animation fix I was honestly searching for a couple of hours how to fix the animation until i finally came across a video that for each animation you have to change the Avatar definition and the source to what control rig you want it on, and it seemed to work. I just had to do it for each animation. 


1/2 For Pirate AI Blocking. I introduced this blocking technique inside of taking damage. A random value is called and the blackChance is set a .3 float so it has a 30% chance of blocking an incoming attack from a player. 


2/2 For Pirate AI Blocking for this set of called the BlockAttack() funciton is set to a trigger and then the trigger resets after 1 second posing a "Block" animation for the pirate. 


Aftermath
Like I said I am really proud of the ai results and bunch of bug fixes I completed this Sprint. It makes me really happy and proud of how the Electronic Prototype will come out and for the players having an immersive pirate pvp adventure.

Results 





Comments

Popular posts from this blog

CAGD Portfolio

SevenSeasToGlory - Programmer Sprint 6

495 - Sprint 1