Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update AI functions #333

Merged
merged 10 commits into from
May 21, 2016
Merged

Update AI functions #333

merged 10 commits into from
May 21, 2016

Commits on May 19, 2016

  1. Add an AI function to correctly clear all waypoints

    Unfortunately clearing all waypoints from AI is not as simple as deleting them all with `deleteWaypoint`.
    
    You have to kill their pre-planned movement (based on old waypoints) by having them complete at least one waypoint.
    
    One solution is to move all of their old waypoints to their position before deleting them, however if waypoint statements are being used this could have adverse effects.
    
    So this function creates a fresh waypoint for the purpose of killing their movement. It is also self-deleting (through its completion statement) to avoid any possible issues with timing.
    kymckay committed May 19, 2016
    Configuration menu
    Copy the full SHA
    25dcc95 View commit details
    Browse the repository at this point in the history
  2. Update taskDefend AI function

    - Retain open building positions to make groups defending overlapping areas respect one another.
    - Use new A3 scripting commands to optimise and enhance the function.
    - Makes the function a lot more readable with comments and more spacing.
    - Capitalize commands and function names appropriately.
    - Any existing waypoints are cleared before defending begins.
    kymckay committed May 19, 2016
    Configuration menu
    Copy the full SHA
    678bb64 View commit details
    Browse the repository at this point in the history
  3. Update taskPatrol AI function

    - The `cycle` waypoint is placed back at the start of the loop instead of randomly within the radius.
    - Any existing waypoints are cleared before the patrol loop is created.
    - `_this` is now correctly private.
    kymckay committed May 19, 2016
    Configuration menu
    Copy the full SHA
    752e186 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2016

  1. Update taskSearchArea AI function

    - Any existing waypoints are now cleared before the searching begins.
    - The recursive argument check is now more explicit.
    kymckay committed May 20, 2016
    Configuration menu
    Copy the full SHA
    b4f6277 View commit details
    Browse the repository at this point in the history
  2. Update searchNearby AI function

    - Now callable (by including the spawn within the function).
    - Accounts for units being killed while searching and dispatches all available units to search simultaneously.
    - Doesn't permanently change behaviour of the group if the function aborts due to building distance.
    - Optimized with new A3 commands and made more readable with comments and spacing.
    kymckay committed May 20, 2016
    Configuration menu
    Copy the full SHA
    fd36422 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2016

  1. Fix v1.54 compatiblity of fnc_taskDefend

    Commented out the part that isn't easily regex replaced so that it can be uncommented in future.
    kymckay committed May 21, 2016
    Configuration menu
    Copy the full SHA
    9c823f3 View commit details
    Browse the repository at this point in the history
  2. Restore fnc_searchNearby leader behaviour

    In actuality this is something of a compromise.
    
    Having the leader enter the building was not an intentional change I made. However it makes sense to do things that way when the group is small and so for any group with 2 or less units (includes the leader) the leader will now search the building too.
    kymckay committed May 21, 2016
    Configuration menu
    Copy the full SHA
    f27cdf3 View commit details
    Browse the repository at this point in the history
  3. Fix building search completion condition

    Accounts for cases where the leader enters the building.
    kymckay committed May 21, 2016
    Configuration menu
    Copy the full SHA
    d876997 View commit details
    Browse the repository at this point in the history
  4. Improve behaviour of fnc_searchNearby

    - The group leader (and any spare units) will now wait at his current position for the search to be complete before moving on.
    - Waiting between orders instead of between rounds of orders should prevent congestion and decrease time gaps in the search.
    - Embedding the post-search code into the waypoint condition and completion removes the need to `waitUntil` while also providing built in group unit list `thisList`.
    kymckay committed May 21, 2016
    Configuration menu
    Copy the full SHA
    5f531b5 View commit details
    Browse the repository at this point in the history
  5. Fix edge case in fnc_clearWaypoints

    If a waypoint was created at index 0 before the group complete the waypoint used to reset their path, then the wrong waypoint would be deleted upon its completion.
    kymckay committed May 21, 2016
    Configuration menu
    Copy the full SHA
    3d7f518 View commit details
    Browse the repository at this point in the history