Trying to Make a Stealth Base Game (Enemy AI Help)

Yaustedia

New member
Hi ya'll, first post I guess. I just had a question regarding AI for enemies.

I want to make a stealth based game and have the same idea as Metal Gear had on the NES, where the monster will have a specific pattern of moving until a player is seen causing them to move towards the player at all cost. if anyone could help me out on this thank you so much!
 

Yaustedia

New member
also just realized I may have posted in the wrong area of the forums, if so apologies on that one I'm fairly new here.
 
also just realized I may have posted in the wrong area of the forums, if so apologies on that one I'm fairly new here.
You're fine, I already have a way to get the player to follow the enemy if caught as well as the easier pattern stuff... willing to share that code when I get back to my computerso I can share it
 

tbizzle

Well-known member
 
Ahead of my game huh? No seriously though thanks dude! And I hope this helps you Yaustedia šŸ˜€ if you still need help with anything just update the post and I'll try to help when I see the update
 

tbizzle

Well-known member
Ahead of my game huh? No seriously though thanks dude! And I hope this helps you Yaustedia if you still need help with anything just update the post and I'll try to help when I see the update
I don't think this script is complete. Also don't know which version it's for, but its good to mess around with anyways.
 

JamesNES

Well-known member
I did something like this, basic idea was first I snapped enemy movement to the collision grid, ie 16x16. Then every frame I'd run a line of sight check in front and to the sides of them, checking each tile to see if it was solid. When it hit a solid, I'd check the rectangle from the enemy to that solid block and see if the player was in that rectangle. If they were, I'd make the enemy run in that direction. Might be a bit advanced if it's your first time doing assembly stuff.

Once they were alerted I had it checking all four directions so they could chase the player around but it was too hard so I just made them keep running until they hit a wall.

mgs.gif
 
Last edited:
Top Bottom