4 Pull Request for Issue #4: Implement AI Healing and Unit Creation Logic
Summary:
This pull request implements the new AI behaviors for healing units and considering the creation of Medics or Support Ships. These changes are crucial for enhancing the AI's strategic decision-making, particularly in managing unit health and resource allocation.
Changes:
healUnit Function:
Filters healers and identifies units that require healing.
Calculates whether healing should be performed based on health, healing cost, and available resources.
Executes the healing action if criteria are met.
getHealCost Function:
Calculates the cost of healing a unit based on its missing health points.
createUnit Function:
Incorporates logic for building Medics or Support Ships periodically.
Determines the best time to build these units based on game conditions.
Unit Tests:
Added comprehensive tests to validate the new AI behaviors.
Ensured tests fail if the new behaviors are not correctly implemented, thus validating their necessity.
Testing:
Verified the AI correctly identifies and heals units in need.
Confirmed the AI periodically considers building Medics or Support Ships based on game state.
All new unit tests pass, confirming the new behaviors work as expected.
Notes:
The probability and conditions for building Medics or Support Ships may need further tuning based on playtesting feedback.
Thank you for reviewing this pull request. Please let me know if there are any questions or further adjustments needed.
4 Pull Request for Issue #4: Implement AI Healing and Unit Creation Logic
Summary:
This pull request implements the new AI behaviors for healing units and considering the creation of Medics or Support Ships. These changes are crucial for enhancing the AI's strategic decision-making, particularly in managing unit health and resource allocation.
Changes:
healUnit Function:
getHealCost Function:
createUnit Function:
Unit Tests:
Testing:
Notes:
Thank you for reviewing this pull request. Please let me know if there are any questions or further adjustments needed.