AI decision implementation method and system based on large language model in 4X game

By deploying a large language model and an AI agent module in 4X games to work together, intelligent decision-making is achieved, solving the problems of mechanical repetition and insufficient immersion in traditional 4X games, and improving the flexibility and immersion of the game.

CN121860028APending Publication Date: 2026-04-14GUANGDONG TIANYUN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Traditional 4X games rely on pre-programmed decision-making processes, resulting in mechanical and repetitive decisions, a lack of novelty in the plot, and an inability to flexibly respond to the player's personalized behavior, leading to insufficient game immersion.

Method used

By employing a large language model and an AI agent module working together, a private domain large language model adapted to the game's worldview is deployed. Its reasoning ability is used to generate intelligent decisions, including information indexing, prompt word generation, feedback standardization, and instruction conversion, to achieve intelligent decision-making for NPCs/factions.

Benefits of technology

It enhances the decision-making flexibility and immersion of game AI, solves the problems of limited plot branches and insufficient immersion in traditional 4X games, and realizes flexible response of dynamic plot and personalized experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121860028A_ABST
    Figure CN121860028A_ABST
Patent Text Reader

Abstract

The invention provides an AI decision implementation method and system based on a large language model in a 4X game, and relates to the technical field of game AI. According to the method and the system, intelligent decision-making of NPC / power is realized through cooperation of a private domain large language model, an AI agent module and a game AI system. Firstly, a private domain large language model matched with the game world view is deployed, information indexing, cue word generation, feedback specification and instruction conversion are completed through an AI agent module, and then execution and closed-loop optimization of decision instructions are achieved through a game AI system. The limitation that a traditional game AI depends on a fixed program process is broken through, the flexibility and immersion of decision making are improved through the reasoning ability of a large language model, and the problems that a traditional 4X game is limited in plot branch and insufficient in substitution sense are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game AI technology, specifically to a method and system for implementing AI decision-making based on a large language model in 4X games. Background Technology

[0002] 4X games (Explore, Expand, Exploit, Exterminate) are popular in today's gaming market due to their grand worldviews, complex faction interactions, and rich branching storylines. Traditional 4X games rely on pre-programmed processes for AI decision-making, with all NPC / faction behavior logic and storyline branches pre-designed by developers.

[0003] This model has obvious flaws: on the one hand, the decision-making logic and plot branches designed by humans are limited, and as the game progresses, the decision-making becomes mechanically repetitive and the plot lacks freshness; on the other hand, the fixed process cannot flexibly respond to the personalized behavior of players, making it difficult to achieve a truly dynamic plot evolution, resulting in insufficient game immersion.

[0004] Large language models possess powerful natural language understanding and reasoning capabilities, offering new possibilities for game AI decision-making. Currently, the application of large language models in games is largely limited to chatbot scenarios, used only for simple dialogue interactions between NPCs and players. Their reasoning capabilities are not fully utilized to solve core AI decision-making problems, failing to fundamentally overcome the limitations of traditional game AI. Summary of the Invention

[0005] This invention aims to provide a method and system for AI decision-making in 4X games based on a large language model. It utilizes the reasoning ability of the large language model to achieve intelligent decision-making for NPCs / factions, solving the problems of mechanical decision-making, limited plot branches, and insufficient immersion in traditional 4X games.

[0006] Specifically, this invention provides an AI decision-making implementation method based on a large language model in 4X games. The method includes: a first step: deploying a private domain large language model adapted to the worldview of the 4X game, and inputting a game worldview dataset into the model to enable it to have a basic understanding of the core game settings; the dataset includes game rules. A second step: the game AI system module of the 4X game intelligently triggers decision requests based on the game scene and progress. A third step: after receiving the decision request, the AI ​​agent module of the 4X game organizes the current local information of the game and constructs a classification retrieval index based on the type of local information, quickly searching for target information related to the decision request through the index. A fourth step: the AI ​​agent module generates prompt words adapted to the private domain large language model based on the decision request and target information. A fifth step: the private domain large language model performs reasoning and decision-making based on the prompt words, and generates feedback information based on the reasoning and decision-making combined with the target information. A sixth step: the AI ​​agent module removes content from the feedback information that does not conform to the game rules, extracts the core decision logic, and converts the core decision logic into game instructions recognizable by the game AI system module. A seventh step: the game AI system module receives and executes the game instructions to complete the corresponding decision-making behavior.

[0007] The present invention also provides an AI decision-making implementation system based on a large language model in 4X games. The system includes: a private domain large language model, an AI agent module, and a game AI system module. The private domain large language model is deployed to adapt to the world view of the 4X game and a game world view dataset is input into the model to enable the model to have a basic understanding of the core settings of the game. The dataset contains the game rules. The game AI system module intelligently triggers decision requests based on the game scene and progress. Upon receiving the decision request, the AI ​​agent module organizes the current local information of the game and constructs a categorized retrieval index based on the type of this local information. This index allows for rapid searching of target information related to the decision request. The AI ​​agent module generates prompt words adapted to the private domain large language model based on the decision request and target information. The private domain large language model performs reasoning and decision-making based on the prompt words, and generates feedback information based on this reasoning and decision combined with the target information. The AI ​​agent module removes content from the feedback information that does not conform to the game rules, extracts the core decision logic, and converts this core decision logic into game instructions that the game AI system module can recognize. The game AI system module receives and executes the game instructions to complete the corresponding decision-making action.

[0008] Preferably, the game world view dataset includes background story, faction settings, character personalities, game rules, and plot triggering conditions.

[0009] Preferably, the local information includes game progress, faction status, player behavior records, resource distribution data, and triggered storyline information.

[0010] Preferably, the prompts incorporate elements of game immersion and define the constraints on decision-making behavior.

[0011] Preferably, the randomness of decision-making is controlled by adjusting the temperature parameters of the private domain large language model.

[0012] In summary, this invention proposes a method and system for AI decision-making in 4X games based on a large language model, belonging to the field of game AI technology. This method achieves intelligent decision-making for NPCs / factions through the collaborative operation of a private domain large language model, an AI agent module, and a game AI system. First, a private domain large language model adapted to the game's world view is deployed. The AI ​​agent module completes information indexing, prompt generation, feedback standardization, and instruction conversion. Then, the game AI system executes the decision-making instructions and optimizes the closed-loop process. This invention breaks through the limitations of traditional game AI relying on fixed program flows, utilizing the reasoning ability of a large language model to enhance the flexibility and immersion of decision-making, and solving the problems of limited plot branches and insufficient immersion in traditional 4X games. Attached Figure Description

[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be discussed below. Obviously, the technical solutions described in conjunction with the accompanying drawings are only some embodiments of the present invention. For those skilled in the art, other embodiments and their accompanying drawings can be obtained based on the embodiments shown in these drawings without creative effort.

[0014] Figure 1 The diagram shows a general flowchart of the AI ​​decision-making implementation method and system based on a large language model in 4X games according to the present invention. Detailed Implementation

[0015] The technical solutions of various embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments described in the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] In summary, to address the limitations of existing technologies, this invention proposes a method and system for AI decision-making in 4X games based on a large language model, relating to the field of game AI technology. This method achieves intelligent decision-making for NPCs / factions through the collaborative operation of a private domain large language model, an AI agent module, and a game AI system. First, a private domain large language model adapted to the game's world view is deployed. The AI ​​agent module completes information indexing, prompt generation, feedback standardization, and instruction conversion. Then, the game AI system executes the decision-making instructions and optimizes the closed-loop process. This invention overcomes the limitations of traditional game AI relying on fixed program flows, utilizing the reasoning capabilities of a large language model to enhance the flexibility and immersion of decision-making, solving the problems of limited plot branches and insufficient immersion in traditional 4X games.

[0017] Let me explain the term "game worldview". A game worldview is the "virtual world operation system" constructed by the developers. Its core is to clarify "what this world is like, what rules it follows, and why the characters exist". It includes both emotional narrative settings and rational rule constraints, and is the basis for the immersion of players and NPCs (and AI).

[0018] For example, the core of a game's worldview can be composed of four key dimensions. The first is the basic setting, that is, the world's "underlying logic," including the world's origin, geographical environment, and historical background. The second is the setting of factions and characters, that is, the world's "rules of the game," clarifying the core characteristics of factions, the personalities and goals of characters, and the basic tone of relationships between characters. The third is the rules and constraints, that is, the world's "rules of operation," encompassing the game's hard rules and soft constraints, which directly determine the boundaries of AI decision-making. The fourth is the plot and objectives, that is, the world's "main storyline," providing "motivational guidance" for game decisions.

[0019] The following text will refer to Figure 1 The specific technical content of this invention is described in detail. Figure 1 The diagram shows a general flowchart of the AI ​​decision-making implementation method and system based on a large language model in 4X games according to the present invention.

[0020] Specifically, the AI ​​decision-making method based on a large language model in 4X games provided by this invention includes multiple steps. Each step will be described in detail below.

[0021] The first step in the above AI decision-making implementation method is the deployment of a private domain large language model.

[0022] In the first step, a private domain large language model adapted to the 4X game worldview is deployed, and the game worldview dataset is input into the model. The dataset includes the game's background story, faction settings, character personalities, game rules, and plot triggering conditions, enabling the model to have a basic understanding of the game's core settings.

[0023] The next step is to trigger decision requests. In this step, decision requests are triggered by the game AI triggering system based on the game scenario and progress. There are two triggering methods: one is to trigger at regular intervals based on the game progress, such as triggering a faction development decision at the end of each game round; the other is to trigger in a specific scenario.

[0024] The third step is information indexing and retrieval. In this step, after receiving the triggered decision request, the AI ​​agent module organizes the current local game information, such as game progress (e.g., current era, unlocked technologies), NPC / faction status (e.g., troop strength, resource reserves, diplomatic relations), player behavior records (e.g., recent attack targets, diplomatic attitudes), resource distribution data, and triggered plot information. Based on the types of local game information, a categorized retrieval index is built, allowing for quick searching of target information related to the decision request.

[0025] The fourth step is prompt generation and transmission. The AI ​​agent module generates prompts adapted to the private domain large language model based on the decision request and target information. These prompts need to incorporate elements of game immersion while clearly defining the decision constraints. The generated prompts are then sent to the private domain large language model.

[0026] The fifth step is model reasoning and feedback. In this step, the private domain large language model makes reasoning decisions based on the prompt words, combines its understanding of the game's world view and target information, and generates feedback information. For example, the model provides feedback information for the prompt words mentioned above. The feedback information is then returned to the AI ​​agent module.

[0027] The next step is the sixth step – feedback processing and instruction conversion. In this step, the AI ​​agent module processes the feedback information, removes content that does not conform to the game rules, extracts the core decision-making logic, and converts it into game instructions that the game AI system can recognize.

[0028] The seventh step is instruction execution and optimization. In this step, the game's AI system receives and executes game instructions, controlling NPCs / factions to complete corresponding decision-making actions. Simultaneously, by adjusting the temperature parameters of the private domain large language model (e.g., adjusting the temperature parameter from 0.3 to 0.7), the randomness of decision-making is controlled, and the prompt word generation rules of the AI ​​agent module are optimized (e.g., increasing the weight of character personality keywords), enhancing the drama and story coherence of decision-making and avoiding mechanical decision-making.

[0029] The above method involves multiple functional modules, and these modules, along with their interactions, constitute the AI ​​decision-making implementation system corresponding to the AI ​​decision-making implementation method in this invention. These functional modules are described below.

[0030] The AI ​​decision-making system includes a private domain large language model module, an AI agent module, and a game AI system module. These modules work together to achieve AI decision-making functions.

[0031] First, let's introduce the Private Domain Large Language Model module. This module preloads 4X game world view data and has reasoning and decision-making capabilities based on prompt words. Furthermore, this module supports parameter optimization; by adjusting the temperature parameter, the randomness of decision-making can be controlled. The lower the temperature parameter, the more conservative and predictable the decisions; the higher the temperature parameter, the more flexible and varied the decisions, adapting to the diverse needs of the game's storyline.

[0032] Secondly, there is the AI ​​agent module, which includes an information indexing unit, a prompt word generation unit, a feedback processing unit, and an instruction conversion unit.

[0033] The information indexing unit organizes local game information and builds a categorized search index, employing a real-time update mechanism to synchronize dynamic information during the game process (such as the latest player behavior and resource changes) to ensure the accuracy of decision-making. The prompt generation unit is responsible for generating prompts incorporating elements of immersion based on decision requests and target information. The feedback processing unit is responsible for removing content from feedback that does not conform to game rules and standardizing the information format. The instruction conversion unit is responsible for converting the standardized feedback information into structured instructions that the game's AI system can recognize.

[0034] The game AI system module is used to trigger decision requests (timed or scene-triggered), receive game instructions sent by the AI ​​agent module, control NPCs / factions to perform decision-making behaviors (such as movement, attack, and diplomatic interactions), and synchronize the execution results to the AI ​​agent module to provide data support for subsequent decisions.

[0035] To make the technical advantages of the present invention more intuitive, the following description will be combined with actual game application scenarios.

[0036] For example, design a 4X game.

[0037] The deployment of the private domain large language model was completed during the pre-launch preparation phase. Before the game's launch, the technical team had already completed the deployment of the private domain large language model adapted to the game's world view.

[0038] The core operations are divided into dataset input and model tuning.

[0039] In the dataset input phase, import the specific dataset into the model.

[0040] During the model tuning phase, the model's "temperature parameter" is initially set to 0.5 (to balance decision stability and diversity). The inference logic is optimized for the game scenario to ensure that the model's decisions conform to the characteristics of the scenario.

[0041] Then, a decision request is triggered to meet the scenario-based triggering conditions.

[0042] At this point, the game's AI system detects the trigger condition and automatically sends a decision request to the AI ​​agent module, with the trigger priority set to "high" (the decision must be completed and feedback provided within 3 minutes to avoid player lag).

[0043] Subsequently, the AI ​​agent module is responsible for information indexing and prompt word generation. This module first completes the information indexing and target information extraction.

[0044] For example, after receiving a decision request, the AI ​​agent module immediately activates the "real-time information retrieval" function to extract core target information based on the classification index.

[0045] Prompt words are then generated and integrated into the scene constraints.

[0046] Based on the above target information, the AI ​​agent module generates prompts that are adapted to the private domain large language model. Our food transport volume is reduced by 50%. If the blockade continues, we will enter a 'food shortage' state after 10 rounds.

[0047] Subsequently, the private domain large language model performs reasoning, decision-making, and feedback. After receiving prompt words, the private domain large language model combines its learned worldview with real-time target information to perform multi-dimensional reasoning and decision balancing.

[0048] Feedback information is then generated. Finally, the AI ​​agent module processes the feedback and translates the instructions. After receiving the model feedback, the AI ​​agent module performs two core operations: first, feedback standardization processing, checking whether the feedback content conforms to the game rules; second, supplementary processes, ensuring that the decisions can be implemented.

[0049] This concludes the basic introduction of the technical content of this invention. In summary, this invention proposes a method and system for AI decision-making in 4X games based on a large language model, relating to the field of game AI technology. This method achieves intelligent decision-making for NPCs / factions through the collaborative cooperation of a private domain large language model, an AI agent module, and a game AI system. First, a private domain large language model adapted to the game's world view is deployed. The AI ​​agent module completes information indexing, prompt generation, feedback standardization, and instruction conversion. Then, the game AI system executes the decision-making instructions and optimizes the closed-loop process. This invention breaks through the limitations of traditional game AI relying on fixed program flows, utilizing the reasoning ability of a large language model to enhance the flexibility and immersion of decision-making, and solving the problems of limited plot branches and insufficient immersion in traditional 4X games.

[0050] The above description is merely an exemplary embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for implementing AI decision-making based on a large language model in 4X games, characterized in that, The method includes: The first step is to deploy a private domain large language model adapted to the world view of the 4X game, and input the game world view dataset into the model so that the model has a basic understanding of the core settings of the game. The dataset contains the game rules. The second step: The game AI system module of the 4X game intelligently triggers decision requests based on the game scene and progress; The third step: After receiving the decision request, the AI ​​agent module of the 4X game organizes the current local information of the game and builds a classification retrieval index based on the type of local information. The target information related to the decision request is quickly searched through the index. Step 4: The AI ​​agent module generates prompts adapted to the private domain large language model based on the decision request and target information; Fifth step: The private domain large language model makes inference decisions based on prompt words, and generates feedback information based on the inference decisions and target information; Step 6: The AI ​​agent module filters out content that does not conform to the game rules from the feedback information, extracts the core decision-making logic, and converts the core decision-making logic into game instructions that the game AI system module can recognize; Step 7: The game AI system module receives and executes game instructions to complete the corresponding decision-making actions.

2. The method according to claim 1, characterized in that, The game world view dataset includes background story, faction settings, character personalities, game rules, and plot triggering conditions.

3. The method according to claim 1, characterized in that, The local information includes game progress, faction status, player behavior records, resource distribution data, and triggered story information.

4. The method according to claim 1, characterized in that, The prompts are integrated into the game's immersive elements and define the constraints on decision-making behavior.

5. The method according to claim 1, characterized in that, The randomness of decision-making is controlled by adjusting the temperature parameters of the private domain large language model.

6. An AI decision-making system based on a large language model for 4X games, characterized in that, The system includes: a private domain large language model, an AI agent module, and a game AI system module. A private domain large language model is deployed to adapt to the world view of the 4X game, and the game world view dataset is input into the model to enable the model to have a basic understanding of the core settings of the game. The dataset contains the game rules. The game AI system module intelligently triggers decision requests based on the game scene and progress; After receiving the decision request, the AI ​​agent module organizes the current local information of the game and builds a classification retrieval index based on the type of local information. The index is then used to quickly search for target information related to the decision request. The AI ​​agent module generates prompts that are adapted to the private domain large language model based on the decision request and target information; The private domain big language model makes inference decisions based on prompt words, and generates feedback information based on the inference decisions and target information. The AI ​​agent module filters out content that does not conform to the game rules from the feedback information, extracts the core decision-making logic, and converts the core decision-making logic into game instructions that the game AI system module can recognize; The game AI system module receives and executes game commands to complete the corresponding decision-making actions.

7. The system according to claim 6, characterized in that, The game world view dataset includes background story, faction settings, character personalities, game rules, and plot triggering conditions.

8. The system according to claim 6, characterized in that, The local information includes game progress, faction status, player behavior records, resource distribution data, and triggered story information.

9. The system according to claim 6, characterized in that, The prompts are integrated into the game's immersive elements and define the constraints on decision-making behavior.

10. The system according to claim 6, characterized in that, The randomness of decision-making is controlled by adjusting the temperature parameters of the private domain large language model.