I couldn't decide on one thing to write for the competition, so I'm going to compile a bunch of great Mini-Articles I have written, all feature-packed and totally awesome! Hope you enjoy them!
Developing Your AI
Intro: Yes, yes, I know. I'm really hyped up on AI. But is that so wrong? AI is a crucial part in your game, and I've seen plenty of games with extremely idiotic AI that don't make any sense at all. Frankly it's sickening. But this time I'm not going to give you my codes for AI. You're going to learn to create your own!
Firstly, what exactly do we want AI to be like? This is a question with an answer that depends on your game and your needs. Maybe you need smart AI for a stealth-based game. Perhaps you need odd alien AI for another one of those 'Kill All Aliens Because They Have Taken Over the World' games that everyone has done already but you decide to do anyway. Whatever you need can be accomplished. But how? Let's run through the basics, shall we?
Your AI needs to be realistic. Fields of view, command stacks, etc. make for great AI!
They should have their own "personality" that defines them as "people". Some may be wimps, others may be fearless, and others may just be mindless drones.
The AI should be randomized such as real people would be. Not everyone in the world is Caucasian or African.
Those are just a few points. It's up to you as a developer to decide what else to add to the AI. So let's start creating some of the basics.
Realism
Field of View - No one can see what's behind them in real life. So you need to create a, let's say "cone", that the AI can see in. There are many way's you can accomplish this. One way is to use an object with collision checking, however this can lead to complications with seeing through walls and other objects. One of the best ways is to use my absolute favorite command, collision_line. It's a great code we can use to create outstanding FOVs. You should do a little flipping through the manual to understand this code a little more, but here's a few tips:
- Use the lengthdir_x and lengthdir_y functions. They're great for seeing in only the AI's direction!
- Check to make sure the AI can't see through solid objects unless your game requires this. No one can see through walls in real life. If you can, please contact the government right away as you could be a crucial part in helping your country.
It's up to you how you make your field of view as everyone has their own style.
This article is a placeholder. More to this article will come.
.
Users logged in:
Comments
Loading comments...