Author Topic: [CODE REVIEW] AI code rationalise  (Read 2539 times)

0 Members and 1 Guest are viewing this topic.

Offline Echelon9

  • 210
[CODE REVIEW] AI code rationalise
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)
  • ...

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: [CODE REVIEW] AI code rationalise
This is probably a great idea but I'm completely terrified.

 
Re: [CODE REVIEW] AI code rationalise
I'm all for better AI.
How do I test?

Bh

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: [CODE REVIEW] AI code rationalise
This is probably a great idea but I'm completely terrified.
Yes.

Some time ago, I had this high speed gliding AI completely nailed down. And then suddenly there was this AI change made in the code for Diaspora, that made my AI almost completely toothless. It would suddenly spend most of its time doing half assed maneuvers that it wouldn't fully complete, making it just a sitting duck.

Gotta make sure that every change and fix is tested extensively to avoid already released campaigns from suddenly going limp!
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

  

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: [CODE REVIEW] AI code rationalise
{SNIP} to avoid {} from suddenly going limp!

Well that would be awkward...

But yeah. I'm all for more robust AI stuff.. but it will definitely need to be seriously tested.. possibly even an entire release cycle dedicated to it (given how little people test special builds, sometimes).
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Echelon9

  • 210
Re: [CODE REVIEW] AI code rationalise
Yes, I totally get the concern around testing AI changes. Working through the best way of getting testing builds out there, as code alone is going to be widely enough tested.