Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

How to tone down overly aggressive A.I.?

Archive: 9 posts


I've had a few people test themselves against the A.I. bots for my new lightsaber level and they've agreed that they're just too good. The idea is that they act as stand-ins because it's a versus level, but I figure people won't always have somebody to play against and they'll still want to try the level (used the same method in my old level). Anyway, the problem is that they are just way too good at sword fighting because they're using a "look at rotator" instead of aiming by hand the way human players have to. I've tried lowering the strength of their sabers so that human players have an easier time of parrying, and, while that helps, many fights end up with the player and bot almost on top of each other, so parrying stops being an issue and the bots' flawless aim beats the players just about every time.

So my question is, what's to be done about it? How can I give the bots accurate aim without it being too perfect, and how can I lower their accuracy without completely ruining it?


What I've tried so far:
I tried replacing the look at rotator with a joystick rotator hooked to four tag sensors, but that just seemed to make it so the bot aimed in one of the eight cardinal directions instead of directly at the player, but still did so flawlessly enough to be lethal.

I've also tried attaching a joystick rotator in conjunction with the normal look at rotator and hooking randomizers into its inputs. The problem with that was that if the joystick rotator was too weak, it had no effect on the bots' aim but as soon as it was strong enough to affect it, it screwed them up so badly that they became almost useless in a fight.

I've also tried to make them less aggressive by giving them logic to switch from pursue to idle or flee if they get too close, but in practice, they're moving at fast enough speeds that they've already killed the player before they flee far enough to make a difference. Increasing the distance of their idle and flee logic would leave them standing out of range, ineffectually waving their sabers at the player.
2013-04-04 08:40:00

Author:
Sehven
Posts: 2188


i cant really suggest much without knowing exactly how it plays, but from what you described my first thought would be to lower both the look at rotator speed and strength. i'm not on lbp2 much these days but feel free to add me on psn and i may be able to take a look2013-04-04 08:59:00

Author:
evret
Posts: 612


i cant really suggest much without knowing exactly how it plays, but from what you described my first thought would be to lower both the look at rotator speed and strength.

The problem with that is these weapons push off each other (when an impact with another weapon is detected, a look at rotator is triggered, but it faces the opposite direction, so the saber tries to spin to point the opposite direction). The strength of the rotators are balanced so that the repel rotator is stronger than the aiming rotator, but the way it ends up working out is that if two sabers come together and one has a stronger aiming rotator than the other, that one will always be able to push the other one away. If I weaken the bots' aim rotators too much, they won't be able to fence at all: their sabers will always give way to the players'. (Note that human players have access to a "strong stance" which uses two aiming rotators for increased strength, which bots don't have access to, meaning a bot is more vulnerable to a player in strong stance, and weakening their sabers even more would make them almost useless).

The problem is that simply weakening them nerfs them too much and it makes them play even less like human players (they're meant to offer a similar experience to multiplayer). The ideal solution would be to keep their saber speed and strength but add a bit of latency (about 0.6s) to the look-at rotator somehow (to simulate a human's reaction time), but I don't think such a thing is possible.

I'm having a little bit better luck with the randomizer thing after tweaking it a bit, so maybe I'll stick with that, but if anybody has any ideas on that latency thing, that'd be great. It'd be best if the saber were always about .6s behind where the player is.
2013-04-04 11:33:00

Author:
Sehven
Posts: 2188


I think adding a bit of time delay in between some of that logic so it doesn't have such instant reaction. Like you said .06s, but maybe have several and randomize them. From .05s up to .11s ?

Would be nice to lessen the perfection of the look-at rotator a bit at times. Somehow tossing it off a few degrees up to a few more. Possibly randomizing that as well. Not sure how you would add that in though..
2013-04-04 12:22:00

Author:
jwwphotos
Posts: 11383


Evret came over to my pod last night and showed me a few possible solutions, one of which I think is exactly what I need! Since the player is on a follower following their bot around, and the enemy bots target the player rather than the bot itself (it was just simpler to implement their aim logic that way), he pointed out that I could use an inverted tag sensor wired into the follower's speed input to cause the follower to lag behind the bot a bit. Since the enemy bots are targeting the player, that means their aim will lag a bit too. I haven't had time to implement it into my level yet, but it's very promising!2013-04-04 20:54:00

Author:
Sehven
Posts: 2188


Ahhh very cool. 2013-04-04 21:31:00

Author:
jwwphotos
Posts: 11383


AIs should be relentless and without mercy.

I'm sick and tired of humans complaining that their central nervous system has a 200 millisecond reaction time and that it's not fast enough. Should have evolved a better one then, fleshbags.
2013-04-05 21:52:00

Author:
Ayneh
Posts: 2454


AIs should be relentless and without mercy.

I think you were mostly joking here, but it's still a fair point. I actually had fun with the tougher bots but everybody I tested them on wanted them toned down. I'm thinking of implementing a variable difficulty setting, though: players who struggle against the bots will continue to face the toned down versions while players who slaughter the bots will face tougher ones. Given that the solution Evret gave me was one that changed the players' bots, it should be easy to implement variable difficulty on a per-player basis rather than a per-game basis: just have the follower run without lag for the better players so the A.I. can target them better.
2013-04-07 20:25:00

Author:
Sehven
Posts: 2188


Hi.
I'm not sure without seeing the level play, but maybe add a randmoiser to give an uncertaintyelement.

The randomiser could maybe be set to come on around 60% of the time and might off the look at rotator, so essentially the AI opponent 'drops' a move. (like a human player missing a move.)
Just an idea
2013-04-08 14:16:00

Author:
Sean88
Posts: 662


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.