Mythruna
April 19, 2024, 02:42:07 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: A.I  (Read 8224 times)
Bigworsh
Newbie
*
Posts: 9


View Profile
A.I
« on: November 02, 2011, 12:21:24 PM »

I'm not sure whether it's the right time to ask, but may I ask what ideas do you have for the A.I.?

I dont know what the others think about it, but I would be very pleased if you could add different behavior for the same type of enemys.
For an example, I want to use the creeper from minecraft. I think everyone who played minecraft, have noticed that a creeper is running in a straight line toward the player and then explode, when it is near enough to deal damage. But that makes it pretty easy to defeat them and after a while a creeper isn't interesting as a enemy at all. But if a creeper would attack in different ways, like running a semicircle around the player and then attacking him(the player), it would make fighting much more fun, because then you have a less predictable enemy.
Or you could add teamwork between certain types of monsters. Of course only simple things, like the first monster starts attacking a player and only after the player noticed it, the second one trys to attack the player from behind.

But if you have totally other plans for the A.I., then I'm hoping that at least I can create such a mod for myself, so that I dont get bored by easy monsters. Cool

P.S. I hope it is understandable what I mean and if not maybe some german user could help me out and write it in proper english. Grin
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #1 on: November 02, 2011, 01:03:21 PM »

Mythruna won't have "heat seaking missile" monsters like some other games of note.  If I have my way, all creatures (friendly or not) will have motivations beyond just "I appeared now I will kill the player".

There's an AI design methodology called Goal Orient Action Planning (GOAP).  http://web.media.mit.edu/~jorkin/goap.html is one launch point.  The current AI design for Mythruna relies on this heavily with some additions to deal with the case where players are not around but the AI still needs to operate.  For example, NPCs building a city.  If the player is watching then you should see the buildings get built... but if you walk far away for some long period of time and come back then progress should have advanced as if you'd been standing there... but there was no reason for the game to bother doing the individual steps.  "Player was away for 10 game days, buildings go up in 1.5 days so randomly place x number of buildings, etc."

Custom AI behaviors will be in the form of defining new GOAP actions which will have requisite conditions, results, etc. along with the additional stuff to know "average time" and how to interpolate mid-action, etc..  Building a creature AI is then a matter of giving it a catalog of actions that it can choose from and associating a hierarchy of goals.

For example, a wolfs base goals would be "eat when hungry", "sleep when tired", "hang with my pack".  It would then have a set of actions to chose from (potentially sequences of actions it can chain together) to achieve those goals.  And nearly every creature gets those exact same goals, it's just their actions that change.

For example, a deer might also have a "run when threatened goal" but its other goals would be the same.  Its actions for finding food would be vastly different and its other priorities may be sorted differently.

I hope that clears things up and gives food for thought.  AI is something I'll be diving into more deeply after physics is integrated because physics capabilities ultimately factor into everything else.
Logged
ayoriceball
Donators
Jr. Member
***
Posts: 99


Control Magic


View Profile
« Reply #2 on: November 03, 2011, 04:17:00 PM »

What about Player NPC interactions? Will creatures be able to change behaviors when there are external events (example: food moving away, therefor causing a migration)?
Logged

From Bay12Forums
Don't dwarven ladies know they're beautiful the way they are? They don't need to starve themselves to look like those elven bitches.
I have a skin, a potato has a skin, therefore, I'm God
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #3 on: November 03, 2011, 04:59:49 PM »

Yeah, that's the idea.

NPCs have goals.  Those goals can be achieved through some catalog of actions but each action has requirements.  If there is no path through the actions, their results, and subsequent requirements then that goal cannot be completed.

So if a wolf pack lives nearby and there are plenty of trees and wandering larger game (I'm pretty sure things like squirrels, rabbits, etc. will be more like 'encounters'... if there is forest then they just randomly exist when needed... not 'real' NPCs) then that wolf pack will keep to its own business unless disturbed.  But if you kill enough of the larger game or deforest enough of their territory then they will have to look for food elsewhere.  This isn't something I'd have to program... it would be a function of the goals, the actions, and their requirements.

If a wolf gets hungry enough and there is no food through normal means then it might venture into town to see what it can find... despite the danger that poses to it.

At least that's the plan.

Humanoid NPCs are more complicated but it's basically the same system.  If you sneak into their house and steal their food then they will have to go to the market and buy it.  If the market is out of food or food is too expensive then the NPC will have to resort to other strategies.  Their personality traits and the actions in their action set will determine what those might be.  Or they starve and die.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #4 on: November 03, 2011, 05:01:49 PM »

re: migration, and yes that's a specific set of goals/actions built into migratory animals and humanoid NPCs.  So the avians will move with the seasons and in some cases might leave early if food has grown scarce.  The requirements for the migration actions would have to be careful not to let them migrate back and forth too quickly or stupidly.
Logged
ayoriceball
Donators
Jr. Member
***
Posts: 99


Control Magic


View Profile
« Reply #5 on: November 03, 2011, 07:54:26 PM »

Very interesting. I look forward to seeing the interactions ingame.
Logged

From Bay12Forums
Don't dwarven ladies know they're beautiful the way they are? They don't need to starve themselves to look like those elven bitches.
I have a skin, a potato has a skin, therefore, I'm God
Bigworsh
Newbie
*
Posts: 9


View Profile
« Reply #6 on: November 04, 2011, 04:27:19 AM »

Wow, thats even more then I hoped for, but I still have a question. Will there be a random factor, so that the action that a NPC will perform isn't too logical. As an exaple I will using your food situation, instead of buying food, which would be easier, the NPC is going to hunt a few animals.

And perhaps you could add a variable, which show the intelligents of a creature. And this variable could be divided with the random factor, so that more intellegent creatures, would act more logical then less intellegent ones. Ok, after reading it again I noticed, that I don't know how you are going to program it. In other words nearly my whole post, could be for nothing, but still I hope you got a rough idea what I wanted to show with this example.

Edit: By the way keep up the good work. I like your ideas. Wink
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #7 on: November 04, 2011, 06:38:55 AM »

NPCs will have some kind of personality profile that helps decide things.  I'm not exactly sure what all traits will factor into this yet but it's important.

Regarding hunting versus buying, that would come up in the case where an NPC would equally choose either option.  In which case the AI system will have to randomly choose one of mostly equal potential strategies.  But the typical city-dwelling NPC probably won't hunt and if they do it will be really low on their list of priorities.  That's a natural effect of how the actions get sorted into priorities, though.  Those priorities will be a combination of base priority levels for that type of NPC modified by their personality traits which might be effected by mood.  (Mood might actually not be necessary as it's generally a reflection of state which is already known and factors into the strategy planning already.)

There are a few ways to wire this system up that will all do the job that same but the final design will be informed by how easy it is to add new behaviors and (more importantly) how easy it is to do "low level of detail" AI processing on NPCs that no player is near.  Mood may make modeling easier, "When this NPC is mad he should hunt instead of buy."  But it also may make long term low level of detail AI processing more difficult, "NPC eats X per day and buys Y food per day."   So we'll see.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!