Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Solved] reasons for horrible artificial intelligence in AAA games?

Discussion in 'General Discussion' started by Soul-Challenger, Apr 26, 2016.

  1. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Hey everyone, I'm not a frequent poster and normally keep most thoughts for myself but this has been bugging me a lot. Been increasingly trying to wrap my head around the reasons why multi-million-budget productions have dreadfully incompetent AI. While probably not being that prevalent in other genres, it seems to be common practice in the vast majority of games which have driving or racing elements. How is it possible that productions which have the necessary funds to hire the brightest brains release something so flawed. To illustrate, some examples, among many:

    GTAV. Sure, some of the adressed "problems" in the following video are actually compromises to get better performance but some behaviors, like the fake PIT maneuver (starting at 25:49) are the worst examples of lazy, cheating, artificial stupidity:


    Need For Speed. Cop AI is traditionally bad in the whole series, masking it's incompetence by spawning cars in close proximity coming from all directions. Not the best video to show that, but nonetheless:


    Subjectively, Driver SF seems to have a more decent driving AI. Unfortunately, it cheats heavily on the physics. Mafia II cheats less but it's driving AI is incompetent. These are open-world examples and I could go on (The Crew, TDU, Watch Dogs, Sleeping Dogs, MC:LA...). Circuit-based racing games suffer too.

    So, any logical reason(s) for this? The only explanation, which verges on conspiracy theories, I can think of:

    All the big studio bosses sat around a table and agreed that no-one will ship a game with competent AI in the coming years. To cut down on production costs. The majority of players are not complaining, so why waste resources on this. Heck, it probably makes the players feel good when they beat dumb/cheating AI.

    *To make sure I'm not delusional, I did check with gamers on different forums. Some of them are actually annoyed by stupid AI, and not just in driving/racing games. Fighting games, RPG's and other genres were mentioned.

    Would love to read your thoughts about this. From a game-dev perspective :)
     
  2. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    They do not care about AI. It is not a factor. The AAA games are attempting to bedazzle user with visuals and special effects, scale, etc. & provide "movie-like" experience, occasionally praising the player and saying that they're doing a good job.

    Smart/challenging AI is not even on the list of things to do.
     
    ToshoDaimos and GarBenjamin like this.
  3. Dave-Carlile

    Dave-Carlile

    Joined:
    Sep 16, 2012
    Posts:
    967
    To paraphrase someone well known in the FPS genre (don't recall who), "Why should a huge amount of time be spent on creating clever AI when the average AI lifespan is 7 seconds?"
     
    Kiwasi, dogzerx2 and Deleted User like this.
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    It's because clever AI is never fun AI in action games (or action films).

    If it's a suspense thriller or tactical game you're likely to see the AI quality shoot up. It's really that simple.
     
  5. Deleted User

    Deleted User

    Guest

    Well they did have a good point, ironic thing is simple AI is technically the most accurate AI. Although it doesn't mean players would like it, for example you make an RPG. It's not difficult to calculate the position difference between the NPC and player, then you say when in range go chase player and finish them.

    You can do that in a few lines of code in Unity etc. problem with that being, computers are very literal and the player probably wouldn't last two minutes without a good whooping.

    So you spend many more lines of code, randomising / dumbing down accuracy and trying to make it more "movie like". Because I'm pretty sure in a real life FPS, your opponent wouldn't give you the chance to go find cover and in terms of a game it would be very short lived.

    So you have to compromise, as long as there isn't any glaring issues. Like NPC's in an FPS being so dumb you could walk up and give them a massage, then in most cases I believe it works.

    Would be interested in hearing ideas on how to compromise?!
     
    Dustin-Horne likes this.
  6. Dave-Carlile

    Dave-Carlile

    Joined:
    Sep 16, 2012
    Posts:
    967
    Compromise is key to pretty much everything in game development it seems. It's all smoke and mirrors. The compromises for an FPS are going to be different from RTS and RPG and racing.
     
    Deleted User likes this.
  7. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,964
    LOL!

    Although, maybe player would spare NPC's life if they saw signs of intelligence. Once NPC becomes boring and predictable it's good as dead (or ignored and left behind).
    So it's a vicious cycle, no one works on AI because AI gets killed fast, and AI gets killed because no one works on AI.
     
  8. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Thanks for your thoughts guys. What you're saying does make sense to me, at least when your target audience is the majority - which is the case for AAA studios, no doubt. The thing is, a minority of players, me included, are annoyed by dumb AI. It breaks the immersion and is not-fun, at all.

    I probably should have made this topic be more specifically about driving AI, my bad. Sure, in an FPS you shoot a vector from the NPC to the player's head and have to randomize, dumb it down. But if you're in a scenario where you're being chased by cops and they suck so much at driving that you can escape within seconds, and/or they resort to blatantly cheating on the physics, it would seem beneficial, as opposed to the FPS example, to smarten up the AI. Yet no "driving" game, that I know of, manages to do that.
     
  9. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Try GTA Online, no such things happen. The AI goes for you full throttle and does not cheat. The reason it cheats here is because it is attempting to entertain the player, and for most people, it does.
     
    dogzerx2, GarBenjamin and Martin_H like this.
  10. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Yeah, I know what you mean :) Been playing TDU for 4 years... Many human players in an online game do drive better than AI - and as many will be annoying and turn the experience into a juvenile ramfest.
    I'm aiming for an AI that drives better than a human player would. Beta testing will tell how that makes the players feel. Probably as good as getting beaten in chess by a computer :D

    [Edit] @hippocoder Sorry, turns out I didn't know what you meant. Thought you were talking about human players in GTA online. Checked out the online cop AI and while it does drive more aggressively, the cars are defying the in-game laws of physics all the time. Tires covered with suction cups, UFO braking and acceleration capabilities... not my kind of entertainment :(
     
    Last edited: Apr 26, 2016
  11. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    It is probably a bad idea.

    See, computers have been consistently defeating chess grandmasters since 2005 or 2006. Going against something like that will be no fun at all.

    So, if you make an aI driver that drives better than human (that probably won't be very hard), you'll create undefeatable monster your player will have to face. It is one thing when you have a tough challenge. It is another thing when the challenge is impossible.
     
    angrypenguin, Kiwasi and landon912 like this.
  12. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Time will tell. For now it's quite balanced, the AI is roughly as skilled as I am, and I've added behaviors that make it drive more like a human than a "machine". Gamers seem to be quite entertained just by watching these videos but beta testing will show if that's still the case when they actually play.



     
    Johns_Art, kittik, ZJP and 1 other person like this.
  13. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    I think it is likely a combination of what others have stated. It is pretty obvious the AAA focus on presentation. Not really any way to miss that. However, a good game AI is generally more about being entertaining or at least interesting than it is to be "better than you" or "smarter than you".

    Definitely they could do a better job on the interaction than they are. For example the police car bumping the player from behind and the wheels always seeming to turn the same way or at least same amount. Just a little random range of turn angle could have helped that out. But better would have been to just check which side of the car took the greatest impact (left, right or even center which seems to be the case in the video) then they could have bumped you to the right, left or simply a little boost forward which would make more sense. In this case, it seems like it always turns left and the same amount.

    And I get you and others being frustrated by this kind of thing. It is what makes people think their top priority is always presentation. The reason simply being it is obvious they spend a hell of a lot of effort and time on that aspect. And yet it is also obvious they don't spend nearly the amount of thought, effort and time on the other aspects. And that results in the kind of stuff pointed out in the videos you posted.

    It's actually a good thing. Because if the AAA were focused equally on all aspects of a game there would be less reasons for Indies to exist. Sure there would still be niches and micro niches to go after but with them being so focused on the movie like / presentation stuff it creates holes in the other aspects creating more opportunities for Indies. And then an Indie can focus on that stuff and leave holes in the movie like / presentation stuff and go after the niche that cares about such things. :)
     
    Last edited: Apr 26, 2016
    Kiwasi and dogzerx2 like this.
  14. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Yeah that definitely is a good thing for us indies. Concerning the "smarter than you" AI, what I meant is more an AI that would be a real but fair challenge, which you can always dumb down, to match player skill. I guess one of the reasons for my somewhat naive question, is the gut feeling that while technology and graphics have been evolving rapidly, over the last decade, AI has been stagnating, even regressing in some cases. An assumption would be that gamers are getting less demanding on that level - you know, a consequence of the dumbing-down of our society in general :)

    Anyway, I'm grateful to all for your insight on the subject.
     
    GarBenjamin likes this.
  15. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    I think the regression in the GTA cop response is interesting and telling.

    The sequence where the cops walk the guy they're arresting into the car, etc, that's a really impressive minor detail. That in later games they decided to scrap the sequence and just have the cops shoot is telling. Players either didn't care or didn't notice, and the devs decided that it was more worthwhile to cut straight to gun play.

    When you dig into the details of AAA game AI, I think they often do a really, really impressive job. The details in how characters respond and the like is often extremely impressive.

    That AI is stupid or ineffective generally revolves around the developer not wanting to pose too much challenge, and make sure the player can have fun being a super god dude. The cops in these games are more like props than like actual challenge.

    Also - your game looks great man! How are you doing that fog and lighting? It looks volumetric.
     
    landon912 likes this.
  16. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Seems to be the case. But what about a game like Driver SF, which is all about car chases. Why not make the driving AI competent (assuming it's not very hard to code, as neginfinity wrote - I'm not sure I agree, but I'm just a noob coder) and dumb it down based on player skill. Because only an irelevant 5% of gamers will bitch about the AI being incompetent/unfair? Only 5% used cockpit view in Grid, so they removed it in Grid2. Doesn't the rampant regression of AI sophistication over the last years educate gamers to expect even less sophistication in the future? What about all the gamers who are becoming old farts now and who grew up playing games that were much more challenging - are they OK with the dumbing-down too?

    Thank you :). It's just faked with particles. The ground fog are cross-plane meshes spawned above the terrain with a slightly modified vertex-lit shader.
     
    frosted likes this.
  17. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    That 5% of gamers who are unsatisfied is basically the opportunity for indies. AAA games are targeted at AAA audience, that is, huge general audiences.

    You can't please everyone all the time, so the gamers who want more can look to more niche titles that provide more challenge, or realism, or smart AI. While the biggest efforts will target the 90% who just want to have some fun and feel like a bad ass.

    Also, just because a title is AAA doesn't mean it's great, or that they made the best possible decisions. The big boys eff up too. At the end of the day, we're all mere mortals.

    I thought that this was faked, but it was faked well enough that I wasn't sure. Kudos!
     
  18. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    @Soul-Challenger I think you got to the heart of it. AAA focus on "general gamers". I mean they don't go after niches... that 5% who care about such things. Always been this way. And that is why there have always been shareware and now Steam Indie titles available to fill in the cracks. Most folks don't care. Hand them a superb looking game, bunch of cinematics and a bowl of popcorn.... they will be entertained. The people who want something more (outside of graphics because AAA pretty much rule the presentation side) or different look to Indie games.

    And I agree your game is looking great! Hopefully you will fill some of the cracks AAA are missing.
     
    Soul-Challenger likes this.
  19. mantekkerz

    mantekkerz

    Joined:
    Dec 24, 2013
    Posts:
    111
    @Soul-Challenger after watching the vids, I'm interested to know how you've gone about your AI? Does it use the same physics as the players car? At the moment that's what I'm doing, with the AI following waypoints, but also using raycasts in some directions to know if it needs to avoid something. It works, but I'm not sure how robust a solution it really is.

    As for driving games having bad AI, I think I agree with the general sentiment here- rubber banding and cheating physics is just there to try and make sure the player is being entertained. I'd not really noticed it in GTA V, but certainly in the last NFS title. But the whole driving physics in that title seem off to me, often it feels like cars are actually steering from somewhere near the centre of the car. It' weird.

    On the other hand recent iterations of Forza have had decent AI if you crank it up a bit. AI based on how real players race is probably a pretty good idea, but seems unachievable from a indy point of view.
     
  20. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Sorry @frosted just noticed I basically just said the same thing as you had a post or two earlier. Hadn't seen that one when I wrote mine. I really need to spend less time on thes forums. lol ;)
     
  21. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Well, driving AI in ETS2 and ATS is pretty smart and I haven't seen anybody complaining about it. Moreover, that good driving AI is the reason I stay away from multiplayer mod, as it doesn't include "civilian" cars.
     
  22. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    I meant to say that instead of AI that drives smart it is possible to accidentally make an AI that drives perfectly.

    That's because computer has direct access to the state of the world, while player does not.
     
  23. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Yes, both cars use the same simulation physics. Same tires, aero, weight, suspension, brakes. Player car has a different weight distribution as it's rear-engined, and 9Nm less torque. I also use waypoints but not in the classical way where the car steers to the next one when it reaches the closest one. Been refining the secret sauce for the last two years and completely rewrote the steering and braking behavior a couple times. The toughest part was making the AI loose grip while still retaining control, as can be seen at 0:35 in the AI vs Player video, where the cars are power-sliding through the 180 turn.

    Back on topic - if the current trend for triple-A is to give the audience a "superb looking game, bunch of cinematics and a bowl of popcorn" then so be it. It's kind of boring though and reminds me exactly of the same mindset inside the CGI industry 20 years ago, where people were getting properly excited about FBIK, GI, liquid simulations and the thought that very soon, CG VFX would be indiscernible from reality. I guess you can't skip that phase in the life of a new medium, where it tries to attain photorealism. Been like that with painting, sculpture, photography (yeah, the first photoetchings were pretty low-fi), film. Maybe it's the reason current big-budget games are more about shiny imagery and less about gameplay (as opposed to older games where that level of graphical fidelity was not yet technically possible). Maybe. The whole trend of AAA games trying to be interactive movies... if I want a good story, I'll read a good book or see a good film or play Eidolon. If I want good entertainment, I'll eat some shrooms and go talk to some trees in the forest (it's more immersive and cheaper than a VR headset). Oh no! Guess I'm getting old :D
     
    mantekkerz likes this.
  24. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    So those lights - is that like old school godray with just a transparent mesh?

    The quality of that the fog and lighting effect is top shelf. I'm really impressed.
     
  25. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    If you mean the streetlamps "fog", it's just a particle system emitting from the light source using particle/Additive (soft). The volume is faked using the Force over Lifetime module (x and z directions). You could also check this out: http://forum.unity3d.com/threads/true-volumetric-lights-now-open-source.390818/ (though DX11 only)
     
    theANMATOR2b and frosted like this.
  26. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    That may be true, yes. However you can easily avoid the problem by giving it limited info about state of the world (spherecast?), with similar range to what player would see.
     
  27. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    In this case you'll increase AI programming difficulty significantly, because you'll end up recreating google's self-driving car.
     
  28. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    That's how I like doing AI. Give the enemies, etc actual data collecting methods (for their immediate environment). Basically sensors whether that is a line of sight, hearing range or even a 6th sense to some degree. Then just use the information that thing has available to make decisions, explore its environment, react to danger and so forth. What it actually decides to do or can be aware of (interpreting the available data),is based on how smart and / or experienced it is.

    Basically we're just modeling an imaginary being.
     
    Last edited: Apr 28, 2016
    darkhog and Soul-Challenger like this.
  29. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    Creating a natural looking and feeling AI certainly isn't as easy as people make out - my guess, is they've not seriously tried it themselves. Race drivers simply don't drive like machines nor are vehicles glued to the ground and they certainly don't travel on rails.

    The commercial reality is that AAA games have their brand identity at stake - not to mention they are answerable to investors and the like. They must appeal to 95% of their core audience and have little choice but to invest heavily on Look and Feel of the overall game experience. Guess, there are some advantages of being an indie...

    We spend a lot of time getting the vehicle to feel "right" and we spend effort on being physically realistic. Although most people will realize pretty quickly that your average gamer doesn't actually want realistic. For some reason (that I barely understand) many do actually want their Japanese boy-racer with the big wing and drain-pipe exhaust to be able to accelerate to 400km/h in 4 seconds when they press the "turbo" or "boost" button...
     
    CarterG81, Kiwasi and frosted like this.
  30. derf

    derf

    Joined:
    Aug 14, 2011
    Posts:
    356
    Look at Alien Isolation and its AI for the alien compared to the humans.

    The Alien AI is very good, but not perfect. It can make mistakes depending on many game factors, but for the most part it does not. However the human AI is quite clearly dumb and all human objects get the same AI.

    Only the Alien has a unique AI devoted to it which is the focus of the game play.

    A game can have a basic design or an advance design or something in between based on the needs of the game play.

    Can anyone think of an action/adventure/horror game where the enemy AI was designed to be tough?
     
  31. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,229
    We've designed our AI on the highest difficulty level to be as good and sometimes a little better than our best in-house gamer. We figure there are some better players out there up for the challenge and other people can turn down the difficulty if required. AAA game studios having a bigger pool of testers so they can get a better view on what the "average" gamer is after.

    We also build tools so that we can quickly prototype our AI on different roads and tracks. Its great to be able to stand up a quick scene which is going to be something like the finished product. Some of our tools are available in the asset store.
     
    Kiwasi likes this.
  32. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    This. Creating sophisticated AI is a hard thing to do. Often there are plenty of other easier tasks that can be done to make the game more engaging that take less effort then making a perfect AI.

    And simply cheating is often a far better way to balance difficulty then building a complex AI that can deal with every situation.
     
  33. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    Exactly. In theory, it seems easy - it's just four factors isn't it? Steer left, steer right, accelerate, brake. Especially in a simulation, get one of these slightly wrong and it's an instant fail. Specifically in my car chase scenario: if the AI brakes too early, it won't be able to keep up with the player. If it brakes too late, it won't make the turn. It needs to brake hard at the last moment - at exactly X meters, where X depends on traveling speed and the angle of the bend ahead. Similar fun with steering, where the AI will have to cut corners to avoid unnecessarily loosing speed + be able to regain control using counter-steering should it loose grip.

    Now, why do I want my AI to be able to drive equally/better than the most skilled player would? To be able to do this:



    Oversteering, loosing and regaining control, power-sliding (kids now call it drifting). Why do I want such a behavior?

    1) As @hippocoder stated above, to entertain the player. To convey that aggressive, 70's movie-style, car-chase feeling - screeching tires, wild steering.

    2) To be able to dose this behavior to act as a more natural-feeling rubber-banding. If the AI looses ground on the player, I can make the AI drive more like a racing driver would: no unnecessary oversteering, perfect braking and racing line. If, on the other hand, the player is too slow, I can make the AI drive sideways, "show off", oversteer so it does not catch up with the player that fast.

    3) To actually make the AI look as if it had a state of mind: ranging from the cold and concentrated perfect driver to the pissed-off drunk-agressive driver prone to take risks and make mistakes.


    To get back to the fake PIT maneuver in GTAV. I'm still puzzled why they opted for such a cheap trick. It's really not that difficult to code. Managed to do that in a couple of days:



    ...and I am not a skilled programmer at all. Never programmed before using unity.


    I blame it on the "2 Furious 2B Fast" series :D


    @BoredMormon Fixed that for you :p
     
    antislash and sstrong like this.
  34. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Sometimes it's hard for me to take off my production hat. Easier means faster and cheaper. Faster and cheaper often means better.
     
  35. Martin_H

    Martin_H

    Joined:
    Jul 11, 2015
    Posts:
    4,436
    4 hours into the game it felt like the alien has no AI at all and everything is 100% scripted. If this changes down the line I might even continue to play the game.
     
  36. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Souls?

    Lol, that's what I've did for AV Agents in Computer Virus Simulator. They emit few rays from their eyes, one forward and little to the down (about 45 degrees towards the ground, one straight forwards and one forwards and little up (again, about 45 degrees).

    Normally, they wander aimlessly, avoiding pits by checking downwards rays and jumping over any obstacles not too high (front ray detect some obstacle, but upward ray doesn't, so it's safe to jump over). Granted, jumping over often means falling to their death if there's a pit on the other side, but with clever level design, it can be avoided. Also, since those are basically "police" of my world, they rest often.

    When they detect player however (it crosses any of their sight rays), they drop everything and chase him until he's out of sight (and for a while afterwards to check if they can catch up). Was surprisingly easy to write as it didn't require any pathfinding code (they wander aimlessly, changing direction every so often) with only basic obstacle avoidance (pits and vertical obstacles small enough to jump over - if the vertical obstruction is too high, it just changes direction until it can move again).

    Not quite, Google's self-driving cars require sophisticated image recognition algorithm (driving itself is easy enough as OP proved in his/her videos). Googlecar can't simply do a spherecast around and say "OK, there's a bush, a tree, house, garbage truck and a stop sign nearby" then decide what to do. No, it has to process image from cameras to do so (with RFID this may change, but even then in rural areas it won't work and image processing would have to be used). With game, such easy spherecast can be done and from player's point of view it wouldn't be much different.
     
    GarBenjamin likes this.
  37. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    No, because those factors are expressed as floating point, non-discrete values. You can get few billion of possible output values easily.

    AI in dark souls is dumb as a rock - it simply follows predefined patterns.

    Alien in alien isolation wasn't that great either.

    Something like FEAR, maybe. RAGE had very solid shooter AI on combatants.
    People on the internet mention AI combat, and galactic civilization. Not sure about those.

    While it is true that google car can't spherecast, good luck constructing pathfinding data on the fly using this method.
     
  38. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    One of the things with this is that tough enemies are easier to make by simply tweaking stats, rather then making the AI smart. Read up on the Halo AI. Initial playtesters described the AI as easy and stupid. Bungie turned up the health on the enemies. The playtesters described the AI as smart and challanging. No further AI programming was needed.

    Take Dark Souls as another example. The AI actually plays like something a twelve year old wrote. Move towards enemy. Block. Randomly select an attack animation. Repeat. The game is challenging, but the AI is pretty simple.

    For many games the cost benefit analysis for investing in great AI just doesn't stack up. Why spend months tuning a racing car to drive better then a human in every scenario, when you can just make the AI car slightly faster then the human and be done with it.
     
    ToshoDaimos and GarBenjamin like this.
  39. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    I think there are also structural reasons:
    - "good ai" is hard to spec out
    - it can very easily become extremely subjective
    - it can also become harder and harder to test adequately

    I think that as you scale up the production effort, things need to fit nicely and be better and better defined. It's just one of the side effects of working with larger and larger teams.

    And like all things, scaling up the complexity of the system can also incur other costs. With GTA the most important AI behaviour with vehicles is probably just making the background traffic look correct. The AI is all there just as window dressing. The player is never supposed to actually get caught by the police, he's never supposed to lose the chase mission.

    When you're playing GTA - do you really want the cops to successfully execute a PIT maneuver?

    Think about it, by AI correctly executing that maneuver, you'd be committing a cardinal sin: you'd be taking control away from the player.

    Would GTA actually be a better game with this feature? I think it would work against the core premise of GTA's game play to be honest. The goal of this game is really just to make the player feel like an unstoppable bad ass.
     
    kB11, GarBenjamin and Kiwasi like this.
  40. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,964
    One little thing that puts me off about GTA AI, is when you take out a gun -or punch someone, or something violent- everyone, including people a block and a half away, start running and screaming instantly, at the same time.

    It's the most unrealistic thing ever. People aren't that self-aware and do not react so fast, and much less at the same time.
    How hard would it be to delay and unsync their reaction times, especially for people that are far away?

    I'm going to assume this is taken as an unimportant minor detail, doesn't affect market. But for me it's a shame, because GTA people are very realistic in other aspects.
     
    Last edited: Apr 29, 2016
    darkhog and GarBenjamin like this.
  41. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Most of GTA competition got this aspect right, too. Saints row (3, dunno about others as I've never played them), Watch_Dogs, take your pick. Too bad that competition either doesn't take itself seriously (SR), which is fine by the way, or fail in other aspects (WD), otherwise GTA wouldn't be so big as it's now. Maybe one day, perhaps.
     
    dogzerx2 likes this.
  42. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Ever heard of the GPS? All the virtual car needs to know is where in the world roughly it has to turn and in which direction, while avoiding obstacles (and abide to stop signs/lights if necessary), while otherwise driving roughly straight (roughly, because it has to avoid nearby things).

    Basically take the world as human does. Here's my writeup on the topic in my game's devlog. The only reason I didn't use this approach in my game is because I couldn't figure out how to do it in 3D environment so the AI agent would properly seek nearby ram/stairs without me having it to tell there's ramp/stairs nearby. That however doesn't meant it can't be done, it just means I couldn't figure it out.
     
    GarBenjamin likes this.
  43. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    I think you were likely very close. What I would do in this scenario is first the enemy (or whatever this AI is for) would have a target position. That could be tracked as a specific static position it needs to move to for whatever reason or it can be the result of tracking something else such as the Player.

    All it really needs to know is target is above me. So now it needs to search for a way to move higher so it is closer to the player vertically than it is now. So, it scans around sees a ramp or stairs and recognizes that as a way to move higher. Then from there of course you already have the rest implemented. So it would just set the stairs as its immediate task. It moves to bottom of stairs. It then sets top of stairs as its next objective. So it moves up to the top of stairs. And so forth. Of course, when it finds stairs or when at bottom it can check the height of the top to filter out any that will not allow it to travel high enough. Basically just needs to consider everything we would in the situation.

    I just use States and Tasks. So State may be catch this thing, move to this position, Patrol, etc. Task is the immediate objective it is doing within that state.

    I'll have to check out your game tonight. Seems like we approach this stuff with the same mindset. And I agree about the pathfinding and other navigation systems. I was surprised when I came to Unity and found so many people were using that stuff. It seems more sensible to me to just make the AIs use and interact with their environment the way we would. Just model the behavior of the imaginary being.
     
    Last edited: Apr 29, 2016
  44. darkhog

    darkhog

    Joined:
    Dec 4, 2012
    Posts:
    2,218
    Thanks. My game is pretty oldschool tho when it comes to graphics and sound. Untextured flat-shaded polys, no textures, using module (tracker) music, even made lowres mode with palette decrease to only 192 colors, like you'd find in DOS games. No idea if you like that stuff.
     
    GarBenjamin likes this.
  45. GarBenjamin

    GarBenjamin

    Joined:
    Dec 26, 2013
    Posts:
    7,441
    Ha ha. For me the game is the game and the graphics are the graphics. Game != graphics. I like the flat-shaded no textures look. It's the same thing I'm doing in my current project. It's clean, very readable and can be created in a reasonable amount of time. And it's something different. There are plenty of games around with awesome modern graphics for folks to look at. I started an FPS action adventure several months back and ended up with textures and [modern] particle FX. One of the reasons I threw it out & started fresh with an even simpler visual style is because I thought the "look" was starting to get too much focus.
     
    Last edited: Apr 30, 2016
    darkhog likes this.
  46. Soul-Challenger

    Soul-Challenger

    Joined:
    Dec 30, 2010
    Posts:
    152
    As others have pointed, tough AI != good AI...

    Same thing. Because faster is not better. Many games have such an approach. The AI cars will be slightly faster on straight segments of the track but slower as soon as advanced steering and braking is required - unable to take sharp turns at optimal speed.
    Sure, why make something great if you can get away with average + cheating.
     
    darkhog likes this.
  47. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Yeah, right.

    Please play Richard Burns rally.

    One decent bump on the road and ai driven with this kind of approach will take off and fly into sunset while spinning.
    Also, it is a behavior of suicidal cops in GTA games. Extra fun when obstacles are moving.
     
  48. ToshoDaimos

    ToshoDaimos

    Joined:
    Jan 30, 2013
    Posts:
    679
    One more issue with AI development: it's tightly coupled with design. You can leave your programmers alone when they make their renderer. You can't do that with AI programmers. Subtle changes in AI code can deeply influence gameplay experience.
     
    Kiwasi and GarBenjamin like this.
  49. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,965
    Kiwasi likes this.
  50. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Precision can wary from 5 to 50 meters, pretty much, and GPS software usually pins car marker to the nearest road when in driving mode.

    IIRC, precision gets worse when you move closer to the poles (well, because you can't place geostationary satellate above the north pole), but I think there were few places with higher precision.

    Basically, making AI drive using gps is a bad idea.
    I also remember few stories where map was incorrect, and people tried to drive through the river and something.

    Either way, if there's in-game "GPS", and AI uses it to drive, then the AI is not driving like a human would.
     
    Kiwasi likes this.