Game playing simulation method, device, equipment and medium
By acquiring pre-set general interaction paradigm data and a unified interface set, a simulation environment adapter is generated, which solves the problem of integrating different game modes in the existing technology, realizes efficient integration and flexible management of game simulation systems, and simplifies the user development process.
Patent Information
- Application Number
- CN202411196157.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2026-08-04
- Estimated Expiration
- 2044-08-28
AI Technical Summary
Existing simulation environment software has significant differences in API design, lacking universality and interoperability. This makes it difficult to directly integrate different game modes, limiting the generalization ability and flexibility of intelligent game adversarial simulation systems and increasing the complexity of user development work.
This paper provides a simulation method for game games. By acquiring pre-set general interaction paradigm data and a unified interface set, a simulation environment adapter is generated, the interface specifications of different game types are unified, and game game interactions of different game types are realized based on the general interaction paradigm data, thus integrating various simulation environments.
It improves the generalization ability and flexibility of the game simulation system, simplifies the development work for users, enables different game environments to be managed and controlled in a unified manner, and realizes the integration of multiple simulation environments.
Smart Images

Figure CN119129699B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of intelligent game confrontation technology, and in particular to a simulation method, device, equipment and medium for game games. Background Technology
[0002] Currently, in the field of intelligent game adversarial simulation, especially in simulation research involving large-scale multi-agent systems, there are various types of game problems, such as single-agent, multi-agent, turn-based and non-turn-based, perfect information and imperfect information games. These different game problems usually require different simulation environments for modeling and support. However, existing simulation environment software has significant differences in API design, lacking universality and interoperability. Different game modes require different access schemes, making it difficult to directly integrate multiple different simulation environments when developing large-scale intelligent game adversarial simulation systems. This limits the generalization ability and flexibility of intelligent game adversarial simulation systems and increases the complexity of user development work. Summary of the Invention
[0003] This invention provides a method for simulating game games. It can generate simulation environment adapters based on a unified interface set to unify the interface specifications of game environments for different game types. It can also realize game game interaction for different game types based on a general interaction paradigm data, so that the game simulation system can integrate various simulation environments, thereby effectively improving the generalization ability and flexibility of the game simulation system and simplifying the development work for users.
[0004] To achieve the above objectives, a first aspect of the present invention provides a simulation method for game play, comprising: acquiring preset general interaction paradigm data, the general interaction paradigm data including interaction control logic in simulation environments of multiple game types; acquiring a preset unified interface set, the unified interface set including interface functions for interacting with the simulation environments of the multiple game types; acquiring multiple business environments corresponding to the multiple game types, selecting a target game environment from the multiple business environments, and generating a simulation environment adapter corresponding to the target game environment based on the unified interface set; creating a game environment instance corresponding to the target game environment through the simulation environment adapter, and creating at least one intelligent agent object corresponding to the game environment instance based on a preset intelligent agent model; and controlling at least one of the intelligent agent objects to perform game play interaction through the game environment instance according to the general interaction paradigm data.
[0005] In some embodiments, controlling at least one of the intelligent agents to engage in game interaction through the game environment instance according to the general interaction paradigm data includes: obtaining game decision information of at least one of the intelligent agents according to the general interaction paradigm data; and executing the current simulation steps of the game environment instance in the game based on the game decision information, so as to control at least one of the intelligent agents to engage in game interaction.
[0006] In some embodiments, the game decision information includes action information, survival information, observation information, and reward information. Obtaining the game decision information of at least one agent object according to the general interaction paradigm data includes: initializing the game environment instance and at least one agent object according to the general interaction paradigm data; obtaining the action information by querying a list of agent identifiers for actions that at least one agent object can perform in the current simulation step; obtaining the survival information by querying whether at least one agent object corresponding to the agent identifier list is in a terminated state; querying the observation information of at least one agent object corresponding to the agent identifier list; and querying the reward information of at least one agent object corresponding to the agent identifier list.
[0007] In some embodiments, the step of executing the current simulation steps of the game environment instance in the game based on the game decision information includes: when it is detected that the target game type corresponding to the target game environment is a single-agent game or a turn-based multi-agent game, obtaining action information and reward information based on the game decision information, and executing the current simulation steps of the game environment instance in the game based on the action information and the reward information; when it is detected that the target game type is a non-turn-based multi-agent game, obtaining the action information, survival information, and reward information based on the game decision information, and executing the current simulation steps of the game environment instance in the game based on the action information, the survival information, and the reward information; when it is detected that the target game type is a perfect information game or an imperfect information game, obtaining the action information, observation information, and reward information based on the game decision information, and executing the current simulation steps of the game environment instance in the game based on the action information, the observation information, and the reward information.
[0008] In some embodiments, after executing the current simulation steps of the game environment instance in the game based on the game decision information to control at least one of the intelligent agents to perform game interaction, the method further includes: if the game environment instance does not reach a preset termination condition, repeatedly executing the steps of obtaining the game decision information of at least one of the intelligent agents according to the general interaction paradigm data, and repeatedly executing the current simulation steps of the game environment instance in the game based on the game decision information, until the preset termination condition is reached.
[0009] In some embodiments, before obtaining the preset unified interface set, the method further includes: creating multiple interface functions that interact with the simulation environment of the multiple game types to obtain a unified interface set; wherein, the unified interface set includes: a simulation environment initialization interface function for initializing a game environment instance; a static metadata interface function for providing static metadata of the game environment instance and at least one of the agent objects; a dynamic attribute interface function for configuring dynamic attributes for the game environment instance and at least one of the agent objects based on the static metadata; an agent action acquisition interface function for acquiring a list of agent identifiers for at least one of the agent objects that can perform actions in the current simulation step; a simulation step interface function for executing the current simulation step of the game environment instance; an agent information query interface function for acquiring action information, survival information, observation information, and reward information of at least one of the agent objects; a global information acquisition interface function for acquiring global state information of the game environment instance and at least one of the agent objects; and a shutdown interface function for shutting down the game environment instance.
[0010] In some embodiments, the step of generating a simulation environment adapter corresponding to the target game environment based on the unified interface set includes: obtaining configuration information of the business environment corresponding to the target game environment; and implementing the simulation environment initialization interface function, the static meta-information interface function, the dynamic attribute interface function, the agent action acquisition interface function, the simulation step interface function, the global information acquisition interface function, and the shutdown interface function corresponding to the target game environment according to the configuration information, so as to generate a simulation environment adapter corresponding to the target game environment.
[0011] In some embodiments, the step of creating a game environment instance corresponding to the target game environment through the simulation environment adapter, and creating at least one agent object corresponding to the game environment instance based on a preset agent model, includes: obtaining configuration information of the business environment through the simulation environment adapter, so as to create a game environment instance corresponding to the target game environment according to the configuration information; selecting a target agent model from the preset agent models based on the target game environment, and creating at least one agent object corresponding to the game environment instance according to the target agent model.
[0012] In some embodiments, after controlling at least one of the intelligent agents to engage in game interaction through the game environment instance according to the general interaction paradigm data, the method further includes: configuring parameters for the game environment instance and at least one of the intelligent agents through the simulation environment adapter; obtaining the running information of the game environment instance and at least one of the intelligent agents after parameter configuration through the simulation environment adapter; and performing game object analysis based on the running information.
[0013] To achieve the above objectives, a second aspect of the present invention provides a simulation device for game play, the device comprising: a paradigm data acquisition module, configured to acquire preset general interaction paradigm data, the general interaction paradigm data including interaction control logic in simulation environments of multiple game types; an interface set acquisition module, configured to acquire a preset unified interface set, the unified interface set including interface functions for interacting with the simulation environments of the multiple game types; an adapter generation module, configured to acquire multiple business environments corresponding to the multiple game types, select a target game environment from the multiple business environments, and generate a simulation environment adapter corresponding to the target game environment based on the unified interface set; an environment instance creation module, configured to create a game environment instance corresponding to the target game environment through the simulation environment adapter, and create at least one intelligent agent object corresponding to the game environment instance based on a preset intelligent agent model; and a game play interaction module, configured to control at least one of the intelligent agent objects to perform game play interaction through the game environment instance according to the general interaction paradigm data.
[0014] To achieve the above objectives, a third aspect of the present invention provides an electronic device, comprising: at least one processor; at least one memory for storing at least one program; and, when at least one of the programs is executed by at least one of the processors, implementing a game simulation method as described in any one of the first aspects.
[0015] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions for performing a simulation method of a game as described in any one of the fourth aspects.
[0016] This invention provides a method, apparatus, device, and storage medium for simulating game theory. It acquires pre-set general interaction paradigm data, a pre-set unified interface set, and multiple business environments corresponding to various game types. A target game environment is selected from these business environments, and a simulation environment adapter corresponding to the target game environment is generated based on the unified interface set. Then, a game environment instance corresponding to the target game environment is created using the simulation environment adapter. At least one agent object is controlled to interact with the game environment instance according to the general interaction paradigm data, thereby simulating the game theory. It is understood that the general interaction paradigm data in this invention defines a general interaction process applicable to various types of game problems, such as single-agent, multi-agent, turn-based, and non-turn-based games. The system employs various mechanisms to ensure that different game environments can interact in the same manner. Correspondingly, a unified interface set defines standard interface functions for communication with different game-type business environments, enabling different simulation environments to be managed and controlled within the same framework. Therefore, after the system identifies the target game environment from multiple external business environments requiring game simulation, it can use the aforementioned unified interface set to create a simulation environment adapter. This adapter converts the specific interfaces of the target game environment into unified standard interfaces. Using the target game environment instance created by the adapter, and through a pre-defined agent model, agent objects are created. These agent objects are then controlled to interact with the game environment instance according to a preset general interaction paradigm, thus achieving game simulation. In summary, this invention provides a game simulation method that allows different game environments to be managed and controlled uniformly, enabling the game simulation system to integrate various simulation environments. This effectively improves the generalization and flexibility of the game simulation system and simplifies user development. Attached Figure Description
[0017] Figure 1 A flowchart illustrating a game simulation method according to an embodiment of the present invention;
[0018] Figure 2 A schematic diagram illustrating a game simulation method provided in an embodiment of the present invention;
[0019] Figure 3 Another flowchart of a game simulation method provided in an embodiment of the present invention;
[0020] Figure 4 This is a schematic diagram of a game interaction process based on a general interaction paradigm provided in an embodiment of the present invention.
[0021] Figure 5 Another flowchart of a game simulation method provided in an embodiment of the present invention;
[0022] Figure 6 Another flowchart of a game simulation method provided in an embodiment of the present invention;
[0023] Figure 7 Another flowchart of a game simulation method provided in an embodiment of the present invention;
[0024] Figure 8 Another flowchart of a game simulation method provided in an embodiment of the present invention;
[0025] Figure 9 Another flowchart of a game simulation method provided in an embodiment of the present invention;
[0026] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0028] In some embodiments, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the foregoing drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0029] Furthermore, unless otherwise explicitly specified and limited, the term "connection / linkage" should be interpreted broadly, for example, it can be a fixed connection or a movable connection, a detachable connection or a non-detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection or a connection that can communicate with each other; it can be a direct connection or an indirect connection through an intermediate medium.
[0030] In the description of the embodiments of this invention, the terms "one embodiment / implementation," "another embodiment / implementation," or "some embodiments / implementations," "in the above embodiments / implementations," etc., refer to specific features, structures, materials, or characteristics described in conjunction with embodiments or examples that are included in at least two embodiments or implementations disclosed in this invention. In this disclosure, illustrative expressions of the above terms do not necessarily refer to the same embodiment or implementation. It should be noted that although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in a different order than that shown in the flowcharts.
[0031] Currently, in the field of intelligent game adversarial simulation, especially in simulation research involving large-scale multi-agent systems, there are various types of game problems, such as single-agent, multi-agent, turn-based and non-turn-based, perfect information and imperfect information games. These different game problems usually require different simulation environments for modeling and support. However, existing simulation environment software has significant differences in API design, lacking universality and interoperability. Different game modes require different access schemes, making it difficult to directly integrate multiple different simulation environments when developing large-scale intelligent game adversarial simulation systems. This limits the generalization ability and flexibility of intelligent game adversarial simulation systems and increases the complexity of user development work.
[0032] Furthermore, existing solutions involve only a single agent object during the interaction loop and do not distinguish between different agent objects when acquiring observation information. Although existing solutions such as PettingZoo attempt to solve multi-agent game problems through abstract adaptation, they employ two different access schemes, AEC and Parallel, to address the different characteristics of turn-based and non-turn-based games (the former allows only one agent to act per step, while the latter allows multiple agents to act simultaneously). This makes it impossible to achieve compatibility between these two game types through a single adapter design. In addition, existing technologies have several limitations, such as failing to provide an interface for obtaining global state information (i.e., lacking a God's-eye view function), not supporting replay saving functions common in environments like StarCraft 2, and being unable to obtain static information such as the number of agents, whether visualization or replay saving is supported, before creating a simulation environment instance. These limitations necessitate additional targeted adaptations when integrating systems, even for some common multi-agent game scenarios.
[0033] Therefore, in order to overcome the limitations of the prior art, this invention provides a simulation method for game games. It can generate a simulation environment adapter based on a unified interface set to unify the interface specifications of game environments of different game types, and realize game game interaction of different game types based on general interaction paradigm data. This allows the game simulation system to integrate various simulation environments, thereby effectively improving the generalization ability and flexibility of the game simulation system, and simplifying the development work of users.
[0034] The embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0035] refer to Figure 1 , Figure 1 This is a flowchart illustrating a game simulation method according to an embodiment of the present invention. A first aspect of the present invention provides a game simulation method, including, but not limited to, the following steps:
[0036] Step S110: Obtain preset general interaction paradigm data, which includes interaction control logic in simulation environments of various game types;
[0037] Step S120: Obtain a preset unified interface set, which contains interface functions for interacting with simulation environments of various game types;
[0038] Step S130: Obtain multiple business environments corresponding to various game types, select the target game environment from the multiple business environments, and generate the simulation environment adapter corresponding to the target game environment based on a unified interface set.
[0039] Step S140: Create a game environment instance corresponding to the target game environment through the simulation environment adapter, and create at least one intelligent agent object corresponding to the game environment instance based on the preset intelligent agent model.
[0040] Step S150: According to the general interaction paradigm, at least one intelligent agent object is controlled to conduct game interaction through the game environment instance.
[0041] In some embodiments, the general interaction paradigm data is a pre-built data set containing interaction control logic for simulation environments of various game types. This logic defines the basic flow and rules of interaction between the agent and the simulation environment, such as initialization, action execution, and observation information acquisition. The unified interface set is a pre-built set containing interface functions for interacting with simulation environments of various game types. These interface functions define a standard interface that allows different simulation environments to interact with the agent through this interface. Various game types refer to different types of game problems, such as single-agent games, multi-agent games, turn-based games, non-turn-based games, perfect information games, and imperfect information games. Multiple business environments refer to simulation environments that implement the above different game types, such as Gymnasium, PettingZoo, MAGENT2, and VizDoom. The target game environment refers to a specific game environment selected from multiple business environments for subsequent simulation.
[0042] Understandably, a simulation environment adapter is an intermediary component that is generated based on a unified interface set. It is used to convert the specific interfaces of the target game environment into a unified standard interface. A game environment instance is an instantiated object of the target game environment used for actual simulation operation. An agent object refers to an entity that performs actions in the simulation environment. It can be a player-controlled character, an AI-controlled character, etc. The number of agent objects can be one or more, depending on the type of the target game environment. Game interaction refers to the interaction process between agent objects and game environment instances, including but not limited to agent objects performing actions, observing environmental feedback, and receiving rewards. In subsequent processes, the interaction between agent objects and game environment instances can be guided according to the processes and rules specified by the general interaction paradigm data.
[0043] It is conceivable that, through a series of pre-set data and interface sets, the embodiments of the present invention can enable different game environments to be uniformly managed and controlled, thereby effectively improving the generalization ability and flexibility of the game simulation system and simplifying the user's development work.
[0044] refer to Figure 2 , Figure 2This is a schematic diagram of a game simulation method provided in one embodiment of the present invention. In some embodiments, the present invention can obtain preset general interaction paradigm data, a preset unified interface set, and multiple business environments corresponding to various game types to select a target game environment from multiple business environments. Based on the unified interface set, a simulation environment adapter corresponding to the target game environment is generated. Then, a game environment instance corresponding to the target game environment is created through the simulation environment adapter. At least one agent object is controlled to perform game interaction through the game environment instance according to the general interaction paradigm data, thereby realizing the simulation of the game. It is understood that the general interaction paradigm data in the embodiments of the present invention defines a general interaction process, which can be applied to various types of game problems, such as single-agent, multi-agent, turn-based, and... Non-turn-based systems ensure that all game environments can interact in the same manner, regardless of their type. Correspondingly, a unified interface set defines standard interface functions for communication with different game-type business environments, enabling different simulation environments to be managed and controlled within the same framework. Therefore, after the system determines the target game environment from multiple external business environments requiring game simulation, it can use the aforementioned unified interface set to create a simulation environment adapter. This adapter converts the specific interfaces of the target game environment into unified standard interfaces. Using the target game environment instance created by the adapter, and through a pre-defined agent model, agent objects are created. These agent objects are then controlled to interact with the game environment instance according to a preset general interaction paradigm, thus achieving game simulation. In summary, this invention provides a game simulation method that allows different game environments to be managed and controlled uniformly, enabling the game simulation system to integrate various simulation environments. This effectively improves the generalization and flexibility of the game simulation system and simplifies user development.
[0045] In some embodiments, corresponding Figure 2This invention can acquire pre-set general interaction paradigm data, which includes interaction control logic in simulation environments of various game types; acquire a pre-set unified interface set, which includes interface functions for interacting with simulation environments of various game types; acquire multiple business environments corresponding to various game types, such as Gymnasium, PettingZoo, MAGENT2, VizDoom, etc.; select a target game environment from the multiple business environments, and generate a simulation environment adapter corresponding to the target game environment based on the unified interface set; and use the simulation environment adapter to create a game environment instance corresponding to the target game environment. For example, the system creates at least one agent object corresponding to a game environment instance based on a preset agent model; it controls at least one agent object to interact with the game environment instance through game play according to a general interaction paradigm data; finally, other functions can be added to the system as needed, such as visualization functions, so that users can more intuitively understand the performance of the agent model; in this way, the present invention provides a flexible game simulation system that can adapt to a variety of different game environments and can easily create and manage agent models. At the same time, due to the use of a unified set of interfaces and a general interaction paradigm data, the scalability and compatibility of the system are significantly improved.
[0046] refer to Figure 3 , Figure 3 Another flowchart of a game simulation method provided in an embodiment of the present invention; in some embodiments, at least one intelligent agent object is controlled to perform game interaction through a game environment instance according to a general interaction paradigm, including but not limited to the following steps:
[0047] Step S310: Obtain the game decision information of at least one intelligent agent object according to the general interaction paradigm data;
[0048] Step S320: Execute the current simulation steps of the game environment instance in the game based on the game decision information, so as to control at least one intelligent agent object to perform game interaction.
[0049] In some embodiments, the agent object here refers to an entity that makes decisions and takes actions in a game environment, and there may be one or more. The agent object may be a player-controlled character, an AI agent that makes automatic decisions, etc.; game decision information is the information that the agent object needs to make decisions during the game process, which usually includes action information, survival information, observation information, and reward information. Among them, action information is the action that the agent can currently choose; survival information is whether the agent is still active in the game (not eliminated or killed); observation information is the state information about the environment that the agent can currently obtain; and reward information is the reward value that the agent obtains after the current decision.
[0050] In some embodiments, the simulation steps of the game environment instance in the game are executed based on game decision information to control at least one agent object to interact in the game. Executing the simulation steps involves updating the state of the game environment based on the agent object's selection, executing the agent's actions, and calculating new environment states, rewards, and completion status, thereby enabling the agent object to interact with the game environment based on its decision information. This includes executing actions and receiving feedback (such as rewards and new observations).
[0051] refer to Figure 4 , Figure 4 This is a schematic diagram of a game interaction process based on a general interaction paradigm provided in an embodiment of the present invention. In some embodiments, the game decision information includes action information, survival information, observation information, and reward information. The game decision information of at least one intelligent agent object is obtained according to the general interaction paradigm data, including but not limited to the following steps: if the game environment instance does not reach the preset termination condition, repeatedly execute the process of obtaining the game decision information of at least one intelligent agent object according to the general interaction paradigm data, and repeatedly execute the simulation steps of the game environment instance in the game game based on the game decision information, until the preset termination condition is reached.
[0052] Among them, degree Figure 4As shown, game decision information includes action information, survival information, observation information, and reward information. The game decision information of at least one agent object is obtained according to the general interaction paradigm, including but not limited to the following steps: Initializing the game environment instance and at least one agent object: First, the game environment instance and at least one agent object are initialized according to the general interaction paradigm. This means setting the initial parameters of the game environment and creating agent objects; Obtaining action information: Action information is obtained by querying the agent identifier list of at least one agent object that can perform actions in the current simulation step. This may involve determining which agents can take actions at the current moment and what actions they can take; Obtaining survival information: Survival information is obtained by querying whether at least one agent object corresponding to the agent identifier list is in a terminated state. This helps determine which agents are still active in the game and which have been eliminated; Obtaining observation information: Observation information is obtained by querying the agent identifier list of at least one agent object. This may be any information received by the agent regarding the game state, such as the map, resources, enemy positions, etc.; Obtaining reward information: Reward information is obtained by querying the agent identifier list of at least one agent object. This typically involves immediate feedback from the agent after performing an action, indicating their performance level; executing the current simulation step: based on the agent's game decision information, the current simulation step is executed. This may include executing the agent's actions, updating the environment state, calculating rewards, etc.; outputting state information: if the game has not yet terminated, the current state information is output to the agent for its next action decision. Otherwise, the game ends; iterative loop: the above steps continue to be executed until the game ends or other stopping conditions are met.
[0053] refer to Figure 5 , Figure 5 Another flowchart of a game simulation method provided in an embodiment of the present invention; in some embodiments, the simulation steps of the game environment instance in the game are executed according to the game decision information, including but not limited to the following steps:
[0054] Step S510: When it is detected that the target game type corresponding to the target game environment is a single-agent game or a turn-based multi-agent game, action information and reward information are obtained according to the game decision information, and the simulation steps of the game environment instance in the game are executed according to the action information and reward information.
[0055] Step S520: When the target game type is detected to be a non-turn-based multi-agent game, action information, survival information and reward information are obtained based on the game decision information, and the simulation steps of the game environment instance in the game are executed based on the action information, survival information and reward information.
[0056] Step S530: When the target game type is detected to be a perfect information game or an imperfect information game, action information, observation information and reward information are obtained based on the game decision information, and the simulation steps of the game environment instance in the game are executed based on the action information, observation information and reward information.
[0057] In some embodiments, corresponding to steps S510 to S530, the generalized interaction paradigm data described above can address the generalization requirements of various game-theoretic adversarial problem types in the following manner:
[0058] Call the env.reset() function to initialize the environment;
[0059] Obtain the list of agent identifiers for executable actions (action information): For single-agent, non-turn-based multiplayer games and turn-based multiplayer games, the env.get_current_player_ids() function can be used to obtain the list of agent identifiers for currently executable actions, so as to allow this application to handle different types of game environments;
[0060] Querying whether an agent has been eliminated (survival information): For multi-agent games like StarCraft 2 micro-management, this application embodiment can use the env.get_player_terminated(player_id) function to actively query whether a certain agent has been eliminated (died) in advance;
[0061] Obtaining observation information, reward information, and other information: The functions env.get_player_obs(player_id), env.get_player_reward(player_id), and env.get_player_info(player_id) are used to obtain observation information, reward information, and other relevant information for a specific agent, respectively, supporting perfect information and imperfect information games.
[0062] Simulation steps: Use the env.step(actions) function to perform a one-step simulation. The structure of actions is standardized to be a list containing num_agents. Agents that are eliminated early are set to None, thus achieving a more standardized interaction mode.
[0063] In summary, the Env (the game environment instance) and the Agent (the intelligent agent object) interact cyclically. The Env provides the Agent with observation information (Obs), which in turn makes action decisions and influences the Env, followed by a simulation calculation of one step size.
[0064] Specifically, the following are examples of simulations performed by calling the relevant functions mentioned above according to different game types:
[0065] Single-agent game: In a single-player game or simulation environment, the agent can interact with the environment through a general process. First, the environment is initialized using the `env.reset()` function, then a loop is entered. The agent uses `env.step(action)` to execute actions and receive feedback until the game ends.
[0066] Multi-agent games: In perfect information multi-player games such as Go, each agent takes turns acting. The agent that should act now can be determined by env.get_current_player_ids(), and the action can be executed by env.step(action). All agents can access the complete board state, thus obtaining perfect information.
[0067] Imperfect information games: In games such as poker, the agent cannot access all players' hand information. Nevertheless, the general process still applies. The agent can obtain the private information of the player by env.get_player_obs(player_id) and make decisions based on this information.
[0068] Turn-based multiplayer games: In turn-based strategy games, each agent acts during their own turn; the current agent's turn can be determined using env.get_current_player_ids(), and then that agent performs the action;
[0069] Non-turn-based multiplayer games: In real-time strategy games, multiple agents can act simultaneously. A general process can be used to handle the actions of multiple agents concurrently using `env.step(action)`, with each agent executing actions based on its own observations and policies. Additionally, in cases such as reaching a certain score, completing a specific task, or triggering a specific event, `env.get_player_terminated(player_id)` can be used to check if an agent has met the exit conditions.
[0070] refer to Figure 6 , Figure 6 Another flowchart of a game simulation method provided in an embodiment of the present invention; in some embodiments, after executing the current simulation steps of the game environment instance in the game based on game decision information to control at least one intelligent agent object to perform game interaction, the method further includes, but is not limited to, the following steps:
[0071] Step S610: If the game environment instance does not reach the preset termination condition, repeatedly execute the process of obtaining the game decision information of at least one intelligent agent object according to the general interaction paradigm data, and repeatedly execute the simulation steps of the game environment instance in the game based on the game decision information, until the preset termination condition is reached.
[0072] Understandably, the termination condition is a game-ending criterion defined in the game environment. For example, the game reaches a predetermined maximum number of moves or rounds, or an agent achieves a victory condition, such as capturing all of the opponent's pieces in a board game, leaving all agents with no legal actions to take, i.e., a stalemate. The game environment itself sets specific conditions, such as automatically ending when the environment reaches a certain state in some environments. If the game environment instance does not meet the preset termination condition, then the game decision information of at least one agent object will be obtained multiple times according to the general interaction paradigm data, and the current simulation steps of the game environment instance in the game will be executed based on this decision information. This will give the agent the opportunity to continuously adjust its strategy until the game ends.
[0073] refer to Figure 7 , Figure 7 Another flowchart of a game simulation method provided in an embodiment of the present invention; in some embodiments, before obtaining a preset unified interface set, the method further includes, but is not limited to, the following steps:
[0074] Step S710: Create multiple interface functions that interact with simulation environments of various game types to obtain a unified interface set;
[0075] The unified interface set includes: a simulation environment initialization interface function for initializing the game environment instance; a static metadata interface function for providing static metadata of the game environment instance and at least one agent object; a dynamic attribute interface function for configuring dynamic attributes for the game environment instance and at least one agent object based on the static metadata; an agent action acquisition interface function for obtaining a list of agent identifiers for at least one agent object that can perform actions in the current simulation step; a simulation step interface function for executing the current simulation step of the game environment instance; an agent information query interface function for obtaining action information, survival information, observation information, and reward information of at least one agent object; a global information acquisition interface function for obtaining global state information of the game environment instance and at least one agent object; and a shutdown interface function for shutting down the game environment instance.
[0076] Specifically, compared to existing open-source solutions, the unified interface set exhibits higher generalization in its interface design. The unified interface set can include:
[0077] `act_space(player_id)`: Retrieves the action space of a specific agent. This helps the agent determine its feasible set of actions in order to make decisions. `player_id` is the agent's identifier.
[0078] obs_space(player_id): Retrieves the observation space of a specific agent. This provides the spatial dimension through which the agent receives information, helping it understand the state of its environment.
[0079] `reward_space()`: Gets the range of possible rewards. This helps the agent understand the potential benefits of its actions.
[0080] is_available(): Determines whether the simulation environment is available in the current environment. This helps avoid invalid environment access.
[0081] get_env_static_meta(): Retrieves some static properties of the simulation environment (can be called before creating an instance). This provides basic information about the environment, such as rules and restrictions.
[0082] get_env_runtime_meta(): Retrieves some runtime properties of the simulation environment (must be called after the instance is created). This provides real-time information about the environment's state.
[0083] `reset(seed=None, save_replay_path=None)`: Resets the simulation instance to its initial state, and allows you to set a random seed and the save path for the replay of this episode as needed (env support required). This makes the experiment reproducible and controllable.
[0084] Step(action): Input the action to be performed by each Agent instance at the current time into the game engine, then calculate a timestamp backward, and return whether the game is over. Information such as reward, observation, and done can be obtained through the get_xxx function. This is the core simulation step, which determines the behavior of the agent and the evolution of the environment.
[0085] `get_current_player_ids()`: Returns the list array of agents that should perform actions in the current round, where each element is an integer representing the index of the participating agent. This is helpful for managing multi-agent interactions.
[0086] `get_player_default_action(player_id=0)`: Retrieves the default action corresponding to the specified `player_id`. This is typically used when the agent's action decision function times out. It provides an alternative when the agent cannot determine an action.
[0087] `get_player_legal_actions(player_id=0)`: Returns the set of actions that the agent represented by the specified `player_id` can take in the current state. This helps the agent understand its currently feasible actions.
[0088] `get_player_terminated(player_id=0)`: Returns whether the agent represented by the specified `player_id` has entered the terminated state in the current round of the game. This helps the agent know when to exit the game.
[0089] `get_player_obs(player_id=0)`: Returns the information that the agent represented by the specified `player_id` can observe. This is a key way for intelligent agents to perceive their environment.
[0090] get_player_reward(player_id=0): Returns the reward information obtained by the agent represented by the specified player_id after this step. This is the main driving force for agent learning.
[0091] `get_player_info(player_id=0)`: Returns additional auxiliary information obtained by the agent represented by the specified `player_id` after this step. For details, please refer to the implementation of each sub-game engine. This provides additional environmental feedback.
[0092] `get_global_state()`: Returns global state information. This function is only necessary if the game engine supports it. It can be used for spectator functionality but should not be called on the agent client to prevent information leakage. It provides a global view but should be used with caution.
[0093] `render(mode='human')`: Called after each step, this function renders the game screen. It provides a visual interface for easy observation and debugging.
[0094] `close()`: Closes the simulation environment and releases the corresponding resources. This ensures efficient resource utilization and normal program termination.
[0095] The design of the upper interface takes into account different game types and environmental characteristics, which can make the system more flexible and adaptable.
[0096] In some embodiments, generating a simulation environment adapter corresponding to the target game environment based on a unified interface set includes: obtaining configuration information of the business environment corresponding to the target game environment; and matching and implementing the simulation environment initialization interface function, static metadata interface function, dynamic attribute interface function, agent action acquisition interface function, simulation step interface function, global information acquisition interface function, and shutdown interface function corresponding to the target game environment according to the configuration information, so as to generate a simulation environment adapter corresponding to the target game environment.
[0097] Specifically, the following are concrete examples for Gymnasium:
[0098] Simulation environment initialization interface function: Initializes and creates a gymnasium original env instance as a member variable self._env_instance;
[0099] The static metadata interface function get_env_static_meta() returns the following information:
[0100] Software SDK name: sdk_name = "gymnasium";
[0101] Software SDK version: sdk_version = get_package_version(gymnasium.package);
[0102] The list of all included environments: all_env_names = list(gymnasium.envs.registry.keys());
[0103] Minimum number of players: min_num_players = 1;
[0104] Maximum number of players: max_num_players = 1;
[0105] Does the system support visual rendering?: if_supports_rendering = True;
[0106] Whether to support replay saving: if_supports_replay_saving = True (if required);
[0107] (Other required static properties).
[0108] The dynamic property interface function get_env_runtime_meta() returns the following information:
[0109] env name: Set according to the initialization parameters, for example, "LunarLander-v2";
[0110] Actual number of players: num_players = 1.
[0111] The intelligent agent action acquisition interface function get_current_player_ids(): forces a return value of 0 (because there is only one agent).
[0112] The simulation steps interface functions include: the reset function reset(seed, save_replay_path=None):
[0113] Call rets=self._env_instance.reset(seed=seed);
[0114] Information such as obs, reward, and terminated is parsed from rets and cached in member variables;
[0115] Save the latest OBS; if the replay saving function is enabled, the rgb_array contained in the OBS needs to be cached separately.
[0116] The step function `step(self, actions)` is used to perform the following actions:
[0117] Retrieve element 0 from the `actions` list and pass it to the `step` function of the original `env`: `rets = self._env_instance.step(action)`
[0118] Information such as obs, reward, and terminated is parsed from rets and cached in member variables.
[0119] If replay is enabled, you can refresh and write the rgb_array image information to the video file here.
[0120] The intelligent agent information query interface function: get_player_default_action(player_id): verifies that player_id must be 0, and then returns self._act_space.sample(action information);
[0121] `get_player_legal_actions(player_id)`: Verifies that `player_id` must be 0, then returns `self._act_space` (action information); `get_player_terminated(player_id)`: Verifies that `player_id` must be 0, then returns `self._last_terminated` (survival information); `get_player_obs(player_id)`: Verifies that `player_id` must be 0, then returns `self._last_obs` (observation information); `get_player_reward(player_id)`: Verifies that `player_id` must be 0, then returns `self._last_reward` (reward information).
[0122] The global information retrieval interface function get_global_state(): Since it only involves one agent, it also returns self._last_obs.
[0123] To close the interface, call the `close()` function: call `self._env_instance.close()` to release the relevant resources.
[0124] The following is an example of RLCard, covering a unified adaptation for various turn-based, imperfect information multiplayer card and board games. Specifically, RLCard implements the following interface functions:
[0125] The simulation environment initialization interface function initializes the environment based on the input generic kwargs parameter dictionary and creates an rlcard original env instance as a member variable self._env_instance.
[0126] The static metadata interface function get_env_static_meta() returns the following information:
[0127] Software SDK name: sdk_name = "rlcard":
[0128] Software SDK version: sdk_version = rlcard.__version__
[0129] List of all included environments:
[0130] all_env_names=list(rlcard.envs.registration.registry.env_specs.keys());
[0131] Minimum number of players: min_num_players = 1, some games only support a single player;
[0132] Maximum number of players: max_num_players = 10. Some games may support a variable number of players.
[0133] Whether to support visual rendering: if_supports_rendering=False, since RLCard itself does not have visualization capabilities, this is set to not support;
[0134] Whether to support replay saving: if_supports_replay_saving = False;
[0135] (Other required static properties).
[0136] The dynamic attribute interface function get_env_runtime_meta() returns the following information:
[0137] env name: Set according to initialization parameters, for example, "limit-holdem";
[0138] Actual number of players: determined by initialization parameters, for example, num_players = 2;
[0139] The function to reset a seed is `reset(seed, save_replay_path = None)`.
[0140] Call self._last_obs, self._player_id = self._env_instance.reset();
[0141] Where self._last_obs represents the current state, and self._player_id is the player ID that can perform actions in the current round;
[0142] The current step executes the player ID function get_current_player_ids(), which returns [self._player_id]. Note that in turn-based multiplayer games, only one player can execute an action at a time, but the player's identity is related to the game rules and the actual execution status.
[0143] The simulation step interface function is step(self, actions):
[0144] Get element 0 from actions (because there must be only one player's action command), and then pass it to the step function of the original env: self._last_obs, self._player_id = self._env_instance.step(action[0]);
[0145] Where self._last_obs represents the current state, and self._player_id is the player ID that can perform actions in the current round;
[0146] To check if the game has ended, use `self._last_terminated = self._env_instance.is_over()`.
[0147] The intelligent agent information query interface function is as follows:
[0148] get_player_default_action(player_id), verify that player_id is in the range [0, self.num_players-1], then query the legal actions through the RLCard original API and sample them, self._env_instance.get_state(player_id)['legal_actions'].keys()[0];
[0149] get_player_legal_actions(player_id), verify that player_id is in the range of [0, self.num_players-1], return list(self._env_instance.get_state(player_id)['legal_actions'].keys());
[0150] The `get_player_terminated(player_id)` function checks if `player_id` is in the range [0, self.num_players-1] and then returns `self._last_terminated`.
[0151] The `get_player_obs(player_id)` function verifies that the player_id is in the range [0, self.num_players-1] and then returns `self._last_obs`. Note that since the obs information returned in each step has already matched the identity of the player whose identity needs to be queried for action decisions, no additional processing is required here.
[0152] The function `get_player_reward(player_id)` checks if `player_id` is in the range [0, self.num_players-1], then queries `payoffs` from the original `env`, where `payoffs = self._env_instance.get_payoffs()`, and returns `float(payoffs[player_id])`.
[0153] The global information retrieval interface function get_global_state() involves a variable number of agents, [self._env_instance.get_state(i)['raw_obs']foriinrange(self._runtime_meta.num_players)], which requires retrieving the corresponding information separately and then aggregating it.
[0154] The close() function can be ignored since the original RLCardenv implementation does not have a corresponding API.
[0155] The above steps further demonstrate that embodiments of the present invention can use an adapter scheme to uniformly abstract and integrate a multiplayer turn-based imperfect information game (board game) RLCard.
[0156] In summary, it can be understood that the processing details for different types of simulation environments are implemented in advance in the specific simulation environment adapter. If a new business environment wants to be connected, it is only necessary to implement the specific simulation environment adapter according to the unified API. Then, all types of simulation environments can be uniformly connected in the upper-layer business system, while providing general support for functions such as replay saving, static and runtime attribute acquisition of environment.
[0157] refer to Figure 8 , Figure 8 Another flowchart of a game simulation method provided in an embodiment of the present invention; in some embodiments, a game environment instance corresponding to the target game environment is created through a simulation environment adapter, and at least one agent object corresponding to the game environment instance is created based on a preset agent model, including but not limited to the following steps:
[0158] Step S810: Obtain the configuration information of the business environment through the simulation environment adapter, and create a game environment instance corresponding to the target game environment according to the configuration information;
[0159] Step S820: Select a target agent model from the preset agent models based on the target game environment, and create at least one agent object corresponding to the game environment instance according to the target agent model.
[0160] It is understandable that by obtaining the configuration information of the business environment through the simulation environment adapter, this information can help create a game environment instance that conforms to the characteristics of the target game environment. Then, based on the target game environment, a suitable agent model can be selected from the preset agent models, and at least one agent object corresponding to the game environment instance can be created based on the selected target agent model.
[0161] refer to Figure 9 , Figure 9 Another flowchart of a game simulation method provided in one embodiment of the present invention; in some embodiments, after controlling at least one intelligent agent object to perform game interaction through a game environment instance according to a general interaction paradigm, the method further includes, but is not limited to, the following steps:
[0162] Step S910: Configure the parameters of the game environment instance and at least one intelligent agent object through the simulation environment adapter;
[0163] Step S920: Obtain the running information of the game environment instance and at least one intelligent agent object after parameter configuration through the simulation environment adapter, and perform game object analysis based on the running information.
[0164] In some embodiments, after controlling at least one intelligent agent object to engage in game interaction through a game environment instance according to a general interaction paradigm, the following operations can be performed: Parameters of the game environment instance and at least one intelligent agent object are configured using a simulation environment adapter to optimize their behavior and performance; further, the runtime information of the parameter-configured game environment instance and at least one intelligent agent object is obtained through the simulation environment adapter, and game object analysis is performed based on this information, wherein, referring to... Figure 2Other functions, which can be part of step S920 after the analysis of the game objects, include: General configuration parameters: General parameters used during the game, such as learning rate, exploration rate, network architecture, etc. These parameters can be adjusted according to the game results and running information to optimize the learning effect of the agent; Replay saving: During the game, each step of the operation and result can be recorded to form a so-called "replay". These replays can be used to further analyze the behavior of the agent, and can also be used for subsequent training and testing; Visualization rendering: In order to facilitate the observation and understanding of the game process, visualization tools can be used to render the game environment and the behavior of the agent. This can help researchers intuitively understand how the agent responds to environmental changes and how they learn and adapt; Human-computer interaction: In addition to the game between agents, human-computer interaction functions can be designed so that human players can directly participate and play against the agent. This can not only test the ability of the agent, but also collect more human behavior data to improve the algorithm.
[0165] In some embodiments, the game simulation method proposed in this invention has been fully implemented and functionally verified in a large-scale game adversarial simulation system. Through this simulation method, various simulation environments, including gymnasium, gym, pettingzoo, magent2, vizdoom, rlcard, openspiel, pysc2, smac, metadrive, and finrl, can be uniformly accessed. These environments cover various problem types such as single-agent, multi-agent, perfect information games, imperfect information games, turn-based, and non-turn-based games, as well as multiple application areas such as real-time strategy, first-person shooter, physics simulation, card games, robotics, military simulation, and financial quantitative analysis. Users can freely select and test their self-developed agent models on the platform, which also implements visualization functions to help users analyze model performance. Therefore, this invention significantly improves the compatibility of simulation environments and the development efficiency of agent models.
[0166] A second aspect of this invention provides a simulation apparatus for game play, comprising: a paradigm data acquisition module for acquiring preset general interaction paradigm data, the general interaction paradigm data including interactive control logic in simulation environments of various game types; an interface set acquisition module for acquiring a preset unified interface set, the unified interface set including interface functions for interacting with simulation environments of various game types; an adapter generation module for acquiring multiple business environments corresponding to various game types, selecting a target game environment from the multiple business environments, and generating a simulation environment adapter corresponding to the target game environment based on the unified interface set; an environment instance creation module for creating a game environment instance corresponding to the target game environment through the simulation environment adapter, and creating at least one intelligent agent object corresponding to the game environment instance based on a preset intelligent agent model; and a game play interaction module for controlling at least one intelligent agent object to perform game play interaction through the game environment instance according to the general interaction paradigm data; wherein, the apparatus is used to implement the game play simulation method as described in any of the first aspects, and therefore will not be elaborated further here.
[0167] Some embodiments of the present invention provide an electronic device, Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, with reference to... Figure 10 The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the game simulation method of any of the above embodiments, for example, executing the above-described... Figure 2 Method steps S210 to S230, Figure 3 Method steps S310 to S330, Figure 5 Method steps S510 to S550, Figure 7 Method steps S710 to S750.
[0168] The electronic device 1000 of this invention includes one or more processors 1010 and a memory 1020. Figure 10 The example uses a processor 1010 and a memory 1020.
[0169] The processor 1010 and the memory 1020 can be connected via a bus or other means. Figure 10 Taking the example of a connection between China and Israel via a bus.
[0170] Memory 1020, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory 1020 may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 1020 may optionally include memory 1020 remotely located relative to processor 1010. These remote memories can be connected to electronic device 1000 via a network, and examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0171] In some embodiments, when the processor executes a computer program, it executes the simulation method of the game game of any of the above embodiments at preset intervals.
[0172] Those skilled in the art will understand that Figure 10 The device structure shown does not constitute a limitation on the electronic device 1000, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0173] exist Figure 10 In the electronic device 1000 shown, the processor 1010 can be used to call the simulation method of the game game stored in the memory 1020, thereby realizing the simulation method of the game game.
[0174] Based on the hardware structure of the above-mentioned electronic device 1000, various embodiments of the game simulation device of the present invention are proposed. At the same time, the non-transient software program and instructions required to implement the game simulation method of the above embodiments are stored in the memory. When executed by the processor, the game simulation method of the above embodiments is executed.
[0175] This invention also provides a computer-readable storage medium storing computer-executable instructions for executing the above-described game simulation method. These instructions enable one or more processors to execute the game simulation method of any of the above embodiments, for example, to execute the methods described above. Figure 1 Method steps S110 to S150, Figure 3 Method steps S310 to S320, Figure 5 Method steps S510 to S530, Figure 6 Method step S610, Figure 7 Method step S710, Figure 8 Method steps S810 to S820, Figure 9 Method steps S910 to S920.
[0176] This invention also provides a computer program product comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, causing the computer device to perform a simulation method for a game scenario implementing any of the above embodiments, for example, executing the methods described above. Figure 1 Method steps S110 to S150, Figure 3 Method steps S310 to S320, Figure 5 Method steps S510 to S530, Figure 6 Method step S610, Figure 7 Method step S710, Figure 8 Method steps S810 to S820, Figure 9 Method steps S910 to S920.
[0177] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network nodes. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0178] It will be understood by those skilled in the art that all or some of the steps and apparatuses in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. The software can be distributed on a computer-readable medium, which can include computer-readable storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer-readable storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer-readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0179] The above is a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.
Claims
1. A simulation method for game theory, characterized in that, include: Obtain pre-set general interaction paradigm data, which includes interaction control logic in simulation environments of various game types; Obtain a pre-defined unified interface set, which contains interface functions for interacting with the simulation environment of the various game types; Multiple business environments corresponding to the various game types are obtained, a target game environment is selected from the multiple business environments, and a simulation environment adapter corresponding to the target game environment is generated based on the unified interface set. The simulation environment adapter creates a game environment instance corresponding to the target game environment, and at least one agent object corresponding to the game environment instance is created based on the preset agent model. According to the general interaction paradigm, at least one of the intelligent agents will perform game interaction through the game environment instance. The step of controlling at least one of the intelligent agents to engage in game interaction through the game environment instance according to the general interaction paradigm includes: According to the general interaction paradigm, obtain at least one of the intelligent agent objects' game decision information; Based on the game decision information, execute the current simulation steps of the game environment instance in the game to control at least one of the intelligent agents to interact in the game. Furthermore, the game decision information includes action information, survival information, observation information, and reward information. Obtaining the game decision information of at least one of the intelligent agents according to the general interaction paradigm data includes: Initialize the game environment instance and at least one of the intelligent agent objects according to the general interaction paradigm data; The action information is obtained by querying a list of agent identifiers for at least one agent object that can perform actions in the current simulation step. The survival information is obtained by querying whether at least one of the intelligent agent objects corresponding to the intelligent agent identifier list is in a terminated state; Query the observation information of at least one of the intelligent agent objects corresponding to the intelligent agent identifier list; Query the reward information of at least one of the intelligent agent objects corresponding to the intelligent agent identifier list; Additionally, the step of executing the simulation of the game environment instance in the current game state based on the game decision information includes: When it is detected that the target game type corresponding to the target game environment is a single-agent game or a turn-based multi-agent game, action information and reward information are obtained according to the game decision information, and the simulation steps of the game environment instance in the game are executed according to the action information and the reward information. When the target game type is detected to be a non-turn-based multi-agent game, the action information, survival information and reward information are obtained according to the game decision information, and the simulation steps of the game environment instance in the game are executed according to the action information, survival information and reward information. When the target game type is detected to be a perfect information game or an imperfect information game, the action information, observation information and reward information are obtained based on the game decision information, and the simulation steps of the game environment instance in the game are executed based on the action information, observation information and reward information.
2. The simulation method for game theory according to claim 1, characterized in that, After executing the simulation steps of the game environment instance in the game game based on the game decision information to control at least one of the intelligent agents to perform game game interactions, the method further includes: If the game environment instance does not meet the preset termination condition, the process of obtaining the game decision information of at least one of the intelligent agents according to the general interaction paradigm data and the process of executing the simulation steps of the game environment instance in the game based on the game decision information are repeated until the preset termination condition is met.
3. The simulation method for game theory according to claim 1, characterized in that, Before obtaining the preset unified interface set, the method further includes: Multiple interface functions are created to interact with the simulation environment of the various game types, resulting in a unified interface set; The unified interface set includes: The simulation environment initialization interface function is used to initialize the game environment instance; A static metadata interface function is used to provide static metadata of the game environment instance and at least one of the agent objects; Dynamic attribute interface functions are used to dynamically configure attributes for the game environment instance and at least one of the intelligent agent objects based on the static metadata. The intelligent agent action acquisition interface function is used to obtain a list of intelligent agent identifiers for at least one intelligent agent object that can perform actions in the current simulation step; The simulation step interface function is used to execute the current simulation step of the game environment instance; The intelligent agent information query interface function is used to obtain action information, survival information, observation information and reward information of at least one of the intelligent agent objects; A global information acquisition interface function is used to acquire the global state information of the game environment instance and at least one of the intelligent agent objects; The close interface function is used to close the game environment instance.
4. The game simulation method according to claim 3, characterized in that, The step of generating a simulation environment adapter corresponding to the target game environment based on the unified interface set includes: Obtain the configuration information of the business environment corresponding to the target game environment; Based on the configuration information, the simulation environment initialization interface function, the static metadata interface function, the dynamic attribute interface function, the agent action acquisition interface function, the simulation step interface function, the global information acquisition interface function, and the shutdown interface function corresponding to the target game environment are matched and implemented to generate the simulation environment adapter corresponding to the target game environment.
5. The simulation method for game theory according to claim 4, characterized in that, The step of creating a game environment instance corresponding to the target game environment through the simulation environment adapter, and creating at least one agent object corresponding to the game environment instance based on a preset agent model, includes: The configuration information of the business environment is obtained through the simulation environment adapter, so as to create a game environment instance corresponding to the target game environment according to the configuration information; Based on the target game environment, a target agent model is selected from the preset agent models, and at least one agent object corresponding to the game environment instance is created according to the target agent model.
6. The simulation method for game theory according to claim 1, characterized in that, After controlling at least one of the intelligent agents to engage in game interaction through the game environment instance according to the general interaction paradigm data, the method further includes: The simulation environment adapter is used to configure the parameters of the game environment instance and at least one of the intelligent agent objects. The simulation environment adapter obtains the running information of the game environment instance and at least one of the intelligent agents after the parameter configuration, and performs game object analysis based on the running information.
7. A simulation device for a game of strategy, characterized in that, The device includes: The paradigm data acquisition module is used to acquire preset general interaction paradigm data, which includes interaction control logic in simulation environments of various game types. An interface set acquisition module is used to acquire a preset unified interface set, which includes interface functions for interacting with the simulation environment of the various game types. The adapter generation module is used to obtain multiple business environments corresponding to the multiple game types, select a target game environment from the multiple business environments, and generate a simulation environment adapter corresponding to the target game environment based on the unified interface set. The environment instance creation module is used to create a game environment instance corresponding to the target game environment through the simulation environment adapter, and to create at least one intelligent agent object corresponding to the game environment instance based on the preset intelligent agent model. The game interaction module is used to control at least one of the intelligent agents to perform game interaction through the game environment instance according to the general interaction paradigm data. The step of controlling at least one of the intelligent agents to engage in game interaction through the game environment instance according to the general interaction paradigm includes: According to the general interaction paradigm, obtain at least one of the intelligent agent objects' game decision information; Based on the game decision information, execute the current simulation steps of the game environment instance in the game to control at least one of the intelligent agents to interact in the game. Furthermore, the game decision information includes action information, survival information, observation information, and reward information. Obtaining the game decision information of at least one of the intelligent agents according to the general interaction paradigm data includes: Initialize the game environment instance and at least one of the intelligent agent objects according to the general interaction paradigm data; The action information is obtained by querying a list of agent identifiers for at least one agent object that can perform actions in the current simulation step. The survival information is obtained by querying whether at least one of the intelligent agent objects corresponding to the intelligent agent identifier list is in a terminated state; Query the observation information of at least one of the intelligent agent objects corresponding to the intelligent agent identifier list; Query the reward information of at least one of the intelligent agent objects corresponding to the intelligent agent identifier list; Additionally, the step of executing the simulation of the game environment instance in the current game state based on the game decision information includes: When it is detected that the target game type corresponding to the target game environment is a single-agent game or a turn-based multi-agent game, action information and reward information are obtained according to the game decision information, and the simulation steps of the game environment instance in the game are executed according to the action information and the reward information. When the target game type is detected to be a non-turn-based multi-agent game, the action information, survival information and reward information are obtained according to the game decision information, and the simulation steps of the game environment instance in the game are executed according to the action information, survival information and reward information. When the target game type is detected to be a perfect information game or an imperfect information game, the action information, observation information and reward information are obtained based on the game decision information, and the simulation steps of the game environment instance in the game are executed based on the action information, observation information and reward information.
8. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When at least one of the programs is executed by at least one of the processors, the simulation method for game play as described in any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium storing computer-executable instructions for performing a simulation method of a game as described in any one of claims 1 to 6.