• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

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

Paul Cunningham

Artificial Intuition

57 posts in this topic

quote:
Original post by dwarfsoft
I think though to explain vectors is; forget the word vector... Just treat it like a magic box


A vector is an ordered set (ie, array) of numbers, nothing more.

One of their popular uses is in visual programming, using a 2 or 3 element vector to represent a point or direction in 2D or 3D space.

But a vector, in the original mathematical sense, is just an ordered set of numbers

What I was meaning when I said "appropriate input/output vectors" was encoding the required info of the game state into a sequence (ie, ordered set) of numbers - these numbers would be the values on the input column of neurons. And the output is encoding the "intuititive decisions" of the system into a sequence of numbers - these would appear on the output column of neurons.

Egerlach is quite likely right when he says that this is bad for intuition - I possibly alluded to this when discussing getting training pairs...

Sam
Space Cadet''s DJ Random, Thinker, and Geek at heart.
0

Share this post


Link to post
Share on other sites
quote:
Original post by dwarfsoft
I think though to explain vectors is; forget the word vector... Just treat it like a magic box


A vector is an ordered set (ie, array) of numbers, nothing more.

One of their popular uses is in visual programming, using a 2 or 3 element vector to represent a point or direction in 2D or 3D space.

But a vector, in the original mathematical sense, is just an ordered set of numbers

What I was meaning when I said "appropriate input/output vectors" was encoding the required info of the game state into a sequence (ie, ordered set) of numbers - these numbers would be the values on the input column of neurons. And the output is encoding the "intuititive decisions" of the system into a sequence of numbers - these would appear on the output column of neurons.

Egerlach is quite likely right when he says that this is bad for intuition - I possibly alluded to this when discussing getting training pairs...

Sam
Space Cadet''s DJ Random, Thinker, and Geek at heart.
0

Share this post


Link to post
Share on other sites
Woah! Am I seeing double . Anywho... I do understand vectors, I was just shortening my understanding of NN, which I was then informed was wrong... yay! I learn something new every day! Which is more than I do in my SQL lectures or Math lectures... Joy, sets as if we haven''t ever done predigate calculus before

But anyway, Now that we are all agreed that NN''s are gonna suck for what we were discussing its use for (I hope we all agreed right?) what can we use instead? As someone who just learned that he was wrong should always do... my long dark jacket fans out behind me as I disappear back into the shadows...

(I''m not joking about the jacket... I do this often, with a long black coat that allows me to sneak around in the shadows . Unfortunately it is not quite Matrix style material, but it IS effective )


-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)
0

Share this post


Link to post
Share on other sites
I''ve read it twice now and it''s still sinking in. I think i''ll skip the exam for now Time to read it again

I love Game Design and it loves me back.

Our Goal is "Fun"!
0

Share this post


Link to post
Share on other sites
ROFL

I am that bad at explaining my thoughts ?
Then I am sure it''s not my brain I''ll try to recreate if I ever get far enough into AI

But I agree on one point, if NN don''t seem appropriate what do we use ?
I had to ideas in mind : a script language that the computer would be able to write (some sort of assembly then ?)
And something to analyse causes and their effects (a sort of ... Z notation ? regular expressions ? still trying to find a good idea on that )

youpla :-P
0

Share this post


Link to post
Share on other sites
LMAO! You're not that bad at explaining your ideas, but after being drilled with all that SQL and math stuff in lectures, my sponge is already full . I thought your NN desc. was the best I have read (and I have actually read some ). BTW. I would just like to state this as I am doing Databases@uni:I AM A PROGRAMMER... I AM DEFINITELY NOT HERE TO DO YOUR DAMN DATA ENTRY! I remember reading something like that in the Hacker FAQ .

What I would like to see is variable scripting, or dynamic scripting. Self modifying of course... It is the ONLY way that you can have learning and therefore probably the ONLY way to get Artificial Intuition to work. I would like to see any other suggestions of solutions. We could always just database it (which is like the dynamic scripting except you store the new data seperate from the script - but I class them as one in the same).

I think I rant now


-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet

Edited by - dwarfsoft on August 1, 2000 7:47:14 AM
0

Share this post


Link to post
Share on other sites
quote:
Original post by dwarfsoft
Which is more than I do in my SQL lectures or Math lectures... Joy, sets as if we haven't ever done predigate calculus before



Heh, you had to talk about calculus, didn't you (even if only predicate calc). I just possibly put the last nail in the coffin of my calculus mark... (final exam)

So, in light of that, I have to make myself feel smart. So I'm going to talk about something I actually understand (to some degree).

I think, contrary to popular belief, ANNs might be just what you're looking for for intuition. Just not the design I talked about in my earlier post. Feed-forward networks do one thing, but they do it really well: approximating functions. Now, remember that this is any function, not just those f(x) = x^2 crap you talk about in calc (aaah! Calc! *has relapse*). Any mapping of one set to another is a function.

But if we pick another design and another learning algorithm, we can get an ANN that, with a little feedback from an evaluation function looks at strategies it used in the game, and then learns to pick useful ones. If we implement noise in the network, then the choices it makes will be modified randomly. I think that this idea could work really well with a little fine tuning.

The biggest problems are:
1) encoding the situation that the AI has to respond to as a series of binary or real numbers (0..1)
2) having an output layer that is able to describe the strategy to be used
3) making a function that is able to evaluate the strategies chosen, and assign them an effectiveness.

As far as network design goes, a more "chaotic" network would be better for this idea (BTW, this is along the lines of what I'm going to try to do with the 3d matrix), that is, less of the "clear defined layers passing data from one to the next" and more "higgldy-piggldy". The learning algorithm would have to be based on a function that determines the effectiveness of a strategy after gameplay ends.

Just some ideas.

Eric

Edited by - egerlach on August 1, 2000 2:21:08 PM
0

Share this post


Link to post
Share on other sites
egerlach, since you seem to master ANN, could you gently put up an EXAMPLE of why on earth you would use ANN. Something like, "OK, so far you used this method and you had that, but now take ANN, give them those functions, and lo and behold, you get the same thing, but you can get even better results." I dunno, an example of the kind of inputs I would put in, and the meaning of the final output would be nice.

I DO understand NN, as I said, it''s just the same than Real Life (tm) ones (No way? Yes, I swear ! ). The thing is that I don''t visualise a situation where, "hey wait, THAT''s a situation for our Neural Network !".

Please ?

youpla :-P

dwarfsoft : are you talking about MY explanation of NN ? Wow, if you are thanks So I still stand a chance to make a good lecturer.
0

Share this post


Link to post
Share on other sites
quote:
Original post by ahw

egerlach, since you seem to master ANN, could you gently put up an EXAMPLE of why on earth you would use ANN. Something like, "OK, so far you used this method and you had that, but now take ANN, give them those functions, and lo and behold, you get the same thing, but you can get even better results." I dunno, an example of the kind of inputs I would put in, and the meaning of the final output would be nice.

I DO understand NN, as I said, it''s just the same than Real Life (tm) ones (No way? Yes, I swear ! ). The thing is that I don''t visualise a situation where, "hey wait, THAT''s a situation for our Neural Network !".



Master? Definitly not. Adept? Some would say yes. I''ve done a couple little things with Backpropagation and one big project. I''m just beginning to dabble into some of the other... wierder things, after reading a lot.

Okay, some examples:

My friend did a really cool project where he got a network to "drive a car". The inputs were the road, with ones being the lines on the side, sort of like this:
00100000100 - input #1
00010000010 - input #2
00001000001 - input #3
So in every succesive time cycle, in this case the car was drifting to the left. The 2 outputs from the network were an amount to turn the steering wheel left or right, and gas/brake.

I read about a network that was trained at... uh... Carnegie-Mellon (I think) to recongise human faces, and distinguish male from female. It had something like an 80% sucess rate, if I recall correctly. The input was a greyscale bitmap of the face, and the output was something that indicated if it was male or female, with a neutral answer for "not a face".

The first example isn''t great, you should be able to write a simple program to do the same thing. If you can write me a program to do the second though, I''d be really impressed.

ANNs are useful for analysing complex situations, and devising solutions similar to ones its already found out about. Ergo, I think they''d be great for helping to build a semi-intuitive system.

Now, whilst walking around today I came up with a great idea (I seem to come up with the best ideas while walking. Why? I donno). If an AI were somehow able to evaluate its position in term of attacking strength, defense strength, resources, whatever terms you can define, you could use that as the input to an ANN of some type, and get out the other end the general properties of the strategy to take (i.e. percent attack, percent defend, percent build, percent develop, stuff like that). Then that data could get passed into a fuzzy database, or dynamic scripting system, and that would determine the actual actions to be taken.

What does the AMM do in this example, you may ask. It determines whether the response to an attack will be defend or attack, for instance. I''m not sure about any details, but what do people think of this?

Eric

P.S. Can you tell I like ANNs a lot? ^_^
0

Share this post


Link to post
Share on other sites
I just browsed through my leaving cert. Biology lectures, and noticed only one nice example that could be related to the way neurons work : women periods. But it''s not really helpful nor on topic. though it''s a very nicely balanced system I must say.
Now I''ll read your explanation egerlach.

But I am still wondering if another system wouldn''t work.

As I said somewhere, the idea is to take a massive amount of data and see rules in it, patterns, and eventually try to create rules ourselves by using mathematical tools such as deduction.

The reasong I was suggesting a assembly like script language is mainly because it would be easier for the machine to write (well ... I guess ).
Oh, BTW, dwarfsoft, don''t give up on Databases just yet, at the end they talk about data analysis, data mining, even BSP ! I know, I didn''t listen. But I had to learn all that for the finals. So there is some use to Databases as well !!!

BTW, do you know what SQL stands for ?
Suicide is QewL.

youpla :-P
0

Share this post


Link to post
Share on other sites
Well, egerlach. It happens that I have ideas for having a "global" situation. I would to use this for a "commander" AI, that would decide of an overall strategy (in a RTS).
BAsically, you use the concept of "Influence map" (there is an article about it on gameai.com).

You have several representations of the map as arrays, bitmaps, fields...

Imagine this example :

you have one "control" bitmap : you divide the map into tiles that represent the amount of control by each side. The example would be shades of red for the enemy, shades of blue for us, and purple for mixed. Then all units buildings emit a "halo" of control around them.
Then you could have a field of vectors (a flow map ?) where all units would be represented with their movement vectors.
Now mix the two, and you would see the heat propagate, according to the flow map, you could kinda predict massive offensive ...

Just take the control bitmap thingie. By looking at the bitmap you can see :
conflict zones : everything in purple means that there are units from both sides involved, the width of the zone indicates the size of the conflict.
offensives : a big red cloud.
if you have a time related bitmap, where the intensity of the control value decrease slowly with time rather than just disappear, you get trails behind moving units, you would even have very bright trails for roads (especially for harvesters uits that always go to the same area...).

I think you get the idea.
Basically you try to find defining characteristics and store them as something easy to cross with other characteristics. (flow map and control bitmap here)
But this doesn''t really help for patterns of events, nor for non-map-position related stuff.

The way I see it, you need ingame analysis (intuition routines, and fast reasoning based on classic algorithms), and debriefing analysis (much more detailed, this phase will create new "intuitions" that can be used later) that doesn''t occur during the game sequence, which means we don''t have to worry about CPU .

Maybe this gives you some ideas.

oh egerlach, the face recognition is really easy,you know. You just need some filters that will emphasis pilosity, bone structure (males have a bigger jaw and chin), Adam apple (the bump on your throat, you know), hair length (very lame criterion, but hey). Then just mix the results. Some young girls do have a bit of hair on the upper lips, some males would have very fine jaw, the Adam''s apple is a bit hard to see on a photo, depending on the light... hehe, doesn''t it sound much easier suddendly ?

youpla :-P
0

Share this post


Link to post
Share on other sites
ahw, I think that control bitmap/flow map idea is really neat, although I''m pretty sure I''m just ignorant to the game AI realm. I''m not a game AI buff, per say, I''m into more "academic" AI... and then gaming on top of that .

The reason I like ANNs is their ability to deal well with new situations that don''t fit any of the concepts they know about. Which is why I''m going to be stupidly stubborn about them being in someway useful here. Now, an ANN couldn''t do it on its own for sure. But I think it would fit well into that "intuition routines" part of your "ingame analysis", providing an intuitive direction for strategising. Of course, then you''d need traditional (or non-traditional) techniques to help with the input and/or expand on the output.

Well, yes, you can do image ananlysis... must admit I don''t know much about that... but what kind of accuracy do you get from it? I wouldn''t be that surprised if it beats the AI... but...well do you know?

Eric
0

Share this post


Link to post
Share on other sites
Well, game AI is really just AI twisted to the need of gameplay I guess.
At least, I have been convincing my lecturers every year of this, and they consistently gave me good marks, even though in France most "academic" teachers think game programming is more about playing games than anything ... and if you are a wannabe game programmer it''s equally hard to understand what Maths and Databases, and Softare Engineering and the likes can give to you ... anyway, you''ll see soon enough I guess.

As for bitmaps, s I said, they are a nice way to represent things for a human mainly. I don''t think the machine gives a damn about it.
As well, a bitmap would match, as I described, the map on which the game is played (assuming RTS again).
But it would still leave us with quite a bunch of data to look at.

At the end of the game, you should have things like :
Unit 1 detects Unit 36. (you can the ask unit 36 identity and stats) Units 36 fire Unit 1. Unit 1 destroyed by Unit 36. Unit 2 collecting. Unit 36 moves. Unit 2 destroyed by unit 36. And so on ...
by looking at unit 36, you see it was an enemy, and it wiped out your two little harvesters (1 and 2) after a single shot ! ... now they''ll know when to run and when to collect.
A simple analysis in game would be that a unit of same type as unit 1 and 2 should avoid enemy units of same type than uint 36.
A complex analysis (made during debriefing) would show that harvesters units got crushed by most enemy units, thus you should make them avoid all enemy units. Units that had allies nearby survived ? Then harvesters should be guarded by nearby units if possible. Enemy infantry never hit a harvester ? Then ignore them.
Of course the difficulty is to build those statements I just made...

We have ANN, so let''s give a nice example of a simple scenario please. And let''s look to other solutions. Any ideas ? Maybe a scripted language ? I really like this idea, as computer generated programs that you give to units, would also give us a nice possibility of using genetics ... new generations of tanks would get cross breed of old tanks programs, and try new random version .. why not ?

though I don''t like the idea of giving in to the "trendy AI" stuff. I''d like to see a first draw, maybe using good old branching. I''ll have to write that down to see what it would look like...

youpla :-P
0

Share this post


Link to post
Share on other sites
For an ANN, why not use info about a unit or character and info about yourself, output would be your stance toward that unit. Depending on the domain information, this could be a fairly small (and therefore fast) net that can be used for each unit/char. Take the output for each unit and feed that into another net to get the general mood of the situation out of another net. Use your stance toward each unit and the general mood to plan what you will do: Command other units; Attack outright; Retreat; Negotiate; Ignore; etc...

How does that sound?


Pax
0

Share this post


Link to post
Share on other sites
It sounds like a very good way to go to me pax. Because it''s feasible. Hmmm

I love Game Design and it loves me back.

Our Goal is "Fun"!
0

Share this post


Link to post
Share on other sites
Woohoo, somebody liked my idea!!

In trying to develop good AI, I look at myself. Why do I do things? What''s my motivation and what external influences do I experience? How can I represent that on a computer?

In any situation, there''s a mood, hence the mood determination net (can also be used for selecting appropriate music?). Then using the mood and other input (each of the relationship outputs and maybe one for the location) I determine what I want to do. This can be weighted by my goals, schedule, priorities and personality/values.

The problem with AI is that there are so many factors to realistic behavior, both internal and external.


Pax
0

Share this post


Link to post
Share on other sites
Well, I was watching a fascinating program last night on the evolution of the idea Science has had about the importance of the brain. And they showed that lobsters for instance, have a dramatically simple nervous system, and yet has to deal with 8 legs plus 2 arms when walking onland. Just to say that there seem to be some hope of simulating all this in a simple way. Of course, it will only be simple when we figure it out.

Maybe if we deal with tanks being very simple beings (I just can''t forget my first program, an ant simulator in BASIC, very nice emerging behaviour, that''s probably what started me in studying all this computer crap rather than Fine Arts)

maybe we could do something. So the question is, what kind of input and stats do we give to a tank.
I am also thinking, for my MAsters, about seeing all this as a multi scalar problem. The tank is a being, but on another scale, the tank is just a "cell", an arm, of a greater being, a group for instance; which is itself a part of a greater body, etc.
Can all this speed up some processes, this is what I expect to see.

So any idea how we could model a "unit" on the battlefield. For the sake of argument, let''s take the RTS context, unless you see a better context ? (NOT RPG. There is way too much stuff to take into account)
0

Share this post


Link to post
Share on other sites
Finally! I can post! (I''ve been having trouble postsing ever since they made the upgrade to the message boards)

Pax, I like your idea, very similar to the one I suggested not 5 posts earlier. Correct me if I''m wrong, but I think you''re suggesting that you use an ANN for every unit, and then a master one for everything. Each of those nets on their own is feasible, as Paul suggests, but as a whole, when there''s 200 units on the board? You''d probably see that ANN routine slowly eat up your processor time as the game got bigger. But I do like the ANN determining the mood; if you look at my suggestion buried deep within another one of my posts you''ll find they''re very similar. I like your term better than mine too.

Guess great minds really do think alike.

Eric


===============
"Or a pointed stick!"
0

Share this post


Link to post
Share on other sites
quote:
Original post by ahw

Well, I was watching a fascinating program last night on the evolution of the idea Science has had about the importance of the brain. And they showed that lobsters for instance, have a dramatically simple nervous system, and yet has to deal with 8 legs plus 2 arms when walking onland. Just to say that there seem to be some hope of simulating all this in a simple way. Of course, it will only be simple when we figure it out.



ahw, you (and everyone else) should check this out:

http://www.frams.poznan.pl/

It''s Framsticks, an AL simulation. I can''t do it justice explaining it here.... you''ll have to check it out for yourself.

Perhaps there''s something in it for unit AI?

Here''s a good question: Does better unit AI make the system more intuitive with emergent properties???

Eric



===============
"Or a pointed stick!"
0

Share this post


Link to post
Share on other sites
No one ... can tell you what the Framsticks is. You''ll have to see it for yourself. LOL

God, it''s that time of the night again.
0

Share this post


Link to post
Share on other sites
ahw: Your multi-scalar idea is called heirarchal AI and is being used or at least investigated for RTS games. The way they use it is that there is an AI for the player, an AI for each group of units and an AI for each unit. The player AI determines overall strategy and assigns tasks to the groups. The group AI determines how to best complete its task, and the individual AI determine how they complete their own part of the task.


Pax
0

Share this post


Link to post
Share on other sites
I think that the only feasable option in using a NN for RTS AI (how''s that for acronyms?) would be as an overall strategy-controller. From my (1 hour) research, NN''s use a good deal of processing power. Individual unit AI should be built in at the most basic level. For instance, in my RTS-under-construction, in the damage-dealing routine, I check for any units that got hurt and tell them, based on their power and the attacking unit''s power, to attack that unit or retreat. Then I take any other unit that could see the unit that got hurt, and repeat the process for them. So, if you attack a group of marines with one marine, that marine and all the ones near it will attack your unit back immediately. The same thing goes if the computer attacks your units.

Where the NN would come in would be in telling the computer how to best build a base, when to go beyond friendly territory and build a new base, when to make an attack, which units to build given certain conditions, etc. What I''m talking about is a mostly factory-trained AI-NN, and letting it learn on the players'' computers, too. So, if the standard set of strategies fails miserably, the computer would start experimenting, and when something starts working well (this is where NN''s are awesome), it would slowly become the natural thing for the AI to do. And if the player changes his strategies again, well, it''s no problem for more than a few games.

BTW, is there a tutorial out there to build a neural net in C++? I''m not sure I fully understand the underlying concepts. I have a book, "Neural Nets in C++", but it is from 1992 and WAY outdated before the ANSI C++ standard, so the coding is a bit wierd. Plus, the associated source is on a 5 1/4" floppy...

~BenDilts( void );
0

Share this post


Link to post
Share on other sites
Beandog:

Hi, personally I prefer to read through algorithms and implement them by myself.
No need to buy books like "....using C++" gfx/NN whatever.

They are usually quite badly written.

Anyone has the same opinions?



/Mankind gave birth to God.
0

Share this post


Link to post
Share on other sites
A good reference for ANNs is the follwing, although it's not really a tutorial.
com.ai.neural-nets FAQ
This, on the other hand, is a good place to learn algorithms (implementation not included):
Backpropagator's Review
Another link, explaining a different kind of ANN, perhaps more useful:
Self-Organising Maps

===============
"Or a pointed stick!"


Edited by - egerlach on August 9, 2000 12:39:23 PM
0

Share this post


Link to post
Share on other sites