AI Moving

version 1 by Sebastian Rahn

  • Home page
  • Beginning
  • Previous
  • Next



  • Section 1.2 - Advanced Chasing

    [Will initialize the simple chase. If it fails, the actor will try to walk either into one of two corresponding directions or the one it receives from the complex chase]

    Follow_truth state is a truth state that varies.
    Follow_Richtung is a direction that varies.

    To start a chase:
    change Follow_truth state to true;
    start a simple chase;
    If Wallrunner of Follow_Runner is false
    begin;
    change Follow_Richtung to tmp_Direction;
    end if;
    If Follow_Stop is false begin;
    check sector;
    If Freespace is Wall
    begin;
    If tmp_Direction is northeast
    begin;
    If Wallrunner of Follow_Runner is true
    begin;
    change tmp_Direction to Follow_Richtung;
    check sector;
    otherwise;
    change tmp_Direction to north;
    check sector;
    If Freespace is Wall
    begin;
    change tmp_Direction to east;
    check sector;
    end if;
    end if;
    change Follow_truth state to false;
    end if;
    If Follow_truth state is true begin;
    If tmp_Direction is southeast
    begin;
    If Wallrunner of Follow_Runner is true
    begin;
    change tmp_Direction to Follow_Richtung;
    otherwise;
    change tmp_Direction to south;
    check sector;
    If Freespace is Wall
    begin;
    change tmp_Direction to east;
    check sector;
    end if;
    end if;
    change Follow_truth state to false;
    end if;
    If Follow_truth state is true begin;
    If tmp_Direction is southwest
    begin;
    If Wallrunner of Follow_Runner is true
    begin;
    change tmp_Direction to Follow_Richtung;
    check sector;
    otherwise;
    change tmp_Direction to south;
    check sector;
    If Freespace is Wall
    begin;
    change tmp_Direction to west;
    check sector;
    end if;
    end if;
    change Follow_truth state to false;
    end if;
    If Follow_truth state is true begin;
    If tmp_Direction is northwest
    begin;
    If Wallrunner of Follow_Runner is true
    begin;
    change tmp_Direction to Follow_Richtung;
    check sector;
    otherwise;
    change tmp_Direction to north;
    check sector;
    If Freespace is Wall
    begin;
    change tmp_Direction to west;
    check sector;
    end if;
    end if;
    change Follow_truth state to false;
    end if;
    If Follow_truth state is true
    begin;
    If tmp_Direction is south
    begin;
    If Wallrunner of Follow_Runner is true
    begin;
    change tmp_Direction to Follow_Richtung;
    check sector;
    otherwise;
    If Follow_Goal is left of Follow_Runner begin; change tmp_Direction to southwest; otherwise; change tmp_Direction to southeast; end if;
    check sector;
    If Freespace is Wall
    begin;
    If Follow_Goal is left of Follow_Runner begin; change tmp_Direction to southeast; otherwise; change tmp_Direction to southwest; end if;
    check sector;
    end if;
    end if;
    change Follow_truth state to false;
    end if;
    If Follow_truth state is true begin;
    If tmp_Direction is north
    begin;
    If Wallrunner of Follow_Runner is true
    begin;
    change tmp_Direction to Follow_Richtung;
    check sector;
    otherwise;
    If Follow_Goal is left of Follow_Runner begin; change tmp_Direction to northwest; otherwise; change tmp_Direction to northeast; end if;
    check sector;
    If Freespace is Wall
    begin;
    If Follow_Goal is left of Follow_Runner begin; change tmp_Direction to northeast; otherwise; change tmp_Direction to northwest; end if;
    check sector;
    end if;
    end if;
    change Follow_truth state to false;
    end if;
    If Follow_truth state is true begin;
    If tmp_Direction is west
    begin;
    If Follow_Goal is below of Follow_Runner begin; change tmp_Direction to northwest; otherwise; change tmp_Direction to southwest; end if;
    check sector;
    If Freespace is Wall
    begin;
    If Follow_Goal is below of Follow_Runner begin; change tmp_Direction to southwest; otherwise; change tmp_Direction to northwest; end if;
    check sector;
    end if;
    change Follow_truth state to false;
    end if;
    If Follow_truth state is true begin;
    If tmp_Direction is east
    begin;
    If Follow_Goal is below of Follow_Runner begin; change tmp_Direction to northeast; otherwise; change tmp_Direction to southeast; end if;
    check sector;
    If Freespace is Wall
    begin;
    If Follow_Goal is below of Follow_Runner begin; change tmp_Direction to southwest; otherwise; change tmp_Direction to northeast; end if;
    check sector;
    check sector;
    end if;
    change Follow_truth state to false;
    end if;
    end if;
    end if;
    end if;
    end if;
    end if;
    end if;
    end if;
    end if;
    end if.