★ TouchArcade needs your help. Click here to support us on Patreon.

Artificell Intelligence in games

10-19-2014, 07:43 AM
#1
Joined: Oct 2014
Posts: 30
Artificial intelligence in games

How do you design and implement your AI in your games?

Do you have a special designmethod? Neural networks and alike?

We try to make an AI that thinks like we do ourselves. Different steps in the thinking and then evalution of different alternatives. But our AI is always extremely hardcoded for the game that should use it.

Right now we are making an AI that handles "zero - infinite" amount of Unitgroups. The AI should divide all its units into Unitgroups and assign tasks to them.

For example the AI can have several different offensive tasks at the same time, just like a human can.

Designing AI is often a nightmare. Some tough stuff hehe.

We should add that we design strategy games.


Rexopax Software

Last edited by rexopaxdev; 10-19-2014 at 10:49 AM. Reason: Misspelled title
10-19-2014, 04:16 PM
#2
Joined: Aug 2013
Posts: 1,065
In strategy games sometimes people overthink AI. Sometimes "find closest target" is fine for a unit, or "find nearest building" etc.

Some people try to implement very complex AI and it results in it not being fun. Players like when they can see a unit and know what it is going to try and do (thus giving them a chance to counter).

Please follow me on twitter @JamesDestined I post lots of development from both my game creation and professional development.
Time to measure - Brain challenge https://itunes.apple.com/us/app/time...820864672?mt=8
The light box, can you solve it (free) (on google play too)
https://itunes.apple.com/us/app/the-...6300?ls=1&mt=8
10-19-2014, 05:03 PM
#3
Joined: Sep 2013
Location: Auckland
Posts: 114
Most AI in games is still done as state machines, or behaviour trees. I think the main reason is that fuzzy logic alternatives become so complex so fast. And they are not always guaranteed to give the same output, or an output that seems real to human behaviour, plus it becomes very very hard to tweak it to make it act better. Like you could use genetic algorithms in say a FPS game, but you might find that the computer player becomes just too good, and will do very strange things like constantly spinning around on the spot to try and see a new target, or just constantly jumping while it does everything to avoid being shot. The issue is that the results are unpredictable, and the algorithm will take advantage of every tiny little thing that exists, bugs and all. Making the players act in very un-life-like ways.

But if you are smart you might be able to add some fuzzy logic in parts of the AI, say the path finding, base on where the best cover is, and other units are etc. So units can position themselves in the best possible way. But the problem is the amount of training you would need to do, and then if you change any of the game logic that might effect this, you need to retrain all your networks again. Something that can take ages even using gpus.

Last edited by OnlyJoe; 10-19-2014 at 05:11 PM.
10-20-2014, 01:45 AM
#4
Joined: Oct 2014
Posts: 30
Quote:
Originally Posted by Destined View Post
In strategy games sometimes people overthink AI. Sometimes "find closest target" is fine for a unit, or "find nearest building" etc.

Some people try to implement very complex AI and it results in it not being fun. Players like when they can see a unit and know what it is going to try and do (thus giving them a chance to counter).
Yeah its easy to overthink AI. But many games with many units seem to move the units in a "one and one way". There don't seem to be any design to move many units as a group in a smart way. Units that cooperates makes for a better AI then units just moving separately one by one. My personal opinion.
10-20-2014, 01:51 AM
#5
Joined: Oct 2014
Posts: 30
Quote:
Originally Posted by OnlyJoe View Post
Most AI in games is still done as state machines, or behaviour trees.
We are using that in our next game. We usually make the AI like this and then we testplay against it and identify its weaknesses and when it acts stupid. We then make specific code to handle these weaknesses and stupidities. So its all hardcoded.