• 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.
Sign in to follow this  
Followers 0
calculemus1988

Bayes Networks in games?

16 posts in this topic

I am learning about Bayes Networks at Stanford's online AI class. I was wondering if there are books that talk about and implement code related to Bayes networks in context of games?

Thanks
0

Share this post


Link to post
Share on other sites
There's not a lot of writing about Bayes in games because there's not a lot of use for Bayes in games. That's unfortunate because it is a really powerful technique. Most of the reason that we don't need to process partial information in the game realm is because, with regard to the game engine and entities, we already [i]have [/i]ALL the information. What we [i]can[/i] use it for is stuff that is not inherently a part of the game -- the player, for example. There is some use of Bayes to intuit player [i]intent[/i]. For example, given a list of criteria about a situation, if the player is holding his sniper rifle, we are undetected by the enemy, we are in cover, and the player starts to move forward, chances are the player is not planning on rushing the enemy -- he wants to pop a melon or two.

That being said, in the book, AI Game Programming Wisdom, there is a great explanation with examples of Bayesian networks by Paul Tozour.
2

Share this post


Link to post
Share on other sites
[quote name='IADaveMark' timestamp='1319203268' post='4875034']
There's not a lot of writing about Bayes in games because there's not a lot of use for Bayes in games. [/quote]

I disagree. Dave, have you ever played Monopoly for the iPhone? <shudder>

It has 3 difficulty levels. At level 1 (easy) you can offer the computer the list price for a property it owns, and it will sell it. At levels 2 and 3 I'm pretty sure that the computer cheats-- as in the dice are loaded with magical weights that allow the computer to alter its 'luck' level. lol. It doesn't look like EA made any effort to build a 'smarter' opponent and IMO the game seriously suffers because of it.

Bayes would have been perfect for Monopoly.

So, OP, there is plenty of room for improvement in games, provided you're thinking about the right sorts of games.
0

Share this post


Link to post
Share on other sites
Like I said, there are game for which it would be a powerful technique. Discerning the results of something stochastic (e.g. Monopoly) is one. I also seem to remember our discussion regarding the very Stratego-like game a few months back where I suggested that Bayes is the way of approaching that. However, in the face of actual perfect knowledge that the computer has, AI programmers don't [i]need [/i]to use Bayes when we can just look up the info and fake stupidity. That's not my preferred method... I was just stating that it is often done that way.

A good example would be finding the player when he is hidden. Obviously the computer [i]knows [/i]where the player is and can simply feign stupidity. However, that doesn't always lead to convincing error. Using Damián Isla's occupancy maps, however, is a Bayes-like treatment of influence maps. THAT leads to a very realistic approach by the NPCs because it is based on that magic combination of observation, belief, and possibility.
2

Share this post


Link to post
Share on other sites
I am kinda disappointed finding out more and more(I am student by the way) that the jobs available in computer science are not that interesting as I thought. The things we study in theory, the cool stuff, don't have much applications yet. It seems the real world is way way behind in relation to the theory that is developed. I am not like oh I should quit computer science, far from that, I am just saying theory is way way too far from what is actually done in real world and what you get paid for.
0

Share this post


Link to post
Share on other sites
[quote name='calculemus1988' timestamp='1319302884' post='4875370']
I am kinda disappointed finding out more and more(I am student by the way) that the jobs available in computer science are not that interesting as I thought. The things we study in theory, the cool stuff, don't have much applications yet. It seems the real world is way way behind in relation to the theory that is developed. I am not like oh I should quit computer science, far from that, I am just saying theory is way way too far from what is actually done in real world and what you get paid for.
[/quote]

Calculemus, about 1% of people get the really cool jobs (like test driving Bugati Verons, reverse engineering fly brains, or designing video games). Everyone else is stuck doing things that your average teenager could care less about.

EA, in terms of a profit model, did the right thing by building a cheap AI. They wasted no money, and the 'Monopoly' brand name sold itself. The lame AI probably didn't affect sales one bit.

Dave is quite right in pointing out that most RTS or FPS games don't require an AI any more complex than a set of scripts. There really isn't much value in building complex AI for for most NPCs.

It has been my experience that if you want to do interesting cutting-edge things you have two options: Work for yourself, or work in academia. Build a game that uses a strong AI as the gimic that gets people to play it. It's never been a better time for the indy developer.
0

Share this post


Link to post
Share on other sites
While it's true that intellectual products like new algorithms don't take huge numbers of people to produce -- so you'll be facing some competition to get these jobs -- I wouldn't totally write off these technologies as useless.

- Android and iOS devices both include speech recognition engines. Witness the much-hyped [i]Siri[/i]. As far as I know, Hidden Markov Models are at the heart of most speech recognition algorithms; it's possible that Bayes nets are in use here too. And the speech recognition engines, though impressive, still leave much room for improvement. That means room for competition.

- The government funds a great many contractors that you've never heard of, who are trying to develop both old-fashioned database systems, and fancier statistical analysis tools including semantic networking tools, for understanding intelligence data. I imagine Bayes nets either get used here, or could be used.

- Robotics is very slowly taking off, not just in defense and in a few "silly" consumer applications like the Roomba (though it has some sophisticated competitors that even do SLAM!), but also in warehousing and factory automation, and we're just [i]beginning [/i]to see the very leading edge of agricultural robotics. The world won't need a billion roboticists, but it [i]is[/i] one more area where these sophistical tools can actually be useful.

I also think that games have a lot to teach these other fields. Sure, they don't need to deal with uncertainty to the same extent, but one thing they do a great job of is producing usable interfaces for interacting with the real world (or simulations thereof). People are beginning to acknowledge, for instance, that Starcraft is a pretty good model for what a good "net-centric warfare" interface should look like. Indeed, it was by explicitly following a strategy of copying Starcraft's UI that Ed Olson and his students won the recent MAGIC robotics competition in Australia. The difference, of course, is that instead of loading a map file you're doing SLAM, and the "fog of war" is real! My point in bringing this up is to say that, although some of these algorithms don't get used in games themselves, they get used in other fields that involve many of the same things as game development.
1

Share this post


Link to post
Share on other sites
Thank you guys, I got a good idea about Bayes Nets in games.

In week 3 Machine Learning course, we learn about Neural Networks. So that I don't start a new topic, you guys wanna talk about Neural Nets in games? Are they used and to what degree?

Thanks
0

Share this post


Link to post
Share on other sites
[quote name='calculemus1988' timestamp='1319841906' post='4878033']
Thank you guys, I got a good idea about Bayes Nets in games.

In week 3 Machine Learning course, we learn about Neural Networks. So that I don't start a new topic, you guys wanna talk about Neural Nets in games? Are they used and to what degree?

Thanks
[/quote]
Even the most basic search of this forum's posts will give you the answer(s) about NNs in games. Trust me... we don't want to restart that.
2

Share this post


Link to post
Share on other sites
[quote name='calculemus1988' timestamp='1319156107' post='4874867']
I am learning about Bayes Networks at Stanford's online AI class. I was wondering if there are books that talk about and implement code related to Bayes networks in context of games?

Thanks
[/quote]

Bayes Networks would be wasted on games. They are slow, inference on them is NP - hard. Building the network structure from data is also NP-hard. So for a decent sized network you gonna be doing something like gibbs sampling to do inference on network a structure that is almost guaranteed to be wrong. For a game the AI will take a long time to get at the distribution and is not worth it. Most of machine learning is either too slow, data intensive or stationary for Game use.

If there would be one machine learning thing that I would actively look into, it would be Decision Trees. Decision trees are brittle so can add variance and do well with little data. You could then augment them as Random forest or boosted trees. I think that would be where I would start.

A close cousin to bayes nets that might be useful to some types of games (arcade shooter, anything requiring movement tracking and prediction) would be a particle filter. Finally, a bared down Reinforcement learning algo may be good for long term play in a strategy or RPG. All of these would be very hard to get right and take a lot of time when a simple markov chain based model or even Finite state machine would have done just as good or better for much less work.
-1

Share this post


Link to post
Share on other sites
[quote name='Emergent' timestamp='1319324953' post='4875467']
While it's true that intellectual products like new algorithms don't take huge numbers of people to produce -- so you'll be facing some competition to get these jobs -- I wouldn't totally write off these technologies as useless.

- Android and iOS devices both include speech recognition engines. Witness the much-hyped [i]Siri[/i]. As far as I know, Hidden Markov Models are at the heart of most speech recognition algorithms; it's possible that Bayes nets are in use here too. And the speech recognition engines, though impressive, still leave much room for improvement. That means room for competition.

- The government funds a great many contractors that you've never heard of, who are trying to develop both old-fashioned database systems, and fancier statistical analysis tools including semantic networking tools, for understanding intelligence data. I imagine Bayes nets either get used here, or could be used.

- Robotics is very slowly taking off, not just in defense and in a few "silly" consumer applications like the Roomba (though it has some sophisticated competitors that even do SLAM!), but also in warehousing and factory automation, and we're just [i]beginning [/i]to see the very leading edge of agricultural robotics. The world won't need a billion roboticists, but it [i]is[/i] one more area where these sophistical tools can actually be useful.

I also think that games have a lot to teach these other fields. Sure, they don't need to deal with uncertainty to the same extent, but one thing they do a great job of is producing usable interfaces for interacting with the real world (or simulations thereof). People are beginning to acknowledge, for instance, that Starcraft is a pretty good model for what a good "net-centric warfare" interface should look like. Indeed, it was by explicitly following a strategy of copying Starcraft's UI that Ed Olson and his students won the recent MAGIC robotics competition in Australia. The difference, of course, is that instead of loading a map file you're doing SLAM, and the "fog of war" is real! My point in bringing this up is to say that, although some of these algorithms don't get used in games themselves, they get used in other fields that involve many of the same things as game development.
[/quote]

You are definitely right about game having a lot to teach other fields.

Robotics usually focus on reinforcement learning type stuff.

Yeah contractors, data scientist are the prime users of bayes nets. They have the resources, expertise and time to build, train and sample from networks (sometimes measured in days). The lack of black box also means that the parameters themselves may have actionable info.

HMM mostly, never heard of bayes nets though Condition random fields gaining in use.

Siri is stupid (not an insult) - I read from someone who worked on it that its mostly keyword matching.
0

Share this post


Link to post
Share on other sites
[quote name='Daerax' timestamp='[url="tel:1320029118"]1320029118[/url]' post='[url="tel:4878783"]4878783[/url]']


If there would be one machine learning thing that I would actively look into, it would be Decision Trees. Decision trees are brittle so can add variance and do well with little data. You could then augment them as Random forest or boosted trees. I think that would be where I would start.

A close cousin to bayes nets that might be useful to some types of games (arcade shooter, anything requiring movement tracking and prediction) would be a particle filter. Finally, a bared down Reinforcement learning algo may be good for long term play in a strategy or RPG. All of these would be very hard to get right and take a lot of time when a simple markov chain based model or even Finite state machine would have done just as good or better for much less work.
[/quote]

Trees are that little tool that nobody ever talks about. You can derive probability distributions from them, use them for clustering, regression, and classification. They can be built in near real time, and a human can understand their output (it's a decision tree!!!).
I've posted a few screen shots of regression and boosted regression trees. I've even offered to write a tutorial. They lack a cool name maybe... Or the math isnt complex enough to invoke the voodoo factor? Not even one thumbs up though... <sigh>
1

Share this post


Link to post
Share on other sites
[quote name='ApochPiQ' timestamp='1320082315' post='4878944']
If you honestly feel they are that valuable, you should be willing to make the resources available to teach people about them [i]without needing encouragement[/i]. Most people won't see the need or interest until [i]after[/i] a resource is available which clearly, concisely, and comprehensively illustrates the value of that technique.

Frankly, you shouldn't need our approval or rabid anticipation to do something that you think is worthwhile.
[/quote]

I am short on time or I would volunteer. Someday maybe. But he is right Decision Trees are something that are not payed enough attention to. Random Forest in my use case outperformed neural nets and SVM and are speedy to train.

For games, more than neural or bayes nets or genetic search, decision trees are the one thing out of machine learning I would argue to be most applicable to games in a splash and dash manner. They represent a probability distribution over the data, are not very far from FSM many are used to and with a weighted randomized voting method are close to behaviour trees (although built in an inverse manner - decision trees you start from a list of scenarios and desired ouptuts and it returns a tree, btrees - you start with actions to input states and build the tree - at least for what I can understand of behaviour trees, the game literature terminology is not one I am fluent in)

Here is a fairly clear but basic python example of a decision Tree from Machine Learning An Algorithmic Perspective (I highly recommend the book). [url="http://www-ist.massey.ac.nz/smarsland/Code/6/dtree.py"]http://www-ist.masse...Code/6/dtree.py[/url]
2

Share this post


Link to post
Share on other sites
[quote name='ApochPiQ' timestamp='[url="tel:1320082315"]1320082315[/url]' post='[url="tel:4878944"]4878944[/url]']
If you honestly feel they are that valuable, you should be willing to make the resources available to teach people about them [i]without needing encouragement[/i]. Most people won't see the need or interest until [i]after[/i] a resource is available which clearly, concisely, and comprehensively illustrates the value of that technique.

Frankly, you shouldn't need our approval or rabid anticipation to do something that you think is worthwhile.
[/quote]

I do think they are worthwhile, and so I use them in my work. It's also why I have suggested them.
Thinking something is a great tool in no way means that one is obliged to write a how-to guide for the uniniatied.
0

Share this post


Link to post
Share on other sites
I'm not trying to suggest you're obligated to do anything; I'm just saying that if you think these are worth teaching people about, why wait for the "thumbs up" as you put it? Just go do it. Unless you're doing it purely for recognition, there should be no reason to hold off.
1

Share this post


Link to post
Share on other sites
[font="Calibri"][size="3"]For video games, I think decision trees make more sense than Bayesian network. Generally, the outcomes you want in a video game are well defined. [/size][/font]

[font="Calibri"][size="3"][b]The advantages of decision trees are[/b][/size][/font]

[font="Calibri"][size="3"]1: easy to program [/size][/font]

[font="Calibri"][size="3"]2: designer friendly[/size][/font]

[font="Calibri"][size="3"]3: easy to debug[/size][/font]

[font="Calibri"][size="3"]4: can be used as a Game tree for game theory applications[/size][/font]

[font="Calibri"][size="3"]5: full deterministic because each node only has 1 parent node.
[/size][size="3"]Unlike a Bayesian network where multiple variables can affect the truth-value.[/size][/font]

[font="Calibri"][size="3"][b]The advantages of Bayesian network seem to be[/b][/size][/font]

[font="Calibri"][size="3"]1: allows independent / [/size][/font]conditionally independent[font="Calibri"][size="3"] nodes[/size][/font]

[font="Calibri"][size="3"]2: allow reasoning about [/size][/font]independent [font="Calibri"][size="3"]nodes[/size][/font]

3[font="Calibri"][size="3"]: Often will have less nodes. However, each node will have more edges. [font="Times New Roman"] [/font][size="3"]Especially true with joint probability[/size]

[/size][/font][font="Times New Roman"] [/font]
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0