Action evaluation

Started by
2 comments, last by ddlox 3 years, 7 months ago

In my current game project I have hit a bit of a roadblock and was hoping to get some help. When it comes to deciding on what action an NPC should take, I am having difficulty “normalising” the various actions so I can compare their utility. Let me explain.

Let's say I have an NPC who has some kind of shield, a knife and a gun. For the knife and the gun, I can estimate the expected damage they'd do at their levels to a given target, and that would give me a score that I could select either with. However for the shield, it's passive, so I don't really know how much damage it will save me. So it's really hard to compare against the attack values. Ideally, the shield should be raised pretty early on, so that seems a hard-coded behaviour. But this breaks the mechanic of “select the best action in the current state”.

I don't want to go the full Reinforcement Learning, get a Q function; and a neural network seems way overkill for what should be a simple decision. I could dice-roll attack / defence with some “aggression” weighting and then I only need to compare attack vs attack or defence vs defence which might be easier. But this seems like a bit meh.

Suggestions most welcome!

Advertisement

I think it's ok to only compare attack vs attack or defence vs defence. In my opinion, you should have an algorithm to help your NPC to decide whether it should attack or defend in the first place. Then use score to decide the best way to attack or defend.

Also I think whether to defend is heavily base on the current environment. For example, if the enemy is going to attack your NPC, your NPC should raise the shield. If you can add such information to your AI perception system, and you AI can make decisions base on it, it will make your NPC much smarter.

Don't use Neural network, it's a monster and hard to tune.

Hope this helps.

However for the shield, it's passive, so I don't really know how much damage it will save me.

at its basic application, you need to define how much damage the npc can sustain for a given weapon without a shield:

npc health 100

npc attacked with knife → reduce by 30 → npc health -= 30

npc attacked with gun → reduce by 40 → npc health -= 40

when shield is up

reduce by 20 for knife

reduce by 10 for gun

That's an example… then for shielding:

npc raises his shield everytime it is attacked OR when health is at a certain level OR ….etc…

finally make sure the behaviour is slightly different for the game's level of difficulty

this should get u going and unblocked ?

That's it … all the best ?

This topic is closed to new replies.

Advertisement