[WIP] Brimstone Engine - Control Systems (A Simple Physics Based Solution To Navigation and AI)

About me:

Hey everyone, this is my first asset and I guess I can say that I am a little new to developing on Unity as well as to the Unity community. One of the things I enjoy most is working with robotics. My passion for robotics has lead me through some of the major engineering fields, including programming. I recently obtained my degree in mechanical engineering and a specialization in robotics. After graduating a friend introduced me to Unity and I was really impressed by Unity’s physics engine. Since then, I have been working on this project for the asset store.

Brimstone Engine:

This project is a physics based series of controllers, sensors and test environment generator. These scripts let anyone quickly and easily add PID controls to their games. So far, I have made a few basic controllers, a range sensor and environment generator that are useful for 2D top down navigation but I plan to add other controllers for other types of games and eventually expand the project with other concepts such as path planning. Currently I am working on this project solo so I will provide updates as soon as I can.

Features:

The controllers react to any physical properties applied to them, then compensate with user adjustable gains to achieve the desired result. Anyways, I think a few videos can help me explain things better. Please let me know your thoughts and questions on my project.

7/21/2017 ------------------------------------------------------------------------------------------------------------------

Behavior Manager (Implementation Of All Controllers)

  • Position Controller: The Behavior Manager switches to this controller when the range sensor script does not detect an obstacle (clear path to specified goal position).

  • In this situation only a single green line, which points to the goal position, is visible.

  • Avoidance Controller: This controller is only used in hazardous situations ( rover is too close to a obstacle).

  • Only a single magenta line is visible.

  • Position-Avoidance Controller: A combination of both the Position and Avoidance controllers. The Position-Avoidance controller is used most often. Its purpose is to head in the direction of the specified position while also avoiding obstacles along the way.

  • In this case, three lines are visible, the position (green), avoidance (magenta) and the combination of both (cyan) .

  • Wall Follow Controller: The Behavior Manager switches to this control in cases where the Position-Avoidance controller would fail. The controller follows a wall until it reaches a new location that would not cause the Position-Avoidance controller to fail.

  • No lines are visible, only range sensor visualizations are displayed.

7/14/2017 --------------------------------------------------------------------------------------------------------------------

Position Controller

  • Allows user to set custom X and Y position coordinates at any time, and the controller will move the game object attached to the script to that specific location.

  • The controller is completely adjustable, allowing multiple variations of routes and speeds

  • User can toggle visual debugging indicators to show objects current heading and the heading and location to the user specified position.

Position Controller (Follower)

  • In the video, the red rover is player controlled.
  • The other black rovers are NPCs controlled by the position controller.

__https://www.youtube.com/watch?v=ZZDSXmf7TQw__

  • A variation of the position controller instead of setting coordinates, users can drag and drop a game object and the controller will move the game object attached to the script to the specific location of the other game object placed by the user.

Avoidance Controller

__https://www.youtube.com/watch?v=YWx9lKXUWXQ__

  • Using distances detected by the range sensor script, this controller will change the current heading of its game object to a new clear heading.

  • The controller is completely adjustable, allowing users to set custom reaction times and magnitudes.

I think, that is as much as I can describe in this update. Thanks for checking out my project! I will add more videos and improve the current descriptions with more details soon.

2 Likes

7/15/2017 –

Hey everyone, I made a few more videos today. For today’s update I am posting a video on the range sensor script. I will post the rest of the videos within the next few days. Let me know what y’all think.

Features:

Range Sensor:

  • Attach a group of range sensors to any game object.

  • These sensors report the distances between the script corresponding game object and any other game object that is within the sensor’s detection area.

  • The sensor’s detection area can be set to any size, and the amount of sensors per detection area is adjustable as well.

  • Toggle-able visualization tools allow users to see the length and direction of each sensor’s detection area in yellow. Sensors will decrease in length and change to a red color, when an object its detected.

7/17/2017 –

Here is a quick look at the environment generator. I made this script to allow everyone to quickly have a custom test area to configure the other control scripts. Let me know what y’all think.

Features:

Environment Generator:

  • Quickly create a maze like area.

  • The generator is completely adjustable: set your own tile prefabs, set the size of each area, and customize the maze complexity anywhere form an open area to your own personal labyrinth.

  • Each generated environment can be saved and loaded and any time.

7/18/2017 –

Today’s update takes a look in to a core controller I created called Angle Control. Many of the other controllers I made are derived from this simple controller. Essentially, this controller rotates any object to a specified angle. Rotations are achieved by using the physics command addTorque. Let me know what y’all think.

Features:

Angle Control__:__

  • Rotate an object to the angle of your choice by setting custom angles, and controlling torque forces.

  • Once the object has reached it’s specified angle, the controller will maintain that specified angle.

  • If an other object interferes with the controlled object, the controller will adjust its objects rotation returning it to the previously set angle. (The rover pushing the beam out of its set angle)

7/19/2017 –

Hey everyone. I am excited to share a interesting controller call Wall Follow. As you might have guess from it’s name, this controller gives any game unit the ability to follow walls. The Wall Follow Control lets you choose the direction units must follow walls (clockwise, counterclockwise) and set a specific distance units must maintain between the wall and its self.

This not one of my better videos but I thought I would share it anyway. I plan to make better versions of each video soon.

Anyway I will try to guide everyone through what is happening in the video, bellow it.

Features:

Wall Follow Control__:__

  • At the start of the video, (0:13 - 0:23) the controller is set to follow walls to the left of the rover. The controller uses distance data from the range sensor script to determine if there is a wall to the left of the rover.

  • The yellow lines on the rover turn red to display detection. Finally with a little bit of math the control will estimate the location of the wall.

  • The estimation is displayed by a green line. (It is somewhat difficult to see in the video) The green line is located between the two red lines representing sensor detection and the green line is also parallel to the wall.

  • At (0:23 - 0:29) the wall follow direction is changed to follow walls to the right of the rover. This direction remains set to the right for the rest of the clip.

  • At (0:29 - 0:33) the distance the rover must maintain from the wall is increased.

  • Then at (0:33 - 0:38) the distance is lowered (rover get really close to the wall) and the distance is raised again.

  • I know the changes are quick and random, I was just trying to show the setting was adjustable.

  • Finally, for the rest of the video, the settings stay constant and only the wall the rover must follow is changed.

7/21/17-----------

Hey everyone, here is a new update. My previous posts gave a peek of some of the capabilities each controller could accomplish individually. For this update I wanted to try something new, so I am introducing the Behavior Manager script. This script uses each of the previous controllers, in different situations, to accomplish navigation. Thanks for watching. =)

Behavior Manager (Implementation Of All Controllers)

  • Position Controller: The Behavior Manager switches to this controller when the range sensor script does not detect an obstacle (clear path to specified goal position).

  • In this situation only a single green line, which points to the goal position, is visible.

  • Avoidance Controller: This controller is only used in hazardous situations ( rover is too close to a obstacle).

  • Only a single magenta line is visible.

  • Position-Avoidance Controller: A combination of both the Position and Avoidance controllers. The Position-Avoidance controller is used most often. Its purpose is to head in the direction of the specified position while also avoiding obstacles along the way.

  • In this case, three lines are visible, the position (green), avoidance (magenta) and the combination of both (cyan) .

  • Wall Follow Controller: The Behavior Manager switches to this control in cases where the Position-Avoidance controller would fail. The controller follows a wall until it reaches a new location that would not cause the Position-Avoidance controller to fail.

  • No lines are visible, only range sensor visualizations are displayed.