AI Preview

Games with combat, inventory, crafting and more beside a story and dating/life sim gameplay
Post Reply
User avatar
Anima_
Druid
Posts: 345
Joined: Fri Mar 02, 2012 2:44 pm
Location: Germany
Contact:

AI Preview

Post by Anima_ »

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.
Last edited by Anima_ on Mon May 21, 2012 9:25 am, edited 1 time in total.
User avatar
jack1974
Pack leader
Posts: 15479
Joined: Thu Jun 16, 2005 4:43 pm

Re: AI Preview

Post by jack1974 »

Cool, I think the possibility of having NPC and also auto-resolve battles (in case the player is clearly winning) would be very interesting new features. Also, nice wallpaper image :)
User avatar
Aleema
Official writer
Posts: 223
Joined: Tue Jul 19, 2011 12:03 pm

Re: AI Preview

Post by Aleema »

That's ridiculously cool. That's premium AI right there. I've only coded basic AI. Most complex I've gotten is moving NPCs around the game map to fight each other while the player explores, factoring only a few things like their health, location, supplies, and permanent attitude - so I can take one look at this and be in awe. The goals really intrigue me, such as what affects them in battle. There's already an anger sort of mechanic in battle that you can tranquilize, but I'd love to be able to have a battle strategy that makes all my enemies doubt themselves to death.

Intrigued by what "juicyness" infers. I assume it means how appealing a target they are? Mages are probably really juicy, even if not a big threat when out of mana.

Also - tickled that you pit Plant Stronghold against LorenRPG for the prototype. :mrgreen:
User avatar
Anima_
Druid
Posts: 345
Joined: Fri Mar 02, 2012 2:44 pm
Location: Germany
Contact:

Re: AI Preview

Post by Anima_ »

Aleema wrote:That's ridiculously cool. That's premium AI right there. I've only coded basic AI. Most complex I've gotten is moving NPCs around the game map to fight each other while the player explores, factoring only a few things like their health, location, supplies, and permanent attitude - so I can take one look at this and be in awe. The goals really intrigue me, such as what affects them in battle. There's already an anger sort of mechanic in battle that you can tranquilize, but I'd love to be able to have a battle strategy that makes all my enemies doubt themselves to death.
Well the goals aren't final and their calculation are even more in the air. But that's why it's a prototype, working these things out is its job. :wink:
Though I'm not sure if this is really "premium" AI. The base algorithm is actually really simple and the AI rabbit hole is a deep one. Still, I really like this approach to game AI, it's fun to work with.
Intrigued by what "juicyness" infers. I assume it means how appealing a target they are? Mages are probably really juicy, even if not a big threat when out of mana.
Bulls eye, Juicyness is calculated by comparing the character current hit points with his total hit points and his current hitpoints again with the average of the current team members hitpoints.
Characters have also static personality modifiers, one for example changes the calculation of the Juicyness multiplier. So you can make characters prefer vulnerable targets even more.
Also - tickled that you pit Plant Stronghold against LorenRPG for the prototype. :mrgreen:
That's actually somewhat of a running joke for my prototypes. The Loren RPG test battle used the characters from Planet Stronghold for enemies as well. :lol:
User avatar
jack1974
Pack leader
Posts: 15479
Joined: Thu Jun 16, 2005 4:43 pm

Re: AI Preview

Post by jack1974 »

Anima_ wrote: Bulls eye, Juicyness is calculated by comparing the character current hit points with his total hit points and his current hitpoints again with the average of the current team members hitpoints.
Characters have also static personality modifiers, one for example changes the calculation of the Juicyness multiplier. So you can make characters prefer vulnerable targets even more.
That's a very good thing and can make battles much more interesting, by having enemies that play defensively or offensively, trying to buff only, and so on. I think it's a big improvement, I don't understand all the basics behind it but seeing the prototype running immediately triggered lots of possibilities in my mind to design new cool enemies/battles :)
Anima_ wrote:
Also - tickled that you pit Plant Stronghold against LorenRPG for the prototype. :mrgreen:
That's actually somewhat of a running joke for my prototypes. The Loren RPG test battle used the characters from Planet Stronghold for enemies as well. :lol:
I remember the first prototype of Loren battle, all enemies were named Tom, Michelle, Philipp, etc. Was fun indeed :mrgreen:
Post Reply