Short Answer : Yes, not should be hard.
Long Answer ;
Finite State Machine
In fact, FSM and NeuralNetowrk are different things depending on where you look. In theory, FSM usually control your logic in asynchronous.
Give an example for this ;
BootState : State (When your app is booting)
GameState -> State (inheritance) (For only OOP logic)
MenuState : GameState (When your app state changed from boot to menu)
MainState : GameState (Your main logic)
GameStatusState -> GameState (inheritance) (For control some status)
WinState : GameStatusState (When won a game)
LoseState : GameStatusState (When lose a game)
bla. bla. bla...
A very complex and detailed subject. You can research from many sources on internet. Our subject isn't to explain it how to work, how to make etc.
Let's go to our actual subject.
Neural Networks With Finite State Machine
You can look like the example I gave you first. I have worked a little on this subject. Even if it is not a very detailed answer, I can give my own examples used in my games.
Some scripts are required ;
StateMachine -> Main FSM class to control some things like ;
- CurrentState, PreviousState, Transition etc.
StateMachineController -> Control to StateMachine. A singleton, An Instance.
State -> Main base state class. We will use it for inheritance and some functions like ;
void Initialize(StateMachine stateMachine, StateMachineController
Enter, Exit, Update etc.
StateComponent -> A base class for other states.
- We need to store come variables like : State, OldState, StateMachine, SharedStates (For other states) etc.
AIStateBehaviour -> We realy need this for control main logic. Like ;
- Transform, Rigidbody, Positions, Speed, Animations, Movement, Control bounds, virtual effects like freeze, poison, stunned and everything that might come to mind... !I.M.A.N.I.G.A.T.I.O.N!
AIStateBehaviour needs a controller class for control sometings. We can
say "Neural States".
I found a picture, showing how it should be structured like a neural networks.
Now, you can inheritance everythink like AIPerson, AIMonster (AIBird and AIBirdInterFaces, AIFish and AIFishInterfaces, etc... ) from AIStateBehaviour.
As a result, We can control every AI action with neural networks. All neural transitions have to be chosen best way according to the values coming from anythings.
Some useful keywords you can searh from Google ;
State Machine Design
Neural Network Design
Finite State Machine