A plugin for creating intelligent vehicle AI systems with customizable road networks.
Installation
First method: Open the Epic Games Launcher, go to the Fab Library, and click 'Install to Engine.' Make sure to select the correct engine version that matches your project. Open your project, then navigate to "Edit → Plugins" from the top menu. In the Plugins window, select "All Plugins" and search for "Vehicle AI". Enable the plugin, then restart the editor. You should now see the plugin in your project's Content Drawer.
https://dev.epicgames.com/documentation/en-us/unreal-engine/working-with-plugins-in-unreal-engine
Second method:
Download and extract the plugin files.
2. If your Unreal Engine project does not already contain a "Plugins" folder, create one.
3. Move the VehicleAI folders into the "Plugins" folder of your Unreal Engine project.
4. Launch your project as usual in Unreal Engine
5. You can find the sample map at: /All/Plugins/VehicleAI/RoadNetwork/Map_SampleRoadNetwork
How to Make the Vehicle Move to a Target
Explore the Scene:
Enter the Scene: Right-click to enter the scene.
Move Around: Use WASD to navigate and Q/E to move up or down.
Look Around: Hold the right mouse button and drag to look around.
Set a Target Location:
Left-click on a location to set it as the target for the vehicle to move toward.
Switch Between Vehicles:
Press Tab to switch control to a different vehicle.
Or Left-click on another vehicle to select a different vehicle.
How to Possess and UnPossess Vehicle
Select Vehicle:
Left-click on vehicle to select a vehicle.
Possess Vehicle:
Press 'P' on the keyboard to possess the vehicle and drive it yourself.
UnPossess Vehicle:
Press 'P' on the keyboard to unpossess the vehicle and possess the flying pawn.
How to Set Up Vehicle AI with City Sample Vehicles or Custom Vehicles
Download the City Sample Vehicles from the Fab Marketplace and add it to your project.
2. Open the BP_Vehicle blueprint.
3. Add a Box Collision component and a Vehicle AI Component. Adjust the box extent to match the size of the vehicle.
4. Ensure the box collision is properly sized for each child vehicle.
5. Drag the vehicle into the level.
6. Verify that your floor or landscape tag is set to "Floor".
7. In World Settings, set the Game Mode to VehicleGameMode.
How to Use Road Network Tool
Switch to the Road Network Tool Mode: Click on Selection Mode and switch to RoadNetworkTool Mode.
2. Create Splines: While in Line Tool mode, click on the floor or landscape to add new spline points.
3. Connect Roads: Connect road segments to shape the network as needed using the Line Tool.
4. Convert Straight Road to Curved Road: Switch to the Curve Tool, click on the spline, and drag to create curved roads.
5. Generate Road Meshes: Adjust the road width as needed and click Create button to create procedural road surfaces based on the spline shapes.
6. Return to Selection Mode: Once you're finished, switch back to Selection Mode by clicking it again in the toolbar.
How to Set up New Map for Vehicle AI
Create a new map and add a landscape or static mesh as the ground.
2. Assign the tag "Floor" to the landscape or mesh.
3. Use the road network tool to create a road network.
4. Set the Game Mode Override to "VehicleGameMode". Remove the Player Start if it exists
5. Drag SportsCar_Pawn into the level.
6. Now, you're ready to play!
How to Spawn the Traffic System
Prepare the road network and vehicles that have the Vehicle AI component.
2. Drag "BP_TrafficManager" into the scene. You can place it anywhere.
3. Set the number of vehicles to spawn. A recommended value is 35 or fewer for optimal frame rate.
4. Add a Vehicle Classes array member and select vehicle you want to spawn. The spawned vehicles need to have a Vehicle AI component and a box collision.
5. Press Play, and the traffic will be created.
Feedback and Other Questions