HUD element display adjusting method in game and model training method and device
By obtaining the description text of the scene and HUD elements in the game, instantiating the propt template and inputting it into the prediction model to obtain display priority information, dynamically adjusting the display of HUD elements, solving the problem of dynamic changes in player attention and improving the efficiency of information acquisition.
Patent Information
- Application Number
- CN202411659172.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-11-19
AI Technical Summary
The existing technology cannot meet the dynamic changes in players' attention to HUD elements in the game, resulting in misalignment between the elements displayed on the HUD interface and the elements that players actually pay attention to, affecting the efficiency of information acquisition.
By obtaining the scene description text of the game scene where the virtual character is currently in and the description text of the HUD element, instantiate the propt template to generate the target propt, input it into the prediction model to obtain the display priority information of the HUD element, and dynamically adjust the display of the HUD element on the game interface based on this information.
It realizes intelligent dynamic adjustment of HUD elements, adapts to the dynamically changing information needs of players in real time, avoids the misalignment of information and player needs, and allows players to obtain key information in a timely and quickly manner, and improves operational judgment and reaction speed.
Smart Images

Figure CN119701337A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for adjusting the display of HUD elements in a game, a model training method, a device, an electronic device, and a computer-readable storage medium. Background Art
[0002] At present, the Heads-Up Display (HUD) system in the game displays various important information of the player in real time through the game interface or window, such as health points, energy, maps, task prompts and other HUD elements, to help players better understand their own status and surrounding environment during the game, so as to make more effective decisions and operations.
[0003] In the related art, HUD elements are usually displayed using a fixed display level and a preset display rule. For example, each HUD element corresponds to a fixed display level, and a fixed display position and a fixed display mode of each HUD element are determined according to the preset display rule.
[0004] However, since the player's attention to different HUD elements changes dynamically at different game stages, as the game stage changes, the HUD elements displayed on the HUD interface are misaligned with the HUD elements that the player actually pays attention to. Therefore, the above-mentioned related technologies cannot meet the dynamic changes in the player's attention to HUD elements. For example, assuming that the character's health progress bar is fixedly displayed in a prominent position on the HUD interface, and the display size of the technical description icon is small and the display position is not conspicuous, then in the game stage of fierce fighting, the player can check his own health status in time to make decisions. However, when checking the virtual supplies stage, the player cannot find the skill description icon in time, and thus cannot obtain key information in time. Summary of the invention
[0005] The present application provides a method for adjusting the display of HUD elements in a game, a model training method, an apparatus, an electronic device, and a computer-readable storage medium to solve the problem that the existing technology cannot meet the dynamic changes in the player's attention to HUD elements.
[0006] In a first aspect, an embodiment of the present application provides a method for adjusting the display of HUD elements in a game, the method comprising:
[0007] Get the scene description text of the current game scene of the virtual character and the HUD element description text of the HUD element on the current game interface;
[0008] Instantiating a first prompt template according to the scene description text and the HUD element description text, and obtaining a target prompt after instantiation, wherein the first prompt template is used to set a format of input data of a target prediction model, and the target prediction model is used to predict display priority information of a HUD element;
[0009] Inputting the target prompt into the target prediction model to obtain display priority information of the HUD element output by the target prediction model;
[0010] The HUD elements on the game interface are displayed and adjusted according to the display priority information.
[0011] In a second aspect, an embodiment of the present application provides a model training method, the method comprising:
[0012] Acquire multiple groups of first training samples, where the first training samples include scene description text of any game scene and HUD element description text of HUD elements matching the game scene;
[0013] Instantiating a second prompt template according to the first training sample to obtain a prompt training sample after instantiation, wherein the second prompt template is used to set a format of input data when training a pre-trained language model;
[0014] The pre-trained language model is trained according to the prompt training sample, and a target prediction model is obtained after the training is completed. The target prediction model is used to predict the display priority of the HUD element.
[0015] In a third aspect, an embodiment of the present application provides a HUD element display adjustment device in a game, the device comprising:
[0016] The first acquisition module is used to acquire the scene description text of the game scene currently located by the virtual character and the HUD element description text of the HUD element on the current game interface;
[0017] A first processing module is used to instantiate a first prompt template according to the scene description text and the HUD element description text, and obtain a target prompt by instantiating the first prompt template, wherein the first prompt template is used to set a format of input data of a target prediction model, and the target prediction model is used to predict display priority information of the HUD element;
[0018] A prediction module, used for inputting the target prompt into the target prediction model to obtain the display priority information of the HUD element output by the target prediction model;
[0019] An adjustment module is used to adjust the display of the HUD elements on the game interface according to the display priority information.
[0020] In a fourth aspect, an embodiment of the present application provides a model training device, the device comprising:
[0021] A second acquisition module is used to acquire multiple groups of first training samples, where the first training samples include a scene description text of any game scene and a HUD element description text of a HUD element matching the game scene;
[0022] A second processing module is used to instantiate a second prompt template according to the first training sample, and obtain a prompt training sample after instantiation, wherein the second prompt template is used to set the format of input data when training a pre-trained language model;
[0023] The training module is used to train the pre-trained language model according to the prompt training sample, and obtain the target prediction model after the training is completed. The target prediction model is used to predict the display priority of the HUD element.
[0024] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:
[0025] A memory and a processor, wherein the memory and the processor are coupled;
[0026] The memory is used to store one or more computer instructions;
[0027] The processor is used to execute the one or more computer instructions to implement the HUD element display adjustment method in the game described in any one of the first aspect above, or to implement the model training method described in any one of the second aspect above.
[0028] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having one or more computer instructions stored thereon, characterized in that the instruction is executed by a processor to implement the HUD element display adjustment method in the game described in any one of the first aspect above, or to implement the model training method described in any one of the second aspect above.
[0029] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it is used to implement the HUD element display adjustment method in the game described in any one of the first aspect above, or to implement the model training method described in any one of the second aspect above.
[0030] Compared with the prior art, this application has the following advantages:
[0031] The HUD element display adjustment method in the game provided by the present application obtains the scene description text of the current game scene of the virtual character and the HUD element description text of the HUD element on the current game interface; instantiates the first prompt template according to the scene description text and the HUD element description text, and obtains the target prompt after instantiation, wherein the first prompt template is used to set the format of the input data of the target prediction model, and the target prediction model is used to predict the display priority information of the HUD element; the target prompt is input into the target prediction model to obtain the display priority information of the HUD element output by the target prediction model; and the HUD element on the game interface is dynamically adjusted according to the display priority information. The present application adopts an intelligent dynamic adjustment mechanism, which can adapt to the dynamically changing information needs of players in real time, avoids the misalignment between the information provided by the HUD interface and the actual needs of the players, and enables players to obtain key information in a timely and rapid manner, promotes operation judgment and improves reaction speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0033] Figure 1 A flowchart of a model training method provided in the first embodiment of the present application;
[0034] Figure 2 A flowchart of a method for adjusting the display of HUD elements in a game provided in the second embodiment of the present application;
[0035] Figure 3 A schematic diagram of HUD elements before and after adjustment provided in the second embodiment of the present application;
[0036] Figure 4 A schematic diagram of the structure of a HUD element display adjustment device in a game provided in the third embodiment of the present application;
[0037] Figure 5 A schematic diagram of the structure of a model training device provided in the fourth embodiment of the present application;
[0038] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in the fifth embodiment of the present application.
[0039] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0040] In order to make the purpose, advantages and features of the present application clearer, the present application is described clearly and completely below in conjunction with the accompanying drawings and specific embodiments. In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments, and all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0041] It should be noted that, in the description of the present application, the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance, and a specific order or sequence. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, the term "multiple" refers to two or more. The term "and / or" describes the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can be represented: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship. The terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0042] Below, the prior art involved in this application and the problems existing in the prior art are described:
[0043] At present, the Heads-Up Display (HUD) system in the game displays various important information of the player in real time through the game interface or window, such as health points, energy, maps, task prompts and other HUD elements, to help players better understand their own status and surrounding environment during the game, so as to make more effective decisions and operations.
[0044] In the related art, HUD elements are usually displayed using a fixed display level and a preset display rule. For example, each HUD element corresponds to a fixed display level, and the display position and display mode of each HUD element are determined according to the preset display rule.
[0045] However, the above related technologies still have the following problems:
[0046] Problem 1: It is difficult to adapt to the players' dynamically changing information needs: During the game, the players' focus on different information changes dynamically at different stages of the game. The use of a fixed display hierarchy and preset display rules results in a misalignment between the HUD elements displayed on the HUD interface and the HUD elements that the players actually focus on.
[0047] Problem 2: Key information may be blocked, affecting information acquisition efficiency. Due to the use of a fixed display level, when different elements in the HUD are blocked, important information that players care about may be blocked at a lower display level.
[0048] In order to solve the problems existing in the above-mentioned related technologies, the present application provides a method for adjusting the display of HUD elements in a game, a device for adjusting the display of HUD elements in a game corresponding to the display adjustment method, and a model training method, a model training device corresponding to the model training method, and an electronic device and a computer-readable storage medium that can implement the method for adjusting the display of HUD elements in a game and the model training method. The following provides embodiments to describe the above-mentioned methods, devices, electronic devices, and computer-readable storage media in detail.
[0049] In order to make the purpose and technical solution of the present application clearer and more intuitive, the method provided by the embodiment of the present application will be described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. It is understood that the following embodiments may exist separately, and the following embodiments and features in the embodiments may be combined with each other when there is no conflict between the embodiments provided in the present application, and the same or similar content will not be repeated in different embodiments. In addition, the step sequence in the following method embodiments is only an example, not a strict limitation, and in some cases, the steps shown or described may be performed in a different order from this.
[0050] The present application provides a method for adjusting the display of HUD elements in a game, a model training method, an apparatus, an electronic device, and a computer-readable storage medium. Specifically, the method for adjusting the display of HUD elements in a game of one embodiment of the present application can be performed by a computer device, wherein the computer device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, etc. The terminal can also include a client, which can be a game application client, a browser client carrying a game program, or an instant messaging client. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, and big data and artificial intelligence platforms.
[0051] First embodiment
[0052] Next, combine Figure 1 , the model training method provided in the first embodiment of the present application is described, Figure 1 A flowchart of a model training method provided in one of the embodiments of the present application.
[0053] like Figure 1 As shown, the model training method includes steps S110-S130:
[0054] S110, obtaining multiple groups of first training samples, where the first training samples include scene description text of any game scene and HUD element description text of HUD elements matching the game scene.
[0055] S120. Instantiate a second prompt template according to the first training sample, and obtain a prompt training sample after instantiation. The second prompt template is used to set the format of input data when training the pre-trained language model.
[0056] S130, training the pre-trained language model according to the prompt training sample, and obtaining a target prediction model after the training is completed. The target prediction model is used to predict the display priority of the HUD element.
[0057] Next, steps S110 to S130 are described in detail.
[0058] In the embodiment of the present application, considering that players pay attention to different HUD elements in different game scenes, in order to gradually learn the matching relationship between game scenes and HUD elements during the model training process, that is, which HUD elements should be displayed in a game scene, the embodiment of the present application obtains multiple groups of first training sample data, and the first training sample includes the scene description text of any game scene and the HUD element description text of the HUD elements matching the game scene. The scene description texts included in different first training samples describe different game scenes, which makes it easier to guide the model to learn more matching relationships between game scenes and HUD elements during the model training process.
[0059] In an embodiment of the present application, in order to describe the game scene and HUD elements more comprehensively and in detail, the embodiment of the present application performs attribute annotation (or labeling) on the game scene and HUD elements from multiple dimensions to form description texts for the game scene and HUD elements respectively.
[0060] First, a detailed explanation is given on attribute labeling of game scenes from multiple dimensions.
[0061] In the gameplay process, according to the nature of the game and the rhythm of the player experience, several typical game scenes are extracted. For example, game scenes include but are not limited to the novice period, daily exploration, boss battles, PVP confrontation, etc., just as examples. The key elements of each game scene are extracted and structurally annotated, and the annotation dimensions include but are not limited to: scene type, scene goal, scene difficulty, time pressure, key events, and special mechanisms. Among them, scene types, such as towns, dungeons, battlefields, boss battles, etc.; scene goals are used to describe the main goals of players in this scene, such as task completion, confrontation victory, equipment acquisition, etc.; scene difficulty is used to evaluate the degree of challenge of the scene to the player, such as simple, normal, difficult, epic, etc.; time pressure is used to describe the degree of time constraints faced by players in this game scene; key events are used to extract key event nodes in the scene that have a significant impact on player decision-making; special mechanisms are used to annotate special gameplay mechanisms in the scene, such as time-limited BUFFs, random events, etc.
[0062] In an embodiment of the present application, by extracting different game scenes and describing the characteristics of each game scene in each dimension from multiple dimensions, a structured semantic representation of the game scene can be formed, thereby obtaining a structured scene description text corresponding to the game scene.
[0063] Exemplarily, a structured scene description text for a game scene can be: scene: epic boss battle, [scene goal: kill the boss], [scene difficulty: epic], [time pressure: high], [key event: the boss becomes furious and releases a big move], [special mechanism: scene limited-time BUFF], so that the characteristics of the game scene can be portrayed from multiple dimensions.
[0064] The following is a detailed description of attribute labeling of HUD elements from multiple dimensions.
[0065] By selecting representative games from massive game data, and selecting representative and typical games as analysis objects, the HUD interfaces of these games are comprehensively collected. Multi-dimensional attribute annotation is performed on each HUD element (such as text, icon, progress bar, etc.) in the collected HUD interface, and the annotation dimensions include but are not limited to: element type, information category, business importance, interaction mode, information update characteristics, and information update characteristics. Among them, element types include text, icon, progress bar, button, etc.; information categories are used for character attributes, task information, skill descriptions, etc.; business importance is used to refer to the core gameplay and numerical system of the game to evaluate the objective importance of the information carried by the element to the player's decision-making; interaction mode is used to describe the acceptable operations of the element, such as clicking, hovering, dragging, etc.; information update characteristics are used to describe the dynamic changes in the content of the element, such as real-time update, staged display, triggered pop-up, etc.; display life cycle is used to describe the time characteristics of the element displayed in the interface, such as permanent display, timed hiding, staged appearance, etc.
[0066] In an embodiment of the present application, by collecting different HUD interfaces and describing the characteristics of each HUD element in the collected HUD interfaces from multiple dimensions, a structured semantic representation of the HUD elements can be formed, thereby obtaining a structured HUD element description text corresponding to the HUD elements.
[0067] Exemplarily, a structured HUD element description text of a HUD element may be: HUD element: character health bar, [element type: progress bar], [information category: character attribute], [business importance: high], [interaction mode: hover to display details], [update feature: real-time], [display feature: permanent], so that the characteristics of the HUD element can be characterized from multiple dimensions.
[0068] As mentioned above, the second prompt template is used to set the format of input data when training the pre-trained language model.
[0069] Below, two possible second prompt templates are exemplified.
[0070] First, the second prompt template includes a scene description text area, a HUD element description text area and a question area. The scene description text area is used to place the scene description text in the first training sample, the HUD element description text area is used to place the HUD element description text, and the question area is used to place the question text asking about the display priority of the HUD element. The question text can be fixed or modified according to actual needs. The question text can be, for example, "Please rate the display priority of each HUD element (1-5 points) and give reasons." The question text is used to guide the model to output the desired content, such as the rating of the display priority of each HUD element.
[0071] When using the second prompt template, you need to fill in the scene description text area and the HUD element description text area with the scene description text and the HUD element description text of the corresponding game scene respectively.
[0072] The second type, the second prompt template includes a scene background knowledge area, a scene description text area, a HUD element description text area, and a question area. Among them, the scene background knowledge area is used to place the scene background knowledge related to the corresponding game scene. That is to say, compared with the first type, the second type adds a scene background knowledge area to enhance the description of the scene background knowledge of the game scene, so that the model can have a more detailed understanding of the game scene during the training process, thereby helping to give the display priority information of the HUD element that is more matched with the game scene. Similarly, the question text can be fixed or modified according to actual needs. The question text can be, for example, "Please rate the display priority of each HUD element (1-5 points) and give reasons." When using the second prompt template, it is necessary to fill in the scene background knowledge text, scene description text and HUD element description text of the corresponding game scene in the scene background knowledge area, scene description text area and HUD element description text area respectively.
[0073] In an embodiment of the present application, the second prompt template is instantiated according to the first training sample, and the prompt training sample is obtained after instantiation. The second prompt template is used to set the format of input data when training the pre-trained language model.
[0074] Specifically, for the above-mentioned first type of second prompt template, obtain the scene description text and HUD element description text from the first training sample, and fill the obtained scene description text and HUD element description text into the scene description text area and the HUD element description text area respectively. That is, instantiate the second prompt template (the first type) according to the first training sample to obtain an instantiated prompt training sample. That is to say, assuming that there is fixed question text in the question area of the second prompt template, when instantiating this (first type) second prompt template, it is necessary to fill the scene description text and HUD element description text corresponding to the game scene into the scene description text area and the HUD element description text area respectively.
[0075] Exemplarily, a prompt training sample is as follows:
[0076] {<Scene>
[0077] Scene Difficulty: Epic
[0078] Time Pressure: High
[0079] Key Event: Boss Rage
[0080] Special Mechanism: Invincible BUFF
[0081] < / Scene>
[0082] <HUD Element>
[0083] HUD Element 1:
[0084] Element Type: Progress Bar
[0085] Information Category: Character Health
[0086] Business Importance: High
[0087] HUD Element 2:
[0088] Element Type: Icon
[0089] Information Category: Skill Description
[0090] Business Importance: Medium
[0091] ……
[0092] < / HUD Element>
[0093] <Question>
[0094] Please rate the display priority of each HUD element (1-5 points) and give reasons.
[0095] < / Question>}
[0096] Specifically, for the second second prompt template mentioned above, obtain the scene description text and HUD element description text from the first training sample, and fill the obtained scene description text and HUD element description text into the scene description text area and the HUD element description text area respectively, and obtain the scene background knowledge related to the game scene and fill the obtained scene background knowledge into the scene background knowledge area, that is, instantiate the second prompt template (the second one) according to the first training sample to obtain the instantiated prompt training sample. That is to say, assuming that there is fixed question text in the question area of the second prompt template, when using this second prompt template, it is necessary to fill in the scene background knowledge text, scene description text and HUD element description text corresponding to the game scene into the scene background knowledge area, the scene description text area and the HUD element description text area respectively.
[0097] Exemplarily, a prompt training sample is as follows:
[0098] {<Scene background knowledge>
[0099] The current game scene is "Demon King's Hall" (scene id: s100), and the key HUD elements of this game scene include the BOSS health bar, skill cooldown reminder, etc.;
[0100] The player is performing the task "Defeat the Demon King" (task id: t050), and the relevant HUD elements of this task include a task timer, BOSS position guidance, etc.;
[0101] The BOSS is currently in the "Rage State" (event id: e200), and information such as the character's health and defensive skills needs to be focused on in the rage state.
[0102] < / Scene background knowledge>
[0103] <Scene>
[0104] Scene difficulty: Epic
[0105] Time pressure: High
[0106] Key event: Boss gets enraged
[0107] Special mechanism: Invincible BUFF
[0108] < / Scene>
[0109] <HUD element>
[0110] HUD element 1:
[0111] Element type: Progress bar
[0112] Information category: Character HP
[0113] Business importance: High
[0114] HUD Element 2:
[0115] Element type: Icon
[0116] Information category: Skill description
[0117] Business importance: Medium
[0118] ……
[0119] < / HUD Element>
[0120] <Question>
[0121] Please rate the display priority of each HUD element (1 - 5 points) and give reasons.
[0122] < / Question>}
[0123] Next, a possible implementation method for obtaining scene background knowledge related to the game scene will be described, including steps S111 - S112:
[0124] S111. Obtain a game knowledge graph, which includes multiple nodes and edges connecting two nodes. Different nodes are used to represent different game elements, and the edges are used to represent the semantic association between the game elements represented by the two connected nodes.
[0125] S112. Determine the scene background knowledge related to the game scene based on the game knowledge graph and the scene description text.
[0126] As described above, the game knowledge graph is a structured data model that organizes and displays a large amount of game - related information in the form of a graph.
[0127] The construction process of the game knowledge graph is as follows: First, extract important game elements such as the basic concepts, term expressions, narrative styles, gameplay rules, and character relationships of the game from a large amount of game data (such as game text materials, player guides, live commentaries, etc.). For example, important game elements include, but are not limited to: game characters, equipment, skills, quests, maps, dungeons, etc. Among them, the attributes related to game characters include, but are not limited to, profession, gender, and faction; the attributes related to equipment include, but are not limited to, name, type, and rarity.
[0128] Subsequently, the knowledge graph technology is used to semantically model the above game elements, define nodes and edges. Nodes are used to represent game elements in the game; edges are used to represent semantic associations between nodes. Edges representing different semantic relationships include but are not limited to: own, belong to, be located in, strengthen, upgrade, restrain, etc.
[0129] Finally, based on massive game data, node instances are extracted and edge relationships between node instances are constructed. For example, specific character A, equipment B, and character A owning equipment B are identified from the game data, and an edge with a semantic relationship of "owns" is established between the node representing character A (i.e., node instance) and the node representing equipment B (i.e., node instance). The game knowledge network formed by continuously enriching node instances and edge relationships is the game knowledge graph. The game knowledge graph covers all aspects of the game and can flexibly express the semantic connections between game elements.
[0130] For example, "character 1 has equipment 2" in the game knowledge graph means: the character node representing character 1 and the equipment node representing equipment 2 are connected by an edge representing the "own" relationship. For another example, "equipment 2 strengthens skill 3" in the game knowledge graph means: the equipment node representing equipment 2 and the skill node representing skill 3 are connected by an edge representing the "strengthen" relationship.
[0131] In the embodiment of the present application, by defining nodes (such as characters, equipment, skills, etc.) used to represent game elements and various relationship edges (such as ownership, enhancement, upgrade, etc.) between nodes, the knowledge in the massive game data is refined into a structured semantic network to obtain a game knowledge graph. The game knowledge graph covers all aspects of the game and provides rich game common sense and domain knowledge for training the pre-trained language model.
[0132] In the embodiment of the present application, based on the above-mentioned game knowledge graph, according to the scene description text, the scene background knowledge related to the game scene described by the scene description text is determined from the game knowledge graph. Specifically, from the game knowledge graph, the game elements contained in the scene description text are searched, and other game elements that have semantic associations with the game elements are found, so as to obtain the scene background knowledge related to the game scene described by the scene description text.
[0133] For example, from the scene description text, it can be known that the game scene currently being played by the player is a BOSS battle, then the following information can be queried from the game knowledge graph: "The current game scene is "Devil's Hall" (scene id: s100), and the key HUD elements of this game scene include the BOSS health bar, skill cooldown prompts, etc.; the player is performing the task "Defeat the Demon King" (task id: t050), and the relevant HUD elements of this task include the task timer, BOSS location guide, etc.; the BOSS is currently in a "violent state" (event id: e200), and in the violent state, you need to focus on the character's health, defense skills and other information.".
[0134] In the embodiment of the present application, the pre-trained language model is trained according to the prompt training sample, and a target prediction model is obtained after the training is completed. The target prediction model is used to predict the display priority of the HUD element.
[0135] As mentioned above, the pre-trained language model is a model trained using a large-scale text dataset. The main purpose of pre-training is to enable the model to capture the contextual relationship and semantic structure of the language. Pre-trained language models refer to models that can understand and generate natural language. These models can not only recognize the meaning of the words themselves, but also understand the relationship between words and their meaning in sentences. Pre-trained language models can be used to perform a variety of tasks such as question answering, text generation, sentiment analysis, etc.
[0136] In the embodiments of the present application, a large language model of the Transformer type, such as GPT-3, PaLM, etc., can be used. This type of model is based on the self-attention mechanism and forms a deep network by stacking multiple transformer blocks. In the pre-training stage, the model performs self-supervised learning on a large amount of text corpus and masters rich language knowledge. The encoder part of the model maps the text input into a semantic vector, and the decoder part generates the target text based on the semantic vector. Pre-training semantics enables the model to understand and generate natural language.
[0137] Based on the prompt training samples constructed respectively from the above-mentioned multiple first training samples, in each round of model training, one prompt training sample is used as input data of the pre-trained language model for supervised learning, so that it learns to predict the display priority score of the HUD element based on the scene description text.
[0138] Continuously increasing the number and richness of the first training samples can improve the accuracy of the model's understanding of scene semantics and prediction of the HUD elements that go with them. Incorporating structured scene background knowledge as a priori can help the model more efficiently grasp the specific rules of HUD layout optimization in different game scenarios. By repeating the above training steps, the trained pre-trained language model gradually establishes a mapping relationship between scene features and reasonable HUD matching. The repeated combination of different scene description texts with the corresponding HUD element description texts enables the model to extract and summarize the general rules of "specific scene-HUD presentation" from a large number of first training samples.
[0139] After training, the pre-trained language model (i.e., the target prediction model) learns the implicit correspondence between the game scene features and the best HUD collocation in a large number of labeled samples. The encoder part in the pre-trained language model (such as the self-attention layer of the transformer) can extract the key features of the game scene in terms of difficulty, time pressure, key events, etc. from the scene description text to form a scene embedding vector rich in semantic information. At the same time, the encoder also represents the attribute information (such as element type, information carried, update frequency, etc.) of each HUD element to be evaluated (such as character health bar, skill icon, etc.) as a semantic vector. Through the attention mechanism, the model can analyze the correlation between the semantic vector of each HUD element and the scene semantic vector, that is, the importance of the HUD element to the current scene. In the decoder part, the model comprehensively considers the semantic association information contained in the encoding stage and evaluates the display priority of each HUD element. If the semantics of an element (such as the character's health) is highly correlated with the semantics of a critical scene (such as BOSS rage), the model will judge it as key information and generate a higher priority score, while elements that are not related to the current scene (such as backpack icons) will be rated as low priority. After training, the pre-trained language model (i.e., target prediction model) realizes real-time evaluation of the importance of HUD elements through semantic modeling and association analysis.
[0140] In the embodiment of the present application, through the structured input method of scene description text, HUD element description text, and question text, the integration of the game knowledge graph, and targeted fine-tuning, the model is endowed with the ability to understand the specific game scenes "what it is" and "why it is", enabling it to make HUD priority assessments that meet the scene requirements.
[0141] The model training method provided in the embodiment of the present application first obtains multiple groups of first training samples, wherein the first training samples include scene description text of any game scene and HUD element description text of the HUD element matching the game scene. According to the first training sample, the second prompt template is instantiated, and the prompt training sample is obtained after instantiation. The second prompt template is used to set the format of input data when training the pre-trained language model. The pre-trained language model is trained according to the prompt training sample, and the target prediction model is obtained after the training is completed. The target prediction model is used to predict the display priority of the HUD element. Through the structured input method of the scene description text and the HUD element description text, the present application endows the pre-trained language model with the ability to "know what it is" and "know why it is" to understand the game scene through targeted fine-tuning, so that it can make a HUD element priority assessment that meets the scene requirements.
[0142] Based on the above-mentioned first embodiment, the model training method provided in the first embodiment of the present application is further explained.
[0143] In an optional implementation manner, before the training is completed to obtain the target prediction model, the model training method further includes A1-A2:
[0144] A1. Acquire multiple groups of second training samples, where the second training samples include scene description samples, HUD element description texts of HUD elements on a game interface, and display priority information of the HUD elements.
[0145] A2. Train the pre-trained language model according to the second training sample.
[0146] In the embodiment of the present application, the model can also be trained using second sample data consisting of scene description samples, HUD element description text of HUD elements on the game interface, and display priority information of HUD elements. In other words, adding a small number of pre-made "scene-HUD layout-priority score" cases in the above training process can allow the model to better learn the correspondence between different dimensional features and priority scores, which is equivalent to establishing a stronger correspondence between model training data and model output, so that the model can better "learn from one example and apply it to other situations".
[0147] Second embodiment
[0148] Next, combine Figure 2 , the HUD element display adjustment method in the game provided by the second embodiment of the present application is described, Figure 2 A flowchart of a method for adjusting the display of HUD elements in a game provided in the second embodiment of the present application.
[0149] like Figure 2As shown, the HUD element display adjustment method in the game includes steps S210-S240:
[0150] S210: Obtain a scene description text of a game scene currently located in the virtual character and a HUD element description text of a HUD element on a current game interface.
[0151] S220. Instantiate the first prompt template according to the scene description text and the HUD element description text, and obtain the target prompt after instantiation. The first prompt template is used to set the format of the input data of the target prediction model, and the target prediction model is used to predict the display priority information of the HUD element.
[0152] S230. Input the target prompt into the target prediction model to obtain the display priority information of the HUD element output by the target prediction model.
[0153] S240: Adjust the display of HUD elements on the game interface according to the display priority information.
[0154] Next, steps S210 - S240 are described in detail.
[0155] In an embodiment of the present application, while the player is playing the game, the system captures in real time the scene description text of the current game scene in which the virtual character controlled by the player is currently located and the HUD element description text of the HUD elements on the current game interface.
[0156] For example, the scene description text is: <Scene Difficulty: Epic><Time Pressure: High><Key Event: Boss Rage><Special Mechanism: Invincible BUFF>.
[0157] The HUD element scene description text is: HUD element 1: <element type: progress bar><information category: character health><business importance: high>; HUD element 2: <element type: icon><information category: skill description><business importance: medium>...
[0158] In an optional implementation, the first prompt template includes a scene description text area, a HUD element description text area, and a question area, wherein the question area is used to place question text inquiring about the display priority of the HUD element.
[0159] As described above, the first prompt template is used to set the format of the input data of the target prediction model, and the target prediction model is used to predict the display priority information of the HUD element.
[0160] Below, two possible first prompt templates are exemplified.
[0161] The first type, the first prompt template includes a scene description text area, a HUD element description text area and a question area. Among them, the scene description text area is used to place the scene description text of the current game scene of the virtual character, the HUD element description text area is used to place the HUD element description text, and the question area is used to place the question text asking about the display priority of the HUD element. Among them, the question text can be fixed or modified according to actual needs. The question text can be, for example, "Please rate the display priority of each HUD element (1-5 points) and give reasons." Among them, the question text is used to guide the target prediction model to output a score for the display priority of each HUD element.
[0162] When using the first prompt template, you need to fill in the scene description text area and the HUD element description text area with the scene description text and the HUD element description text of the corresponding game scene respectively, and you can get the target prompt after instantiation.
[0163] The second type, the first prompt template includes a scene background knowledge area, a scene description text area, a HUD element description text area, and a question area. Among them, the scene background knowledge area is used to place the scene background knowledge related to the current game scene of the virtual character. That is to say, compared with the first type, the first type adds a scene background knowledge area to enhance the description of the scene background knowledge of the game scene, so that the target prediction model can have a more detailed understanding of the game scene in which the game character is currently located during the prediction process, thereby helping to provide the display priority information of the HUD element that is more matched with the game scene. Similarly, among them, the question text can be fixed or modified according to actual needs. The question text can be, for example, "Please rate the display priority of each HUD element (1-5 points) and give reasons." When using the first prompt template, it is necessary to fill in the scene background knowledge text, scene description text and HUD element description text of the corresponding game scene in the scene background knowledge area, scene description text area and HUD element description text area, respectively, and the target prompt can be obtained after instantiation.
[0164] Specifically, the step of acquiring scene background knowledge may be: acquiring a game knowledge graph, the game knowledge graph includes multiple nodes and edges connecting two nodes, different nodes are used to represent different game elements, and edges are used to represent the semantic association between the game elements represented by the two connected nodes. According to the game knowledge graph and the scene description text, the scene background knowledge related to the current location of the virtual character is determined.
[0165] Optionally, for an explanation of a possible implementation of obtaining scene background knowledge related to a game scene, reference may be made to the above descriptions and explanations for steps S111 - S112, and the same technical effects can be achieved. To avoid repetition, it will not be elaborated here.
[0166] In the embodiments of the present application, the target prompt is input into the target prediction model, and the display priority information of the HUD elements output by the target prediction model is obtained. After using the target prompt as input data to the target prediction model, based on the understanding of the game scene, the display priority (importance level) of each HUD element is determined. For example, if the question text is "Please rate the display priority of each HUD element (1 - 5 points) and give reasons", then the target prediction model outputs an estimated score of 1 - 5 points for each HUD element and provides a decision basis.
[0167] Exemplarily, an exemplary description is given for the target prompt input into the target prediction model and the predicted display priorities of each HUD element output by the target prediction model:
[0168] The target prompt is as follows:
[0169] {<Scene>
[0170] Scene difficulty: Epic
[0171] Time pressure: High
[0172] Key event: Boss rage
[0173] Special mechanism: Invincibility buff
[0174] < / Scene>
[0175] <HUD element>
[0176] HUD element 1:
[0177] Element type: Progress bar
[0178] Information category: Character health
[0179] Business importance: High
[0180] HUD element 2:
[0181] Element type: Icon
[0182] Information category: Skill description
[0183] Business importance: Medium ...
[0185] < / HUD element>
[0186] <Question>
[0187] Please rate the display priority of each HUD element (from 1 to 5 points) and give reasons.
[0188] < / Question>}
[0189] The target prediction model outputs the display priorities of the predicted HUD elements as follows:
[0190] {<Answer>
[0191] HUD Element 1 (Character Health Progress Bar): 4 points
[0192] Reason: During the boss's enraged phase, players face great survival pressure. Timely understanding of their own health status is crucial for making defenses, recoveries, and other responses. Therefore, the character health progress bar needs to be prominently displayed.
[0193] HUD Element 2 (Skill Explanation Icon): 2 points
[0194] Reason: The primary task of players during the boss's enraged period is survival, and skills are used less frequently. In contrast, the importance of skill explanations decreases. It is recommended to lower the display priority of this element during this phase to avoid interfering with players' access to key information. ...
[0196] < / Answer>.}
[0197] In the embodiment of the present application, after receiving the scene description text and HUD element description text, the target prediction model, based on the understanding of the game scene, gives a display priority estimation score to the display priority (importance level) of each HUD element and provides a decision basis. The priority score comprehensively considers factors such as the category of information carried by the HUD element, its relevance to the scene goal, and the timeliness of the information. The level of the priority score directly reflects the objective importance of the HUD in the current scene and provides a decision reference for subsequent HUD layout adjustments.
[0198] An alternative implementation manner, a possible implementation of step S204 "adjust the display of HUD elements on the game interface according to the display priority information" includes steps S241 - S242:
[0199] S241. According to the display priority information, determine the display manner of each HUD element, and the display manner includes at least one of the following: visibility, display position, display size, and display level.
[0200] S242. Adjust the display of HUD elements on the game interface according to the display manner of each HUD element.
[0201] In an embodiment of the present application, based on the priority estimation scores of the HUD elements, the game client dynamically optimizes the HUD layout from multiple dimensions such as visibility, position, size, and hierarchy.
[0202] In the embodiment of the present application, the adjustment ideas for the visibility dimension of the HUD elements include but are not limited to: for non-critical elements with lower priority (such as 1-2 points), consider hiding or folding them when the interface space is insufficient to reduce the distraction of the player's attention. For critical elements with higher priority (such as 4-5 points), always keep them in permanent display, and expand the display size when necessary to ensure that information acquisition is not affected.
[0203] Example: In an intense battle scene, non-core elements such as skill descriptions and achievement progress can be temporarily hidden to give priority to key information such as character health and skill CD.
[0204] In the embodiment of the present application, the idea of adjusting the size dimension of the HUD elements includes but is not limited to: automatically adjusting important elements with high priority to a prominent position in the interface, such as the center of near field of vision, the golden triangle area, etc., and appropriately expanding the display size.
[0205] In the embodiment of the present application, HUD elements with similar priorities are arranged in a cluster as much as possible to facilitate players to quickly read and associate. Example: In the Boss battle scene, key elements such as the Boss health bar and remaining time are automatically placed in the center of the near field of vision and the size is appropriately enlarged; the player's health bar, skill shortcut bar, etc. are aggregated in the lower left corner to avoid being too scattered.
[0206] In an embodiment of the present application, the adjustment ideas for HUD elements in the depth dimension of element hierarchy include but are not limited to: the interface elements automatically adjust the front and back occlusion relationship according to the priority score to ensure that key information is at the top layer and is not covered by other secondary elements, thereby improving the efficiency of game players in obtaining information.
[0207] Elements of the same level follow the principle of "first come, first served". Newly appeared elements cannot block the first displayed elements of the same level. Example: In a battle scene, the player character's health bar is always at the top and will not be blocked by skill effects, floating text, etc.; the newly appeared pickup prompt cannot block the skill CD number displayed first.
[0208] The HUD element display adjustment method in the game provided by the embodiment of the present application first obtains the scene description text of the game scene currently in which the virtual character is located and the HUD element description text of the HUD element on the current game interface. Subsequently, according to the scene description text and the HUD element description text, the first prompt template is instantiated, and the target prompt is obtained after instantiation. The first prompt template is used to set the format of the input data of the target prediction model, and the target prediction model is used to predict the display priority information of the HUD element. Then, the target prompt is input into the target prediction model to obtain the display priority information of the HUD element output by the target prediction model. Finally, according to the display priority information, the HUD elements on the game interface are displayed and adjusted. This application is based on the scene description text of the game scene currently in which the virtual character is located and the HUD element description text of the HUD element on the current game interface, and the display priority information of the HUD element output by the target prediction model. Based on the display priority information of the HUD element, the HUD elements on the game interface are displayed and adjusted. In the embodiment of the present application, the display priority of the HUD elements changes dynamically according to the game scene, and an intelligent dynamic adjustment mechanism is adopted to adapt to the dynamically changing information needs of the players in real time, thereby avoiding the misalignment between the information provided by the HUD interface and the actual needs of the players, allowing the players to obtain key information in a timely and rapid manner, promoting operational judgment and improving reaction speed.
[0209] Based on the above-mentioned second embodiment, the method for adjusting the display of HUD elements in the game provided in the second embodiment of the present application is further explained.
[0210] In an optional implementation manner, a possible implementation manner of the above step S240 "adjusting the display of the HUD elements on the game interface" includes step S242:
[0211] S242. Adjust the color matching, alignment, and spacing ratio between HUD elements.
[0212] In the embodiment of the present application, in terms of color matching, the formulation of the overall color scheme of the HUD needs to comprehensively consider factors such as the main color of the game screen and the emotional atmosphere, and select a color system that is coordinated with the main screen and has appropriate light and dark contrast. Under the premise of maintaining overall harmony, individual HUD elements can use slightly contrasting colors, such as yellow flashing health value warnings, red attack skill icons, etc., to use color changes to remind players of the special importance of the element. For large amounts of text information, pay attention to the contrast between the background color and the text color to meet the needs of barrier-free reading.
[0213] In the embodiment of the present application, in terms of alignment, in order to pursue visual simplicity and unity, the alignment inside the HUD submodule should be left-aligned or right-aligned, depending on the specific layout requirements. It is recommended to use a monospaced font for text descriptions and numbers in different fields to keep them uniform and facilitate players to quickly obtain information. The alignment of adjacent HUD elements (up, down, left, and right) should be consistent, and less diagonal cutting should be used to avoid unevenness.
[0214] In the embodiment of the present application, in terms of spacing ratio, the spacing between HUD modules and the spacing between elements within the modules should be appropriate to give players an appropriate visual buffer. Usually 2% of the display area width is used as the benchmark unit, and the inner and outer margins of the elements can be set as multiples on this basis. Set the low-priority description text to a smaller font size (not less than the minimum font size specified by the game), and keep a distance from icons and numbers to avoid overshadowing them.
[0215] Next, combine Figure 3 , an exemplary description is given of adjusting the display mode of the HUD element according to the display priority of the HUD element, Figure 3 A schematic diagram of HUD elements before and after adjustment provided in one of the embodiments of the present application.
[0216] like Figure 3 As shown in the figure, before the adjustment, the health bar, compass, task, and skill icons were all displayed, and the game buff logo (i.e., game buff, a kind of "magic" or "effect" that enhances the character's own ability) was displayed in a smaller size. After the HUD elements on the HUD interface are optimized through multi-dimensional layout, they are immediately reflected in the user interface. After the adjustment, the health bar layer is always displayed on the top layer, the compass and tasks are hidden, the game buff logo is enhanced (i.e., the display size of the game buff logo becomes larger), and the skill icon is displayed as a group of dots by folding the icon. After the display adjustment of the HUD elements, the user perceives the intelligent HUD elements that match the rhythm of the game, obtain information efficiently, and are beautiful.
[0217] In an optional implementation manner, a possible implementation manner of the above step S240 "adjusting the display of the HUD elements on the game interface" includes step S243:
[0218] S243: In response to satisfying a preset condition, adjusting the display of the HUD element on the game interface. The preset condition includes at least one of the following: a preset time driving condition and a preset event driving condition.
[0219] In the embodiment of the present application, it can be based on a preset time driving condition, or it can be based on a preset time driving condition, or it can be a combination of the two trigger mechanisms to trigger the HUD elements on the game interface to adjust the display according to the game scene. Specifically, the preset time driving condition, such as a high-frequency periodic trigger (such as every second), can ensure that the HUD interface display responds to the scene changes in real time, and at the same time, it is supplemented by an event-driven trigger mechanism to make targeted optimizations to the HUD elements at key game nodes, and the two trigger mechanisms are combined.
[0220] Below, the HUD element display adjustment device in the game provided by the present application is described. The HUD element display adjustment device in the game described below and the HUD element display adjustment method in the game described above can be referenced to each other.
[0221] Figure 4 This is a schematic diagram of the structure of the HUD element display adjustment device in the game provided in the third embodiment of the present application. Figure 4 As shown, the HUD element display adjustment device 400 in the game includes: a first acquisition module 401, a first processing module 402, a prediction module 403, and an adjustment module 404.
[0222] The first acquisition module is used to acquire the scene description text of the game scene currently located by the virtual character and the HUD element description text of the HUD element on the current game interface;
[0223] A first processing module is used to instantiate a first prompt template according to the scene description text and the HUD element description text, and obtain a target prompt by instantiating the first prompt template, wherein the first prompt template is used to set a format of input data of a target prediction model, and the target prediction model is used to predict display priority information of the HUD element;
[0224] A prediction module, used for inputting the target prompt into the target prediction model to obtain the display priority information of the HUD element output by the target prediction model;
[0225] An adjustment module is used to adjust the display of the HUD elements on the game interface according to the display priority information.
[0226] An optional implementation manner is characterized in that the adjustment module is specifically used to:
[0227] Determining a display mode of each HUD element according to the display priority information, wherein the display mode includes at least one of the following: visibility, display position, display size, and display level;
[0228] According to the display mode of each HUD element, the display of the HUD elements on the game interface is adjusted.
[0229] In an optional implementation manner, the adjustment module is further used for:
[0230] Adjust the color matching, alignment, and spacing ratio between the HUD elements.
[0231] In an optional implementation manner, the first prompt template includes a scene description text area, a HUD element description text area, and a question area, wherein the question area is used to place question text inquiring about the display priority of the HUD element.
[0232] In an optional implementation manner, the first prompt template further includes: a scene background knowledge area, the scene background knowledge area is used to place scene background knowledge related to the current location of the virtual character; the first acquisition module is also used to:
[0233] Obtaining a game knowledge graph, wherein the game knowledge graph includes a plurality of nodes and an edge connecting two of the nodes, wherein different nodes are used to represent different game elements, and the edge is used to represent a semantic association between the game elements represented by the two connected nodes;
[0234] According to the game knowledge graph and the scene description text, the scene background knowledge related to the game scene in which the virtual character is currently located is determined.
[0235] In an optional implementation manner, the adjustment module is further used for:
[0236] In response to satisfying a preset condition, the HUD element on the game interface is displayed and adjusted; the preset condition includes at least one of the following: a preset time-driven condition and a preset event-driven condition.
[0237] The HUD element display adjustment device in the game provided in this embodiment can be used to execute the technical solution of the HUD element display adjustment method embodiment in the above-mentioned game. Its implementation principle and technical effects are similar, and this embodiment will not be repeated here.
[0238] The model training device provided in the present application is described below. The model training device described below and the model training method described above can be referenced to each other.
[0239] Figure 5 This is a schematic diagram of the structure of the model training device provided in the fourth embodiment of the present application. Figure 5 As shown, the model training device 500 includes: a second acquisition module 501, a second processing module 502, and a training module 503.
[0240] A second acquisition module is used to acquire multiple groups of first training samples, where the first training samples include a scene description text of any game scene and a HUD element description text of a HUD element matching the game scene;
[0241] A second processing module is used to instantiate a second prompt template according to the first training sample, and obtain a prompt training sample after instantiation, wherein the second prompt template is used to set the format of input data when training a pre-trained language model;
[0242] The training module is used to train the pre-trained language model according to the prompt training sample, and obtain the target prediction model after the training is completed. The target prediction model is used to predict the display priority of the HUD element.
[0243] In an optional implementation, the second prompt template includes a scene description text area, a HUD element description text area and a question area, and the question area is used to place question text inquiring about the display priority of the HUD element.
[0244] In an optional implementation manner, the second prompt template further includes at least one of the following: a scene background knowledge area, the scene background knowledge area is used to place scene background knowledge related to the game scene; the second acquisition module is also used to:
[0245] Obtaining a game knowledge graph, wherein the game knowledge graph includes a plurality of nodes and an edge connecting two of the nodes, wherein different nodes are used to represent different game elements, and the edge is used to represent a semantic association between the game elements represented by the two connected nodes;
[0246] Based on the game knowledge graph and the scene description text, scene background knowledge related to the current game scene is determined.
[0247] In an optional implementation manner, the training module is further used for:
[0248] Acquire multiple groups of second training samples, where the second training samples include scene description samples, HUD element description texts of HUD elements on the game interface, and display priority information of the HUD elements;
[0249] The pre-trained language model is trained according to the second training sample.
[0250] The model training device provided in this embodiment can be used to execute the technical solution of the above-mentioned model training method embodiment. Its implementation principle and technical effects are similar, and this embodiment will not be repeated here.
[0251] Figure 6A hardware structure diagram of an electronic device provided in the fifth embodiment of the present application is shown in FIG. Figure 6 As shown, the electronic device 600 of this embodiment includes: a processor 601 and a memory 602;
[0252] Memory 602, used to store computer-executable instructions;
[0253] The processor 601 is used to execute the computer-executable instructions stored in the memory to implement the various steps performed by the HUD element display adjustment method in the game in the above embodiment, or to implement the technical solution corresponding to the model training method in any of the above embodiments. For details, please refer to the relevant description in the above method embodiment.
[0254] Optionally, the memory 602 may be independent or integrated with the processor 601 .
[0255] When the memory 602 is independently provided, the electronic device further includes a bus 603 for connecting the memory 602 and the processor 601 .
[0256] The sixth embodiment of the present application also provides a computer-readable storage medium, in which computer execution instructions are stored. When the processor executes the computer execution instructions, the technical solution corresponding to the HUD element display adjustment method in the game in any of the above embodiments is implemented as executed by the above electronic device, or the technical solution corresponding to the model training method in any of the above embodiments.
[0257] The seventh embodiment of the present application also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of the electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the technical solution corresponding to the HUD element display adjustment method in the game in any of the above embodiments, or the technical solution corresponding to the model training method in any of the above embodiments.
[0258] Although the present application is disclosed as above in the form of a preferred embodiment, it is not intended to limit the present application. Any technical personnel in this field may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be based on the scope defined by the claims of the present application.
[0259] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0260] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present application.
[0261] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0262] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0263] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0264] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0265] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0266] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for adjusting the display of HUD elements in a game, characterized in that: The method comprises: Get the scene description text of the current game scene of the virtual character and the HUD element description text of the HUD element on the current game interface; Instantiating a first prompt template according to the scene description text and the HUD element description text, and obtaining a target prompt after instantiation, wherein the first prompt template is used to set a format of input data of a target prediction model, and the target prediction model is used to predict display priority information of a HUD element; Inputting the target prompt into the target prediction model to obtain display priority information of the HUD element output by the target prediction model; The HUD elements on the game interface are displayed and adjusted according to the display priority information.
2. The method according to claim 1, characterized in that The step of adjusting the display of the HUD elements on the game interface according to the display priority information includes: Determining a display mode of each HUD element according to the display priority information, wherein the display mode includes at least one of the following: visibility, display position, display size, and display level; According to the display mode of each HUD element, the display of the HUD elements on the game interface is adjusted.
3. The method according to claim 2, characterized in that The method further comprises: Adjust the color matching, alignment, and spacing ratio between the HUD elements.
4. The method according to claim 1, characterized in that The first prompt template includes a scene description text area, a HUD element description text area, and a question area, wherein the question area is used to place question text inquiring about the display priority of the HUD element.
5. The method according to claim 4, characterized in that The first prompt template further includes: a scene background knowledge area, wherein the scene background knowledge area is used to place scene background knowledge related to the game scene currently located by the virtual character; the method further includes: Obtaining a game knowledge graph, wherein the game knowledge graph includes a plurality of nodes and an edge connecting two of the nodes, wherein different nodes are used to represent different game elements, and the edge is used to represent a semantic association between the game elements represented by the two connected nodes; According to the game knowledge graph and the scene description text, the scene background knowledge related to the game scene in which the virtual character is currently located is determined.
6. The method according to claim 1, characterized in that The display adjustment of the HUD elements on the game interface includes: In response to satisfying a preset condition, the HUD element on the game interface is displayed and adjusted; the preset condition includes at least one of the following: a preset time-driven condition and a preset event-driven condition.
7. A model training method, characterized in that: The method comprises: Acquire multiple groups of first training samples, where the first training samples include scene description text of any game scene and HUD element description text of HUD elements matching the game scene; Instantiating a second prompt template according to the first training sample to obtain a prompt training sample after instantiation, wherein the second prompt template is used to set a format of input data when training a pre-trained language model; The pre-trained language model is trained according to the prompt training sample, and a target prediction model is obtained after the training is completed. The target prediction model is used to predict the display priority of the HUD element.
8. The method according to claim 7, characterized in that The second prompt template includes a scene description text area, a HUD element description text area and a question area, wherein the question area is used to place question text inquiring about the display priority of the HUD element.
9. The method according to claim 8, characterized in that The second prompt template further includes at least one of the following: a scene background knowledge area, the scene background knowledge area is used to place scene background knowledge related to the game scene; the method further includes: Obtaining a game knowledge graph, wherein the game knowledge graph includes a plurality of nodes and an edge connecting two of the nodes, wherein different nodes are used to represent different game elements, and the edge is used to represent a semantic association between the game elements represented by the two connected nodes; Based on the game knowledge graph and the scene description text, scene background knowledge related to the game scene is determined.
10. The method according to claim 7, characterized in that Before the training is completed to obtain the target prediction model, the method further includes: Acquire multiple groups of second training samples, where the second training samples include scene description samples, HUD element description texts of HUD elements on the game interface, and display priority information of the HUD elements; The pre-trained language model is trained according to the second training sample.
11. A HUD element display adjustment device in a game, characterized in that: The device comprises: The first acquisition module is used to acquire the scene description text of the game scene currently located by the virtual character and the HUD element description text of the HUD element on the current game interface; A first processing module is used to instantiate a first prompt template according to the scene description text and the HUD element description text, and obtain a target prompt by instantiating the first prompt template, wherein the first prompt template is used to set a format of input data of a target prediction model, and the target prediction model is used to predict display priority information of the HUD element; A prediction module, used for inputting the target prompt into the target prediction model to obtain the display priority information of the HUD element output by the target prediction model; An adjustment module is used to adjust the display of the HUD elements on the game interface according to the display priority information.
12. A model training device, characterized in that: The device comprises: A second acquisition module is used to acquire multiple groups of first training samples, where the first training samples include a scene description text of any game scene and a HUD element description text of a HUD element matching the game scene; A second processing module is used to instantiate a second prompt template according to the first training sample, and obtain a prompt training sample after instantiation, wherein the second prompt template is used to set the format of input data when training a pre-trained language model; The training module is used to train the pre-trained language model according to the prompt training sample, and obtain the target prediction model after the training is completed. The target prediction model is used to predict the display priority of the HUD element.
13. An electronic device, characterized in that: The electronic device comprises: Processor; and A memory for storing a data processing program. After the electronic device is powered on and runs the program through the processor, it executes the HUD element display adjustment method in the game as described in any one of claims 1-6, or executes the model training method as described in any one of claims 7-10.
14. A computer-readable storage medium, characterized in that: A data processing program is stored, and the program is run by a processor to execute the HUD element display adjustment method in the game as described in any one of claims 1-6, or to execute the model training method as described in any one of claims 7-10.
Citation Information
Patent Citations
Method and system for implementing window local modal in game
CN101441559A
Vehicle interaction method and device, electronic equipment, storage medium and vehicle
CN117235320A
Skill release prompting method, device and equipment and readable storage medium
CN117771665A
Identification display control method and device in game and electronic equipment
CN118512765A
AR-HUD intelligent adjusting system and method based on multi-modal large model
CN118953014A
Cited By
Method, device and equipment for detecting target in open world game based on YOLO
CN120612471A