Conversation
Logging AI decisions shows that this conditional would constantly cancel AI actions during regular gameplay. A special case like this should not affect normal AI routines and I'd rather disable this for now to prevent it from masking other problems with AI decisions.
Clutters logs and slows down game less when logging is on.
!AimingGun(pSoldier) would always evaluate to true and there are no hits to CrowDecideAction in the entire solution even in commented out code
Originally placed in DecideAction(green/yellow/red/black) functions separately
Canceling current AI actions at the start of soldier's turn prevents a lot of ai deadlocks. The status RED & BLACK actions are supposed re-evaluate the situation every turn anyways
We can't do anything with negative action points either.
aiData.bRTPCombat is never initialized and is always 0 when valid values should be #define RTP_COMBAT_AGGRESSIVE 1 #define RTP_COMBAT_CONSERVE 2 #define RTP_COMBAT_REFRAIN 3
It's already handled before a call to this function, and TurnBasedHandleNPCAI() is only called when pSoldier's action is AI_ACTION_NONE
Less clutter in the AI logs if, for example one is only interested in BLACK status decisions
Several actions would sometimes get stuck in a forever loop, where they would not be executed, since no proper path for executing the actions is found. Originally TurnBasedHandleNPCAI() would only be called if aidata.bAction was AI_ACTION_NONE. Now we'll call it if an action is not already in progress, and will be executed if the action is affordable.
* Add optional parameter to ignore search range
* Removes the need to constantly check for fCivilian, ARMED_VEHICLE, ENEMY_ROBOT etc inside DecideAction * Move AI decision checks into their own functions, such as DecideActionRadioRedAlert * Add new entry to ActionType. AI_ACTION_INVALID signals that no valid action was found when a function returns, or no valid action is possible * Do a weighted random selection for choosing target under DecideActionBlackSoldier
distanceInCellCoords will return the distance between pSoldier and closest known opponent. We're often calculating same range after the call using PythSpacesAway and this way it's no longer necessary in most cases.
This was absolutely clogging Debug build when compressing time
SoldierID works without it thanks to operator overload
Possibly wear gasmask if soldier sees tear or mustard gas
Create Scuba fins when in deep water for elites
* Drink canteen * Jump through window * Use explosives * Use wirecutters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quite a bit of changes done, with mostly trying to fix the passive AI and reduce AI deadlocks. Actual AI behavior should be mostly the same as before.
Also some additional AI logging