Jump to content
  • Advertisement
Sign in to follow this  
Timmygyu

AI for an RPG

This topic is 4834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am currently designing a text-based adventure. Although my origanl project was going to be a pure multi-choice dungeon crawler it has(like most projects do) evoleved a bit. I want to add some RPG elements to my game now. My problem is designing the mon AI. I have looked at trait based AI systems which have the monster follow a predesigned move loop unless a rudimentery set of exceptions occur. These were interesting, but I wanted to do more with my game. Also my game is a bit differnt in that I don't have multi-monster, multi-player(I know, I know, I'm using "multi" too much) battles. Instead I want one on one showdown. Because of this certin parts of my AI system can be simpler, but I don't want to use traits. Instead I want the monster to react to the battle situation in whole, like in chess. I joted down the basic parametars the monster would have to analyze, then tried to figure out how long and complex my routines would be. I came up with anywhere between 5-50 million lines of code. Obviously I have either underestimated the task I have set out to acomplish or, more likely, I don't know enough about about AI. I am a complete noob here so I'm sorry if I'm sounding stupid. Any help would be highly appreciated. If I need to clairify more just tell me. Thanks in advance, Tim

Share this post


Link to post
Share on other sites
Advertisement
Perhaps you could share those parameters so we could help you with your actual problem :)

Although I'm sure some here can ramble off 5+ good ways to do it generically it might help us a little with what your actual goal for you AI is.

Share this post


Link to post
Share on other sites
Yes it doesn't have to mindlessly loop...the character can judge the player's standards. Perhaps if the player has statistics (a "past"), the NPC can treat the player accordingly. If the player is supposed to be holding a knife out, the monster would react differently...suppose the monster wants to pick a battle, it would be stupid for the player to just sit there. If the monster wants a fair battle, it may "randomly" lose patience and choose various moves and whatnot...it doesn't have to be a loop. If you're willing, you could even code mating, birth, adult-hood, and death for the monsters.

So, if a player comes back to a "dungeon" (I don't understand why so many people are sickly obsessed with dungeons, however, you could put him in a canyon with a river and maybe some vines and a single tree...and maybe some stepping stones and let the player pick from crossing the "seeming stepping stones" which might be hippos or something, jump into the water rapids, try to run away, go into a nearby cave, climb a vine, climb a tree, or run in circles around the tree to try to confuse and annoy the monster enough to be tired and run away) which requires very little imaginative ability other than self-destruction and blackness, perhaps it will be different each time. Maybe make the text-based world not so predictable, but rather a real, online evolving adventure. Perhaps monsters will have mated or migrated out of that area--so either there will be few, they will be further away off along the canyon wall, across the river from crossing a bridge or something, in the cave, sleeping, or perhaps there are a lot more from having mated--or maybe they all died from a disease or from some other creature who wandered there.

I think you can get really creative with text-based games, and since you don't need a whole bunch of graphics, you can do a LOT with it, including simulated evolution, genes, and genetics. That would be really nice, I think.

Share this post


Link to post
Share on other sites
Hi,

Sorry for not getting back sooner, I haven't been able to get online for awhile.

First to verdad. I'll be honest, thats a really great idea, yet unfortunatley that kind of system would not fit well with the story and world I have designed. Belive me, I wish it did. Still I think your idea is faicnating and very creative, if you ever impliment it I would be glad to play that game. Although the first part is a bit more applicible in my case it is still not quite what I was thinking of.

Anyway I think I should explain my vision, so here it is:

Most RPGs(or at least good RPGs) are games with stunning and artistic graphic, complex battles systems, hundreds of monsters, weapons, items, an epic and well told story, and around 40-50 or more hours of gameplay involved. I love these kinds of games, in fact, to me Final Fantasy stands above any other game ever created. And yet, there are flaws. RPGs have at times been called the "thinking mans" genre, or the "geek" genre. But are they really that hard? Sometimes yes, even the modern FF games have some downright hair-tearing battles, and stratagy RPGs, such as those made by nippon ichi are limited by the fact they are so complex and unfreindly to softcore games, or even to new comers to the genre. My aim is to make a game that fuses the challange of stratagy based RPGs with the simplicity of more conventional RPGs. The CHESS system (my current code name for my ai system) pits one player against one monster. The way I want my system to work is, as the code name suggests, like a modified chess algorithem, and yet not. Oh well, I've tried to keep this simple, but I'm failing. Heres how it works: The monster and the player have a set of parametars that are affected over the course of the game, such as hp, atk, elemental weaknesses, limb damage, special status(psn, brn..), ect. Whenever the monster is called upon to make his move he analyzes both his status are your status. I concived of two completly implausible ways to do this. 1: have a gigantic if..else list chronicling every possible status combination. When the monster finaly comes across the right if...else statement he enters it. The statement lists the adaquicy of every move in the game, from the best suited move to the worst. He scans down until he hit a move he knows, the first move he hits wil be the best since he's going down the list. He then executes the move. The problem with this method is even with a rudimentery analisys of the battle the if...else list is unbelivibly large, this obviously is the 50 million line plus option.
2:feeding in all monster and player parametars (including monsters move list) into a function that then goes through each move and using an algorithem determines which move is best, then executes it. I have no idea how to do something like this. Anyway I'm being rushed off the computer, there's a thunderstorm coming. Sorry for being so confusing.

Bye,
Tim

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
An approach in AI, is to consider the intelligent artefact (your monster) as a function. Your function has inputs, and outputs. Which kind of output ? Real or integers number, list of numbers, whatever. Maybe, if you try to think "what are the inputs and the outputs of my monster ?", it well helps you. When you have fixed this, you will know :
- Is it possible to discover this function ?
- How to design my function.
No very concrete, hu ?



An example will help, and I like walking step by step ;)

* Let's say your monster will have a behavior that only depends from a player and the kind of the monster. So the inputs of the monster 'behavior function' are player informations, and informations from himself. The outputs will be a behavior selected from a limited set of behavior. A monster behavior could have some parameters, like a position or a threshold.

* A player, it's a set of numerical parameters : endurance, magical power, courage,dexterity, etc... That's the same for the monster.

* A neural network (3 layers perceptron will be ok) could be trained with the player and the monster parameters as input, and returning an index : the behavior to trigger. The parameters needed for each behavior is taken from the player and monster parameters trought a dedicated neural network.

* A monster, it's a neural network to choose a behavior, and the behaviors takes their parameters from a dedicated neural network. A genetic algorithm could be used to train the monster, his objective is to survive often to random fights. You can also coevolve differents monsters :)

* You can add some complexity : a monster could to see the parameters of the player with some small random errors. This error depends of the players capacities.

Share this post


Link to post
Share on other sites
Nothing is random, dear. Everything is what we, existence, creates.

Please note I am not in any form or fashion testifying I believe that the process of evolution does not exist, indeed I do, and that is creation. I also believe in God, I believe all things are God--we are a part of God. Even if you are not conscious of things, nothing is random, higher forms of consciousness exist.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!