Thank you for the reply! I also believe its imperative to separate the mechanics of units from their AI. In the constructor of each unit I assign it all its variables such as movement speed and range and line of sight and the unit itself merely extends base classes that contain generic move() commands.
When I spoke of orders, an order object such as moveTo simply stores the destination and performs the necessary collision detection and calls the body's move() method, it doesn't actually contain any code to change the units position manually.
This is important as you said because orders could be given that would give the unit extra unintended powers on an order by order basis otherwise.
My main problem is that of, as you said, determining how smart each unit will be.
I would prefer my units in the game to be fairly autonomous in that they will defend themselves, work with other nearby units meaningfully and without any additional higher command. By this I mean that they won't run into each other, shoot at each other, and will move around objects, maintain general formations all without a higher AI guidance controlling the units. I want each unit to know where the others are and know where it should be.
They would obviously only move from their general positions when given an order by a higher player/ai authority.
This contradicts what you were saying in that I would need a higher AI for squad and army movements.
My hope is that I will put the player in a much more macromanagement position in that they wouldn't control their units on an individual level at all. They would assign General AIs to command armies to accomplish goals and the player would merely coordinate strategy and determine objectives.
When I say I want each unit to have a brain, I mean that yes that brain would see where the units are in its surroundings, consider whether it has any orders or not or is moving in formation or with other units, and decide what to do on its own.
Currently, each unit operates similar to a finite state machine. It is given a individual order (although my implementation of the Order class allows orders to be linked together so taht when one is accomplished it is immediately replaced with another one) and that order contains all the code to accomplish that order such as moving the unit around or firing the units weapon.
Keep in mind however, that when the order object tells the unit to "move" or "shoot" it calls one of the units own methods and the unit moves or shoots based on its own movement speed or weapon.
I want all this code and functionality to be taken out of the order class and be put into a brain class so that the units aren't just finite state machines but rather approach a truer AI.