EasyScan
Unit detection and AI target selection.
|
Getting Started
EasyScan provides a system for detecting and classifying units, and logic for the AI choosing and prioritizing targets. It was designed to easily integrate to the architecture of many different projects. EasyScan has three main function groups:
Access EasyScan classes with the namespace: using MobFarm; Basic Setup To get EasyScan up-and-running, you'll to set a few things:
Next, for every unit that will scan or potentially become a target, it will need an MF_EasyScan script at its root level. Here, you can designate its faction, as well as other categories that will be used for target selection. Active the scanner and targeting modules, and set max range to something appropriate for your project. To use a target with another script, access the script, and use: GetTarget(); This will return that target's MF_EasyScan script. You may wish to start with the included demo scene, or head to the Usage Overview section. Go to Tutorials for more information regarding setup. |
Script Reference
Demo Scrips These scripts are not necessary for MF_EasyScan to work, and may be deleted. They simply provide example functionality to the demo scene.
Demo Scenes
Within the Demo folder are several assets that comprise the DemoScene. These assets are completely independent from core asset functionality. This folder and its contents may be deleted. The demo includes a simple movement script and a few colored box ships with different scan and targeting parameters. You can see how units are targeting each other with attached LineRenderer script. You can also watch in the scene view to see range and targeting guides. Demo Co-op Blue Team As the blue ship gets closer to the red ships, it shares vision with the larger blue ship, allowing it to target red ships, despite the large ship not using a scanner. The small blue ship navigates between two waypoints, until the yellow ship comes in range, and then it uses the other targeting script to pass it as a navigation target. Red Team Each red ship has a scanner and long range targeting. As the blue ship comes in range of one, they can both target. Demo Multi-target In this scene, the large blue ship has three targeting scripts. You can see the range rings by selecting the root and the left and right gun objects. Watch in the scene view. The front targeter only targets the large red ships. The side targeters prefer to target large ships, but will target small ships that get with 15 meters (purple rings) |