Ideas: Strategy AI

6 Responses to “Ideas: Strategy AI”

  1. Igor says:

    I thought we weren’t doing the “state based” AI?

    In any case I don’t understand your example of turning aggression on and off. You would think that in a logical flow some events would trigger an aggressive response and others would not. Or rather different events would trigger a level of aggression on some sort of scale. This is a simplified version of what happens in reality.

    Importantly though, I do not think that these events and the level of aggression caused should be defined. i.e. The program flow should not be ENEMY CREATURE IS CLOSE -> CHANGE TO ATTACK STATE -> INCREASE AGGRESSION TO 0.9.

  2. Ben says:

    Yeah, I agree that it shouldn’t be predefined, nor should it be a simple on/off state. That was just an example, I’m really just wondering how many variables the strategy AI is going to have to output.

    So I’m not saying that aggression has to be a boolean on/off thing, rather than a sliding scale thing… but asking do we even need to have an aggression output in the first place?

    I think for aggression, we will need an output – because it’d be silly to have all animals always attacking whenever they bumped into eachother. They should be able to decide.

    So if the strategy AI is outputting back to the system:

    int xTarget;
    int yTarget;
    float aggression;

    Do we need any other outputs? Are there any other important decisions that the AI must make? Like.. is it necessary for the animal to decide whether it’s eating or not? Or can we safely assume that if an animal is standing on some grass/meat – they’ll start eating automatically.

    Same with resting, does the AI have to tell the animal that it’s resting? Or can we just assume that if the AI isn’t moving/eating/drinking/shagging or being attacked, then it’s automatically resting.

    I think that it might be cool to have a ‘resting amount’, which is a sliding scale from 0 to 1. Where 0 is not resting at all, and 1 is complete sleep, and 0.5 is somewhere in between. We could balance it out so that at 0, you have full awareness, but the rest bar doesn’t improve at all, and at 1, you have no awareness, but the rest bar goes down really fast.

    Eitherway, we should try and create a list of all the variables that we’re going to need to output.

  3. Igor says:

    What do you mean by output in this case? What other process of the program will use, for instance, this aggression variable? Aren’t these going to be most useful “in house” so to speak, to the strategy AI anyway?

    In terms of some of the other things you mentioned, I think eating should be a decision not automatic based on whether it is on grass or not.

    For resting I like the idea of having the resting scale, maybe then eating can be a form of resting, etc.

  4. Ben says:

    Well, I suppose the actual aggression variable wouldn’t need to be outputted.. but something would. Maybe just that boolean on/off for attacking thing – which would be deterimined, in house, by an agression variable.

    Reason is, the strategy AI isn’t going to be calculating how much damage is dealt to the animals when they’re attacking – that’d be calculated by the evaluators part I’d have thought. Unless we’re merging them. They way it is now, the animal’s evaluators get updated (including damage recieved from other animals). Then, these evaluators get inputted into the ‘strategy AI’, and the strategy AI decides what to do based on these inputs. It then outputs a new xTarget, yTarget, and an ‘attacking’ boolean.

    We could merge it all into 1, but the reason I haven’t is for computing power reasons. The animals evaluators have to get updated every frame. But I don’t think it’s necessary for the animal to be ‘thinking’ every frame. Most of the time, the animal will simply be walking to a destination, and it’ll just decided to keep on doing what it’s doing. At the moment, the animals update their ‘strategy’ every 10 frames.

    Anyway, I guess it’s not important if we decide to do all the animal interactions and evaluations within the strategy section. But if we do, are the only things we’re ever going to have to output an xTarget and a yTarget value? To go to the movement AI?

  5. Igor says:

    I see your point with this and I think maybe we are getting to the level of complexity here where it will be beneficial to start mapping out a flowchart of how all of these modules fit together just so we can keep track. It will also help us keep track of all inputs/outputs.

  6. Igor says:

    I don’t know what happened here but somehow the original post got deleted…?

    Possibly my mistake.

Leave a Reply

You must be logged in to post a comment.