Sign in to follow this  
m_waddams

Lode Runner guards A.I.

Recommended Posts

Hi everyone,

The guards in my Lode Runner remake are a little too clever I guess.
In the original they would keep doing stupid (strange?) things,
like 'fleeing' from you when you're both on the same ladder...
I'm thinking maybe the guards should 'retreat' to their starting positions
when they can't reach the lode runner. For instance in level 9 (see below),
it's almost impossible to finish (it can be done, luring them to higher ground).
Any ideas, or existing algorithms for lode runner games? (not the original,
I don't want them that stupid : - )

[url="http://java-expert.nl/games/test/loderunner.zip"]Download Lode Runner[/url]


[img]http://java-expert.nl/games/test/lr9.jpg[/img]

Share this post


Link to post
Share on other sites
Do you have them evaluate their path to the player on every update? A very easy way to dumb them down just a little is if they only plan their paths every second or two.

They should still continue to the point they intended to go the last time they "thought," but the delay in changing means the player might get a little breathing room by quickly slipping through between updates.

You can also have them think again every time they reach their target point so they're more responsive when they're hot on the player's tail, but a good evasive action would give you some distance and let them turn "normal" again.

Share this post


Link to post
Share on other sites
[quote name='Haps' timestamp='1306762788' post='4817494']
Do you have them evaluate their path to the player on every update? A very easy way to dumb them down just a little is if they only plan their paths every second or two.
[/quote]Yeah, but they would still be too clever. Sometimes they need to take the long way round. They have to go up (see picture, or [url="http://www.youtube.com/watch?v=Z3mrMiqvsDk"]http://www.youtube.c...h?v=Z3mrMiqvsDk[/url], the stupid way they behave in the original).

Share this post


Link to post
Share on other sites
Sorry, my suggestion was for dumbing down the AI in general, I didn't take your level into consideration.

Looks to me like they can tell when they're going to sandwich the player while on a ladder, and reroute any above you to attack from below instead. I'm not too familiar with the game but I assume that's why the player in the video waits for one to get low enough before climbing.

Since the level itself has that ladder as a key limitation, there may not be much else to do except the same thing.

Share this post


Link to post
Share on other sites
[quote name='Haps' timestamp='1306764662' post='4817510']
Looks to me like they can tell when they're going to sandwich the player while on a ladder, and reroute any above you to attack from below instead.
[/quote]But then why don't they actually sandwich? My guards would, and it still wouldn't solve anything...

Share this post


Link to post
Share on other sites
[quote name='Milton Waddams' timestamp='1306765033' post='4817511']
But then why don't they actually sandwich? My guards would, and it still wouldn't solve anything...
[/quote]

I'm guessing it checks for that specific condition, where two guards are using or intending to use the same ladder that the player is on, and there are no paths for escape. Then it probably restricts the space above the player so they can't consider climbing down. Imagine the player has an invisible wall above them when that happens in that video, and you can see the AI move to find the next shortest route - Dropping off the top and attacking from the bottom. With a shorter ladder or with other floors in between, the effect would be less noticeable.

A programmer might create little failsafes like that to prevent completely unwinnable situations that happen too often in their game. If the player had the opportunity to avoid the trap, sure it's their own fault for getting stuck. But when the design of a game or level makes these problems happen way too easily, you'll either have to redesign things or make an exception so the player doesn't get too frustrated at it. If that ends up making the level 'too easy' as opposed to 'ridiculously unfair," most designers might prefer cutting the player a break.

Of course, I'm only guessing based on a minute-and-a-half clip for a game I haven't played, so if anyone else wants to correct my assumptions, please do!

Share this post


Link to post
Share on other sites
[quote name='Haps' timestamp='1306767800' post='4817527']
[quote name='Milton Waddams' timestamp='1306765033' post='4817511']
But then why don't they actually sandwich? My guards would, and it still wouldn't solve anything...
[/quote]
A programmer might create little failsafes like that to prevent completely unwinnable situations that happen too often in their game. If the player had the opportunity to avoid the trap, sure it's their own fault for getting stuck. But when the design of a game or level makes these problems happen way too easily, you'll either have to redesign things or make an exception so the player doesn't get too frustrated at it. If that ends up making the level 'too easy' as opposed to 'ridiculously unfair," most designers might prefer cutting the player a break.

Of course, I'm only guessing based on a minute-and-a-half clip for a game I haven't played, so if anyone else wants to correct my assumptions, please do!
[/quote]
Thanks for thinking along :)

I'm not sure I want to implement such crazy failsafes.
I think I'll have them go to their starting positions (which happen to be nicely out of the way), and move around only a bit .

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

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

Create an account

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

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this