Then there's the problem of having to recreate those behaviors in lua and have them running twice if they need to be modified.
So I suggest we start moving the TA unit logic out of the engine C++ code, and into lua gadgets. These gadgets would be bundled along with the OTA base archives. This way they can be overriden and modified if necessary, and those games that do not need them can simply not include them.
This should allow for small gains in performance, possibly negligible, but the added flexibility both in content development and in cleaner engine code should outweigh that immensely.
It would also allow people to fix behavior bugs without requiring a whole new release of the engine, and it would increase the pool of potential contributors since you would not need to be able to compile and understand the engine in order to modify things.
An added benefit would be that it can be done incrementally and not all at once.
Examples of unit logic that could be moved into lua gadgets:
- Air repair pads
- Construction animations & wireframes
- Compound commands such as patrolling