Sunday, 16 June 2024

How to add AI soldier into Project IGI 1

Adding AI Soldiers in Project IGI 1


Adding AI soldiers to Project IGI 1 requires a methodical approach to ensure they operate smoothly within the game. Here’s a step-by-step guide:


1. AI Path (PatrolPath):

   - Each AI soldier needs a designated path, known as a PatrolPath, to navigate through the game world.

   - These paths dictate where the AI can move and patrol.

   - In Project IGI 1, you define these paths directly in the game’s level files, such as "objects.qvm". Example: `Task_New(1, PatrolPath1, "", ...`.


2. AI Script:

   - AI scripts are essential as they define how the soldiers behave and interact within the game.

   - These scripts govern actions like movement, combat responses, and interactions with the player.

   - You can find AI scripts in the game’s directories, such as `level1/ai/530.qvm`, where `530` is the soldier’s ID.


3. Graph ID:

   - Each AI soldier operates within a specific game graph, which confines their actions and movements.

   - Ensure you specify the correct graph ID when adding an AI soldier to maintain game compatibility and functionality.


How to Add AI Soldiers


To simplify the process:


- Duplicate Existing AI Configurations:

  - Identify similar AI configurations already in the game, like Patrol or Guard AI.

  - Copy their paths and scripts.


- Customize the AI:

  - Modify the copied configurations to create new AI soldiers with unique behaviors.

  - Adjust IDs, paths, and scripts as needed to differentiate them from existing soldiers.


- Integrate Into the Game:

  - Once customized, integrate the new AI soldiers into Project IGI 1.

  - Ensure all configurations are correctly linked and referenced in the game files for seamless operation.

- Make sure in objects.qvm you add like this.


Task_New(-1, "HumanSoldier", "", 24103034.0, -55681832.0, 161166576.0, 4.71238899230957, "015_01_1", 1, 6, 4, 
Task_New(1898, "HumanAI", "", "AITYPE_PATROL_AK", 12))),  // Here 1898 is soldier Id and  12 is Graph Id 
Task_New(-1, "Container", "AIs in base for security cam", 
Task_New(3030, "PatrolPath", "",  // Here 3030 is the Patrol Id it should math with Id you give in this AI script 
Task_New(-1, "PatrolPathCommand", "Delays the script execution for 1700 ticks", 1, 1700), 
Task_New(-1, "PatrolPathCommand", "Walks to node id 4", 2, 4), 
Task_New(-1, "PatrolPathCommand", "Walks to node id 3", 2, 3), 
Task_New(-1, "PatrolPathCommand", "Walks to node id 2", 2, 2), 
Task_New(-1, "PatrolPathCommand", "Walks to node id 1", 2, 1), 
Task_New(-1, "PatrolPathCommand", "Walks to node id 3", 2, 3), 
Task_New(-1, "PatrolPathCommand", "Walks to node id 2", 2, 2), 
Task_New(-1, "PatrolPathCommand", "Walks to node id 1", 2, 1), 
Task_New(-1, "PatrolPathCommand", "Walks to node id 2", 2, 2), 
Task_New(-1, "PatrolPathCommand", "Walks to node id 3", 2, 3), 
Task_New(-1, "PatrolPathCommand", "Walks to node id 4", 2, 4)), 

How to add AI soldier into Project IGI 1

Adding AI Soldiers in Project IGI 1 Adding AI soldiers to Project IGI 1 requires a methodical approach to ensure they operate smoothly withi...