The Daily Click ::. Downloads ::. Tutorial ::. State based AI system for multiple Actives
 

State based AI system for multiple Actives
Author: butterfingers Submitted: 2nd September, 2013 Favourites:0
Genre: Tutorial Downloads: 135
Rated:


Hello!

This is my first ever article!

In working on Ur Not A Hero, I've been trying develop a decent way of doing AI.

Now, while using a fastloop and comparing the index of the fast loop to a spread-value generated ID in an actives is a good way to deal with AI on a small scale it's left me with a problem that I've not seen a solution to on here:

If I have 2 actives, Baddy1 and Baddy2 and they both behave in exactly the same way, but that behaviour is governed by a particularly large and complex fast loop, when I want AI for Baddy2 I have to copy and paste the entire fast loop for Baddy1 and change all the conditions so that it works for Baddy2.

As well as being inefficient, this takes AGES.

So, why can't you have one AI fast loop that can be used for multiple different actives?

Well, you can, but it takes a bit of setting up.

In the attached tutorial MFA you can see that I have 2 different enemys - RED and GREEN.

They are controlled individually, but using 1 AI fast loop.

I realise that the AI in the example is simple (and could be done without the whole fastloop thing) but the difference is that the system I've presented is flexible enough that you could expand it to very complex AI systems, with multiple states.

This is pretty hard to explain, but I've attached a commented example, that should demonstrate what I'm blabbering on about.

Firstly, I haven't really seen any AI stuff like this, so I'd be really interested to get some feedback on whether people have better ways of doing this,

Secondly, if anything isn't clear then feel free to hit me up in the comments or whatever and I'll try and explain better!

Review This Download



  


http://www.peanutbutterfingers.co.uk/tobelinked/AI%20EXAMPLE.mfa (300 kb )



No comments have been posted for this download.

 



Author

Favourite



Advertisement

Worth A Click