Hi all,
Firstly, from the look of the other posts in this part of the forum - most of you are operating on a way higher level of expertise than me when it comes to AI. I know none of the terminology and am new to it, so treat me as a layman!
I have recently started learning about GameMaker at a very basic level, (making coloured blobs move around on screen when cursors are pressed). I have gradually worked up to a basic isometric game where a player moves his blob around a simple single screen maze - avoiding other 'enemy' blobs that are on a pre described linear up-down style path. Simple stuff.
I have even experimented a little with blobs that chase you when you get close and them - but then abandon the chase when you get far enough away again (I know, right).
Gradually, I am getting to grips with the GML code side of things, so I got thinking about planning a much more sophisticated AI.
The code instructions I have used so far are pretty simple, and only govern crude NPC chasing behaviour - but could be applied to a more complex actions.
This got me onto a new train of thought, what If I put together a flow diagram (for lack of a better word) of 'if-x-is-y-then-do-this-action' style commands that is based on a core set of variables that I guess you could call the 'character'.
The variables (for the sake of this post, lets say each variable is a value of 1-100) in question would basically be anything, from physical attributes (video game staples like 'strength - 50' etc...) to things that are more abstract (one idea that I had would be a variables that govern what motivates the character - for example: 'desire to find food - 20' 'desire to make a shelter - 70').
The idea would be that the flow diagram that would govern the decisions that the AI makes would constantly refer back to the character attribute figures in order to influence its behaviour. For example:
- Enemy attacks
(If aggression stat is less than 15, go to the stage in the flow diagram/algorithm that governs behaviour while fleeing).
(If aggression stat is between 15 and 75, fight back until enemy is subdued)
(If aggression stat is more than 75, fight back until enemy is killed).
Basically, the idea is that once the behaviour flow diagram is assembled - NPC's core identity could be either carefully tailored by adjusting the 'character' figures. These could even be randomised (within certain parameters) to add variety to the NPC's in a game.
I also though that it would make sense that certain actions/results of decisions made by the NPC's could work in reverse and have an impact on their 'character'. For example, if an aggressive NPC constantly retaliates with heavy violence but is overpowered x amount of times - this could gradually lower the aggression stat so that they become more wary.
I'm basically just thinking aloud - I assume that to most of you, this is just a very vague description of how things are already done. Sorry if this is the case.
Am I on the right lines with my thinking?
My end goal is a behaviour system that has an initial 'stat input' system for each NPC. This will allow me to then just turn them loose in an RPG and see how they interact with each other - this could even form the basic premise for a very simple eco-system sim?
I'll elabourate on this after sleep and coffee.
TJ