AI Preview
Posted: Sun May 20, 2012 8:06 pm
Well I've got some usable time on the last two weekends and spent it on something fun: working on AI prototypes.
While the prototypes were for my own project, the same system is planned to replace the current decision trees used in Loren and Planet Stronghold. If I end up coding the RPG framework for them of course.
So before we go into a bit more detail why the new system is so much better (potentially) then the old one (If it works), here is a preview on the prototype UI. (You can click on the picture to get the bigger readable version, it's 3280*1080 px though.)
To understand my problems with the old AI, lets take a look at how it works. Every class has it's own specific AI and each AI comes with Skill slots. The AI is more or less binary, it can only decide if a condition is True or False and then goes to the next decision node, which one depends on the conditions truth value. Until it reaches an action that it executes.
These actions are linked to Skill slots, so whenever we wanted to add a new skill to an enemy that didn't fit in the current skill slots, the AI had to be rewritten. On the other hand the new AI can take an arbitrary amount of actions, since the actions handle any specific decision making on their own. There is a limit due to computation power of course, but so far it looks like we can have a practical amount of actions without problems. That's one of the reasons I made the prototype in the first place, to see how many actions the system can take before it becomes to slow.
Since the old system was hardwired to specific skill slots, we couldn't provide an auto attack function that would suggest an action to the player. Or even an automatic battle for testing purposes. Running 100 battles to test for fringe errors is better left to the computer itself. The prototype does exactly that, both sides are controlled by the AI. That also adds the possibility of NPC allies.
And finally, the new system has much better situational awareness thanks to it's goal oriented approach. So it should take more intelligent actions. Well, that's also the main drawback of course. The system has to be fine tuned much more before it makes even remotely sensible decisions. A decision tree is much easier to get working in the first place.
We won't use the new system for Lorens expansion, since it's still at an early stage and we don't want to risk running late.
[tl,dr] I worked on a new AI and wanted to boast, eh share with you.
While the prototypes were for my own project, the same system is planned to replace the current decision trees used in Loren and Planet Stronghold. If I end up coding the RPG framework for them of course.
So before we go into a bit more detail why the new system is so much better (potentially) then the old one (If it works), here is a preview on the prototype UI. (You can click on the picture to get the bigger readable version, it's 3280*1080 px though.)
To understand my problems with the old AI, lets take a look at how it works. Every class has it's own specific AI and each AI comes with Skill slots. The AI is more or less binary, it can only decide if a condition is True or False and then goes to the next decision node, which one depends on the conditions truth value. Until it reaches an action that it executes.
These actions are linked to Skill slots, so whenever we wanted to add a new skill to an enemy that didn't fit in the current skill slots, the AI had to be rewritten. On the other hand the new AI can take an arbitrary amount of actions, since the actions handle any specific decision making on their own. There is a limit due to computation power of course, but so far it looks like we can have a practical amount of actions without problems. That's one of the reasons I made the prototype in the first place, to see how many actions the system can take before it becomes to slow.
Since the old system was hardwired to specific skill slots, we couldn't provide an auto attack function that would suggest an action to the player. Or even an automatic battle for testing purposes. Running 100 battles to test for fringe errors is better left to the computer itself. The prototype does exactly that, both sides are controlled by the AI. That also adds the possibility of NPC allies.
And finally, the new system has much better situational awareness thanks to it's goal oriented approach. So it should take more intelligent actions. Well, that's also the main drawback of course. The system has to be fine tuned much more before it makes even remotely sensible decisions. A decision tree is much easier to get working in the first place.
We won't use the new system for Lorens expansion, since it's still at an early stage and we don't want to risk running late.
[tl,dr] I worked on a new AI and wanted to boast, eh share with you.