How to make Smart Guys...

Blitz3D Forums/Blitz3D Programming/How to make Smart Guys...

nerdy_kid(Posted 2008) [#1]
How would somebody make an entity smart? Like in Age of Empires, the guys walk around stuff, and the like. How do they do that?


GfK(Posted 2008) [#2]
Its called Artificial Intelligence and its a vast subject.

You might want to start off reading up on path-finding.


nerdy_kid(Posted 2008) [#3]
Vast subject! I think I'll wait a few years before I try tackling that stuff...


boomboom(Posted 2008) [#4]
its not that complicated, just learn how to use functions and types well, and you can start building decent AI with just abit of common sence.

This is my AI loop for a simulation of a load of ants going out, looking for food, and if they then found it brought it back to the nest. This is most of the code involved, apart from a sub routine handeling the way the ants move (just move in z):



'Hive' is my type for each individual ant, this code is run for each ant every turn to determin what they are doing this loop.


Jsoren(Posted 2008) [#5]
Theres a good AI function in the Tanks game in the code archives, that helped me out alot when i first started my AI Lib.