diff --git a/doc/contributions.txt b/doc/contributions.txt
index f70336a94..ea148abd9 100644
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -114,6 +114,7 @@ Aleric Inglewood
IMP-670
IMP-701
IMP-734
+ IMP-735
Alissa Sabre
VWR-81
VWR-83
diff --git a/indra/cwdebug/debug.cc b/indra/cwdebug/debug.cc
index 3066c2845..48392beae 100644
--- a/indra/cwdebug/debug.cc
+++ b/indra/cwdebug/debug.cc
@@ -171,6 +171,7 @@ void stop_recording_backtraces(void)
channel_ct gtk DDCN("GTK"); //!< This debug channel is used for output related to gtk.
channel_ct sdl DDCN("SDL"); //!< This debug channel is used for output related to sdl locking.
channel_ct backtrace DDCN("BACKTRACE"); //!< This debug channel is used for backtraces.
+ channel_ct statemachine DDCN("STATEMACHINE"); //!< This debug channel is used class AIStateMachine.
} // namespace dc
} // namespace DEBUGCHANNELS
diff --git a/indra/cwdebug/debug.h b/indra/cwdebug/debug.h
index 66408ad72..e91eab92e 100644
--- a/indra/cwdebug/debug.h
+++ b/indra/cwdebug/debug.h
@@ -116,6 +116,7 @@ extern CWD_API channel_ct primbackup;
extern CWD_API channel_ct gtk;
extern CWD_API channel_ct sdl;
extern CWD_API channel_ct backtrace;
+extern CWD_API channel_ct statemachine;
#endif
diff --git a/indra/llcommon/llfasttimer.h b/indra/llcommon/llfasttimer.h
index 898ed496b..726274c23 100644
--- a/indra/llcommon/llfasttimer.h
+++ b/indra/llcommon/llfasttimer.h
@@ -177,6 +177,7 @@ public:
FTM_REFRESH,
FTM_SORT,
FTM_PICK,
+ FTM_STATEMACHINE,
// Temp
FTM_TEMP1,
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 57a6163d7..628ee9ec4 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1005,6 +1005,15 @@ set(viewer_HEADER_FILES
source_group("CMake Rules" FILES ViewerInstall.cmake)
+set(statemachine_SOURCE_FILES
+ statemachine/aistatemachine.cpp
+ )
+set(statemachine_HEADER_FILES
+ statemachine/aistatemachine.h
+ )
+list(APPEND viewer_SOURCE_FILES ${statemachine_SOURCE_FILES})
+list(APPEND viewer_HEADER_FILES ${statemachine_HEADER_FILES})
+
if (DARWIN)
LIST(APPEND viewer_SOURCE_FILES llappviewermacosx.cpp)
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index b0a04a3bd..1406c4e96 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11382,6 +11382,17 @@
Value
0
+ StateMachineMaxTime
+
StatsAutoRun