Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Does game logic use artificial intelligence?

Discussion in 'General Discussion' started by thegamer1234, Oct 18, 2015.

  1. thegamer1234

    thegamer1234

    Joined:
    Feb 13, 2015
    Posts:
    48
    I'm a person interested in Artificial intelligence.
    Does game logic like the behaviour of the enemy, spread of disease(in plague inc.) etc. Use artificial intelligence?
    Does it use all those algorithms?
    Can game logic be considered artificial intelligence?
     
  2. McMayhem

    McMayhem

    Joined:
    Aug 24, 2011
    Posts:
    443
    Game Logic is a broad term that encompasses all parts of a games workings, so it can't be compared to Artificial Intelligence. Just like fruit can't be compared to apple. If you are asking if the same algorithms are used in simple game code such as spread of disease, it is possible, but not necessarily.

    Artificial Intelligence refers to a very specific part of game logic that deals with simulating human behavior. The more varied and unique the behavior the less artificial the intelligence seems. This is the goal for the person making the algorithms used by the AI. What to do when noticing an enemy, where to hide or find cover, when to use utility items, when to attack and when to defend. These are all parts of AI code that contribute to fabricating human logic. It's all about making your AI react to situations based on dynamic scenarios that occur in real-time.

    It's perfectly possible to use some of the same techniques in AI code other places, but the main goal of AI code is to simulate human behavior. So unless the other part of the game logic was something sentient that needed to be able to make decisions based on environment, it wouldn't be a very good idea.
     
    Kiwasi and zombiegorilla like this.
  3. thegamer1234

    thegamer1234

    Joined:
    Feb 13, 2015
    Posts:
    48
    image.png image.png
    This was on a document file on the web abou AI in games.
    Doesn't artificial intelligence mean the Ability of a computer to do certain tasks on its own?
    like in xbone there is a feature where the console will play the game when you're offline
     
    Last edited: Oct 18, 2015
  4. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    It's going to come down to a lot of tricks to fake it. The algorithms that mimic learning are too expensive to be in a game more complex than chess, which would not benefit from them since chess is simple enough for the machine to know what move to make based on any state of the board. Games are more likely to settle for dumb enemies or have smart decisions pre-calculated to happen under very specific circumstances.

    A* is probably the extent to which games will employ 'learning' algorithms. In a complex environment that can change you'll likely want a way for your entities to find get around.

    That is both unlikely and absurd. A few games might have a feature that has events happen based on a passage of time, but the console itself is not playing them. The xbone certainly does not have the hardware capable of the degree of artificial intelligence that would be needed to plug & play any game you throw at it. Some human brains can barely manage that ;)
     
    Kiwasi and McMayhem like this.
  5. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    Artificial intelligence is exactly as it sounds. The ability for machines or software to exhibit intelligent behavior.
     
  6. McMayhem

    McMayhem

    Joined:
    Aug 24, 2011
    Posts:
    443
    If your're talking about the most basic concepts yes. But the goal of conventional AI is to simulate human behavior. It's much more fun to fight enemies in a singleplayer game when you forget they're driven by computer logic. These are all techniques to increase the quality of immersion in games. That is, the degree to which you feel included in the game world.

    The key to this is within real-time gameplay. Does the AI make seemingly natural decisions when presented with a given situation? Will the AI pop up out of cover while the player is shooting at him? Will the AI seek cover when she is out of ammo and needs to reload? How long does an AI unit wait while unable to find it's target before seeking? Questions like that drive the AI algorithms.

    While it is possible that eventually AI will become sophisticated enough to play games for us. It would completely defeat the point of videogames in the first place.
     
  7. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    Does that mean artificial sweetener is the ability for machines or software to exhibit sweet behavior?

    Quite the impossible task since so much of human behavior is illogical :p

    An intelligent bot would be annoying for mmo developers :)
     
  8. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    How much of that is due to us simply not understanding their conscious and subconscious motivations?
     
    Last edited: Oct 18, 2015
    McMayhem likes this.
  9. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    And how much of that is affected by the fact that a real good AI opponent is too hard.. There was a talk somewhere at ubisoft about artificial dumbness of characters to keep the game playable.
     
    Ryiah and Kiwasi like this.
  10. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Chess playing algorithms don't even learn. It's so much faster to give the computer static move sequences and heuristic algorithms than to generate them while playing. There are algorithms that figure out those move sequence. It's just more efficient figure out those sequences outside of playing.
     
    Tomnnn likes this.
  11. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    A huge part of game AI is building a satisfying challenge for the player. It's not so much about duplicating what a real human would do. In many games this would amount to run away and hide. Nor is it about being actually smart, this leads to players being hammered. Game AI also has to fake just about everything, as the processing power is not there to do the tasks at 60 FPS.

    The main goal of a game AI is to loose convincingly.
     
    Teila and Tomnnn like this.
  12. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    I'd like to think it's that simple, but when you take a very basic and logical subject and explain to people, some of them miraculously do not grasp it.

    That's what I meant :p A game as slow paced as chess is the only one that could get away with full blown artificial brains, because you can stall for 'thinking' and there isn't a lot going on visually. But chess is easier handled as you said, so there wouldn't be a point in implementing actual 'thinking' or 'learning' algorithms.

    @thegamer1234 I see the image now. That's some amusing wording. For a racing games I do believe they can use your friends' driving stats to change how some ai drive. But that doesn't really need ai for a racing game. Like if your friend made an almost perfect drift around a hard corner. One of the ai could mimic the drift when nearing that corner.
     
    Last edited: Oct 18, 2015
    jpthek9 likes this.
  13. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    I think if self-aware AI ever comes about, they'll do something similar to chess development algorithms. They'll sample the scenario and iteratively test for solutions. Kind of like evolution. I doubt AI will ever learn on the go as humans do because it's inefficient.
     
    Tomnnn likes this.
  14. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    That's also an important thing to consider in conversations about ai :) What the human brain does is a miraculous disaster, from fusing multiple streams of consciousness to signal leakage between neurons. It doesn't need much electricity or input though, so it's got that going for it.

    We should build neurons. Simply, garbage quality processors that can barely do anything except pass signals around unreliably to their surroundings. That'd give us something 'intelligent'
     
    Kiwasi and jpthek9 like this.
  15. McMayhem

    McMayhem

    Joined:
    Aug 24, 2011
    Posts:
    443
    I agree 100%. 'Learning' on the go would be an unwieldy way to go about the situation. Really, once you get into it, the process becomes less about when and how to sample those situations, but what to do with the information gathered from the sampling.

    Indeed it is. This kind of reminds me of a great line from Bladerunner:

    "Is this to be an empathy test? Capillary dilation of the so-called blush response? Fluctuation of the pupil. Involuntary dilation of the iris..."

    Although, to put it another way. In games, we want our units (wink) to seem more human. Part of that is actually programming in illogical behavior. If an AI instinctively knows where you are regardless of vision/sound/whatever, it's not very fun. But if there is some variance in whether or not an AI unit makes a good decision, well that kind of makes things interesting :).

    More human than human is our motto.
     
    Tomnnn likes this.
  16. BFGames

    BFGames

    Joined:
    Oct 2, 2012
    Posts:
    1,543
    The goal of simulating human behaviours is important but not always the overall goal for AI in games. In academia you are often looking into dealing with overall intelligent choices that do not have to seem human like at all. Often well performing AI seems very, well computer like, but can help you solve other interesting options for gamers. However i agree with you that human like behaviours are really interesting - thats why i wrote my master thesis about it :)
     
    McMayhem likes this.
  17. thegamer1234

    thegamer1234

    Joined:
    Feb 13, 2015
    Posts:
    48
    All right so AI means the ablity of computer to think and make descsions on its own, Just like a human.
    And yes, doesn't the dog in Ashen Rift (a game made in unity) use AI? http://www.ashenrift.com/
     
  18. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    Well there's "ai" that operates on a decision tree and there's ai that creates new information. The latter is the interesting, more expensive one.
     
  19. thegamer1234

    thegamer1234

    Joined:
    Feb 13, 2015
    Posts:
    48
    Can the latter be used in a game?
    http://www.madfingergames.com/deadtrigger1
    I found this on the website
     
    Last edited: Oct 19, 2015
    Tomnnn likes this.
  20. thegamer1234

    thegamer1234

    Joined:
    Feb 13, 2015
    Posts:
    48
    Imagine a robot AI sleeping for us so that we are saved from the effort of counting sheep.
    Do you think anyone would make an AI that would play video games for us?
    Someone might invent one to play the game while you're busy.
     
  21. Mwsc

    Mwsc

    Joined:
    Aug 26, 2012
    Posts:
    189
    I find it amusing when people get into discussing what is really or truly AI. There is no real definition for intelligence, so there is no real definition for AI. As long as you clearly define what you mean by intelligence, and as long as you go about getting it artificially, it is fair to call it AI.
     
    jpthek9 and Kiwasi like this.
  22. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    In the context of machines, I'm usually talking about a system producing information that is not present initially. Synthesis of new data and making decisions based on it. I also like to include weighted decision trees because I think a lot of what people do can be broken down into just that :D

    It can, but not many games would benefit from going in depth implemented that. Because what you linked there,

    Doesn't mean that the ai is actually evolving. It could mean to say that enemy behavior changes. Being vague on features and their scope is how companies sell games :p

    'Evolving' sounds a lot more enticing to a customer than 'after round 5, the zombies walk faster. after round 10, the zombies run and have 35% increased health and damage.'
     
    jpthek9 and Kiwasi like this.
  23. Mwsc

    Mwsc

    Joined:
    Aug 26, 2012
    Posts:
    189
    In the context of computer science, I find it useful to define AI as any algorithm that solves a problem that we traditionally think of as being something humans do, and machines can't. Once upon a time, adding numbers together was intelligence that no machine could replicate, so by my definition, the first adding machine was AI. For a long time, chess was considered the pinnacle of AI, but now that we understand how to make a computer to play chess, it seems more mechanical than intelligent. Tasks like recognizing faces or understanding spoken language are more recent examples of AI that is now more or less solved, and so doesn't seem very intelligent.

    Computer science departments are making large efforts in machine learning. Machines that can sort through data and learn without having to be guided too closely are at the cutting edge, so by my standard, they are the real AI of today. I think this is close to what Tomnnn was talking about with generating new data.

    But in games, AI is nothing more than whatever system controls the behavior or the NPCs.
     
    jpthek9 and Kiwasi like this.
  24. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Agreed. The meaning of AI is constantly changing because, as @Mwsc suggested, there is no real definition for AI. Part of the implication of intelligence is mystery. As soon as a machine's function becomes no longer a mystery, we don't see it as we see human intelligence. This is sad because machines will never think like humans. Humans intelligence is millions of years of tiresomely developed spaghetti code that we can't understand like we do the logic behind computer programs.
     
  25. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    I think we'll get closer to ai when we build tiny programs that interact randomly and run millions of instances in parallel instead of trying to build up single learning algorithms.
     
  26. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Recent studies have shown it is surprisingly non spaghetti like. The project is to map the entire human neural map. The researchers developing this map expressed surprise at how logically laid out it is. We may not be that far off of understanding human intelligence.

     
    McMayhem and Ryiah like this.
  27. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    How far are we from getting electronics to do what the brain can do with the same amount of power?
     
  28. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    That's a long way off. Our current electronics operate by brute force. We basically create a massive electromagnetic force to push elections from one silicon atom to another. We use thousands of those electrons to represent a single bit.

    Biology is much smarter. It bounces a small number of electrons down a nice little cascade of energetically similar molecules. It's slower, but much more energy efficient.
     
    dogzerx2 and Tomnnn like this.
  29. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    That reminds me of the superconductor that created a magnetic wormhole.

    It's funny to think that biology is 'smarter', given the processes that got it to this point. But I'm guessing it's the same for single celled organisms, yea? They can do more than a machine can given the same amount of energy?
     
  30. thegamer1234

    thegamer1234

    Joined:
    Feb 13, 2015
    Posts:
    48
    I just wanted to point out that the zombies use AI.
    I didn't mean that the zombies would evolve the way we did from apes!
     
  31. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    Can you name a game opponent that does not use ai? ;)

    Zombie gorillas sound terrifying.... don't you think so, @zombiegorilla ?
     
    Ryiah likes this.
  32. McMayhem

    McMayhem

    Joined:
    Aug 24, 2011
    Posts:
    443
    Very true, but it's an incomplete project. A lot of people like to think we are the end-all-be-all of evolutionary development, but the truth is, as a species we are in our infancy.

    Getting conventional technology to interface with the our biological systems has proven incredibly difficult, and I agree we are quite a long way from being able to completely map the human brain like we can a computer. However, there have been some very fascinating breakthroughs in that research over the past ten years. And given that the rate of technological advancement is speeding up, I'm hoping we'll get to see something special in our lifetimes. *crosses fingers*

    Actually, the notion is not that we evolved from apes, but rather that we share the same ancestry. Alternatively, to put it in OOP terms, we both derive from the same base class :D.

    This is what I think is at the core of great AI. Once a unit's actions become predictable, a lot fun gets deflated. I know a lot of games have come out since, but Half-Life 2's AI was just beautiful. The reactions were so varied and well done that it never broke immersion.
     
  33. Xenoun

    Xenoun

    Joined:
    Sep 2, 2015
    Posts:
    201
    Yep, neolithic human remains have been found with skull shapes similar to our own. Key differences show that their brain was different and they were likely less intelligent than our ancestors...possibly why they were all wiped out.
     
    Kiwasi likes this.
  34. McMayhem

    McMayhem

    Joined:
    Aug 24, 2011
    Posts:
    443
    I really like your name.
     
  35. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    The most recent stuff I read on this indicates that Neanderthals (not strictly speaking our ancestors) had more developed memory then out ancestors. Where our species shone was in language centres. Meaning one of them was more intelligent then one of us, but five of us were more intelligent then five of them.

    The old theory about big brains causing trouble with the birth canal seems to be less popular these days.
     
  36. Xenoun

    Xenoun

    Joined:
    Sep 2, 2015
    Posts:
    201
    No-one has ever said that before...not sure if sarcasm or actual compliment.
    Been using the name as my username everywhere for the past 15 years or so.
     
  37. McMayhem

    McMayhem

    Joined:
    Aug 24, 2011
    Posts:
    443
    Not sarcasm at all. I was going to say I really liked the way it rolled off the tongue, but I was afraid it would be taken the wrong way.

    EDIT: Although, you know what? Now everything I type sounds sarcastic to me haha ^_^
     
    Kiwasi and Xenoun like this.
  38. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    There's a character in maplestory called xenon

    It's a curse many of us suffer :(
     
  39. Xenoun

    Xenoun

    Joined:
    Sep 2, 2015
    Posts:
    201
    Yep, I've seen the name "Xenon" used in many places.
    Me using Xenoun pre-dates Maple Story though :) Think I even had a mage character in that game called Xenoun at one stage.
     
  40. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    Or if you take some Internet communities into consideration... five of us are still less intelligent than five of them. :p
     
    Kiwasi likes this.
  41. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    We may have devolved some since we beat out the Neanderthals ;)
     
    Ryiah likes this.
  42. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,141
    Complacency due to lack of competition. Microsoft is a stellar example of this with Internet Explorer and they learned the lesson the hard way courtesy of Firefox and Chrome.
     
    Tomnnn likes this.
  43. Xenoun

    Xenoun

    Joined:
    Sep 2, 2015
    Posts:
    201
    Steam will soon learn too. Forced DRM and absolutely horrible customer service won't be accepted forever. GOG is moving in with their new platform, just need the games to go with it.
     
  44. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Not really. IE still sucks. ;)

    Back in serious evolutionary terms even the internet trolls or the average three year old beats out the Neanderthal for language abilities. Think of the "in between" words, that don't match up with concrete concepts. Words like "the, and, this, with" ect. These non concrete words allow us to communicate abstract concepts. "There is food just past the stream". That may just have been the reason our ancestors won out.
     
  45. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    I only buy games on steam now if they don't use its drm :p
     
  46. Xenoun

    Xenoun

    Joined:
    Sep 2, 2015
    Posts:
    201
    Yeah, tbh the DRM doesn't bother me since I play games on a desktop and it's always connected to the net. It's more the dodgy stuff that Steam pull with Australia that annoys the hell out of me. They're under investigation by our federal consumer affairs watchdog and their argument is that they provide a subscription service and don't actually sell products to Australia. Basically they're trying to slip through a loophole that doesn't exist and they'll get screwed over for it.

    In the meantime that's the real reason why we don't have AUD currency on steam, because then they'd have to admit to selling products to Australia and their thin veneer of legal standing would crumble.

    Nowdays when I buy a steam key it tends to be through a third party site that trades in AUD. Sick of currency exchange fees and having a surprise extra added onto the price of a game.
     
  47. thegamer1234

    thegamer1234

    Joined:
    Feb 13, 2015
    Posts:
    48
    Apple's Siri
    An example of AI(not in game)
    but a characterr like siri who is an assisant
     
  48. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    Oh, that's interesting. That's like a legitimate use for those sites that are usually they're so people can abuse the global economy and buy keys from a region that makes it much cheaper for them.