Last week of prototype
Sept/27 - Oct/3
Over the last week I have been working nonstop to get the prototype to a working state before the deadline today. The main problem was with the AI perception. With the PC version of the prototype, I was able to use the 'OnTargetPerceptionUpdated' event to have the monster detect and then follow the player. But in VR, I could not use that system because 1) The player object location is at the center of the play-space and so the AI wouldn't properly track the player and 2) Teleportation broke the line of sight and so would immediately send the monster into its suspicion behavior.
I tried three different fixes to the problem. The first of which was to do the same concept as with the flashlight and attach an invisible cone to the face of the monster to detect collision. This did not work for two different reasons. The first is that, at this point, I did not realize that the player had to be set as a vector location instead of an object because of problem one above. The second problem with this approach is that it required communication between more blueprints than I would like, and therefore had more points at which to fail. I decided against this approach because of these reasons.
The second thing I tried was the 'ConeCheck' decorator in the AI behavior tree. This would be the most simple and reliable as it is entirely confined to one blueprint and would fit in perfectly with the convention of having all AI related checks on the behavior tree. I would have used this decorator, if it worked! No matter what I did or checked online, I could not figure out how the decorator worked and why it never returned a true value. At this point in the process I was getting close to the deadline and just needed something to work so I dropped the 'ConeCheck' idea for the third and final attempt.
The way that I actually got it to work was by detecting if the player camera was within a range and angle of the monster. It works in exactly the way I want and is all in a service on the AI behavior tree that sets variables and dumps them onto the blackboard every AI tick. After I did this I was able to start on making the rock distraction work correctly. For this I was able to use the 'OnTargetPerceptionUpdated' event in the AI controller because it had nothing to do with the VR. A simple 'ReportNoiseEvent' on the rock when hit setting the last seen location of the monster will distract it and make it go investigate.
Over the last week I have been working nonstop to get the prototype to a working state before the deadline today. The main problem was with the AI perception. With the PC version of the prototype, I was able to use the 'OnTargetPerceptionUpdated' event to have the monster detect and then follow the player. But in VR, I could not use that system because 1) The player object location is at the center of the play-space and so the AI wouldn't properly track the player and 2) Teleportation broke the line of sight and so would immediately send the monster into its suspicion behavior.
I tried three different fixes to the problem. The first of which was to do the same concept as with the flashlight and attach an invisible cone to the face of the monster to detect collision. This did not work for two different reasons. The first is that, at this point, I did not realize that the player had to be set as a vector location instead of an object because of problem one above. The second problem with this approach is that it required communication between more blueprints than I would like, and therefore had more points at which to fail. I decided against this approach because of these reasons.
The second thing I tried was the 'ConeCheck' decorator in the AI behavior tree. This would be the most simple and reliable as it is entirely confined to one blueprint and would fit in perfectly with the convention of having all AI related checks on the behavior tree. I would have used this decorator, if it worked! No matter what I did or checked online, I could not figure out how the decorator worked and why it never returned a true value. At this point in the process I was getting close to the deadline and just needed something to work so I dropped the 'ConeCheck' idea for the third and final attempt.
The way that I actually got it to work was by detecting if the player camera was within a range and angle of the monster. It works in exactly the way I want and is all in a service on the AI behavior tree that sets variables and dumps them onto the blackboard every AI tick. After I did this I was able to start on making the rock distraction work correctly. For this I was able to use the 'OnTargetPerceptionUpdated' event in the AI controller because it had nothing to do with the VR. A simple 'ReportNoiseEvent' on the rock when hit setting the last seen location of the monster will distract it and make it go investigate.
Comments
Post a Comment