laitimes

FPS shooter self-aiming method and idea refer to Key Genie

author:Zen shadow

"Key Genie" introduces the self-aiming ideas and implementation methods of FPS shooters.

At the beginning of the video, I showed a self-aim function. This feature is actually quite simple, I just simply sorted it out. Here to share the idea and implementation method, if you want to achieve this function, you need to research and improve by yourself, including the training of the model. My training was also rough and simple.

FPS shooter self-aiming method and idea refer to Key Genie

Let me briefly introduce the implementation process, first learn to use UR, I explained how to use it in the previous video. Detailed tutorials for using UR can be found in the Programming Techniques album. The implementation process is essentially the same, including acquisition and labeling. After the collection and labeling are completed, the model is obtained through training. The implementation process is basically the same.

FPS shooter self-aiming method and idea refer to Key Genie

It is important to note that objects can be classified when labeling. Here it is necessary to identify two targets: one is bandit number one and the other is bandit number two. I call the one with glasses in green Bandit One, and there is another one behind, and there is Bandit Two in the back. They are differentiated. In the code, you can distinguish the target object by disassembling the recognition result, which is also a way to do friend or foe identification. Distinguish enemies from teammates by the model's categories. Of course, this idea is just one method, and you can also distinguish friend or foe by feedback after targeting. The implementation process is mainly divided into two modules, one is UR identification and the other is aiming. Regarding aiming, it mainly borrows from the previous method of mouse shaking. If you forgot the mouse shake tutorial, check it out.

However, you can't use a wooden doll here, you can only use the relative wooden doll mouse shake tutorial. I can help you find the tutorial, because this is where his knowledge is needed. The mouse shake tutorial can be found in three issues in my programming basics, and this knowledge needs to be used here, combined with target recognition and mouse shaking, you can achieve self-sight. But this implementation is still very crude, and I also explained it here, and I need to improve it myself. My implementation is very simple. I just briefly introduced the principles and methods of implementation. The identification code can refer to the previous video explaining entertainment recognition.

FPS shooter self-aiming method and idea refer to Key Genie

The implementation process is basically the same. After identifying the target, shake the mouse according to the recognition coordinates. The code is mostly mouse-shaking code. I introduced the method of mouse shaking in a previous video, and I won't go into detail here.

We just changed the code for move to, changing it to moore. What I wrote is very simple, only including the upper left and lower left displacement logic judgments. There are many other directions of judgment that need to be perfected by everyone. If you want to improve the self-aim function, you need to add your own code.

FPS shooter self-aiming method and idea refer to Key Genie

While aiming, press the left mouse button to complete the aim, then release the self-aim function and display a box on the screen. There is only this in the script code, and you need to add it yourself.

FPS shooter self-aiming method and idea refer to Key Genie

If you want to practice text drawing, this is a common technique in shooting games, but using the self-aim feature may affect the gameplay experience of the opposing player, so we don't recommend it.

FPS shooter self-aiming method and idea refer to Key Genie

Decoding skills can exercise everyone's skills, and this is the end of today's lesson.

FPS shooter self-aiming method and idea refer to Key Genie

Read on