I am currently completeing a project at University and I am creating a battle system for an RPG, I was just wondering what other people thought would be the best technique to use for the AI in this situation.
I have been looking into Case-Based Reasoning, but I think it might be a bit tricky to get working with this sort of scenario. I was looking into FSMs as well, but I think they're a bit simple for what I'm wanting.
Any suggestions?
--Dannon
FSM's would work nicely.
you could have random paths in your FSM to simulate different reactions.
State being attacked:
throw dice for reaction.
1 = action 1
2 = action 2
3 = action 3
State action 1:
swap to shield
State action 2:
runaway
state action 3:
counter-attack
ok this is a very simple exmaple but you could build it up so at every main state you have some randomness to get to a sub-state.
you could always use a properbility table to decide which sub-state to use.
hope it helps
you could have random paths in your FSM to simulate different reactions.
State being attacked:
throw dice for reaction.
1 = action 1
2 = action 2
3 = action 3
State action 1:
swap to shield
State action 2:
runaway
state action 3:
counter-attack
ok this is a very simple exmaple but you could build it up so at every main state you have some randomness to get to a sub-state.
you could always use a properbility table to decide which sub-state to use.
hope it helps
What you use depends on what kind of RPG you're going to implement. If you plan on having mostly random, Bard's Tale or Diablo sort of encounters, then FSMs should suffice for most of their AI. But if you plan on doing any sort of stylized, cinematic style encounters with story, dialogue, and the like, then you should probably look into some form of scripting system as well. Note, that I said "as well". Don't look for a singular AI technique to cover everything you need within your game. It's very common to piece together different techniques to get everything done that you require.
depends on the battle type....
if its turn based (not atb turns)
-just give enemies normal attack sequences with health constraints
if its atb turns
-same as above but with more variation
if its just action like hack and slash style
-give conditions for movement (running away, charging, etc.)
-also include the above^
if its turn based (not atb turns)
-just give enemies normal attack sequences with health constraints
if its atb turns
-same as above but with more variation
if its just action like hack and slash style
-give conditions for movement (running away, charging, etc.)
-also include the above^
Just to reitterate some of the posts above:
I would agree that a diablo style RPG would most benefit from an FSM style AI system. Enemies should not be on the screen long enough to really have time to establish intelligence to the player. Seek and Destroy, or Flee for My Life.
If it is a turn based combat system (a-la Final Fantasy), I would recommend having a weighted case scenario, based on specific units. This can be done through calculations on self and enemy perceptions. For example, if I recognize that my health is 10, I have a potion, and that there are 4 enemies, than using the health potion would be beneficial. At the same time, if the health potion only restores 30, and I have the ability to spawn an ally with hp 70...well, I might as well go for that right?
This type of AI is far more advanced than a simple FSM -- it requires a lot more perception as to what is going on in the game. However, at the same time, you do want these battles to end. The player "should" be able to win, so having a "dumb" AI isn't too bad.
So I would highly recommend looking into simple case-based reasoning, where each AI entity is given certain "perception" abilities, so that they seem to make the right decisions, but not all the right decisions. The different perceptors could be:
1) Self Health
2) Self Magic
3) Self Items
4) Number Allies
5) Number Enemies
6) Enemy Health
7) Enemy Magic
8) Enemy weapons
etc, etc
Obviously, harder monsters would make decisions on more of these things. A simple enemy would only know "Self Health," making its actions based entirely on its own health. So if its low, it heals or runs away, making itself extremely timid.
Then, based on personality, you simply have overriders. Confident enemies are more likely to stay and fight when low on health than run away. These could be race characteristics.
Reading this, I guess its not all what you were looking for, but it was fun to write :D
I would agree that a diablo style RPG would most benefit from an FSM style AI system. Enemies should not be on the screen long enough to really have time to establish intelligence to the player. Seek and Destroy, or Flee for My Life.
If it is a turn based combat system (a-la Final Fantasy), I would recommend having a weighted case scenario, based on specific units. This can be done through calculations on self and enemy perceptions. For example, if I recognize that my health is 10, I have a potion, and that there are 4 enemies, than using the health potion would be beneficial. At the same time, if the health potion only restores 30, and I have the ability to spawn an ally with hp 70...well, I might as well go for that right?
This type of AI is far more advanced than a simple FSM -- it requires a lot more perception as to what is going on in the game. However, at the same time, you do want these battles to end. The player "should" be able to win, so having a "dumb" AI isn't too bad.
So I would highly recommend looking into simple case-based reasoning, where each AI entity is given certain "perception" abilities, so that they seem to make the right decisions, but not all the right decisions. The different perceptors could be:
1) Self Health
2) Self Magic
3) Self Items
4) Number Allies
5) Number Enemies
6) Enemy Health
7) Enemy Magic
8) Enemy weapons
etc, etc
Obviously, harder monsters would make decisions on more of these things. A simple enemy would only know "Self Health," making its actions based entirely on its own health. So if its low, it heals or runs away, making itself extremely timid.
Then, based on personality, you simply have overriders. Confident enemies are more likely to stay and fight when low on health than run away. These could be race characteristics.
Reading this, I guess its not all what you were looking for, but it was fun to write :D
You could do a range of things fot the rpg ai.
You could give it logical rules, and a goal. You could give it logical rules, bayens rules, and a goal, you could use minimax with alphabeta (w/ a random factor, for difficulty), or even a fsm would suffice.
A goal based system, with logical rules, as well as bayens rules, would be hard to make initially, but will surve you well. (you can use the same thing for every ai, and npc.). You can also use it for scripting too. (you basically tell the "game ai" what to do, and what inferences it can make).
So you bassically tell it something like
"if the player has collected item xyz then open door abc"
"in order for any door to be opened, its surrounding area must be free of Creatures"
"The player has collected item xyz"
"The surrounding area is free of creatures"
"open door abc"
...
And so on.
From,
Nice coder
You could give it logical rules, and a goal. You could give it logical rules, bayens rules, and a goal, you could use minimax with alphabeta (w/ a random factor, for difficulty), or even a fsm would suffice.
A goal based system, with logical rules, as well as bayens rules, would be hard to make initially, but will surve you well. (you can use the same thing for every ai, and npc.). You can also use it for scripting too. (you basically tell the "game ai" what to do, and what inferences it can make).
So you bassically tell it something like
"if the player has collected item xyz then open door abc"
"in order for any door to be opened, its surrounding area must be free of Creatures"
"The player has collected item xyz"
"The surrounding area is free of creatures"
"open door abc"
...
And so on.
From,
Nice coder
Click here to patch the mozilla IDN exploit, or click Here then type in Network.enableidn and set its value to false. Restart the browser for the patches to work.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement