Topic: Request for suggestions of where to learn basic AI programming

Hi folks, I really should learn how to write shorter topic subject lines, but that's another story. Sorry about this one. Anyway, what I wanted to ask was if anyone had any suggestions of where to learn basic AI programming techniques such as fsm's, fuzzy logic and stuff like that. I did by a kindle book on the subject, and have searched on the net a fair bit, but all the techniques seem to have a C++ bias and/or are very visually oriented. I know this is to be expected, and am neither surprised nor annoyed by this, but wonder if there is something out there that can be more easily transfered for use in bgt. I'm looking to abstract some or all of the npc AI in games that can be written using the 2nd and 3rd game programming tutorials in the bgt help file, so arcade and adventure games. Thanks in advance for any help.

Kind regards,

Re: Request for suggestions of where to learn basic AI programming

Well, on reading a little further, into a book on game design patterns, it seems I am asking the wrong question. What I am really after is a very basic introduction to that very thing, game design patterns, that is.

I'm talking about things like the state pattern, component pattern, flyweight, type object and so on.

I think I get the state pattern up until you move the states out of the enum and into classes, but that's as far as it goes. The component pattern totally confuses me. It's something to do with interfaces, isn't it?

The other big question, of course, that this raises is, how much of this is useful for games written in BGT? I won't, for example, be playing with graphics at all.

I understand that this may be a question of semantics and, if it is, I'd be very interested in people's oppinions. I don't want to start a war, though. big_smile
As far as my understanding of BGT goes, the only things I am a bit hazy on are the more advanced topics such as operator overloading, the use but not implementation of interfaces and inheritance.

If it's OK to ask these kinds of questions here, I'll look forward to hearing your responses. If not, then I apologize and will act in accordance with any suggestions.

Kind regards,

3 (edited by Genroa 2015-04-29 16:41:42)

Re: Request for suggestions of where to learn basic AI programming

One thing I noticed in your first post : "are very visually oriented". Game programing is quite never choosing between graphic or sound game. The screen or the audio output is the interface with the player, and the controller/keyboard+mouse is the input. But inside the system you programed, it's exactly the same. You have to adapt your game to be playable with just an audio output, but inside, it's the same.
So if an AI is made by looking at directions and all, your system should be able to do that, no matter if it's an audio game or not. smile

What does an AI do, for example? Looking in forward and try to see if there's an enemy less than 10 meters away? Why couldn't you do that with an audio game? You can do all this.

I'm not a pro in AI programing I only know some words like state machines and all. But I can help you with inheritance and interfaces smile

Let's first talk about operator overloading : when you program, your code often do comparisons, for example. So know if "th object which was given to the function is the one you are looking for", for example. And, maybe for you two "People objects" are the same if their name, age and weight are equal. But for the language, myObject == anObject will by default check if their references are the same. Their adress in memory. So, you override functions (with inheritance) like opEqual, which define the behaviour of an object when compared to another. The result is a boolean and the tests are made inside.

Another example is the vector function : if you want to add two vectors objects to get a third one, the language will not let you doing this. Adding an object to an other? That makes no sense. But if you override the opAdd function to tell it "theses objects can do it!", it will be ok. smile

Why using inheritance? Because whatever the game you are trying to build, the goal is always the same : representing a world only with objects. Objects with attributes and rules. But a frog is an animal, like dogs are. They share a certain number of legs, a weight because they are solid, etc. So, you may see an Animal class and a Dog class inheriting from it. Why doing this? Because adding new Animal children like a Cat class can then be done without having to rewrite what cats share with other animals. And if you correctly cut all in classes, you can modify the behaviour of all your animal by modifying one line. wink
What are interfaces? You can have a class which inherits from two classes. A dog is an animal, nothing more. But what if you want to know which objects may explode? Barrels may explode, cars may explode, and they share nothing. So, you create interfaces which will represent some shared behaviours where classes are made to give a structure to the objects. You can find all theses examples in every game. smile

Programing is in two parts: you create the classes and interfaces, the models of your world, and in an other part you play with them.

For AI, in my BGT game engine project I didn't made them for now, but it's planned. For now, I leave to developers the choice to program them as they wish, but I give them a lot of "tools". The system let objects know what is in an X Y position, their position, what are the objects in the game, and all.

Re: Request for suggestions of where to learn basic AI programming

This is great information, thank you. I really appreciate the time you took to answer in such detail.