Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1] 2   Go Down

Author Topic: Artificial Intelligence  (Read 6781 times)

0 Members and 1 Guest are viewing this topic.
Artificial Intelligence
« on: April 24, 2006, 06:00:00 am »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
We see games around like Halo (3D) and Zelda (2D) and think AI is amazingly predictable.

I think games dont have AI, but bad simulations of it. Honestly, all AI to me i just Collision, Distance, and Status checking, and nothing "Human Instinct." How would you got about programming/designing AI?
Logged
the a o d c
Re: Artificial Intelligence
« Reply #1 on: April 24, 2006, 07:03:54 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 150
Wow, what an open-ended question! I hardly know where to begin...

Let's start with defining how an AI functions:

AI is traditionally state-based; that is to say that the AI takes in its surroundings, and selects an action (aka a 'state') whose parameters best fits the surroundings to do.

Thus, the problem of developing better AI is twofold: a good AI must have a wide variety of states that it can preform, and the environment must be sufficiently expansive enough so that a good variety of surroundings variables can be generated. If either of these is lacking, then the AI won't be terribly interesting.

Let's imagine a great state-based AI entity: it has as many states as I can dream up, each state corresponding to a different set of environmental surroundings. But if the environment is lacking, then this amazing AI can't really do much: put it in a nondescript well-lit hallway without any obstacles or doors, and the only options are either attacking the player or running away. Of course, the AI will still select the most appropriate state (the AI knows that there isn't any cover to hide behind, so it goes prone to reduce its visible 'target area', making it harder for the player to shoot back), but still, the number of options is limited, and so the AI will seem 'bad'.

Similarly, putting an AI with a limited number of states will seem bad as well. It doesn't matter how much cover there is in an environment; if the AI isn't coded to sense the covering objects and take advantage of them, then it'll just stand there and take pot-shots at the player. Boring!

There's a game out there that implements, in a limited context, this concept of (complicated environment + state-based AI with many states). It's called The Sims. =P To sum that game up, there's a complicated environment that the AI's live in, and they will interact with it differently depending on their state: where in the house they are, how tired they are, how clean they are, how bored they are, et cetra. =)

Turn that Sims metaphore into a game: our great AI has values for how wounded it is, how scared it is, how aware of its surroundings, and the amount of time since it has seen an enemy. If the AI sees the player, it will evaluate its surroundings: if there's a good piece of cover nearby, it'll leap for that before opening fire; otherwise, it may drop to the ground and open fire, or immediately take a snap shot off attempting to kill the player before he has a chance to react. If there are an AI squadmates nearby, then the AI will yell a warning so the entire squad can open fire and kill the player with brute force; if the AI is alone, then it might try to hide and then only shoot the player after he has passed.

So, to recap: make the environment complicated, make the AI aware of the environment, give the AI plenty of values to consider, and give the AI plenty of states that it can enter.
Logged
Re: Artificial Intelligence
« Reply #2 on: April 25, 2006, 03:05:53 am »
  • Huzzowee!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 571
One thing that I find interesting about AI is that it's always evolving. In the Red Steel article, they say that their AI has the NPC's able to shoot the player, while actually flipping tables up and over and whatnot to create or find cover. Up until now, in shooters it's pretty much been "ATTACKS WITH GUNS!!!", save very few exceptions. Now people are making the AI more difficult, and more realistic by creating a sort of deire for self-preservation. That's the coolest thing IMO that's coming to gaming. If I could play the single-player campaign and feel like the NPC's are people sitting with a controller next to me, then that would be an accomplished AI.

THe one challenge about AI, is efficiency. Sure, computers are always getting faster and better, but if we're going to be doing what you've just said about states and environments will soon become tricky. There's got to be a point where there are just too many things. New efficiency methods will definitely play into the advancement of AI. That or just whole new technologies which change the entire perspective on the issue ;).
Logged
"They say 'Don't sweat the little things!', but in the end, the little things are all that matter..."
--Alex2539
Re: Artificial Intelligence
« Reply #3 on: April 25, 2006, 03:17:13 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 150
THe one challenge about AI, is efficiency. Sure, computers are always getting faster and better, but if we're going to be doing what you've just said about states and environments will soon become tricky. There's got to be a point where there are just too many things. New efficiency methods will definitely play into the advancement of AI. That or just whole new technologies which change the entire perspective on the issue ;).
Excellent point! For every state that the AI has to evaluate, the CPU use goes up a bit. For every variable (either part of the AI or in the environment), the CPU use goes up exponentially. Put that awesome AI in the super-detailed environment, and you may end up with an engine where framerate might be limited, to some extent, by the AI! =P
Logged
Re: Artificial Intelligence
« Reply #4 on: April 25, 2006, 04:29:07 am »
  • The Broken King
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1259
I've always found the concept of AI that could 'learn' to be interesting, and I think that would probably stop it from getting repetitive.
Logged
  • Broken Kings [Temp Site]

aab

^ Evolved from a Hobbit
Re: Artificial Intelligence
« Reply #5 on: April 26, 2006, 04:28:46 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
Yes, thats a nice illusion. Something i'd enjoy in zelda bosses sometimes: Though thats just following the same method as normal ai, just that the things which must be observed from the environment seem more suttle ( and the response to them is altered by recorded input ).
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace
Re: Artificial Intelligence
« Reply #6 on: April 26, 2006, 04:57:27 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6206
I've always found the concept of AI that could 'learn' to be interesting, and I think that would probably stop it from getting repetitive.
I don't think that it will ever be possible.
Logged

aab

^ Evolved from a Hobbit
Re: Artificial Intelligence
« Reply #7 on: April 26, 2006, 05:19:27 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
All it would involve is recorded response to the things environment. Thats what ai already does. It would just have to do more of it for that to work out well enough.
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace

Gilgamesh

Re: Artificial Intelligence
« Reply #8 on: April 26, 2006, 05:31:29 pm »
For example, the enemy takes note on how much times the Player tried to attack it using a certain type of rifle, and according to that, it uses a certain type of armor to defend itself. Or, the enemy sees how much times the Player hides in a certain area, so, when looking for the Player, it gives a preference to checking that position first.
Logged
Re: Artificial Intelligence
« Reply #9 on: April 26, 2006, 06:46:30 pm »
  • The Broken King
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1259
I've always found the concept of AI that could 'learn' to be interesting, and I think that would probably stop it from getting repetitive.
I don't think that it will ever be possible.

Actually, it is possible, to a certain extent. the AI can 'remember' how the player reacts to certain circumstances, and see which circumstances result in its death/loss more often, and then choose the better circumstance as a result. It's just more variables to calculate when making your choice.
Logged
  • Broken Kings [Temp Site]
Re: Artificial Intelligence
« Reply #10 on: April 26, 2006, 06:50:32 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6206
I've always found the concept of AI that could 'learn' to be interesting, and I think that would probably stop it from getting repetitive.
I don't think that it will ever be possible.

Actually, it is possible, to a certain extent. the AI can 'remember' how the player reacts to certain circumstances, and see which circumstances result in its death/loss more often, and then choose the better circumstance as a result. It's just more variables to calculate when making your choice.
I ment more that the enemy can learn new things after you fight against him. Like making new tactics etc etc.
Logged
Re: Artificial Intelligence
« Reply #11 on: April 26, 2006, 07:21:30 pm »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
I've always found the concept of AI that could 'learn' to be interesting, and I think that would probably stop it from getting repetitive.
I don't think that it will ever be possible.

Actually, it is possible, to a certain extent. the AI can 'remember' how the player reacts to certain circumstances, and see which circumstances result in its death/loss more often, and then choose the better circumstance as a result. It's just more variables to calculate when making your choice.
I ment more that the enemy can learn new things after you fight against him. Like making new tactics etc etc.

Heh, you should look up self-modifying code, code that modifys itself on the go. Thats fun :P.

Logged
Re: Artificial Intelligence
« Reply #12 on: April 28, 2006, 05:18:52 pm »
  • You don't know me.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 234
Well, you'd probably have to give it self preservation instincts. So, when it sees that it's HP is a tad on the ZOMG YOU'R GONNA DIE side, it runs. You'd have to make it react to how the player plays, what the player uses, etc. For a bit of fun in this category, you could make it so that if it sees the player is just jumping up and down or something stupid like that, it just watches, and maybe jumps up and down with the player. It would have to memorize a certain location the player goes to a lot (like a health refill or something), and then have something that makes it block that area off. Things like that.
Logged


No one located in this area of the internet remembers me.
Re: Artificial Intelligence
« Reply #13 on: April 28, 2006, 08:53:19 pm »
  • =/
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2284
Well, you'd probably have to give it self preservation instincts. So, when it sees that it's HP is a tad on the ZOMG YOU'R GONNA DIE side, it runs. You'd have to make it react to how the player plays, what the player uses, etc. For a bit of fun in this category, you could make it so that if it sees the player is just jumping up and down or something stupid like that, it just watches, and maybe jumps up and down with the player. It would have to memorize a certain location the player goes to a lot (like a health refill or something), and then have something that makes it block that area off. Things like that.
Actually someone on the GMC figure something like that out:

The idea itself is pretty promising, took me a few minutes to come up with an actual concept (fitting for a shooter for example)...

Normal AI works it's way around a map via waypoints, players do it different: They get to know the map and find their personal favorite and weak spots in a map through time. An AI is able to do this, too. My idea is a data grid for that.

Example of a map:

#####
#####
#####
#####
#####

Now we assign every place a value, to keep it simple I'd say we don't assign every coordinate a single value, instead we use one value for let's say each 32x32 tile.

Okay, we begin with a neutral value for every spot in the grid. Let's say 100 means "perfect place to go", 0 means "stay the **** away". So on a new map, we start with 50 for each, okay?

Now if the AI is getting hurt or dies on a certain spot, we decrease its value in the grid. If it doesn't get hurt, we increase the value. Also, if we pick up a bonus item or something, we increase the value at that spot (item spawn points are generally useful, we see people flocking the quad damage and rocket launcher spots in Quake3 all the time, eh?)

So if the AI plays for a while, it will find good and bad spots on the map and change them dynamically when players use other strategies.

Example:

####
####
####
####




(One might want to set solid areas like walls to 0 from the beginning on to keep the AI from running into walls. Heh.)



Greetz, Atlantis

Origanal post:
http://forums.gamemaker.nl/index.php?showtopic=202045
« Last Edit: April 28, 2006, 08:56:29 pm by piers »
Logged
Re: Artificial Intelligence
« Reply #14 on: April 29, 2006, 01:27:41 am »
  • The Broken King
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1259
That method could get very memory intensive with lots of AI in big rooms, and the AI would take a long time to learn.

However, a similar method, only mapping the array to actions instead of locations, might work better. Each possible action would get a value when it succeeds and each method would lose a value when it fails. (There might be different states for each method; for example, searching, fighting, running). Then, when it comes time to perform the action, it goes through the list and randomly selects on of these items, with the ones with higher values being more likely (but not guaranteed; that does lead to repetetive/predictable gameplay). It'd also take in other considerations; for example, if the command 'hide' was chosen, but there was nowhere to hide, it'd rechoose.
Logged
  • Broken Kings [Temp Site]

aab

^ Evolved from a Hobbit
Re: Artificial Intelligence
« Reply #15 on: April 29, 2006, 06:29:37 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
Or just make objects with coordinates/referenced grid squares that coincide with health spots etc, on the their creation, and increase attraction with use. If the player is deemed to be heading in the direction of one of these objects such that the ai can assume thats where hes heading, it could try and cut him off the best route.
Right with actions wombat - Also like if an ai gets killed more often doing particular things, do those things less frequently/for shorter periods (ensuring still that its got moments where it can be killed), though not for all games or enemies eg: Deku shrub that eventually stops shooting would be really silly lol.
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace
Re: Artificial Intelligence
« Reply #16 on: April 29, 2006, 08:33:04 pm »
  • The Broken King
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1259
haha, stuff like that would only work with enemies with complex behavior. Something like a deku scrub can't really be programmed to be smart enough to beat a player XD
Logged
  • Broken Kings [Temp Site]
Re: Artificial Intelligence
« Reply #17 on: May 01, 2006, 02:37:27 pm »
  • Minalien
  • *
  • Reputation: +10/-1
  • Offline Offline
  • Gender: Female
  • Posts: 2119
Bethesda Softworks seems to have done the most advanced strategies with AI in their Elder Scrolls IV: Oblivion game. How it works is it takes different priorities for the NPCs based on what the developer (in the Construction Set) set them as. The developers create packages that determine times, durations, etc. of what they do. In example: If I were to create an NPC, I would designate when it slept, where it looked for a bed, when it ate, where it looked for food, I could designate training sessions (so the NPC would start shooting arrows at a target for practicing his Marksman skill). The way they do this is in the NPC's creation, you choose cells for the NPCs to look for things (beds, food, potions targets, etc.), and they will first check all items in the cell to see if it is an Ingredient, and if it is an Ingredient item, they will (based on their Alchemy skill) check its attributes and challenge the good effects to the bad (lower alchemy skills dont get as many effects, however, so they may base their decisions on only one effect.), and if it's safe to eat, they'll eat it, or (if it's a potion), if it's safe to drink, they'll drink it. For beds, they will look for a non-used bed that they either own or that is for public use (most Inns use factions to determine this; so if an NPC is in an inn's customers faction, the NPC can use the bed). They also determine whether it is safe to open certain doors based on door ownership and other area settings. You can also set different responsibility levels, and I've even slept at an inn and woken to the sound of people attacking two pickpockets.
Logged
Quote
There's such a double standard about religion in the modern world. Catholics can gather, wear white robes, and say "In nomine Patris, et Filii, et Spiritus Sancti" and be considered normal.

But if my friends and I gather, wear black robes, and say  "Ph'nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn", we're considered cultists.
  • Development Blog

gm112

Re: Artificial Intelligence
« Reply #18 on: May 01, 2006, 09:09:55 pm »
AI expands only by the idea's of human beings. (That's the cool part so if you actually program stuff and you have a new idea for AI you can introduce the idea)
Logged
Re: Artificial Intelligence
« Reply #19 on: May 01, 2006, 09:46:34 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1635
AI usually chooses a coded set of instructions based on enviroment, player distance, etc - a lot of other factors coded by the programmer. These are called states. The main problem with AI is that the kinds of factors that would influence a normal human's decision making are infinite; the AI can't take other things into account.
Logged
Pages: [1] 2   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.059 seconds with 77 queries.

anything