aliens

Author Topic: Which AI constants should be updated if max view distance weren't 20  (Read 1713 times)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 6655
  • OXCE developer
    • View Profile
    • My Wiki
Hi Warboy,

in OXCE, the max view distance can be increased from 20 to let's say 30-40.

Last time I peeked in AI code (yes, shame on me!) I noticed a few places with hardcoded 20.
I was wondering, which of them could/should be updated?
And since I don't want to study AI code in detail, I thought maybe you could give me some tips on which constants would deserve attention and which not...

1/ https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AIModule.cpp#L1011

Not sure how this would affect the AI's decisions... is there an easy explanation what would happen if this was increased?

2/ https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AIModule.cpp#L1125

I guess this is only indirectly related to max view distance and the algorithm works "correctly" even if 20 is not the limit?

3/ https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AIModule.cpp#L1620

I believe this is a strong candidate for an update? Does this mean AI can't charge from beyond 20 tiles?

4/ https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AIModule.cpp#L1789

I think this works fine, snap shot over 20 tiles is probably useless anyway.

5/ https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/AIModule.cpp#L2102

This also looks like a good candidate for update? Affects throwing grenades beyond 20 tiles, am I right?

6/ https://github.com/SupSuper/OpenXcom/blob/master/src/Battlescape/BattlescapeGenerator.cpp#L1158

This is probably OK too... same argument as in 4/

Thanks for any feedback.
Meridian