FS2Open's AI is one area of the code base which has had many different authors over a number of years. Correspondingly, the AI code is notable for different coding styles, and many occasions of copy-paste coding.
The problems stemming from this should be readily apparent.
With the aim of making small steps to resolve this, I have created a branch on Github for
a rationalisation of the AI code. For example, there are plenty of locations where a series of variables should be set concurrently. However, say, one or two locations presently miss one variable -- perhaps because they were copy-pasted at different times or subsequently one certain locations were edited.
Given the subtleties of bugs introduced into the AI code, I would greatly appreciate testers' assistance.
I'm being assisted by some duplicate code checkers.
The steps identified are:
- Rationalise the eight locations where AI goals are reset, into one utility macro or function (Code ready for review)
- Rationalise guarding (Todo)
- ...