News for hackers. Stuff that matters.
Re:Ask HN: Game devs, what is the hardest part about designi... by Jasper_ on Wednesday March 06, 2019 @02:47PM (#19322058)
Game AI is mostly pathfinding (which basically falls down to creating navigation meshes for levels), and very basic decision making skills, which is usually a weighted decision tree (e.g. if they're getting shot at, cover might be weighted at 80%, shooting back at 20%). You don't want to actually create something actually smart to fight, you want something with understandable, predictable logic for the player and something they feel clever outsmarting. Anything too complex and players will get discouraged by the difficulty.

Machine learning isn't really a great fit for this, as it is neither predictable nor understandable, and thus the player can't plan around it or try to outsmart it.

Re:Ask HN: Game devs, what is the hardest part about designi... by dx87 on Wednesday March 06, 2019 @03:00PM (#19322190)
That reminds me of a lesson developer's learned when making a stealth game, Splinter Cell. Originally, when you were spotted the enemies would just try to shoot you, but tester feedback said that players didn't like getting shot out of nowhere. The devs added audible cues that you'd been found, like the guard yelling "Hey you!" before they started shooting. It turns out realistic AI behaviors aren't necessarily fun AI behaviors in a video game.
Re:Ask HN: Game devs, what is the hardest part about designi... by izacus on Wednesday March 06, 2019 @04:32PM (#19323037)
Gaming is full of tricks - e.g. I liked how Bioshock developers said that they made enemies deliberately miss their first shot so the player has time to react.

Or how many shooters lower incoming damage and increase outgoing damage as you come close to dying to create those "I survived with 1HP left!" moments.

Re:Ask HN: Game devs, what is the hardest part about designi... by blattimwind on Wednesday March 06, 2019 @03:48PM (#19322599)
Splinter Cell also has cooldowns in some/most levels (like most stealth games), which is of course an absurd notion. A guard on a military base wouldn't back out of "DEFCON1" after two minutes just because the invader didn't show herself for that long.
Re:Ask HN: Game devs, what is the hardest part about designi... by mcv on Thursday March 07, 2019 @10:48AM (#19328959)
There's a cool isometric stealth game called Robin of Sherwood, where you can follow what the guards are doing. A guard might accidentally stumble upon someone you killed, be alarmed, look around, run off to warn their commander, then the commander organises a search for the culprit, with lots of guards explicitly looking for you everywhere. Eventually if they can't find you, the whole thing dies down and everybody resumes their original duties, assuming the dead body was just a fluke or something.

Also, if they find someone you merely knocked unconscious, they assume they'd been sleeping on the job. If you tied them up, they free them, but I forgot if they search for you or if they just assume they got accidentally tied up somehow.

Also, you'd think they might raise the alarm if they find less and less guards present at their assigned post.

Re:Ask HN: Game devs, what is the hardest part about designi... by heyyyouu on Wednesday March 06, 2019 @03:42PM (#19322549)
Thanks for sharing this. It's a great illustration of why playtesting (and testing in general) what we think will work is always a good idea.
Re:Ask HN: Game devs, what is the hardest part about designi... by bryondowd on Wednesday March 06, 2019 @03:17PM (#19322344)
Depends on the game. The entire genre of strategy games could probably benefit from smarter AI. More so for 4X style games. Mostly, the current AIs act like players, but make terribly inefficient decisions that get 'balanced' at various difficulty levels by throwing more resources at them or other advantages. So the games vary between being absurdly easy, to being difficult simply because the AI cheats, and even then, it doesn't usually leverage its advantage well. As an alternative, people play against other players, but with long-running strategy games, this adds real life logistical problems. An AI that plays like a human, and can be adjusted for stronger or weaker play would be amazing for the 4X genre. Perhaps difficulty adjustments could even be reverse to giving the player 'cheats' or free resources on lower difficulties if that's easier than throttling the AI.

Outside of those games, I'd say any game with competitive multiplayer could benefit from smart human-like AI. Some people play games for a challenge. The unpredictability of other humans is most of the fun, whereas playing against a typical game AI is just a matter of figuring out how it works, where it fails, and then taking advantage of that failure repeatedly. Considering the market for competitive online games, there's likely a similar market for competitive AI games.

I suspect the real barrier that is that it's a lot cheaper and easier to sick players on one another than to make a challenging human-like AI.

Re:Ask HN: Game devs, what is the hardest part about designi... by scarejunba on Wednesday March 06, 2019 @04:02PM (#19322755)
TA:Spring had these AIs that would exploit shit in a terribly annoying way. Like, you had ballistic projectiles that would take a while to arrive at the target, and your units would fire them. Well, the enemies had them too, except the AI would exploit its superior micro by firing off the projectiles at maximum range and maximum inbound velocity and then immediately shifting outbound.

You can't move your bloody units as fast as them so your units would fire at the place where they were 'going to be' within the range or at the place they were at the limit of the range.

Utterly infuriating as a player. I know it doesn't have to be that way, and the path could be closer to strategic decision making, but it's a funny example of one of those AI decisions that wasn't constrained in one way.

Re:Ask HN: Game devs, what is the hardest part about designi... by bryondowd on Wednesday March 06, 2019 @05:06PM (#19323383)
Yeah, that sounds less like a 'smart' AI gone wrong and more like a typical cheating AI. In this case, instead of an actual cheat it's just able to act at superhuman speeds. Similar to the speculated issue with the Starcraft AI. Even though that one was constrained in actions per minute, it wasn't really constrained the same way a human is.

In general, the smarter you make the AI, the more you have to work to give it constraints to keep it from cheesing the player the same way players often cheese dumb AIs.

In the case of an RTS, you can force the AI to manipulate a cursor and view area the same way a human does. Only give it partial information about areas outside the current view. Put limits on cursor manipulation. Maybe add a fudge factor that makes its clicks land randomly within X distance of its target, where X is based on the average speed the cursor has moved in the last half a second. That alone would make it harder for it to give orders to a bunch of individual units fast enough to out-micro a player, and you're really just giving it constraints similar to a human operating a mouse.

Re:Ask HN: Game devs, what is the hardest part about designi... by PetahNZ on Wednesday March 06, 2019 @04:34PM (#19323067)
Which Spring AI was this? I don't remember any of them being any good.

I made a Spring AI back in the day (it wasn't very good either).

Re:Ask HN: Game devs, what is the hardest part about designi... by scarejunba on Wednesday March 06, 2019 @05:25PM (#19323542)
I saw it do it with BA, but I don’t remember the name. It was many years ago. Perhaps RAI? Was that a name?
Re:Ask HN: Game devs, what is the hardest part about designi... by mcv on Thursday March 07, 2019 @10:40AM (#19328876)
In clicky action games, the AI has a definite advantage over human players, because it's not encumbered by an interface. For turn-based strategy games, that advantage disappears. Outside of heavily researched abstract predictable games like chess and go, I haven't seen any games where AI can beat a skilled human player at strategy.
Re:Ask HN: Game devs, what is the hardest part about designi... by blattimwind on Wednesday March 06, 2019 @03:33PM (#19322463)
There are actually various anecdotes about game developers playtesting "smart AI" where playtesters came back with very negative impressions, because e.g. a couple NPCs giving suppressive fire while another group flanks you quietly felt to players like the NPCs were cheating.

I believe one of these anecdotes was about the AI in F.E.A.R. and their solution was to add very clear callouts to the NPCs whenever the NPC made a decision ("Flanking, cover me!"). I think FEAR also had the concept of a director AI which handed out "tickets" to NPCs for attacking the player; an NPC without a ticket couldn't attack the player, so this limited how many NPCs engaged simultaneously.

I remember AI in Jagged Alliance 2 frequently flanking you and at first that was very frustrating; the stock (1999) JA2 AI is much better than every newbie to the game. You really had to think tactically and think about your moves and approach to be successful in that game. If you just go in "guns blazing" the AI will outmaneuver and outgun you. AI in that game was sometimes quite adept with grenades and such as well.

Edit: Talk about FEAR AI, might/might not be related https://www.youtube.com/watch?v=BmOOrh5lq7o#t=1m44s

Re:Ask HN: Game devs, what is the hardest part about designi... by muzani on Friday March 08, 2019 @04:39AM (#19336253)
Honestly the main reason I enjoyed XCOM (the new one) over X-Com (the old one) was that AI felt a lot smarter than me. I found it entertaining in how clever it was. You'd think you set up a clever perimeter and all and oops, got flanked by a little Sectoid hiding behind a post box.
Re:Ask HN: Game devs, what is the hardest part about designi... by ddebernardy on Wednesday March 06, 2019 @03:33PM (#19322468)
Please... head over to Paradox Interactive and seek to join their team if you're bummed out to a point of thinking that. (And you're welcome to link to this comment in your application.)

Their audience is basically desperate for a better AI that does better strategic and tactical thinking rather than pathfinding, weighted decision trees, and a couple of high level heuristics.

Here's what I and I'd gather many others would want instead: for the AI to go through the dev game logs, and perhaps even end user game logs, and then learn from what humans are doing, so they behave more like them. And then re-inject that into the game so it's something of a challenge to play without needing to give the AI some serious bonuses while playing.

As things stand the AI is so bad you can start as a purposely broken one province nation and still turn into a major power. [0]

And if you're thinking "no, the AI will trash them and they won't find it fun," here's a thought: right now, the AI is so bad that the only way to have some fun is to give it insanely large bonuses. But much like in a game of Go, as a player I'd much rather get those boosts myself to overcome a much stronger AI opponent.

The same holds for other 4X games, like Civ.

Playing Chess or Go against a computer used to suck. It no longer does thanks to how much better AI got.

[0]: https://www.youtube.com/watch?v=qJhyZ-9ktpo

Re:Ask HN: Game devs, what is the hardest part about designi... by lainga on Wednesday March 06, 2019 @04:26PM (#19322977)
My understanding of the latest-gen Pdox games is that parts of the AI are shared at the level of the Clausewitz engine, and that Clausewitz in turn was developed for EU3, but designed as an extremely general engine for 2D games, not even just GSGs. So in some ways the HOI4 AI, for instance, is using techniques that might have worked great for EU3 (and, in my experience, worked fairly well in Victoria II, if you treat the economy separately), but are now unsuitable.

I'm interested as to whether they've improved the AI in Imperator - not that I'm going to buy it - as the Jomini sub-engine was supposed to streamline a lot of the "cruft" that had built up between 2007 and now.

As to your point RE: OPMs going on world conquests, I think that's part of Paradox's cross-franchise decision to move away from historicality and towards more "casual" gameplay (i.e., map painting), not just between EU3 - 4 but HOI3 - 4 as well; and ultimately has more to do with their balance choices for the player than the strength of the AI.

I do think that, as it stands, HOI4 and EU4 are at the same level as certain competitive games, where instead of trying to play historically, many players just wait for the next patch's balancing to over-correct in favour of some set of poor AI choices, and possibly for Reman's Paradox to explain it to them, and then exploit that to their advantage. Making the AI more competent, and removing the need for balancing and overcorrecting, would remove that perceived ability to exploit a broken enemy, and thus some of the desire from the playerbase for map-painting over historical accuracy.

Re:Ask HN: Game devs, what is the hardest part about designi... by bryondowd on Wednesday March 06, 2019 @06:04PM (#19323908)
The only Paradox game I've played is Stellaris, which has god-awful AI. Looks like it uses the Clausewitz engine, so perhaps that's the reason. But the AI empires are terrible at balancing their economies, and it doesn't take long for the player to completely outstrip them, even when giving the AIs advanced starts and bonuses. And then the military AI isn't very good, to the point that when it is outmatched by a stronger opponent, it basically sits and waits to be slaughtered.

The only remote challenge comes in the form of the endgame 'crisis' which is basically an empire that appears late in the game with huge armies and has no economy, just scripted reinforcements and possibly some scripted counters from other special AI entities. None of the regular AI empires will have advanced enough to even think about fighting it, so it mostly serves as a check to see if the player has played efficiently enough to that point to stop the threat, and marks a good point to end your game once you have.

The scripted events make for a somewhat interesting game, but if they could provide an AI that actually made the universe feel like a competition in the early and mid game, and like the other empires were a factor in the end game, it would bring the game to another whole level for me. Of course, they'd probably have to fix their general game balance as well, which an a whole other issue.

Re:Ask HN: Game devs, what is the hardest part about designi... by ddebernardy on Wednesday March 06, 2019 @04:34PM (#19323066)
> As to your point RE: OPMs going on world conquests, I think that's part of Paradox's cross-franchise decision to move away from historicality and towards more "casual" gameplay (i.e., map painting)

TBH I'm actually fine with that, so long as the AI can end up doing the same. I'm still waiting for an AI Ulm to vassalize large chunks of the HRE and become emperor.

Re:Ask HN: Game devs, what is the hardest part about designi... by mindvirus on Wednesday March 06, 2019 @04:05PM (#19322776)
I'm not much of a chess player, but one thing I've wondered is whether the games against Chess AIs are interesting for good players. Do they feel exciting as though you were playing against a similarly skilled human player? And can you distinguish between an AI and a similarly skilled player very easily?
Re:Ask HN: Game devs, what is the hardest part about designi... by ddebernardy on Wednesday March 06, 2019 @04:26PM (#19322974)
The thing with Chess (or Go) is that unless you've a club in your area or a skilled relative, you're playing alone against an AI or playing online.

It's of course much more exciting to play against skilled human players. In particular your parents or your childhood friends while growing up. But unless you're living in some large city you might not find many other offline options after you start beating all of them.

That leaves you with a choice between going "pro" to some degree or another, playing online against other people, and playing against an AI (online or not). I'm honestly at a loss to give you an unbiased view of which is most interesting, since I've seldom found the time to play Chess in the past decade or two. What I do know though is that no bot gives you good social interactions.

Re:Ask HN: Game devs, what is the hardest part about designi... by muzani on Friday March 08, 2019 @04:54AM (#19336328)
Much of the time it's too predictable, to the point it's no longer a simulation.

For example, something like Battle Brothers, where the AI tends to attack the least armored ones. You can put a group of poorly armored people on one side of the map and then put heavy damage ones on the other side. The right side draws the combat which gives the left side space to take out the dangerous targets. Humans would spot the tactic straight away. Setting up I exploitation tactics is not so fun for some people.

A worse case scenario are the FIFA games. Every release has some untested exploit. In some, the defenders often push too high and you can score goals from halfway across the field easily. In some, the goalkeeper gets confused when passing the ball right in front of goal. It becomes less a football sim and more how to get formations that optimize exploits.

Re:Ask HN: Game devs, what is the hardest part about designi... by lainga on Wednesday March 06, 2019 @03:23PM (#19322395)
Do you think there is a class of players who don't want to feel clever for outsmarting a predictable AI?
Re:Ask HN: Game devs, what is the hardest part about designi... by Someone1234 on Wednesday March 06, 2019 @03:29PM (#19322437)
All players want to win. The level of difficulty is equal to the level of accomplishment, but games have to be made for the average rather than the exceptional, so many better than average players won't be challenged by the difficulty.

Nobody is going to invest the resources into a real AI just for the hardest difficulty modes. If it cannot be used on Easy/Normal, it simply isn't happening.

Re:Ask HN: Game devs, what is the hardest part about designi... by blattimwind on Wednesday March 06, 2019 @03:51PM (#19322641)
> Nobody is going to invest the resources into a real AI just for the hardest difficulty modes.

Which is really sad because "hard" difficulties in most games just mean that you have less health and NPCs do more damage or their "cheat factors" are turned to 11. They're still the same stupid NPCs as on "easy", but now they just headshot you behind cover and have zero recoil / perfect accuracy. It's technically difficult but not really fun.

One of the most obvious examples of this is GTA 5 where all NPCs are equally dumb, but "harder NPCs" just mean that they tank huge amounts of damage, while they have very little aim delay and essentially perfect accuracy. Due to various bugs in the game they'll often shoot through walls or even entire buildings: technically hard, but not fun.

Re:Ask HN: Game devs, what is the hardest part about designi... by bryondowd on Wednesday March 06, 2019 @05:36PM (#19323636)
The "tank huge amounts of damage" thing has annoyed me going back to the old RPG games on NES and SNES. How do we make the game harder as the player progresses? Give enemies more HP and DMG values. Ok, how does the player combat this? Have him aquire levels/skills/equipment that increases his own DMG and survivability to restore things to the same balance they were earlier in the game. Repeat ad nauseum. Some variations restrict the player enhancements to DMG so they're forced to chip away at enemies in long dull fights. Others restrict survivability, which tends to result in shorter, more random fights, while others allow near infinite enhancement, but lock it behind boring, redundant grinding.
Re:Ask HN: Game devs, what is the hardest part about designi... by blattimwind on Thursday March 07, 2019 @08:36AM (#19327868)
Vanilla Skyrim is an especially annoying specimen in this category, because it has this weird "S curve". With low levels most enemies are way stronger than you (ok, that's good, a level 5 player shouldn't be able to defeat city guards, for example), then there is a "growth phase" up to ~level 40-70ish (depending on play style) where the player is on par or better than NPCs, and after that the player's abilities level off and NPCs continue to grow stronger, so a high level player has a hard time again against NPCs of a class that she could previously defeat easily.

Which makes no sense at all.

Luckily for Skyrim the game thrives on mods anyway.

Re:Ask HN: Game devs, what is the hardest part about designi... by bryondowd on Wednesday March 06, 2019 @03:48PM (#19322601)
Considering how many successful games are released targeting a niche market, there's probably a pretty sizable niche market of 'better than average players' that some studio could take advantage of.

Market size is only half the equation, the other half is the cost to develop the feature. As methods and technology improve, the cost to make a smart AI for a complex game system should decrease. As the cost decreases, you need less of the overall gaming market to make a return. Might just be a matter of time before somebody takes a gamble on a tough AI, has a huge success, and then everyone starts to emulate it.

Re:Ask HN: Game devs, what is the hardest part about designi... by trexmix on Thursday March 07, 2019 @08:32AM (#19327844)
But smart AI isn't fun to play against. Take Chess- AI is smart to the point of domination against players. In a FPS setting you just have an aimbot. In a RTS game you would have an AI with passable macro and insane micro. I think the only real chance of a smart AI being fun is in a pure strategy game (I believe it's GalCiv 2 with the epic story about a backstabbing, scheming AI).

Smart AI is easier to make than a mediocre, fun AI. Optimality is is a clear goal. Fun AI is less clear and requires a unique blend of technical and design expertise.

Re:Ask HN: Game devs, what is the hardest part about designi... by bryondowd on Thursday March 07, 2019 @10:01PM (#19334744)
Seems like you're conflating Smart AI with an optimal game playing algorithm. An aimbot isn't hard time create, sure, but it's not exactly smart, either. Nor is it fun. I agree it's harder to make mediocre but fun AI, and that's what current shooters do. The point is that there's theoretically a level above that, harder to achieve but not impossible, where the AI behaves like a human would. A reasonable balance of predictability and unpredictability, skill, strategy, but not perfection.

In a real time strategy, it seems we're approaching that level with that StarCraft ai. Need to perhaps restrain the ai's ability to micro by fuzzing it's ability to control quickly and precisely in bursts, and then continue to advance it's strategic ability, but I expect it'll get there eventually.

In the case of shooters. It might involve giving the AI a noisy view of the game world, to force it to approach the problem the way a human does. Humans don't just have an accuracy rate or a timer between an event entering their screen and their ability to shoot at it. A human has to filter through visual noise to notice a target, and decide how to engage. A human has to use an arm and hand and muscle memory to manipulate a mouse to get bullets on target. Those are all imperfect controls, with a certain amount of uncertainty between intent and action. All that is further influenced by how prepared the human was, how much they have to adjust their previous plans, or recenter their attention.

It's a difficult task to identify all the things that actually make a game difficult for a human and make sure the AI faces a close approximation of the same problems. Then it's even more difficult to get an AI to a point where it can compete on a human level, not to mention various human levels.

That doesn't mean it's not possible or not worthwhile.

Re:Ask HN: Game devs, what is the hardest part about designi... by wst_ on Thursday March 07, 2019 @01:09PM (#19330438)
That's why smart AI must also have smart scaling factors. Maybe some randomness. Maybe some imperfections, like players do. I think we should design the best and smartest possible AI and scale it down for average players. Currently we have dumb AI boosted for advanced players. And boosted very naively - by giving them more hp or make them deal more damage.
Re:Ask HN: Game devs, what is the hardest part about designi... by lainga on Wednesday March 06, 2019 @04:10PM (#19322826)
How does that fit into games like Dwarf Fortress where "fun" is in losing? Does winning count as achieving whatever goals the players set for themselves before reaching game-over?
Re:Ask HN: Game devs, what is the hardest part about designi... by mikekchar on Wednesday March 06, 2019 @09:37PM (#19325147)
Some players play DF with specific goals in mind. Others play in order to have a story like experience. In the latter case, the "fun" in losing is only "fun" if it creates a kind of dramatic tension. DF is also unusual in that worlds are intended to be played over and over again. "Losing a game" only adds more interesting history to the world, so "winning" and "losing" loses a lot of meaning. What's "fun" is playing again and having that historical "loss" influence your next game.

Like I said, though, many players choose a goal oriented play through. Achieving that goal is a win for them (and often they abandon the fortress and start a new world afterwards). I remember one person bitterly complaining on the forums that the game was too easy because they had already won the game. After they succeeded in becoming the mountain home for their civ, they felt the game was over. Sometimes it's hard to explain other ways to play games ;-)

Re:Ask HN: Game devs, what is the hardest part about designi... by rishav_sharan on Wednesday March 06, 2019 @10:37PM (#19325351)
Not 8f you are playing Dwarf Fortress. Losing is fun :)
Re:Ask HN: Game devs, what is the hardest part about designi... by xg15 on Wednesday March 06, 2019 @02:55PM (#19322145)
I'm curious about that. Keeping it dumb of course makes sense for adversarial uses - if the AI is you enemy. But I could imagine there are scenarios where the AI is on your side - e.g., as a support player, NPC or pet. Would a smarter approach be more useful in such a game?
Re:Ask HN: Game devs, what is the hardest part about designi... by nkrisc on Wednesday March 06, 2019 @03:01PM (#19322202)
Even if the AI is friendly being able to predict their behavior is still desirable. Nothing worse than friendly AI ruining your game because it went off and did something you couldn't anticipate.
Re:Ask HN: Game devs, what is the hardest part about designi... by c0nducktr on Thursday March 07, 2019 @12:49AM (#19325832)
What if the friendly AI called out it's plan, and the player then could have an agree/disagree option with the proposed strategy?

If done well, it could feel much more like you're playing with a human partner.

Re:Ask HN: Game devs, what is the hardest part about designi... by nkrisc on Thursday March 07, 2019 @11:41AM (#19329491)
Then, sure, because it is now predictable. Alternatively, I don't think it would be an issue if the AI was good enough that it could do unpredictable things that were actually intelligent (which would pleasantly surprise the player) or if the unpredictability and occasional awfulness of the AI were somehow an intentional challenge of the game.
Re:Ask HN: Game devs, what is the hardest part about designi... by jolmg on Wednesday March 06, 2019 @03:01PM (#19322204)
If it's too smart on your side, wouldn't it do all the playing for you? For example, you enter a room full of enemies and your AI partner kills them all the second they come into view. What's the point of playing, then?
Re:Ask HN: Game devs, what is the hardest part about designi... by xg15 on Wednesday March 06, 2019 @03:10PM (#19322291)
True - but that would require that would require that the AI partner is both overpowered (they can kill the whole room without risking to take damage) and completely ignores me.

maybe an alternative appraoch could be to have an AI that tries to figure out what you're trying to do - and then help you with it.

E.g., if the two of you have frequently witnessed a certain enemy launching an attack that can only be deflected by a particular shield spell, an AI healer could "learn" to cast that spell in advance when they see such an enemy.

Re:Ask HN: Game devs, what is the hardest part about designi... by KineticLensman on Wednesday March 06, 2019 @03:11PM (#19322294)
You should also prioritise credible behaviour that will keep a gamer immersed. If you can achieve this with simple rules / tables etc that might be better than a full-blown AI.