How would I go about having multiple AI on the screen all at once all calculating separate movements without too much lag and within sane working memory. Before I have had many on the screen by putting objects of them in an array and looping through calling the move method, however this isn't the fastest method of handling them. Is it okay to use threads when you have say 200 AI at the same time on the screen? Can anyone help me work out the best structure for having multiple AI (which all move)?
It is highly unlikely that you will have so many enemies, that calculating their movements slows the game down.
In a game with a large number of enemies (thousands), most will be off the screen, hence presumed to be (largely) dormant, at any given time. This reduces the amount of effort to do them to very little (perhaps zero).
Using threads is going to hugely increase the complexity of your code, introduce many bugs, and may not actually increase performance at all (for example, if you have more threads than cores). But worst of all, it makes the game nondeterministic, which is never a good thing. You want to be able to replay the game with the same inputs (for example, many mutliplayer network games depend on this).
Pluses: Java does fine with hundreds of threads used this way. You get to use all your cores. And while you only have a few cores, many of your threads will be blocking and unable to run, so having a few unblocked ones ready keeps things moving. (Though most of your threads should be sleeping most of the time. You want a bit of spare CPU usage to the OS can respond rapidly to things outside your game (internet connection, for instance) and even things in your game besides AI.)
Minus: This kind of multithreaded programming is a monster. If you want to do this, study it well. Write your code carefully, because the bugs will not repeat themselves when you want them to and so are extremely difficult to track down. And writing safe code is not enough; you have to minimize blocking. If you have 8 cores, but all the threads are trying to get one lock, you'll have only 12.5% CPU usage. Worse, the player is apt to notice the slowdown. Basically you need to synchronize everything and synchronize nothing at the same time.