How to use artificial intelligence in games?