• Stars
    star
    104
  • Rank 330,604 (Top 7 %)
  • Language
    C++
  • License
    MIT License
  • Created over 7 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A plugin for Unreal Engine 4 with a custom navigation system suitable for spiders

Spider Navigation Plugin For Unreal Engine 4

It implements custom navigation system suitable for spiders. Navigation grid builds on floors, walls, ceilings.

A demonstration of spider navigation

Now available on Marketplace

How it works

To build grid

  1. Scene filled up with special actors Tracer in specified volume with specified step.
  2. From each tracer plugin traces to the nearest WorldStatic.
  3. At point of the hit it spawns actor NavPoint with some offset.
  4. From each NavPoint plugin check sphere collision with the othe nearest NavPoint.
  5. Checks visibility between these two actors. If they are visible to each other - add connection. If not - add to the list of pissible neighbors.
  6. Iterates the list of pissible neighbors and traces in 6 directions from each of two points for possible connection through an edge. Checks visibility between points of intersection. If a point of intersection is visible to each of two points - add a new point NavPointEdge and connections between them.

To find path

  • Plugin implements A* to find path. Can return a normal to each navigation point.

Plugin contains auxiliary blueprints for movement on this grid:

  • SpiderAIController - containts the main code of movement on the spider grid
  • SpiderPawn - Simple Pawn without any code
  • SpiderBB - Demo Blackboard
  • SpiderBT - Demo Behaviour Tree
  • SpiderAgroCheck - Behaviour Task
  • SpiderCloseEnough - Behaviour Decorator
  • SpiderIsAtLocation - Behaviour Decorator
  • SpiderIsTargetMoved - Behaviour Decorator
  • SpiderMoveToLocation - Behaviour Task
  • SpiderRapidMoveTo - Behaviour Task

Setup

  1. Close your project in UE4
  2. Download plugin sources
  3. Copy it into your project in Project folder. Make sure the path ./Plugins/SpiderNavigation/SpiderNavigation.uplugin is correct.
  4. Rebuild your project. If you have non-c++ project, then add in the editor one empty c++ class and then rebuild project in VS.
  5. Run project. Be sure that SpiderNavigation plugin is enabled in Editor's Plugins menu.
  6. Switch on the view option in the Content panel View Options (bottom right corner) to show plugin content.
  7. Click on Choose a path - a small button to left of Content path with icon of open folder. Choose SpiderNavigation Content.
  8. Add DebugSpiderNavigationBP, DebugSpiderNavGridBuilderBP, SpiderPawn on the scene.
  9. Adjust the size of the DebugSpiderNavGridBuilderBP to match size of your level.
  10. For DebugSpiderNavigationBP scene instance choose Input->Auto Receive Input: Player 0 to enable hotkeys of navaigation.
  11. Click on Play. Press R button to rebuild navigation grid. Press Q button to show navigation grid.

Plugin autosaves navigation grid. Try to click Stop and Play again. Spider pawn should follow you.

Here is a video guide:

Video guide

Configuration

SpiderAIController

  • MoveSpeed - How fast spiders move
  • RotationSpeed - How fast spiders rotate for each next navigation point
  • MustCheckTargetVisibility - Whether a spider must trace the target by the visibility channel to follow it

SpiderNavGridBuilder

  • GridStepSize - The minimum distance between tracers. Should not be less then 40 (calculates too long)
  • ActorsWhiteList - The list of actors which could have navigation points on them
  • bUseActorWhiteList - Whether to use ActorsWhiteList
  • ActorsBlackList - The list of actors which COULD NOT have navigation points on them
  • bUseActorBlackList - Whether to use ActorsBlackList
  • bAutoRemoveTracers - For debug. If false then all tracers remain on the scene after grid rebuild
  • bAutoSaveGrid - Whether to save the navigation grid after rebuild
  • BounceNavDistance - How far put navigation point from a WorldStatic face
  • TraceDistanceModificator - How far to trace from tracers. Multiplier of GridStepSize
  • ClosePointsFilterModificator - How close navigation points can be to each other. Multiplier of GridStepSize
  • ConnectionSphereRadiusModificator - The radius of a sphere to find neighbors of each NavPoint. Multiplier of GridStepSize
  • TraceDistanceForEdgesModificator - How far to trace from each NavPoint to find intersection through egdes of possible neightbors. Multiplier of GridStepSize
  • EgdeDeviationModificator - How far can be one trace line from other trace line near the point of intersection when checking possible neightbors. Multiplier of GridStepSize
  • Tracer Actor BP - For debug. Blueprint class which will be used to spawn actors on scene in specified volume
  • NavPointActorBP - For debug. Blueprint class which will be used to spawn Navigation Points
  • NavPointEgdeActorBP - For debug. Blueprint class which will be used to spawn Navigation Points on egdes when checking possible neightbors

SpiderNavigation

  • bAutoLoadGrid - Whether to load the navigation grid on BeginPlay

Blueprint functions from the plugin

  • SpiderNavGridBuilder::BuildGrid

  • SpiderNavGridBuilder::DrawDebugRelations

  • SpiderNavGridBuilder::SaveGrid

  • SpiderNavigation::FindPath

  • SpiderNavigation::LoadGrid

  • SpiderNavigation::DrawDebugRelations

  • SpiderNavigation::FindClosestNodeLocation

  • SpiderNavigation::FindClosestNodeNormal

  • SpiderNavigation::FindNextLocationAndNormal

License

The MIT License

Copyright (C) 2017 Roman Nix

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

docker-openssl-gost

Dockerfile with OpenSSL, GOST-engine and cURL
Dockerfile
127
star
2

selenium2php

Converts HTML text of Selenium test case recorded from Selenium IDE into PHPUnit code
PHP
26
star
3

face-recognition-ue4

C++ project for face recognition with OpenCV which compiles into native library for Android and works from UE4 project
C++
20
star
4

StereoPano

Unreal engine plugin for capturing stereo panoramas
C++
13
star
5

knigopis.com

Save books which you have read
JavaScript
10
star
6

laravel-redis-batch-repository

Redis repository implementation for Laravel Queue Batch
PHP
9
star
7

log-reader

Error log parser written in PHP
PHP
5
star
8

durak

An online multiplayer card game
Go
4
star
9

invalid-passports

A service to check validity of passports
PHP
4
star
10

invalid-passports-go

A service to check validity of passports
Go
3
star
11

bubble

An example of over-engineered Bubble sort
PHP
3
star
12

d-web-radio

Decentralized web radio
Vue
3
star
13

facedetectdemo

JavaScript
2
star
14

yamusic-hotkeys

A chrome extension which adds hot keys to control player on Ya.Music
JavaScript
2
star
15

sql-dumper

A command-line tool to dump a portion of data from DB into sql-file or csv-file
Go
2
star
16

phpunit-migration-to-selenium2

Implements adapter for migration from PHPUnit_Extensions_SeleniumTestCase * to PHPUnit_Extensions_Selenium2TestCase
PHP
2
star
17

tronode-js

An online multiplayer game
JavaScript
1
star
18

bubble-sorter

A package with bubble sort
PHP
1
star
19

backup-validator

Validate DB backup files and alert
PHP
1
star
20

markers-detector

A library based on OpenCV for detection camera's position by markers
C++
1
star
21

know-music-bot

Guess song by part of music - a Telegram bot
Go
1
star
22

favorite-films

A demonstration of code
PHP
1
star
23

webrtc-connection

WebRTC peer connections
TypeScript
1
star
24

webrtc-signaler

A signaling server for WebRTC connections
JavaScript
1
star