Jump to content
  • entries
    334
  • comments
    900
  • views
    258,319

Leprechaun - AI improvements


EricBall

407 views

I've updated the Leprechaun Level Editor with the attached WIP. Load & save to update any levels you have created.

 

There have been signficant changes to the enemy AI. It's now based more on the enemy continuing it's previous action & direction than the previous (broken) hunt/chase logic. I won't say this is the final version, the current AI climbs ladders to the top or bottom rather than getting off in the middle to chase the player.

 

I've also fixed the bug which trashed the screen when the player died, and another which could corrupt the screen if holes existed when the level was reset.

 

I also fixed the difficulty level switches. Both set to B is the easiest with the player moving much faster than the enemies. When both are set to A then player & enemy move at the same speed, but the timer counts down slower.

4 Comments


Recommended Comments

I tried it only briefly, but I couldn't get enemies to fall from ropes.

Yeah, that isn't in the code yet. I've got a bunch of special cases I want to put in including:

1. fall from ropes when the player is directly beneath

2. jump off ladders if the player passes directly beside (tag!)

3. look ahead for drop-offs (only drop off if the player is to that side and below)

4. look ahead for getting off ladders

 

But first I'm trying to see if I can think up some reasonable hunt logic which the enemies would use when they can't go towards the player. The actual issue is how to determine when to stop and go back to normal chase logic.

 

I also want to add some code so enemies avoid overlapping each other. I may also put in the "walking on heads", though it may be tricky to walk over more than one enemy.

 

Hmm... just realized something. If I add in the drop-off look ahead then the enemies won't fall in holes! The law of unintended consequences at work.

Link to comment
Hmm... just realized something. If I add in the drop-off look ahead then the enemies won't fall in holes! The law of unintended consequences at work.

Maybe prevent drop-offs only when the player is above the enemy?

 

Then enemies would avoid holes only when the player has managed to climb a ladder after digging the hole and before it filled in.

Link to comment

Maybe prevent drop-offs only when the player is above the enemy? Then enemies would avoid holes only when the player has managed to climb a ladder after digging the hole and before it filled in.

Duh. You're right. I was originally going to have the enemy walk off the edge on Y equals, but then changed my mind.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...