Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[WIP] Advanced Trigger System

Discussion in 'Works In Progress - Archive' started by zeman97, Oct 1, 2014.

  1. zeman97

    zeman97

    Joined:
    Sep 22, 2012
    Posts:
    53
    This is the forum page to mark the progress of development of the Advanced Trigger System, but what is the Advanced Trigger System? The Advanced Trigger System is designed to be a universal easy-to-use trigger solution for Unity.

    Some notable features are:
    -Advanced handling of collision events via grouping of colliders and a custom collision handling script.
    -The ability to filter collision events using GameObject tags.
    -A flexible, multipurpose input system that allows for both simple and complex trigger interactions.
    -A simple function selection system to allow users to easily set what happens when the trigger is activated.
    -A custom reader component to allow easy access to triggers via code, both statically and dynamically.

    Feedback of all kinds is welcome!

    A video giving an intro to the ATS
     
    Last edited: Mar 17, 2015
  2. zeman97

    zeman97

    Joined:
    Sep 22, 2012
    Posts:
    53
    Just a quick update to explain the lack of new information.

    After some extensive testing, I am now completely redoing the way input is handled as well as how functions are handled.

    More information when overhauls are done.
     
  3. zeman97

    zeman97

    Joined:
    Sep 22, 2012
    Posts:
    53
    Some quick updates about the ATS,

    The new input system is coming along good, just not complete yet. Also the current manual is way out of date as much of the API and interfaces have changed, the idea is still the same, just different execution.

    The big thing that I have to show is the update to the function selection system. Before you had to manually type the function name into the designated area. This caused extra work as level designers would be required to have a list of all the needed functions the triggers would interact with. That being said, the new system is based off of selections rather than typing a name.

    Single Parameter Function.PNG

    Also the way parameters are handled has been changed to allow for automatic parameter detection. Now the parameters needed simply appear instead of requiring the user to know what was required. Furthermore, functions that are not supported (functions that don't return void or have parameters that are not supported) simply do not appear as options, thus cleaning up the menus drastically. The new way parameters are handled also allows for multiple parameter support, something that I quickly found to be a must.

    Multiple Parameter Function.PNG

    That is all for now, I will continue to refine the input handling and will show that off as it improves.

    Thanks for reading and I apologize for the lack of posts, rest assured more are on the way!

    Thanks!
     
  4. zeman97

    zeman97

    Joined:
    Sep 22, 2012
    Posts:
    53
    Here is a screenshot of the new information panel.

    Information Panel.PNG

    The information panel is where the set the information about the ATS Trigger. The general information is used in editor as a way to tell triggers apart and make notes about what they do; it is also used as a way to get information about the trigger such as instructions for how to activate the trigger to be given to the player.

    As can be seen, the trigger supports the use of multiple colliders for detecting collision. This allows you to set up unconventional boundaries for collision detection. There are plans to expand the multiple collider support to assign the colliders to groups, giving the user the ability to use one set of colliders for one input action, and another set of colliders for a different input action.

    The Input Tags are used to filter what GameObjects will be detected by the trigger (an enemy can't activate a trigger designed for the player). Similar to the colliders, there are plans to expand the support to include groups of input tags for specific input actions.

    Although it may seem like there is a lot that goes into setting up a trigger, the extended list of features is designed so the trigger can be used for very simple trigger interactions, or very complex trigger interactions, with as little coding as possible. If you just want collision between one object and one collider, that's okay, if you want to set up an entire quest trigger, that's equally good.

    Thanks for reading!
     
  5. zeman97

    zeman97

    Joined:
    Sep 22, 2012
    Posts:
    53
    Another update, this time featuring the input system.

    Input Action List.PNG

    This is a list of input actions, each serving as an example of the current 4 basic input actions: Buttons, Collisions, Keys, and Time. More types of input will be added later, but for now this is more than enough to provide more complex functionality than the built in Unity trigger functions.

    Input in the Advanced Trigger System is handled via a list of actions, the actions must be completed, in order, to activate the trigger's function. Input actions can be set to be required once (pressing a key) or constantly (holding the key down). If an Input Action that is required constantly stops receiving input, it becomes broken, breaking all the Input Actions below it (there will be settings to better fine tune how this event behaves to better suit your trigger situation). There are also planned Input Actions that will help better control the flow of the input (such as an Input Action that, once satisfied, prevents all previous Input Actions from breaking).

    Input Action List (Collapsed).PNG

    Another feature is the ability to collapse Input Action blocks to allow the list to become more compact for easier reading.


    Also featured in these images is the custom window color option. Many Unity users (myself included) do not have Unity Pro and thus cannot access the Unity Pro dark skin. In my experience, the light skin made it difficult to tell the difference in different windows, so I added the option to set the windows to be a custom color, but don't worry, if you don't like the look of custom window colors, there is the option to disable them.

    Thanks for reading!
     
  6. sowatnow

    sowatnow

    Joined:
    Jun 12, 2014
    Posts:
    309
    Hi zeman97,

    Looking good. It would be much better if you can provide an example of it being used in game etc.
    That would make it more appealing to a person like me.
     
  7. zeman97

    zeman97

    Joined:
    Sep 22, 2012
    Posts:
    53
    Good point, I'm in the middle of refactoring the tool, but once that is done I will start posting videos of the tool in action, but I agree that some videos need to be made.

    Thanks for the feedback :)
     
  8. zeman97

    zeman97

    Joined:
    Sep 22, 2012
    Posts:
    53
    During the process of creating a demo scene to get an idea of what I want to focus on in the upcoming videos I realized that I needed a reliable and universal way to "read" triggers to get specific information, thus creating the ATS Reader:

    ATS Reader.PNG

    The ATS Reader offers a way to get information about an array of triggers. This array can either be fixed (useful for creating environment scripts that respond to the trigger, but are not the target of the trigger) or variable (useful for player characters that will be moving through an environment and come into contact with multiple triggers). Currently the way the variable array is handled is through collision: when a GameObject with the ATS_Reader component attached enters an ATS_Collider, the ATS_Collider's triggers are added to the ATS_Reader and the triggers are removed when the GameObject with the ATS_Reader leaves the ATS_Collider.

    This new component will offer developers a more user-friendly way to interact with triggers via their API as well as the potential tools to personally expand the tool's framework for a given situation.

    With these things sorted out, I'm currently working on some demos, then after that I will begin recording videos to give a better idea of the tool's current capabilities.

    Thanks for reading!

    Chase
     
  9. zeman97

    zeman97

    Joined:
    Sep 22, 2012
    Posts:
    53
    Introducing a new feature of the input action system: input action blocks!

    Input Action Blocks.PNG

    The above input action list would be used to activate the trigger via two terminals. Both terminals require the player to be inside their collider, both terminals require the player to hold down the "E" key, and both terminals require the player to satisfy this input for one second. The only difference is the collider groups that the two terminals must reference.

    When satisfied, the input action blocks "freeze" their contained input, preventing further changes to the input states of the input actions contained. This allows input to be required constantly (such as the key_down and the collision_enter (should) be required constantly) without the input breaking the trigger after it is needed.

    This simply addition will allow much more complex input action lists to be constructed.

    Furthermore, as can be seen, there is now an input action that is highlighted pink, as well as more options to select input actions. The simple selecting of an input action allows the user to insert input actions into the list, rather than having to create them and move them up through the list (as before). This small addition was designed to help speed up the creation process.

    Hope you enjoy,

    Thanks for reading!

    Chase
     
  10. zeman97

    zeman97

    Joined:
    Sep 22, 2012
    Posts:
    53
    Hello Unity!

    I have put together a quick video that gives a basic overview of the Advanced Trigger System, please take a look and leave some feedback.



    Thanks!

    Chase
     
  11. zeman97

    zeman97

    Joined:
    Sep 22, 2012
    Posts:
    53
    Hello All!

    I felt like it would be helpful to have a total list of the current input actions to better get an idea of what can be achieved as far as input goes, so here it is!

    Full List:
    Block Start
    Block Stop
    Button Down
    Button Up
    Collision Enter
    Collision Exit
    Key Down
    Key Up
    Set Input Description
    Time

    Would love to hear what y'all think, and if there is any input you are worried about being left out or think is needed :) ATS Trigger Input Action List 1.PNG ATS Trigger Input Action List 2.PNG

    Once again all feedback is welcome!

    Thanks!

    Chase