Posted 24 May 2018 - 04:26 AM
I made some AI stuff once upon a time. I never finished the pathing stuff needed to make some of it viable. In general, you start by giving an npc an IQ, and some skills. Make checks against IQ every frame to see how smart of a decision they will make, then make skill checks as appropriate.
From there, you have conditional action trees. (This is once place where function pointers would be quite helpful.)
You can keep an array of conditional actions as constants, and have the npc folow down a path based on whether he's making smart, stupid, or neutral decisions. Once you resolve the action to take, you return that constant value to a function to perform the action.
Ultimately, this means fully scripting npcs if you want them to be fully aware and under your control.
-
Evan20000 and OmegaX like this