Get the latest Education e-news
 

Go Back   Game Career Guide Forums > Programming
Forum Home Register Members List Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 04-26-2007, 09:59 PM   #1
HagNasty
Super Moderator

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssss123
Location: Toronto Ontario
Default AI, Where it's at!

From what I hear AI programming is almost a sure fire way to be considered for a job. This tends to be one of the most complicated parts of any game and can lead to disaster if not done correctly.

So, I decided to start a discussion on the subject. Here we will talk about AI directed toward gaming, though I myself am also interested in the way an AI consciousness would be created.

lets discuss some resources and debate over the different kinds of AI. Based on my knowledge, I know of three basic kinds of AI (to categorize anyway). These are Finite state machines, Neural networks, and Scripted.

Of the three I find that Neural networks are my favorite. Having an artificial intelligence grow and learn from it's mistakes and successes is something almost exciting. The downfall is the fact that it has to learn and has to start at zero. You can plug it full of statistics and cases and things so it dose not start as a gibbering idiot or you could make it a god.

Wither way I like this AI because based on the players game play, it creates it's own difficulty settings for the player. Train an AI with Fatal1ty and eventually it will be able to beat him. It may take months but it will. This is given that the AI programming is flawless in design and implementation (something I don't believe we are capable of yet. But doesn't that excite you anyway?)

So thats where I stand on AI. Or rather my preferred stance on AI anyway. Finite state machines are used along side Neural nets a lot but not always. To be quite honest I like to mesh the two together so my AI does not start out retarded. I call this a finite neural network.(to coin a phrase :P)

Lets discuss.


GO!
__________________
~Justin Dooley

C, C++, C#, Objective-C, Java, PHP, SQL, Javascript, Actionscript, HTML, CSS
HagNasty is offline   Reply With Quote
Old 04-27-2007, 04:30 PM   #2
HagNasty
Super Moderator

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssss123
Location: Toronto Ontario
Default

Quote:
Originally Posted by Hesham View Post
Hi
I'm afraid, but to my knowledge what you call scripted AI is actually implementation of finite state machines (FSMs) in scripting languages. However, you may have very simple FSMs with just one state or two in your code.
By scripting AI I was not referring to the language though you are correct. Now that I think of it they do use finite state machines. But you could also argue that everything that uses a flag is part of a finite state machine. What I did mention with the comment on scripted AI was aimed more at Puzzle games where you can record a set of actions and times and have the AI repeat those actions like macros.

Quote:
Originally Posted by Hesham View Post
That's quite interesting, but I guess players don't like to see computer can beat them after a while easily. Because computer can be too much faster than human so in real-time games even when the NN has learnt simple skills it can beat the player. So somehow it should be fair. Or maybe when the algorithm sees the players cant improve their skills then makes it easier for the players to encourage them to play. Anyway, it's supposed to be entertaining :-)
This comment was based more into the theory of NNs and less in the practice use of them. That and you can always program in a cap not via the AI but in the game play itself. I will give you an example below when explaining how I used FMSs with NNs. Not to mention that a NN is also based on pattern recognition making it very difficult to account for all situations. The game may be very good at beating one person that thinks out their attacks and knows what to do in some situations because the AI can follow those patterns but if a player who is not as good and maybe butt mashes or gets a group of units that would not work to great together, It will throw off the AI because it will create a new branch of logic and delve into unknown territory.

Quote:
Originally Posted by Hesham View Post
But you didn't mention that using NNs is not always easy. In many cases, you should consider their convergence. That is, they're parameter based and need a really difficult tuning process. But in simple problems you may get promising results just after a few experiments.

It would be so kind of you if you could give the methods you know that in them "Finite state machines are used along side Neural nets". I'm really interested in Neural-Symbolic methods. In these methods, you give an algorithm a set of rules (in first order logic) and then the algorithm returns a neural networks (the topology and the weights). So you won't have an idiot NN, and you're sure at least before the learning changes the weights (or the topology) completely it does what you wanted.
Aww yes, NNs are difficult to get off their feet. They start absolutely retarded . Like feeding tube and air pump retarded. This is why I use FSMs with them a lot. I have never actually heard of Neural-Symbolic methods before but now thats something to look into Basically I write my code from scratch in a way that seems logical to me. Here is an example of what I did for a fighting game.

The AI moved into range (FSM method)

The AI had a list of moves that the player did, all with weights of zero. Each move contained a list of moves that the AI could do , counterattacks if you will. each of these had a weight of 15.

Now when the AI was in range of the character it would pick a random move among the top three in the list of moves the player has done. (first 3 on the list)

Then inside this move it would proceed to commence a preemptive counter attack where the weight was greater then zero (randomly chosen from the list).

If said attack caused the AI damage that value would have it's weight decreased by X (X is the difficulty setting or the learning curve/rate) If the attacked caused no damage to either side it would be left alone and if it caused damage to the player it would increase it's weight.

Also when the player preforms an attack and is within the range of the AI the value of that attack 's weight is increased thus it has a small amount of pattern recognition. But it can predict your top 3 most commonly used moves and it will effectively build a counter attack for those moves over time.

Now the way that this AI is limited is that it is forced to the same restrictions of the player. It is setup to call the same functions the players key presses do and thus simulates a player controlling player 2. If they want to attack then they will call the attack function and even though they call it every frame it's still only referencing the first call made because you can't call another attack function without it first finishing the initial one.

I generated this AI basically to stop people from cheesing out the AI and only learning one or two moves. Also it causes the player to learn and develop a variety of fighting methods to keep the AI on it's toes. In the end it's very basic but works great. Simple little 3D fighter game.
__________________
~Justin Dooley

C, C++, C#, Objective-C, Java, PHP, SQL, Javascript, Actionscript, HTML, CSS
HagNasty is offline   Reply With Quote
Old 04-28-2007, 01:30 PM   #3
HagNasty
Super Moderator

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssss123
Location: Toronto Ontario
Default

Sorry but I am not aware of any games right now looking for programmers. I would suggest that you troll the XNA community site forums for that . Everyone there is making a game so more then likely they are the ones who will be looking rather then here

Anyway, I saved all the source pages to this book of yours and Ill be reading it this week. I have never heard of these terms in programming (or anywhere) before. I haven't had any discreet math training before so and I see it comes up quite a bit after skimming through it. Does this book cover the meanings of said symbols or does it assumes that you know.

If it assumes you know them can you referee me to a site that I can use as reference for what these symbols mean. I am very interested in discreet math just don't have any resources to approach it that complement my learning style :P

You obviousley know a little more about AI design patterns then I do, but I'm a very fast learner so I'll be catching up in no time The two programming fields that interest me most are AI and Audio, both rely heavily on discreet mathematics, go figure Any help you can offer would be great.
__________________
~Justin Dooley

C, C++, C#, Objective-C, Java, PHP, SQL, Javascript, Actionscript, HTML, CSS
HagNasty is offline   Reply With Quote
Old 05-09-2007, 09:50 AM   #4
Aurican33
Junior Member

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssssss8
Default

This thread is bloody fascinating!

What about an AI type that instead of reacting to a player and their keys/buttons/patterns, actually makes the decision and causes the player to react to the AI.. how would you go about setting something like that up? Is it even possible?

I've never really looked at the mechanics of an AI before, and I'm having one of those epiphany moments right now about what I could do in a game i'm working on...
Aurican33 is offline   Reply With Quote
Old 05-09-2007, 01:55 PM   #5
HagNasty
Super Moderator

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssss123
Location: Toronto Ontario
Default

I don't think you can program the actions of players. That would make it a demonstration and not a game
__________________
~Justin Dooley

C, C++, C#, Objective-C, Java, PHP, SQL, Javascript, Actionscript, HTML, CSS
HagNasty is offline   Reply With Quote
Old 05-09-2007, 05:47 PM   #6
Gshonk
Moderator

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssss831
Location: Philadelphia, PA
Default

Isn't AI alot of times supposed to get a player to react in a certain way? I would say the Half life games did this alot.
__________________
Grant Shonkwiler()
"I would love to fix the world if someone would just give me the source code"
Website Industry blog LinkedIn
Gshonk is offline   Reply With Quote
Old 05-09-2007, 07:06 PM   #7
HagNasty
Super Moderator

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssss123
Location: Toronto Ontario
Default

I think that Half Life used the level design more to guide the player. The AI in that had scripted events and such to spawn monsters. Again this is level design. AI at least in the more broad term of it controls the enemies.

When it comes down to it, I think that what you are speaking of is the reaction to scripted events. When you program AI for a 3rd person shooter, You will not program each event in the game. You will create a AI class for each type of enemy. (gunner, Blades things, Zombies, ect.)

The scripted events created in the level will generate and possibly even modify the AI, but the program still attempts to run the same AI that is usually would. If that instance of the AI was modified then it was the doing of the level designer more so then the AI programmer, Though the level designer may ask the AI programmer to do that for them.

My policy when it comes to programming AI is to never assume that the player will react the way that you want them to. This way you create an AI that will work in any condition not only the condition that you intend for them to be in.

~Justin Dooley
__________________
~Justin Dooley

C, C++, C#, Objective-C, Java, PHP, SQL, Javascript, Actionscript, HTML, CSS
HagNasty is offline   Reply With Quote
Old 05-10-2007, 06:17 AM   #8
Gshonk
Moderator

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssss831
Location: Philadelphia, PA
Default

True I guess thats what I really meant was using the AI to affect the level design.
__________________
Grant Shonkwiler()
"I would love to fix the world if someone would just give me the source code"
Website Industry blog LinkedIn
Gshonk is offline   Reply With Quote
Old 05-27-2007, 06:54 PM   #9
Dracmorair
Junior Member

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssssss1
Default What I was instrested in

Quote:
From what I hear AI programming is almost a sure fire way to be considered for a job. This tends to be one of the most complicated parts of any game and can lead to disaster if not done correctly.
This is GameCareerGuide.com isn't it. I'm interested more in what makes AI a good programming skill to have for a future game developer via programmer.
Dracmorair is offline   Reply With Quote
Old 05-28-2007, 08:35 PM   #10
HagNasty
Super Moderator

Activity Longevity
0/20 20/20
Today Posts
0/11 ssssss123
Location: Toronto Ontario
Default

Quote:
Originally Posted by Dracmorair View Post
This is GameCareerGuide.com isn't it. I'm interested more in what makes AI a good programming skill to have for a future game developer via programmer.

Well do a job search online, Check your favorite companies and see what positions there are. Check Gamasutra, obviously a great tool and no I'm not here to plug the sister site. I'm just a avid user.

You will see that most companies have openings for AI. Not only that but AI programming can be some of the most complicated aspects of a game and thus if you are capable of understanding all the fuzzy logic, discreet math, finite state machines and learning patterns then you should be able to make input move a character around. (I mean your making no input move a character around anyway)

Many companies actually have large teams of programmers based on just the AI of the game, up to 60% but don't quote me on that it's just something I think I remember from a Ubisoft recruiting tour that stopped at the international academy of design and technology Toronto.

So to answer your question in short, it is great to be a AI programmer because it is rare for a game not to have AI anymore meaning that it will always be needed, Also being able to program AI means you can program many other aspects of the game and will cover many situations ahead of schedule. That and with AI getting better and better it will need more and more people to design a AI that will out preform it's predecessor.
__________________
~Justin Dooley

C, C++, C#, Objective-C, Java, PHP, SQL, Javascript, Actionscript, HTML, CSS
HagNasty is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Powered by vBulletin® Version 3.6.9
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
All times are GMT -8. The time now is 01:39 AM.






UBM Tech