Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

wellman

Incredible AI - Could it be possible???

This topic is 5420 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

quote:
Original post by Niphty

Humm.. how about a script that checks for processor percent and modifies based on that? I don''t like the idea that more powerful machines get a bigger advantage over those with less money to spend on a computer.


I can understand Niphty that from your position when your making a game for online. But it would be neat for a single player game as you noted below.

quote:


If a script did it, it could weed out fields in the minimax tree that would likely not work. This way the processor wouldn''t go for long-shot type of solutions They might work, but no sense in trying to find out if it''s useless 95% of the time. But on a bigger machine, you could go for those long shots that might work.


yeah, ive heard of this type of ai memory where the computer actually uses search paths and when it''s done it once, it remembers the best path rather than doing it every time.

(possibly) --->You''d have to allow the program to name a routine and save it by itself. Or something like that. or turn a (already done) search path into a seed and name that seed appropriately so when it comes up again it uses those seeds which have already been solved. Kind of like it makes it''s own scripts in a way.

I probably deserved to be hassled out to the max for what i just said like "how the f#ck am i meant to do that :-)" go ahead, flame me. I understand.
quote:

It could work out either way. Just have a harder game the bigger machine you have.. hehe That might be kinda wild. Perhaps even have the player set the level of enemy AI. The problem with those today is that they''re all just how random the AI is. Since AI can be perfect, the random element is what people use to divert their intelligence. That to me isn''t right. Play almost any racing game today on the hardest level and i bet you''ll swear the AI is cheating. No, the AI is a physics god in the game and knows everything about everything.


hehehuf, yeah i worked that out about the physics god stuff. Why, because i know that i''d be easier to code. and easier on the CPU. Besides, good ai for a racing game is probably a waste of good cpu juice unless you want it to analyse the player for some reason or another.

quote:

Half of the games don''t seem to have realistic controlls either because they''re not analog. Like you can race against someone who''s got percision controls when you''ve got digital As an avid car and race fan.. i find many faults with AI in racing games :/ But.. oh well. Paul, i like that idea.. hehe.. perhaps you should try to come up with more like it so i can be lazy!


I''m just an evil apprentice here niphty ;-) [twiddling thumbs]. Hmmm thinking... hmmm... tell me what you''d really like to see in ai and i''ll bounce some idea''s around with you if you like? I''m enjoying this topic 8^}





WE are their,
"Sons of the Free"

Share this post


Link to post
Share on other sites
Advertisement
LOL.. ok, first off, i''m a dork. How the hell do you quote like that?

Secondly.. hehe.. evil apprentice my arse

And third.. humm.. irrational AI. This makes me think of when i''m losing like mad in a racing game and i turn my car around, trying to ram the lead car while going backwards on a race course.. ehehhee!

Now.. on with the real stuff. The thing that''s hard to do is make an AI which learns because of the sheer size it would take on. You could imagine an install program which reads:
Low-level AI: basically stupid.
Mid-level AI: little processor time required.
High-level AI: Lots of processor time required with moderate memory demands.
Learning-level AI: Lots of processor time required with options for using memory or hard drive for storage. Requires a lot fo storage space which will not exceed 2 terabytes.
Perfect-level AI: Knows it all, doesn''t need to calculate, a true machine.

Just imagine how many people would be like "uhhmm.. what?" so instead you rename those using their first first "low" "mid" "high" etc.. And you call it difficulty.. hehe. The learning AI would start stupid but would become your worst nightmare in the end.. lol. They''d learn to anticipate your moves, knock you out of the race and still be perfect in running Unfortunately, i think that 2 terabyte number might be a bit small depending on how complex the game is. Imagine an AI that remember how it hit the puck at you in an air hockey game. People do this. You look for weaknesses. If someone can''t handle a backhand in tennis, you do it more often to them, as much as you can. In air hockey, my friend could never EVER block a shot that bounced off two walls. So i''d hit it right, off that wall, and off the left wall, and right in.. lol The AI could easily remember what it did to score and try to repeat those conditions. It could keep up with % of times it scored in this manner, and utilize the best ones. It could also track your performance like this and let you know if you''ve improved. And it could tell you your weaknesses.. hehe Very interesting concept, requires little space.. and is very nice for frustrating a player.. hehe. Then the AI level is simply how frequently it gets into position and exposes your weaknesses. The fewer weaknesses you have, the harder you''ll be to beat. Very true to life

J

Share this post


Link to post
Share on other sites
I just realised a problem with having self optimizing minimax. The player would learn that the more red herrings that they can produce for the ai to chomp down the worse (shallower search depth) the computers decisions would be.

I half agree with you on the AI memory issue. Such systems would be applicable to something like a training program but it would have to be gravely modified for gaming. I thing the system would still be very useful if implemented to enhance the fun factor of the game.

How do you do this? Some sort of balancing routine would probably be a good start i think/yes? Maybe rather than adding challange it could calculate how to add to the fun. It would have to calculate what the player is doing to have fun. This way the game becomes customized to each individual gamer. Boy can i dream :-).
-----
(to niphty)
I''m quite suprised you still havn''t flamed me Niphty, you must be a very tolerant dork/nerd :-)??? or do you just think of me as an amusing clown :-)??
-----

Is there any way of reducing the memory consumption of a remembering minimax system? Shall I? Shall I? yeah why not...
You would have to be very tight on what you apply (ingame) the system to. Like one big boss using it then "save" once he''s dead and the next big boss will "load" and on and on until the game is over. Each big boss will become smarter and more customized to you (the player). The longer you take to kill him the more he/she/it learns about you. This would be quite a surprise for the more arrogant gamers (like me)who like to toy with big bosses and take their time with them hehe they''d get a nasty little suprise come the endo of the next level. You see, i am an evil apprentice Niphty :-) or maybe more an evil conspirator. [licking lips, nodding & squinting] mmmm yeahesss Mmmm

Alright, what about a self correction ai. The system would have to first realise that it did something good AND that it could have been done better.

You know i''ve seriously been considering working out irrational ia. It would have to be some kind of virtual wheel of fortune. Rather than going with the option with the highest value it just chucks all the options on a wheel and spins it. Takes the random one that comes out and uses it as a category for it''s next minimax search. Kind of like teaching the computer to gamble in a way.

Teach the computer to apply values to patterns and it could develop strategies. A strategy to me is an influencing act when compared to a tactic which produces a result. A strategy can be calculated a a percentage increase. This way a computer can value a pattern. A pattern that increases the odds for a sucessful tactical manuveur would then be applied in-game. But what happens when the best two patterns have equal values? <--- that''s a topic tease :-)





WE are their,
"Sons of the Free"

Share this post


Link to post
Share on other sites
I think you are placing a little too much faith in this whole ''minimax'' concept. It''s more designed for effective-yet-simple AI than interesting-and-detailed AI. On a very basic level, it''s just ''evaluate all options, choose which one benefits me the most and the opponent the least''. Adjusting the search depth on the fly won''t help you much when you have a billion and one possible options in the first place. You still have to do the hard work up front: namely, assigning scores to given situations. In chess, a knight can nearly always be considered to be worth 3 points. How many points is a gun worth to the bartender? What if the opponent is perhaps resistant to bullets? What if shooting people is illegal? What if there''s a low chance of getting caught? These issues are hard to quantify with simple ''values''. Minimax is really designed to crunch thousands of simple point values in a repetitive manner, and is thus more suited to things like chess. It works best where the ''breadth'' of the search is not very large. For instance, there may only be 30 or so possible moves available in a game of chess. So, there are 30 level one possibilities to evaluate, about 900 at level 2, 27,000 at level 3, and so on. You want to be able to go a few more levels than 3 to have a good result. But the average person might have thousands of things they could do in a given situation. That means you''re dealing with billions of things at level 3 rather than tens of thousands.

In real life, people address major abstract concepts first, and search deeper within that concept if necessary. For example, to re-use the chess analogy, instead of checking every possible chess move, a human player may think ''ah, my queen is under threat'' and often only look at related issues. You can do -some- of this with minimax (known as ''alpha-beta pruning'') but then you start to lose the benefits. This is why a scripting approach is generally going to be much easier to do and yield much better results. You could spend all your life designing minimax data for just the simplest of situations that a person could be in. It''s probably better for you to think of a few high-level abstract situations so that you can use more general heuristics to guide creature behaviour.

Share this post


Link to post
Share on other sites
Paul, i wouldn''t flame you.. you''ve not done anything to deserve it, yet keep trying.

I think the point of the minimax tree is to merely search out what paths would be helpful for the computer. The script would limit those options to search for "do i have a gun? can i use it well? could i hit this guy in this armor?" etc. Once the field is limited then you can begin to make some choices using the minimax. It''s all about limiting those choices before you search. Maybe pick three or four main possiblities with the highest probability.. "duck and cover" "surrender" "blast the mofo''s head off". The minimax would take over evaluating each one of those and determine which on is the best according to what the AI character''s stats are, and then it would return to the script with "blow his head off" and the script would look at this and say "is he aiming at me already?" and if so, then that option''s out.. hehe
It could work well together, and minimax would just allow for some prediciting of the future whereas a script can only deal with what''s going on here and now. Together they could do some serious damage.

Paul, i''ll touch on the other stuff you said later on time to sleep for now.

J

Share this post


Link to post
Share on other sites
quote:
from Kylotan
I think you are placing a little too much faith in this whole ''minimax'' concept. It''s more designed for effective-yet-simple AI than interesting-and-detailed AI.


No, just trying to get the most out of it. ie. explore it''s potential implications.
-----
To me, minimax is a number cruncher that does the work that you couldn''t otherwise code. All thats required is a niphty use of it''s functions :-).

The best way i can see a minimax system being used is where there is a very small amount of options available. Because the real power of this system is (as i think you said kylotan) it''s ability to predict. This is almost impossible to do in code. So be limiting its search breadth you increase its search depth thus making optimal use of the minimax tool.

This may sound lame at first but you have to think about what important elements in games contain a very thin probem resolution. These elements are perfect for minimax.

quote:


In real life, people address major abstract concepts first, and search deeper within that concept if necessary. For example, to re-use the chess analogy, instead of checking every possible chess move, a human player may think ''ah, my queen is under threat'' and often only look at related issues. You can do -some- of this with minimax (known as ''alpha-beta pruning'') but then you start to lose the benefits. This is why a scripting approach is generally going to be much easier to do and yield much better results. You could spend all your life designing minimax data for just the simplest of situations that a person could be in. It''s probably better for you to think of a few high-level abstract situations so that you can use more general heuristics to guide creature behaviour.


Agreed, this is where scripting comes in as we''ve already discussed. Well i think that''s what you we''re implying anyhow.




WE are their,
"Sons of the Free"

Share this post


Link to post
Share on other sites
Using multiple methodolgies collectively is a good way of cutting down your options while retaining a realistic behaviour from your AI. First have the bartender calculate their internal state from their perception of the environment. Are they scared by the players actions, angered, calm or confused. The bartender would have a structure containing all the facets of their emotional state that is adjusted by this environment. From this emotional state you could use a neural network to decide on the general form of their following action (an NN obviously isn''t necessary, you could manage it with a script, a finite state machine (if-then statements), a fuzzy logic function, anything you feel like). Are they angry or confident enough to try a violent approach, are they calm enough to try reasoning, are they scared enough to offer up everything they have to save their life. Once you''ve found the general approach you can narrow the field of actions greatly to those suitable for the bartenders current mental state. Remembering that, because the search tree''s size increases exponentially with the number of options, just halving the potential actions can divide the fourth level of the breadth first search many fold.

Specifically.......(final number of actions / original number of actions) ^ breadth level....is the amount you''ve reduced it to.
If you originally had 20 possible actions and your pruning of the search tree cut it down to ten because only half the actions corresponded to the ''violent'' approach your bartender was taking then at the fourth level of the breadth first search you would only be expanding
(10 / 20) ^ 4 = 6.25% or 1/16th of the amount you would originally have had to expand if you''d checked all the options.

Quite a saving with a fairly realistic reaction thrown in for good measure....not just the best reaction the bartender could come up with.

Mike

Share this post


Link to post
Share on other sites
I''ve got an idea, (similar to scripts)

basic unit
----------

Do output (if aplicable)
Get input (if aplicable)
Change internal variables from input
put variables into formulas
do until didmove = true
x = int(rnd(30) * (var1 + var2 + varn))
if x <= var1 then
output 1
didmove = true
elseif x <= var2 then
output 2
didmove = true
elseif x <= varn then
output n
didmove = true
end if
loop

End of base unit
----------------

you get the base units to call each other, and use that to do your ai search; eg. you would have one looking to see if his friend there, if not, then decrease his courage and check to see if your shotgun''s in reach, or give the guy what he wants.

Some of the formulas, would include something like
VC = variable variable (how much it likes a heigh variable)
MC = memory variable (how much it likes a good value)
(above for each output)
outi = (vari / vc) * (vgoodi / mc)

Then change MC according to what happens next; ie. if you do something, and you get blown up, then you wouldn''t do that again, would you? (would suggest automating the learning process)

Hopefully those reading this have a use for this, and please post on this and some related threads PLEASE!

Share this post


Link to post
Share on other sites
This thread is 4 years old, you realise. I think there''s only about 2 other people in it who actually still post on these forums.

Besides, further technical discussion on this might be better off in the AI forum.

Share this post


Link to post
Share on other sites

This topic is 5420 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.

Guest
This topic is now closed to further replies.

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!