Wednesday, January 27, 2021

Computer Controlled Enemies: My Worst Nightmare

Computer-controlled enemies are insanely difficult to program! The game I'm working on right now, Bouncy Royale, is a battle royal (Which basically means the goal is to be the last one standing) where you have to collect powerups, avoid lava, and try to survive longer than everyone else. The "everyone else" is the computer-controlled enemy I'm talking about. At first, I thought making them would be pretty straight forward. All they need to be able to do is find the closest point (Out of five to fifty possible options) in the world, and go to it. I started the code, and after about a half-hour realized that I was in way over my head. The computer would send them to places that weren't even in the world if it sent them anywhere. So then I decided to try to simplify things a little bit. Let's just have them pick one of the options available to it and go to it, no matter how far away it was from them. This worked better, yet they still sometimes go to places that don't exist, and I've seen some of them just freeze in one spot and do nothing. 

No comments:

Post a Comment