Method and apparatus for adding friend in game, and device and storage medium
By utilizing NPC characters in the game to facilitate dialogue and communication between player characters, the problem of the limited interaction methods for adding friends in existing technologies has been solved, resulting in a more efficient friend recommendation and addition process.
Patent Information
- Application Number
- PCT/CN2025/083231
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-25
- Filing Date
- 2025-03-18
- Publication Date
- 2025-10-30
AI Technical Summary
The existing methods for adding friends in games are too simplistic and lack real-world dialogue, resulting in low efficiency.
Facilitate dialogue between two player characters by using non-player characters (NPCs) in the game, utilize player profile matching and target language models to recommend suitable friend partners, and improve efficiency by guiding the dialogue through NPCs.
It improves the efficiency of adding friends between player characters, and helps players quickly break the ice by guiding dialogue with NPC characters, avoiding chat deadlocks and increasing the success rate of making friends.
Smart Images

Figure CN2025083231_30102025_PF_FP_ABST
Abstract
Description
A method, apparatus, device, and storage medium for adding friends in a game.
[0001] Cross-references to related applications
[0002] This application claims priority to Chinese Patent Application No. 202410515945.0, filed on April 25, 2024, entitled “A method, apparatus, device and storage medium for adding friends in a game”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This disclosure relates to the field of game technology, and more specifically, to a method, apparatus, device, and storage medium for adding friends in a game. Background Technology
[0004] In related games, when players want to add friends, they can send a friend request to the game system. The system responds to this request by recommending other players whose preferences match the player's pre-registered information. Players can then view the in-game profiles of these recommended players. If they wish to add them as friends, they can search for their game accounts in the friend list and send a friend request. However, this traditional method of adding friends is rather simplistic in its interaction. Players can only decide whether to add someone based on their in-game profile, lacking actual dialogue and resulting in low efficiency. Summary of the Invention
[0005] In view of this, the purpose of this disclosure is to provide a method, device, equipment and storage medium for adding friends in a game, which promotes dialogue and communication between two player characters through a non-player character in the game in the context of friend recommendation, thereby improving the efficiency of adding friends between two player characters in the game.
[0006] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings.
[0007] In a first aspect, embodiments of this disclosure provide a method for adding friends in a game, the method comprising:
[0008] When a game client detects that it has sent a friend-finding instruction to a target virtual object, multiple candidate virtual objects for the first virtual object are determined from the game scene; wherein, the target virtual object represents a non-player character in the game scene, the first virtual object represents a player character corresponding to the first game client, and the candidate virtual objects belong to player characters;
[0009] From the plurality of candidate virtual objects, a second virtual object is determined;
[0010] Based on the target virtual object, the second virtual object is recommended to the first virtual object as a friend to be added.
[0011] Secondly, embodiments of this disclosure provide a device for adding friends in a game, the device comprising:
[0012] The detection module is configured to determine multiple candidate virtual objects of the first virtual object from the game scene when it detects that the first game client sends a friend-finding instruction to the target virtual object; wherein the target virtual object represents a non-player character in the game scene, the first virtual object represents a player character corresponding to the first game client, and the candidate virtual objects belong to player characters;
[0013] The matching module is configured to determine a second virtual object from the plurality of candidate virtual objects;
[0014] The recommendation module is configured to recommend the second virtual object as a potential friend to the first virtual object through the target virtual object.
[0015] Thirdly, this disclosure provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above-described method for adding friends in a game.
[0016] Fourthly, embodiments of this disclosure provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described method for adding friends in a game.
[0017] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0018] This disclosure provides a method, apparatus, device, and storage medium for adding friends in a game. When a first game client detects a friend-finding instruction sent to a target virtual object, it determines multiple candidate virtual objects from the game scene; from these candidate virtual objects, it determines a second virtual object; and through the target virtual object, it recommends the second virtual object to the first virtual object as a potential friend. In this way, this disclosure can facilitate dialogue and communication between two player characters through a non-player character in the game, thereby improving the efficiency of adding friends between two player characters in the game. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this disclosure and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 shows a flowchart illustrating a method for adding friends in a game provided in one of the embodiments of this disclosure;
[0021] Figure 2 shows a flowchart illustrating a method for detecting whether a first game client sends a friend-finding instruction to a target virtual object, according to one of the embodiments of this disclosure.
[0022] Figure 3 shows a flowchart illustrating a method for determining the degree of matching between a candidate virtual object and a first virtual object, provided in one of the embodiments of this disclosure.
[0023] Figure 4 shows a flowchart illustrating a method for optimizing a player profile matching score list according to one of the embodiments of this disclosure;
[0024] Figure 5 shows a flowchart illustrating a method for training a target language model according to one of the embodiments of this disclosure;
[0025] Figure 6 shows a flowchart illustrating a method for optimizing model parameters in a target language model according to one of the embodiments of this disclosure;
[0026] Figure 7 shows a schematic diagram of the structure of a device for adding friends in a game provided in one of the embodiments of this disclosure;
[0027] Figure 8 is a schematic diagram of the structure of an electronic device 800 provided in one of the embodiments of this disclosure. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this disclosure are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this disclosure. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this disclosure illustrate operations implemented according to some embodiments of this disclosure. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this disclosure, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0029] Furthermore, the described embodiments are merely some, not all, of the embodiments of this disclosure. The components of the embodiments of this disclosure typically described and illustrated in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this disclosure provided in the drawings is not intended to limit the scope of the claimed disclosure, but merely to illustrate selected embodiments of the disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0030] It should be noted that the term "comprising" will be used in the embodiments of this disclosure to indicate the presence of the features subsequently declared, but does not exclude the addition of other features.
[0031] In related games, when players want to add friends, they can send a friend request to the game system. The system responds to this request by recommending other players whose preferences match the player's pre-registered information. Players can then view the in-game profiles of these recommended players. If they wish to add them as friends, they can search for their game accounts in the friend list and send a friend request. However, this traditional method of adding friends is rather simplistic in its interaction. Players can only decide whether to add someone based on their in-game profile, lacking actual dialogue and resulting in low efficiency.
[0032] Based on this, the present disclosure provides a method, apparatus, device, and storage medium for adding friends in a game. In a friend recommendation scenario, non-player characters in the game facilitate dialogue and communication between two player characters, which helps improve the efficiency of adding friends between two player characters in the game.
[0033] In one embodiment of this disclosure, a method for adding friends in a game can run on a terminal device or a server. The terminal device can be a local terminal device. When the method for adding friends in a game runs on a server, it can be implemented and executed based on a cloud interaction system, which includes a server and client devices (i.e., terminal devices).
[0034] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of methods for adding friends in the game are completed on the cloud gaming server. The client device's role is to receive and send data and present the game screen. For example, the client device can be a display device with data transmission capabilities close to the user, such as a mobile terminal, television, computer, or PDA; however, the terminal device for information processing is the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.
[0035] In an alternative implementation, the terminal device can be a local terminal device. Taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, conventionally downloading, installing, and running the game program via an electronic device. The local terminal device can provide the graphical user interface to the player in various ways, such as rendering it on the terminal's display screen, or providing it to the player through holographic projection. For example, the local terminal device can include a display screen for displaying the graphical user interface, which includes game screens, and a processor for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.
[0036] To facilitate understanding of the embodiments of this disclosure, the following provides a detailed description of a method, apparatus, device, and storage medium for adding friends in a game.
[0037] Referring to Figure 1, which illustrates a flowchart of a method for adding friends in a game according to an embodiment of this disclosure, the method includes steps S101-S103; specifically:
[0038] S101, when it is detected that the first game client sends a friend-finding instruction to the target virtual object, multiple candidate virtual objects of the first virtual object are determined from the game scene.
[0039] Here, the first virtual object represents the player character corresponding to the first game client, the candidate virtual object also belongs to the player character, and the target virtual object represents the NPC (non-player character) character encountered by the first virtual object in the game scene.
[0040] In this embodiment of the disclosure, when the first player (i.e., the player controlling the first virtual object) sends a friend-finding instruction (i.e., an instruction to find friends for the first virtual object in the game) to an NPC character (i.e., the target virtual object) encountered in the game scene through the first game client, as an optional embodiment, the game server can determine the scene area in the game scene whose distance from the first virtual object is less than or equal to a preset distance threshold as the search range for recommended friends (i.e., game friends expected to be recommended to the first virtual object) based on the location of the first virtual object in the game scene. Thus, all player characters (i.e., NPC characters that are not game friends that the first virtual object can add) located within the above search range are regarded as candidate virtual objects expected to be recommended to the first virtual object (equivalent to determining multiple player characters in the game scene whose distance from the first virtual object is less than or equal to the above preset distance threshold as the multiple candidate virtual objects).
[0041] It should be noted that the specific value of the aforementioned preset distance threshold can be set according to the actual game configuration requirements, and the specific number of the aforementioned candidate virtual objects depends on the actual number of player characters in the current game scene whose distance from the first virtual object meets the condition (i.e., the distance from the first virtual object is less than or equal to the preset distance threshold); therefore, this disclosure embodiment does not impose any limitations on the specific value of the aforementioned preset distance threshold or the specific number of the aforementioned candidate virtual objects.
[0042] When the first player sends a friend-finding instruction to an NPC character (i.e., the aforementioned target virtual object) encountered in the game scene through the first game client, as another optional embodiment, after the game server determines the search range of the recommended friends (i.e., the scene area in the game scene where the distance between the first virtual object and the first virtual object is less than or equal to a preset distance threshold) based on the location of the first virtual object in the game scene, it can also randomly select multiple player characters from the search range as the multiple candidate virtual objects. In this embodiment of the disclosure, since the method of sending the friend-finding instruction is not unique, this embodiment of the disclosure does not limit the specific method of sending the friend-finding instruction on the first game client side and the specific detection method on the game server side corresponding to the target virtual object in step S101.
[0043] Specifically, as an optional embodiment, on the first game client side, the first player can control the first virtual object to chat with the target virtual object. Based on the fact that the chat information carries keywords related to making friends, the game server side corresponding to the target virtual object can identify from the chat information sent by the first game client that the first virtual object has the intention to make friends, thereby determining that the first game client has issued a friend-finding instruction to the target virtual object.
[0044] Specifically, as another optional embodiment, on the first game client side, the first player can also directly control the first virtual object to send a friend recommendation request to the target virtual object. At this time, on the game server side corresponding to the target virtual object, upon receiving the aforementioned friend recommendation request sent by the first game client, it can be determined that the first game client has issued a friend-finding instruction to the target virtual object.
[0045] S102, determine a second virtual object from the plurality of candidate virtual objects.
[0046] Here, the second virtual object represents the virtual object to be recommended to the first virtual object. In an optional embodiment, if the friend-finding instruction sent by the first game client contains the friend-making conditions specified by the first virtual object (e.g., the friend-finding instruction specifies the gender, character type, character experience value, and other character attribute information that the recommended virtual object needs to meet), then the player character that meets the friend-finding instruction (equivalent to meeting the friend-making conditions) can be selected from the multiple candidate virtual objects as the second virtual object.
[0047] In another optional embodiment of this disclosure, for each candidate virtual object, the degree of matching between the player profile of the candidate virtual object and the first virtual object can be determined based on the first player profile corresponding to the first virtual object and the second player profile corresponding to the candidate virtual object; then, based on the degree of matching between the player profile of the candidate virtual object and the first virtual object, the candidate virtual object whose degree of matching between the player profiles meets the preset conditions is determined from multiple candidate virtual objects as the aforementioned second virtual object.
[0048] Here, since the first virtual object and each of the aforementioned candidate virtual objects belong to player characters controlled by the player, the player profiles corresponding to each of the aforementioned player characters (i.e., the first player profile corresponding to the first virtual object and the second player profile corresponding to each candidate virtual object) can be obtained based on the player's historical behavior information in the game and the personal account information filled in by the player when registering and logging into the game.
[0049] Specifically, taking the first virtual object as an example, based on the first player's historical behavior information in the game (e.g., liking to participate in some casual game events, frequently chatting with other players in the game's chat channel, purchasing more game character skins than the preset skin quantity threshold, etc.), a player profile of the first player in the game can be obtained; and based on the personal account information filled in by the first player when registering and logging into the game (e.g., residential address, gender, age, etc.), a player profile of the first player outside the game can be obtained; thus, the player profile of the first player in the game and the player profile outside the game together constitute the aforementioned first player profile corresponding to the first virtual object.
[0050] Similarly, for each candidate virtual object, similar to the first player profile mentioned above, the player profile in the game can be obtained based on the player's historical behavior information in the game; the player profile outside the game can be obtained based on the personal account information filled in by the player when registering and logging into the game; thus, the player profile in the game and the player profile outside the game together constitute the second player profile corresponding to the candidate virtual object.
[0051] In this embodiment of the disclosure, the matching method that can be selected based on the player profile is not unique. Therefore, in the above step S102, this embodiment of the disclosure does not limit the specific matching method used between the first player profile and the second player profile corresponding to each candidate virtual object.
[0052] Specifically, as an optional embodiment, on the game server side, by comparing player profiles (i.e., comparing the first player profile with each second player profile), the matching bonus items for the player profile comparison results can be found from a preset player profile matching score list. Based on the specific bonus coefficient corresponding to each matching bonus item in the aforementioned player profile matching score list, the matching score between the first player profile and each second player profile can be calculated as the player profile matching degree between the first virtual object and each candidate virtual object.
[0053] Specifically, as another optional embodiment, since both the first player profile and each second player profile are composed of player features under multiple different dimensions, the matching degree between the first player profile and each second player profile (i.e., the matching degree of the player profile between the first virtual object and each candidate virtual object) can also be determined on the game server side by calculating the similarity of player features between the first player profile and each second player profile.
[0054] It should be noted that after determining the degree of player profile matching between the first virtual object and each candidate virtual object, the candidate virtual object with the highest degree of player profile matching can be selected from multiple candidate virtual objects as the second virtual object to be recommended (equivalent to the above preset condition being the highest degree of player profile matching); alternatively, the candidate virtual object with a player profile matching degree higher than a preset matching degree threshold can be selected from multiple candidate virtual objects as the second virtual object to be recommended (equivalent to the above preset condition being higher than a preset matching degree threshold); the specific condition settings of the above preset conditions are not limited in this embodiment.
[0055] S103, through the target virtual object, recommend the second virtual object as a friend to be added to the first virtual object.
[0056] In this embodiment of the disclosure, after determining the second virtual object to be recommended to the first virtual object, the game server corresponding to the target virtual object can control the target virtual object to recommend the second virtual object to the first virtual object through different interaction methods. This embodiment of the disclosure does not limit which interaction method is specifically used to recommend the second virtual object to the first virtual object in the above step S103.
[0057] Here, as an optional embodiment, the game server can control the target virtual object to recommend the second virtual object to the first virtual object in the manner described in step a1, specifically:
[0058] Step a1: Using the target virtual object, guide the first virtual object to move toward the character position where the second virtual object is located in the game scene.
[0059] Specifically, on the game server side, the position of the first virtual object in the game scene can be used as the starting point of the route, and the position of the second virtual object in the game scene can be used as the ending point of the route. In this way, the target virtual object's target movement route in the game scene can be determined, and the target virtual object can be controlled in the game scene to guide the first virtual object to follow the target virtual object along the above-mentioned target movement route until both the first virtual object and the target virtual object reach the position of the second virtual object.
[0060] Building upon step a1 above, the game server can further execute steps a2-a3 to enable the target virtual object to facilitate dialogue between the first and second virtual objects, helping them quickly break the ice. Specifically:
[0061] Step a2: In response to the first virtual object arriving at the role location of the second virtual object, guide the first virtual object and the second virtual object to engage in dialogue through the target virtual object.
[0062] Specifically, on the game server side, when the first virtual object arrives at the location of the second virtual object's character, the target virtual object can invite both the first and second virtual objects to join the chat. When the chat begins, the target virtual object sends an introduction about the first virtual object to the second virtual object (which can be determined based on the first player profile corresponding to the first virtual object), and simultaneously sends an introduction about the second virtual object to the first virtual object (which can be determined based on the second virtual object's player profile). This facilitates the NPC character (i.e., the aforementioned target virtual object) helping the two player characters (i.e., the first and second virtual objects) quickly enter a chat state, avoiding a stalemate caused by players repeatedly thinking about their character introductions, and effectively improving the dialogue efficiency between the two player characters.
[0063] Step a3: During the dialogue between the first virtual object and the second virtual object, target dialogue guidance information is sent to the first virtual object and / or the second virtual object through the target virtual object.
[0064] Here, the aforementioned target dialogue guidance information represents relevant recommendation information used to guide the first virtual object and the second virtual object to add each other as friends.
[0065] In addition to the method described in step a2 above, which guides the two player characters (i.e., the first virtual object and the second virtual object) to start a conversation in the initial stage of their chat, the game server will also send target dialogue guidance information to the first virtual object and / or the second virtual object through the target virtual object during the subsequent conversation between the two player characters, so as to ensure the smooth progress of the conversation between the two player characters. That is, the target dialogue guidance information sent to the first virtual object and / or the second virtual object through the target virtual object may include: introductory information about the other party sent to the first virtual object and the second virtual object respectively in the above-mentioned initial stage, and dialogue guidance information sent to the first virtual object or the second virtual object during the conversation between the first virtual object and the second virtual object.
[0066] Specifically, on the game server side, the target virtual object is associated with a target language model used to output the aforementioned target dialogue guidance information. During the dialogue between the first and second virtual objects, the game server inputs the current dialogue information of the first and second virtual objects into the target language model. The target language model determines whether the target virtual object needs to intervene in the dialogue between the first and second virtual objects (e.g., if keywords in the input information are detected that might interrupt the dialogue, it is determined that the target virtual object needs to intervene). When intervention is determined, the target language model outputs target dialogue guidance information related to the aforementioned input information. At this time, the game server sends the target dialogue guidance information to the first and / or second virtual objects through the target virtual object (the specific recipients need to be determined based on the actual content of the target dialogue guidance information being sent), ensuring smooth dialogue between the first and second virtual objects.
[0067] Here, as another optional embodiment, the game server can also control the target virtual object to recommend the second virtual object to the first virtual object in the manner described in steps b1-b2, specifically:
[0068] Step b1: In response to the determination of the second virtual object, send a first player profile about the second virtual object to the first game client through the target virtual object.
[0069] Here, the information content of the first player profile is determined based on the player profile corresponding to the second virtual object; this embodiment of the disclosure does not limit the specific information content of the first player profile.
[0070] Specifically, after determining the second virtual object to be recommended to the first virtual object, the game server can determine the aforementioned first player profile based on the player profile corresponding to the second virtual object, and then recommend the aforementioned first player profile as the game name card of the second virtual object to the first virtual object (i.e., send it to the first game client).
[0071] Step b2: Upon receiving the confirmation instruction from the first game client regarding the first player profile, send a second player profile about the first virtual object to the second game client through the target virtual object.
[0072] Here, the above-mentioned confirmation addition instruction indicates that the first game client confirms and agrees to add the second virtual object as the first virtual object's game friend. This embodiment of the disclosure does not limit the specific sending method and specific information content of the above-mentioned confirmation addition instruction.
[0073] Specifically, the aforementioned second game client represents the game client corresponding to the second virtual object; the information content of the aforementioned second player profile is determined based on the first player profile corresponding to the first virtual object; that is, on the game server side, after confirming that the first game client agrees to add the second virtual object as a game friend of the first virtual object, it is also necessary to determine the aforementioned second player profile based on the first player profile corresponding to the first virtual object, and then recommend the aforementioned second player profile as the game name card of the first virtual object to the second virtual object (i.e., send it to the second game client) through the target virtual object, so that the player corresponding to the second game client can refer to the aforementioned second player profile to decide whether to add the first virtual object as a game friend of the second virtual object.
[0074] The following is an exemplary description of each step in the method for adding friends in a game provided in this embodiment of the present disclosure:
[0075] Regarding the specific detection method for the friend-finding instruction in step S101 above, on the game server side, during the chat process between the first virtual object and the target virtual object, when detecting whether the first game client has issued a friend-finding instruction to the target virtual object, Figure 2 shows a flowchart of a method for detecting whether the first game client has issued a friend-finding instruction to the target virtual object according to an embodiment of this disclosure. As shown in Figure 2, when executing step S101, the method includes steps S201-S203, specifically:
[0076] S201, Obtain the chat information sent by the first game client to the target virtual object.
[0077] Here, on the game server side corresponding to the target virtual object, during the chat process between the first virtual object and the target virtual object, the chat information sent by the first virtual object to the target virtual object is the same as the chat information sent by the first game client to the target virtual object (which is also equivalent to the chat information sent to the game server).
[0078] It should be noted that the chat information mentioned above can be text information or voice information. This disclosure embodiment does not limit the specific chat method between the first virtual object and the target virtual object or the specific information type of the chat information mentioned above.
[0079] S202, in response to the appearance of a first keyword in the chat information, obtain the context information of the first keyword from the chat information.
[0080] Here, the first keyword mentioned above represents a keyword related to making friends; for example, the first keyword can be a keyword that reflects the first virtual object's intention to find friends (i.e., the intention to make friends), such as friend, making friends, wanting to make friends, loneliness, etc.; this embodiment of the disclosure does not limit the specific word segmentation range covered by the first keyword.
[0081] Specifically, after detecting the first keyword in the chat information, the game server can, according to the position of the first keyword in the chat information, obtain multiple word segmentation information (including both word segments before and after the first keyword) from the chat information within the preset step size, as the context information of the first keyword.
[0082] S203, when it is identified from the context information of the first keyword that the chat intention between the first virtual object and the target virtual object belongs to the intention of finding friends, it is determined that the first game client has issued a friend-finding instruction to the target virtual object.
[0083] Here, on the game server side, by performing semantic analysis on the contextual information of the first keyword, the game server can identify the chat intention between the first virtual object and the target virtual object (equivalent to the reason why the first virtual object is currently chatting with the target virtual object) based on the semantic analysis results. Thus, when the game server identifies that the above chat intention belongs to the intention of finding friends (i.e., the intention of making friends), it determines that the first game client has issued a friend-finding instruction to the target virtual object.
[0084] Regarding the specific matching method between player profiles in step S102 above, on the game server side, when determining the matching degree between the first player profile and each second player profile according to the preset player profile matching score list, for each candidate virtual object, Figure 3 shows a flowchart of a method for determining the matching degree between a candidate virtual object and a first virtual object provided by an embodiment of this disclosure. As shown in Figure 3, when executing step S102, the method includes steps S301-S303, specifically:
[0085] S301, compare the second player portrait corresponding to the candidate virtual object with the first player portrait to obtain the first portrait comparison result.
[0086] Here, when comparing the second player profile corresponding to the candidate virtual object with the first player profile corresponding to the first virtual object, we can refer to each friendship bonus item included in the preset player profile matching score list for comparison, and obtain the specific friendship bonus item that the second player profile corresponding to the candidate virtual object and the above-mentioned first player profile are matched together as the first profile comparison result.
[0087] S302, based on the preset player profile matching score list containing multiple friendship bonus items, determine the target friendship bonus item that matches the comparison result of the first profile from the multiple friendship bonus items.
[0088] Specifically, the player profile matching score list includes multiple friendship bonus items and the corresponding bonus coefficient for each item; as an optional embodiment, the player profile matching score list can be as shown in Table 1 below:
[0089] Table 1
[0090] S303, obtain the scoring coefficient corresponding to each of the target friendship bonus items from the player profile matching score list, and use the sum of the scoring coefficients corresponding to each of the target friendship bonus items as the player profile matching degree between the candidate virtual object and the first virtual object.
[0091] For example, taking the player profile matching score list shown in Table 1 above as an example, if the target friendship bonus items that match the first profile comparison result are "the two players have the same game preferences" and "the two players have different professions outside the game", then it can be determined that the player profile matching degree between the candidate virtual object and the first virtual object is 150 points.
[0092] Regarding the specific implementation process of step S102 above, when determining the player profile matching degree between each candidate virtual object and the first virtual object according to the method described in steps S301-S303 above, on the game server side, historical friend recommendation data generated when NPC characters (which can be the target virtual object or other NPC characters) recommend friends to be added to the player character can also be collected. Based on the friendship bonus items appearing in the historical friend recommendation data and the final friend recommendation results corresponding to the historical friend recommendation data, the bonus coefficients corresponding to each friendship bonus item in the player profile matching score list can be optimized, so as to improve the recommendation accuracy of friends to be added through the optimized player profile matching score list.
[0093] Based on this, in an optional implementation, Figure 4 shows a flowchart of a method for optimizing a player profile matching score list provided by an embodiment of this disclosure. As shown in Figure 4, the method includes steps S401-S403, specifically:
[0094] S401 records multiple sets of historical friend recommendation data.
[0095] Here, similar to the recommendation method in steps S101-S103 above, where an NPC character (i.e., the target virtual object) recommends each other as game friends to two player characters (i.e., the first virtual object and the second virtual object), the game server can collect the player profile comparison results between the two player characters and the final friend-adding results of the two player characters (i.e., whether the two player characters ultimately add each other as game friends after the NPC character recommends each other as friends) as a set of historical friend recommendation data, thereby recording multiple sets of historical friend recommendation data.
[0096] S402, for each group of historical friend recommendation data, based on the player profile comparison results between the two player characters in the group of historical friend recommendation data, determine the friend recommendation bonus items that match the player profile comparison results from the multiple friend recommendation bonus items as friend recommendation bonus items to be adjusted.
[0097] Here, the method for determining the friend-making bonus items to be adjusted in step S402 is the same as the method for determining the target friend-making bonus items in step S302 above, and the repetition will not be repeated here.
[0098] S403, based on the final friend addition results of the two player characters in the historical friend recommendation data, adjust the scoring coefficient of each of the aforementioned friend-adding items to be adjusted in the player profile matching score list, and obtain the player profile matching score list after the scoring coefficient is adjusted.
[0099] Specifically, when the final friend-adding result for two player characters in the historical friend recommendation data is "successfully added as friends," the bonus coefficient corresponding to each friend-adding bonus item appearing in the current player profile comparison result can be increased (equivalent to assuming that each friend-adding bonus item has a positive impact on the final successful friend-adding). The specific increase ratio of the bonus coefficient corresponding to each friend-adding bonus item can be determined based on the occurrence ratio of that friend-adding bonus item in all historical friend recommendation data where the final friend-adding result is "successfully added as friends" (equivalent to using the historical friend recommendation data of successful friend-adding as positive cases for player profile matching; if the frequency of a friend-adding bonus item in positive cases is higher, the impact of that friend-adding bonus item on positive cases will be greater, and the increase ratio corresponding to the bonus coefficient of that friend-adding bonus item will also be higher).
[0100] Specifically, when the final friend-adding result for two player characters in the historical friend recommendation data is "failed to add friend", the bonus coefficient corresponding to each friend-adding bonus item appearing in the current player profile comparison result can be lowered (equivalent to assuming that each friend-adding bonus item has a positive impact on the final failure to add friend). The specific reduction ratio of the bonus coefficient corresponding to each friend-adding bonus item can be determined based on the occurrence ratio of the friend-adding bonus item in all historical friend recommendation data where the final friend-adding result is "failed to add friend" (equivalent to treating the historical friend recommendation data of failed friend-adding as a negative case of player profile matching; if the frequency of a friend-adding bonus item in the negative case is higher, the influence of the friend-adding bonus item on the negative case will be greater, and the reduction ratio of the bonus coefficient corresponding to the friend-adding bonus item will also be higher).
[0101] Regarding the specific implementation process of step S103 above, when recommending the second virtual object to the first virtual object according to the method described in steps a1-a3 above, on the game server side, the target virtual object is associated with a target language model, wherein the target language model is used to output the target dialogue guidance information during the dialogue between the first virtual object and the second virtual object; at this time, in an optional implementation, Figure 5 shows a flowchart of a method for training a target language model provided by an embodiment of this disclosure. As shown in Figure 5, the method includes steps S501-S504, specifically:
[0102] S501 records historical chat information from multiple friend recommendation scenarios as training samples for the model.
[0103] Here, each group of historical chat information includes: dialogue information between two player characters and historical dialogue guidance information output by a non-player character (i.e., an NPC character) during the dialogue between the two player characters.
[0104] It should be noted that, in addition to the historical chat information mentioned above, to enrich the quantity and type of training samples for the model, on the game server side, game testers can also simulate online friend recommendation scenarios during the game's internal testing (i.e., an NPC character recommends another player character as a friend to a player character). The simulated chat information (i.e., including simulated dialogue information between two player characters, simulated dialogue guidance information output by the NPC character during the simulated dialogue, and the final simulated friend addition result) can be used as training samples for the above model.
[0105] S502, the first historical chat information in the model training samples is used as the first positive training sample, and the second historical chat information in the model training samples is used as the first negative training sample. The first language model is trained based on the first positive training sample and the first negative training sample until the first language model converges.
[0106] Here, the first historical chat information represents the chat history of two player characters who successfully added each other as friends; the second historical chat information represents the chat history of two player characters who failed to add each other as friends.
[0107] In this embodiment of the disclosure, when the first historical chat information is used as a positive sample (i.e., the first training positive sample) and the second historical chat information is used as a negative sample (i.e., the first training negative sample), the first historical chat information is essentially used as a positive case of successful friend recommendation. The first language model is trained to learn the timing of insertion of each historical dialogue guidance message in the positive case (i.e., the first historical chat information) during the dialogue between the two player characters (which is related to the context information of the historical dialogue guidance message in the first historical chat information) and the specific information content of each historical dialogue guidance message. This enables the NPC character to understand, when associating with the first language model, that the purpose of the current dialogue between the two parties (i.e., the two player characters) is to get to know each other, rather than to have a dialogue with the NPC character (which is equivalent to helping the NPC character understand that the purpose of the current interspersed dialogue guidance messages is to guide the two player characters to have a dialogue, rather than to have a one-way communication with either player character). This results in outputting dialogue guidance messages that are more conducive to the two player characters successfully adding friends.
[0108] Specifically, for each of the first training positive samples, the context information of each historical dialogue guidance information in the first training positive sample is input into the first language model, and the prediction result of the first language model for each historical dialogue guidance information is output. The loss between each historical dialogue guidance information and its prediction result is calculated. At this time, since the first training positive sample belongs to the positive case of successful friend recommendation, when adjusting the model parameters of the first language model, the parameters need to be adjusted in the direction of reducing the loss between each historical dialogue guidance information in the first training positive sample and its prediction result.
[0109] Specifically, for each of the first training negative samples, the context information of each historical dialogue guidance information in the first training negative sample is input into the first language model, and the prediction result of the first language model for each historical dialogue guidance information is output. The loss between each historical dialogue guidance information and its prediction result is calculated. At this time, since the first training negative sample belongs to the negative case of the final failure to recommend friends, when adjusting the model parameters of the first language model, it is necessary to adjust the parameters in the direction of increasing the loss between each historical dialogue guidance information in the first training negative sample and its prediction result.
[0110] S503, the first historical chat information is used as the second training negative sample, the second historical chat information is used as the second training positive sample, and the second language model is trained based on the second training positive sample and the second training negative sample until the second language model converges.
[0111] Here, the model parameters in the second language model are the same as those in the first language model; that is, the basic structure of the second language model is no different from that of the first language model. The only difference is that positive and negative samples with opposite definitions are used for model training due to different training objectives.
[0112] In this embodiment of the disclosure, when the first historical chat information is used as a negative sample (i.e., the second training negative sample) and the second historical chat information is used as a positive sample (i.e., the second training positive sample), the second historical chat information is essentially used as a positive case of the final failure to recommend a friend. The second language model is trained to learn the insertion timing of each historical dialogue guidance message in the positive case (i.e., the second historical chat information) in the dialogue process between the two player characters (which is related to the context information of the historical dialogue guidance message in the first historical chat information) and the specific information content of each historical dialogue guidance message. This enables the NPC character to clearly understand at what time and what kind of dialogue guidance message is more likely to cause the failure of adding a friend between the two player characters when associating with the second language model.
[0113] Specifically, for each of the second training positive samples, the context information of each historical dialogue guidance information in the second training positive sample is input into the second language model, and the prediction result of the second language model for each historical dialogue guidance information is output. The loss between each historical dialogue guidance information and its prediction result is calculated. At this time, since the second training positive sample belongs to the positive case of the final failure to recommend friends, that is, since the purpose of training the second language model is to determine the wrong output timing and wrong output content of the dialogue guidance information, when adjusting the model parameters of the second language model, it is also necessary to adjust the parameters in the direction of reducing the loss between each historical dialogue guidance information in the second training positive sample and its prediction result.
[0114] Specifically, for each of the second training negative samples, the context information of each historical dialogue guidance information in the second training negative sample is input into the second language model, and the prediction result of the second language model for each historical dialogue guidance information is output. The loss between each historical dialogue guidance information and its prediction result is calculated. At this time, since the second training negative sample belongs to the negative case of the final failure to recommend friends, when adjusting the model parameters of the second language model, it is necessary to adjust the parameters in the direction of increasing the loss between each historical dialogue guidance information in the second training negative sample and its prediction result.
[0115] S504, the model parameters contained in the first language model and the second language model are integrated to obtain the integrated result as the target language model.
[0116] Here, the above parameter integration includes: subtracting the same model parameters from the converged second language model using the same model parameter vector from the converged first language model; that is, since the purpose of training the first language model is to train the model to learn the correct timing and content of dialogue guidance information, while the purpose of training the second language model is to train the model to learn the incorrect timing and content of dialogue guidance information, the above parameter integration method enables the target language model to not only learn the correct timing and content of dialogue guidance information, but also effectively avoid outputting incorrect content of dialogue guidance information at incorrect times, thereby improving the accuracy of the target virtual object's output of dialogue guidance information.
[0117] It should be noted that the first language model and the second language model contain the same types and numbers of model parameters. Each parameter integration is an integration of the same type of model parameters in the first language model and the second language model. This disclosure does not limit the specific types and numbers of model parameters contained in the first language model and the second language model.
[0118] Regarding the target language model associated with the target virtual object, as the number of times the target virtual object recommends friends to different player characters increases, the game server can also collect online chat information between NPC characters (including the target virtual object) and two player characters who are to be added as friends in real time during the friend recommendation scenario. Based on the online chat information collected in real time, the model parameters in the target language model (which is also equivalent to the language model associated with each NPC character) can be optimized to continuously improve the efficiency of adding friends between two player characters through NPC characters.
[0119] Based on this, in an optional implementation, Figure 6 shows a flowchart of a method for optimizing model parameters in a target language model according to an embodiment of this disclosure. As shown in Figure 6, the method includes steps S601-S604, specifically:
[0120] S601 collects online chat information in real time under multiple friend recommendation scenarios.
[0121] Here, each group of online chat information includes: dialogue information between two player characters and dialogue guidance information interspersed by non-player characters during the dialogue between the two player characters.
[0122] S602, obtain multiple sets of first online chat information from multiple sets of online chat information, and use the dialogue guidance information in the multiple sets of first online chat information with a frequency higher than or equal to a first preset threshold as positive samples for model optimization.
[0123] Here, the first online chat message represents the online chat message when two player characters finally successfully add each other as friends.
[0124] It should be noted that the specific value of the first preset threshold can be set according to the actual information filtering needs, and this embodiment of the disclosure does not impose any limitation on the specific value of the first preset threshold.
[0125] S603, obtain multiple sets of second online chat information from the multiple sets of online chat information, and use the dialogue guidance information in the multiple sets of second online chat information with a frequency higher than or equal to a second preset threshold as negative samples for model optimization.
[0126] Here, the second online chat message represents the online chat message when the two player characters ultimately failed to add each other as friends.
[0127] It should be noted that the specific value of the second preset threshold can be set according to the actual information filtering requirements. The second preset threshold can be the same as or different from the first preset threshold. This embodiment of the present disclosure does not limit the specific value of the first preset threshold.
[0128] S604, Based on the model optimization positive samples and the model optimization negative samples, optimize the model parameters in the target language model to obtain the optimized target language model.
[0129] Specifically, when optimizing the model parameters in the target language model, the negative samples of the above model optimization can be used as negative output cases of dialogue guidance information, and the model parameters in the target language model can be adjusted in the direction of avoiding the output of the above model optimization negative samples; at the same time, the positive samples of the above model optimization can be used as positive output cases of dialogue guidance information, and the model parameters in the target language model can be adjusted in the direction of encouraging the output of the above model optimization positive samples.
[0130] Based on the method for adding friends in a game provided in this embodiment, when a first game client sends a friend-finding instruction to a target virtual object, multiple candidate virtual objects are determined from the game scene; a second virtual object is determined from the multiple candidate virtual objects; and the second virtual object is recommended to the first virtual object as a friend to be added through the target virtual object. In this way, this disclosure can promote dialogue and communication between two player characters through a non-player character in the game, which is beneficial to improving the efficiency of adding friends between two player characters in the game.
[0131] Based on the same inventive concept, this disclosure also provides an apparatus corresponding to the above-mentioned method of adding friends in a game. Since the principle of the apparatus for adding friends in a game in this disclosure is similar to the above-mentioned method of adding friends in a game in this disclosure, the implementation of the apparatus for adding friends in a game can refer to the implementation of the above-mentioned method of adding friends in a game, and the repeated parts will not be described again.
[0132] Referring to Figure 7, which shows a schematic diagram of a device for adding friends in a game according to an embodiment of the present disclosure, the device includes:
[0133] The detection module 701 is configured to determine multiple candidate virtual objects of the first virtual object from the game scene when it detects that the first game client sends a friend-finding instruction to the target virtual object; wherein the target virtual object represents a non-player character in the game scene, the first virtual object represents a player character corresponding to the first game client, and the candidate virtual objects belong to player characters;
[0134] Matching module 702 is configured to determine a second virtual object from the plurality of candidate virtual objects;
[0135] The recommendation module 703 is configured to recommend the second virtual object as a friend to be added to the first virtual object through the target virtual object.
[0136] In an optional implementation, when the detection module 701 detects that the first game client has issued a friend-finding instruction to the target virtual object, the detection module 701 is configured to execute:
[0137] Obtain the chat information sent by the first game client to the target virtual object;
[0138] In response to the appearance of a first keyword in the chat information, the context information of the first keyword is obtained from the chat information; wherein, the first keyword represents a keyword related to making friends;
[0139] When the context information of the first keyword indicates that the chat intent between the first virtual object and the target virtual object is a friend-finding intent, it is determined that the first game client has issued a friend-finding instruction to the target virtual object.
[0140] In an optional implementation, when determining multiple candidate virtual objects of the first virtual object from the game scene, the detection module 701 is configured to perform:
[0141] Based on the position of the first virtual object in the game scene, multiple player characters whose distance from the first virtual object is less than or equal to a preset distance threshold are identified as the multiple candidate virtual objects.
[0142] In an alternative implementation, when determining the second virtual object from the plurality of candidate virtual objects, the matching module 702 is configured to perform:
[0143] Based on the first player profile corresponding to the first virtual object and the second player profile corresponding to the candidate virtual object, determine the degree of player profile matching between the candidate virtual object and the first virtual object;
[0144] Based on the degree of player profile matching between the candidate virtual object and the first virtual object, the candidate virtual object whose player profile matching degree meets the preset conditions is determined from multiple candidate virtual objects as the second virtual object.
[0145] In an optional implementation, when determining the matching degree between the candidate virtual object and the first virtual object based on the first player profile corresponding to the first virtual object and the second player profile corresponding to the candidate virtual object, the matching module 702 is configured to perform:
[0146] The second player profile corresponding to the candidate virtual object is compared with the first player profile to obtain the first profile comparison result;
[0147] Based on a preset player profile matching score list containing multiple friendship bonus items, a target friendship bonus item that matches the comparison result of the first profile is determined from the multiple friendship bonus items;
[0148] From the player profile matching score list, obtain the scoring coefficient corresponding to each of the target friendship bonus items, and use the sum of the scoring coefficients corresponding to each of the target friendship bonus items as the player profile matching degree between the candidate virtual object and the first virtual object.
[0149] In an optional implementation, when recommending the second virtual object as a friend to be added to the first virtual object, the recommendation module 703 is configured to perform:
[0150] Using the target virtual object, the first virtual object is guided to move towards the character's position where the second virtual object is located within the game scene.
[0151] In an alternative implementation, the recommendation module 703 is further configured to perform:
[0152] In response to the first virtual object arriving at the role location of the second virtual object, the first virtual object is guided to engage in dialogue with the second virtual object through the target virtual object;
[0153] During the dialogue between the first virtual object and the second virtual object, target dialogue guidance information is sent to the first virtual object and / or the second virtual object through the target virtual object; wherein, the target dialogue guidance information represents relevant recommendation information for guiding the first virtual object and the second virtual object to add each other as friends.
[0154] In an optional implementation, when recommending the second virtual object as a friend to be added to the first virtual object, the recommendation module 703 is further configured to perform:
[0155] In response to the determination of the second virtual object, a first player profile about the second virtual object is sent to the first game client through the target virtual object; wherein, the information content of the first player profile is determined based on the player profile corresponding to the second virtual object;
[0156] Upon receiving confirmation from the first game client regarding the first player profile, the system sends a second player profile about the first virtual object to the second game client through the target virtual object; wherein, the second game client represents the game client corresponding to the second virtual object; and the information content of the second player profile is determined based on the first player profile corresponding to the first virtual object.
[0157] In one optional embodiment, the apparatus further includes: an adjustment module; wherein the adjustment module is configured to perform:
[0158] Records multiple sets of historical friend recommendation data;
[0159] For each set of historical friend recommendation data, based on the player profile comparison results between two player characters in that set of historical friend recommendation data, the friend recommendation items that match the player profile comparison results are determined from the multiple friend recommendation items as friend recommendation items to be adjusted.
[0160] Based on the final friend addition results of the two player characters in the historical friend recommendation data, the bonus coefficient of each of the aforementioned friend-making bonus items to be adjusted is adjusted in the player profile matching score list to obtain the player profile matching score list after the bonus coefficient is adjusted.
[0161] In an optional implementation, the target virtual object is associated with a target language model, wherein the target language model is configured to output target dialogue guidance information during the dialogue between the first virtual object and the second virtual object, and the recommendation module 703 is configured to train the target language model using the following method:
[0162] Record historical chat information from multiple friend recommendation scenarios as training samples for the model; wherein, the historical chat information includes: dialogue information between two player characters and historical dialogue guidance information output by non-player characters during the dialogue between the two player characters;
[0163] The first historical chat information in the model training samples is used as the first positive training sample, and the second historical chat information in the model training samples is used as the first negative training sample. The first language model is trained based on the first positive training sample and the first negative training sample until the first language model converges. The first historical chat information represents the historical chat information of two player characters who successfully added each other as friends. The second historical chat information represents the historical chat information of two player characters who failed to add each other as friends.
[0164] The first historical chat information is used as the second training negative sample, and the second historical chat information is used as the second training positive sample. The second language model is trained based on the second training positive sample and the second training negative sample until the second language model converges. The model parameters in the second language model are of the same type as those in the first language model.
[0165] The model parameters contained in the first language model and the second language model are integrated to obtain the integrated result as the target language model; wherein, the parameter integration includes: subtracting the same model parameters in the converged second language model from the same model parameter vector in the converged first language model.
[0166] In an optional implementation, the target virtual object is associated with a target language model, wherein the target language model is configured to output target dialogue guidance information during the dialogue between the first virtual object and the second virtual object, and the recommendation module 703 is further configured to perform:
[0167] Real-time collection of online chat information in multiple friend recommendation scenarios; wherein, each set of online chat information includes: dialogue information between two player characters and dialogue guidance information output by non-player characters during the dialogue between the two player characters;
[0168] From the multiple sets of online chat information, multiple sets of first online chat information are obtained, and the dialogue guidance information in the multiple sets of first online chat information with a frequency higher than or equal to a first preset threshold is used as positive samples for model optimization; wherein, the first online chat information represents the online chat information in which two player characters finally successfully add friends.
[0169] From the multiple sets of online chat information, multiple sets of second online chat information are obtained, and the dialogue guidance information in the multiple sets of second online chat information with a frequency higher than or equal to a second preset threshold is used as negative samples for model optimization; wherein, the second online chat information represents the online chat information in which two player characters ultimately fail to add each other as friends;
[0170] Based on the positive and negative samples optimized by the model, the model parameters in the target language model are optimized to obtain the optimized target language model.
[0171] Based on the aforementioned device for adding friends in a game provided in this disclosure, when a first game client sends a friend-finding instruction to a target virtual object, multiple candidate virtual objects are determined from the game scene for the first virtual object; a second virtual object is determined from the multiple candidate virtual objects; and the second virtual object is recommended to the first virtual object as a friend to be added, through the target virtual object. In this way, this disclosure can promote dialogue and communication between two player characters through a non-player character in the game, which is beneficial to improving the efficiency of adding friends between two player characters in the game.
[0172] Based on the same inventive concept, this disclosure also provides an electronic device corresponding to the above-mentioned method of adding friends in the game. Since the principle of solving the problem by the electronic device in the embodiments of this disclosure is similar to the above-mentioned method of adding friends in the game in the embodiments of this disclosure, the implementation of the electronic device can refer to the implementation of the above-mentioned method of adding friends in the game, and the repeated parts will not be described again.
[0173] Figure 8 is a schematic diagram of the structure of an electronic device 800 provided in an embodiment of this disclosure, including: a processor 801, a memory 802, and a bus 803. The memory 802 stores machine-readable instructions executable by the processor 801. When the electronic device runs a method for adding friends in a game as described in the embodiment, the processor 801 communicates with the memory 802 through the bus 803. The processor 801 executes the machine-readable instructions, and when the processor 801 executes the machine-readable instructions, it implements the following steps:
[0174] When a game client detects that it has sent a friend-finding instruction to a target virtual object, multiple candidate virtual objects for the first virtual object are determined from the game scene; wherein, the target virtual object represents a non-player character in the game scene, the first virtual object represents a player character corresponding to the first game client, and the candidate virtual objects belong to player characters;
[0175] From the plurality of candidate virtual objects, a second virtual object is determined;
[0176] Based on the target virtual object, the second virtual object is recommended to the first virtual object as a friend to be added.
[0177] In an optional implementation, when the first game client is detected to send a friend-finding instruction to the target virtual object, the processor 801 is configured to:
[0178] Obtain the chat information sent by the first game client to the target virtual object;
[0179] In response to the appearance of a first keyword in the chat information, the context information of the first keyword is obtained from the chat information; wherein, the first keyword represents a keyword related to making friends;
[0180] When the context information of the first keyword indicates that the chat intent between the first virtual object and the target virtual object is a friend-finding intent, it is determined that the first game client has issued a friend-finding instruction to the target virtual object.
[0181] In an alternative implementation, when determining a plurality of candidate virtual objects of the first virtual object from the game scene, the processor 801 is configured to:
[0182] Based on the position of the first virtual object in the game scene, multiple player characters whose distance from the first virtual object is less than or equal to a preset distance threshold are identified as the multiple candidate virtual objects.
[0183] In one alternative implementation, when determining a second virtual object from the plurality of candidate virtual objects, the processor 801 is configured to:
[0184] Based on the first player profile corresponding to the first virtual object and the second player profile corresponding to the candidate virtual object, determine the degree of player profile matching between the candidate virtual object and the first virtual object;
[0185] Based on the degree of player profile matching between the candidate virtual object and the first virtual object, the candidate virtual object whose player profile matching degree meets the preset conditions is determined from multiple candidate virtual objects as the second virtual object.
[0186] In an optional implementation, when determining the degree of player profile matching between the candidate virtual object and the first virtual object based on the first player profile corresponding to the first virtual object and the second player profile corresponding to the candidate virtual object, the processor 801 is configured to:
[0187] The second player profile corresponding to the candidate virtual object is compared with the first player profile to obtain the first profile comparison result;
[0188] Based on a preset player profile matching score list containing multiple friendship bonus items, a target friendship bonus item that matches the comparison result of the first profile is determined from the multiple friendship bonus items;
[0189] From the player profile matching score list, obtain the scoring coefficient corresponding to each of the target friendship bonus items, and use the sum of the scoring coefficients corresponding to each of the target friendship bonus items as the player profile matching degree between the candidate virtual object and the first virtual object.
[0190] In an optional implementation, when recommending the second virtual object as a friend to be added to the first virtual object, the processor 801 is configured to:
[0191] Using the target virtual object, the first virtual object is guided to move towards the character's position where the second virtual object is located within the game scene.
[0192] In an alternative implementation, the processor 801 is further configured to:
[0193] In response to the first virtual object arriving at the role location of the second virtual object, the first virtual object is guided to engage in dialogue with the second virtual object through the target virtual object;
[0194] During the dialogue between the first virtual object and the second virtual object, target dialogue guidance information is sent to the first virtual object and / or the second virtual object through the target virtual object; wherein, the target dialogue guidance information represents relevant recommendation information for guiding the first virtual object and the second virtual object to add each other as friends.
[0195] In an optional implementation, when recommending the second virtual object as a friend to be added to the first virtual object, the processor 801 is further configured to:
[0196] In response to the determination of the second virtual object, a first player profile about the second virtual object is sent to the first game client through the target virtual object; wherein, the information content of the first player profile is determined based on the player profile corresponding to the second virtual object;
[0197] Upon receiving confirmation from the first game client regarding the first player profile, the system sends a second player profile about the first virtual object to the second game client through the target virtual object; wherein, the second game client represents the game client corresponding to the second virtual object; and the information content of the second player profile is determined based on the first player profile corresponding to the first virtual object.
[0198] In an alternative implementation, the processor 801 is further configured to:
[0199] Records multiple sets of historical friend recommendation data;
[0200] For each set of historical friend recommendation data, based on the player profile comparison results between two player characters in that set of historical friend recommendation data, the friend recommendation items that match the player profile comparison results are determined from the multiple friend recommendation items as friend recommendation items to be adjusted.
[0201] Based on the final friend addition results of the two player characters in the historical friend recommendation data, the bonus coefficient of each of the aforementioned friend-making bonus items to be adjusted is adjusted in the player profile matching score list to obtain the player profile matching score list after the bonus coefficient is adjusted.
[0202] In an optional implementation, the target virtual object is associated with a target language model, wherein the target language model is used to output target dialogue guidance information during the dialogue between the first virtual object and the second virtual object, and the processor 801 is used to train the target language model through the following method:
[0203] Record historical chat information from multiple friend recommendation scenarios as training samples for the model; wherein, the historical chat information includes: dialogue information between two player characters and historical dialogue guidance information output by non-player characters during the dialogue between the two player characters;
[0204] The first historical chat information in the model training samples is used as the first positive training sample, and the second historical chat information in the model training samples is used as the first negative training sample. The first language model is trained based on the first positive training sample and the first negative training sample until the first language model converges. The first historical chat information represents the historical chat information of two player characters who successfully added each other as friends. The second historical chat information represents the historical chat information of two player characters who failed to add each other as friends.
[0205] The first historical chat information is used as the second training negative sample, and the second historical chat information is used as the second training positive sample. The second language model is trained based on the second training positive sample and the second training negative sample until the second language model converges. The model parameters in the second language model are of the same type as those in the first language model.
[0206] The model parameters contained in the first language model and the second language model are integrated to obtain the integrated result as the target language model; wherein, the parameter integration includes: subtracting the same model parameters in the converged second language model from the same model parameter vector in the converged first language model.
[0207] In an optional implementation, the target virtual object is associated with a target language model, wherein the target language model is used to output target dialogue guidance information during the dialogue between the first virtual object and the second virtual object, and the processor 801 is further used to:
[0208] Real-time collection of online chat information in multiple friend recommendation scenarios; wherein, each set of online chat information includes: dialogue information between two player characters and dialogue guidance information output by non-player characters during the dialogue between the two player characters;
[0209] From the multiple sets of online chat information, multiple sets of first online chat information are obtained, and the dialogue guidance information in the multiple sets of first online chat information with a frequency higher than or equal to a first preset threshold is used as positive samples for model optimization; wherein, the first online chat information represents the online chat information in which two player characters finally successfully add friends.
[0210] From the multiple sets of online chat information, multiple sets of second online chat information are obtained, and the dialogue guidance information in the multiple sets of second online chat information with a frequency higher than or equal to a second preset threshold is used as negative samples for model optimization; wherein, the second online chat information represents the online chat information in which two player characters ultimately fail to add each other as friends;
[0211] Based on the positive and negative samples optimized by the model, the model parameters in the target language model are optimized to obtain the optimized target language model.
[0212] The electronic device provided in this embodiment detects that a first game client sends a friend-finding instruction to a target virtual object. It then identifies multiple candidate virtual objects from the game scene; from these candidate virtual objects, it identifies a second virtual object; and through the target virtual object, it recommends the second virtual object to the first virtual object as a potential friend. In this way, this disclosure can facilitate dialogue between two player characters through a non-player character in the game, thereby improving the efficiency of friend-adding between two player characters in the game.
[0213] Based on the same inventive concept, this disclosure also provides a computer-readable storage medium storing a computer program, which is executed by a processor, wherein the processor performs the following steps:
[0214] When a game client detects that it has sent a friend-finding instruction to a target virtual object, multiple candidate virtual objects for the first virtual object are determined from the game scene; wherein, the target virtual object represents a non-player character in the game scene, the first virtual object represents a player character corresponding to the first game client, and the candidate virtual objects belong to player characters;
[0215] From the plurality of candidate virtual objects, a second virtual object is determined;
[0216] Based on the target virtual object, the second virtual object is recommended to the first virtual object as a friend to be added.
[0217] In one optional implementation, when the processor detects that the first game client has issued a friend-finding instruction to the target virtual object, the processor is configured to:
[0218] Obtain the chat information sent by the first game client to the target virtual object;
[0219] In response to the appearance of a first keyword in the chat information, the context information of the first keyword is obtained from the chat information; wherein, the first keyword represents a keyword related to making friends;
[0220] When the context information of the first keyword indicates that the chat intent between the first virtual object and the target virtual object is a friend-finding intent, it is determined that the first game client has issued a friend-finding instruction to the target virtual object.
[0221] In an alternative implementation, when determining a plurality of candidate virtual objects of the first virtual object from the game scene, the processor 801 is configured to:
[0222] Based on the position of the first virtual object in the game scene, multiple player characters whose distance from the first virtual object is less than or equal to a preset distance threshold are identified as the multiple candidate virtual objects.
[0223] In one alternative implementation, when determining a second virtual object from the plurality of candidate virtual objects, the processor 801 is configured to:
[0224] Based on the first player profile corresponding to the first virtual object and the second player profile corresponding to the candidate virtual object, determine the degree of player profile matching between the candidate virtual object and the first virtual object;
[0225] Based on the degree of player profile matching between the candidate virtual object and the first virtual object, the candidate virtual object whose player profile matching degree meets the preset conditions is determined from multiple candidate virtual objects as the second virtual object.
[0226] In an optional implementation, when determining the degree of player profile matching between the candidate virtual object and the first virtual object based on the first player profile corresponding to the first virtual object and the second player profile corresponding to the candidate virtual object, the processor 801 is configured to:
[0227] The second player profile corresponding to the candidate virtual object is compared with the first player profile to obtain the first profile comparison result;
[0228] Based on a preset player profile matching score list containing multiple friendship bonus items, a target friendship bonus item that matches the comparison result of the first profile is determined from the multiple friendship bonus items;
[0229] From the player profile matching score list, obtain the scoring coefficient corresponding to each of the target friendship bonus items, and use the sum of the scoring coefficients corresponding to each of the target friendship bonus items as the player profile matching degree between the candidate virtual object and the first virtual object.
[0230] In one optional implementation, when recommending the second virtual object as a friend to be added to the first virtual object, the processor is configured to:
[0231] Using the target virtual object, the first virtual object is guided to move towards the character's position where the second virtual object is located within the game scene.
[0232] In one alternative implementation, the processor is further configured to:
[0233] In response to the first virtual object arriving at the role location of the second virtual object, the first virtual object is guided to engage in dialogue with the second virtual object through the target virtual object;
[0234] During the dialogue between the first virtual object and the second virtual object, target dialogue guidance information is sent to the first virtual object and / or the second virtual object through the target virtual object; wherein, the target dialogue guidance information represents relevant recommendation information for guiding the first virtual object and the second virtual object to add each other as friends.
[0235] In an optional implementation, when recommending the second virtual object as a friend to be added to the first virtual object, the processor is further configured to:
[0236] In response to the determination of the second virtual object, a first player profile about the second virtual object is sent to the first game client through the target virtual object; wherein, the information content of the first player profile is determined based on the player profile corresponding to the second virtual object;
[0237] Upon receiving confirmation from the first game client regarding the first player profile, the system sends a second player profile about the first virtual object to the second game client through the target virtual object; wherein, the second game client represents the game client corresponding to the second virtual object; and the information content of the second player profile is determined based on the first player profile corresponding to the first virtual object.
[0238] In one alternative implementation, the processor is further configured to:
[0239] Records multiple sets of historical friend recommendation data;
[0240] For each set of historical friend recommendation data, based on the player profile comparison results between two player characters in that set of historical friend recommendation data, the friend recommendation items that match the player profile comparison results are determined from the multiple friend recommendation items as friend recommendation items to be adjusted.
[0241] Based on the final friend addition results of the two player characters in the historical friend recommendation data, the bonus coefficient of each of the aforementioned friend-making bonus items to be adjusted is adjusted in the player profile matching score list to obtain the player profile matching score list after the bonus coefficient is adjusted.
[0242] In one optional implementation, the target virtual object is associated with a target language model, wherein the target language model is used to output target dialogue guidance information during the dialogue between the first virtual object and the second virtual object, and the processor is used to train the target language model through the following method:
[0243] Record historical chat information from multiple friend recommendation scenarios as training samples for the model; wherein, the historical chat information includes: dialogue information between two player characters and historical dialogue guidance information output by non-player characters during the dialogue between the two player characters;
[0244] The first historical chat information in the model training samples is used as the first positive training sample, and the second historical chat information in the model training samples is used as the first negative training sample. The first language model is trained based on the first positive training sample and the first negative training sample until the first language model converges. The first historical chat information represents the historical chat information of two player characters who successfully added each other as friends. The second historical chat information represents the historical chat information of two player characters who failed to add each other as friends.
[0245] The first historical chat information is used as the second training negative sample, and the second historical chat information is used as the second training positive sample. The second language model is trained based on the second training positive sample and the second training negative sample until the second language model converges. The model parameters in the second language model are of the same type as those in the first language model.
[0246] The model parameters contained in the first language model and the second language model are integrated to obtain the integrated result as the target language model; wherein, the parameter integration includes: subtracting the same model parameters in the converged second language model from the same model parameter vector in the converged first language model.
[0247] In one optional implementation, the target virtual object is associated with a target language model, wherein the target language model is used to output target dialogue guidance information during the dialogue between the first virtual object and the second virtual object, and the processor is further used to:
[0248] Real-time collection of online chat information in multiple friend recommendation scenarios; wherein, each set of online chat information includes: dialogue information between two player characters and dialogue guidance information output by non-player characters during the dialogue between the two player characters;
[0249] From the multiple sets of online chat information, multiple sets of first online chat information are obtained, and the dialogue guidance information in the multiple sets of first online chat information with a frequency higher than or equal to a first preset threshold is used as positive samples for model optimization; wherein, the first online chat information represents the online chat information in which two player characters finally successfully add friends.
[0250] From the multiple sets of online chat information, multiple sets of second online chat information are obtained, and the dialogue guidance information in the multiple sets of second online chat information with a frequency higher than or equal to a second preset threshold is used as negative samples for model optimization; wherein, the second online chat information represents the online chat information in which two player characters ultimately fail to add each other as friends;
[0251] Based on the positive and negative samples optimized by the model, the model parameters in the target language model are optimized to obtain the optimized target language model.
[0252] By utilizing the computer-readable storage medium provided in the embodiments of this disclosure, when a first game client sends a friend-finding instruction to a target virtual object, multiple candidate virtual objects are determined from the game scene; a second virtual object is determined from the multiple candidate virtual objects; and the second virtual object is recommended to the first virtual object as a friend to be added, based on the target virtual object. Thus, this disclosure can facilitate dialogue and communication between two player characters through a non-player character in the game, thereby improving the efficiency of friend-adding between two player characters in the game.
[0253] In this embodiment of the disclosure, the computer-readable storage medium can also execute other machine-readable instructions when the processor runs, to perform the method of adding friends in the game as described in other embodiments. For the specific steps and principles of the method of adding friends in the game, please refer to the description of the method-side embodiment, which will not be repeated here.
[0254] In the embodiments provided in this disclosure, it should be understood that the disclosed systems and methods can be implemented in other ways. The system embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces. Indirect couplings or communication connections between systems or units may be electrical, mechanical, or other forms.
[0255] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0256] In addition, the functional units in the embodiments provided in this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0257] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0258] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0259] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure. All should be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A method for adding friends in a game, the method comprising: When a game client sends a friend-finding instruction to a target virtual object, multiple candidate virtual objects are determined from the game scene; wherein, the target virtual object represents a non-player character in the game scene, the first virtual object represents a player character corresponding to the first game client, and the candidate virtual objects belong to player characters; From the plurality of candidate virtual objects, a second virtual object is determined; Based on the target virtual object, the second virtual object is recommended to the first virtual object as a friend to be added.
2. The method according to claim 1, wherein, The detection of the first game client sending a friend-finding instruction to the target virtual object includes: Obtain the chat information sent by the first game client to the target virtual object; In response to the appearance of a first keyword in the chat information, the context information of the first keyword is obtained from the chat information; wherein, the first keyword represents a keyword related to making friends; When the context information of the first keyword indicates that the chat intent between the first virtual object and the target virtual object is a friend-finding intent, it is determined that the first game client has issued a friend-finding instruction to the target virtual object.
3. The method according to claim 1, wherein, The step of determining multiple candidate virtual objects from the game scene for the first virtual object includes: Based on the position of the first virtual object in the game scene, multiple player characters whose distance from the first virtual object is less than or equal to a preset distance threshold are identified as the multiple candidate virtual objects.
4. The method according to claim 1, wherein, The step of determining the second virtual object from the plurality of candidate virtual objects includes: Based on the first player profile corresponding to the first virtual object and the second player profile corresponding to the candidate virtual object, determine the degree of player profile matching between the candidate virtual object and the first virtual object; Based on the degree of player profile matching between the candidate virtual object and the first virtual object, the candidate virtual object whose player profile matching degree meets the preset conditions is determined from multiple candidate virtual objects as the second virtual object.
5. The method according to claim 4, wherein, The step of determining the degree of player profile matching between the candidate virtual object and the first virtual object based on the first player profile corresponding to the first virtual object and the second player profile corresponding to the candidate virtual object includes: The second player profile corresponding to the candidate virtual object is compared with the first player profile to obtain the first profile comparison result; Based on a preset player profile matching score list containing multiple friendship bonus items, a target friendship bonus item that matches the comparison result of the first profile is determined from the multiple friendship bonus items; From the player profile matching score list, obtain the scoring coefficient corresponding to each of the target friendship bonus items, and use the sum of the scoring coefficients corresponding to each of the target friendship bonus items as the player profile matching degree between the candidate virtual object and the first virtual object.
6. The method according to claim 1, wherein, The step of recommending the second virtual object to the first virtual object as a potential friend includes: Using the target virtual object, the first virtual object is guided to move towards the character's position where the second virtual object is located within the game scene.
7. The method according to claim 6, wherein, The method further includes: In response to the first virtual object arriving at the role location of the second virtual object, the first virtual object is guided to engage in dialogue with the second virtual object through the target virtual object; During the dialogue between the first virtual object and the second virtual object, target dialogue guidance information is sent to the first virtual object and / or the second virtual object through the target virtual object; wherein, the target dialogue guidance information represents relevant recommendation information for guiding the first virtual object and the second virtual object to add each other as friends.
8. The method according to claim 1, wherein, The step of recommending the second virtual object as a potential friend to the first virtual object also includes: In response to the determination of the second virtual object, a first player profile about the second virtual object is sent to the first game client through the target virtual object; wherein, the information content of the first player profile is determined based on the player profile corresponding to the second virtual object; Upon receiving confirmation from the first game client regarding the first player profile, the system sends a second player profile about the first virtual object to the second game client through the target virtual object; wherein, the second game client represents the game client corresponding to the second virtual object; and the information content of the second player profile is determined based on the first player profile corresponding to the first virtual object.
9. The method according to claim 5, wherein, The method further includes: Records multiple sets of historical friend recommendation data; For each set of historical friend recommendation data, based on the player profile comparison results between two player characters in that set of historical friend recommendation data, the friend recommendation items that match the player profile comparison results are determined from the multiple friend recommendation items as friend recommendation items to be adjusted. Based on the final friend addition results of the two player characters in the historical friend recommendation data, the bonus coefficient of each of the aforementioned friend-making bonus items to be adjusted is adjusted in the player profile matching score list to obtain the player profile matching score list after the bonus coefficient is adjusted.
10. The method according to claim 7, wherein, The target virtual object is associated with a target language model, wherein the target language model is used to output target dialogue guidance information during the dialogue between the first virtual object and the second virtual object, and the target language model is trained using the following method: Record historical chat information from multiple friend recommendation scenarios as training samples for the model; wherein, the historical chat information includes: dialogue information between two player characters and historical dialogue guidance information output by non-player characters during the dialogue between the two player characters; The first historical chat information in the model training samples is used as the first positive training sample, and the second historical chat information in the model training samples is used as the first negative training sample. The first language model is trained based on the first positive training sample and the first negative training sample until the first language model converges. The first historical chat information represents the historical chat information of two player characters who successfully added each other as friends. The second historical chat information represents the historical chat information of two player characters who failed to add each other as friends. The first historical chat information is used as the second training negative sample, and the second historical chat information is used as the second training positive sample. The second language model is trained based on the second training positive sample and the second training negative sample until the second language model converges. The model parameters in the second language model are of the same type as those in the first language model. The model parameters contained in the first language model and the second language model are integrated to obtain the integrated result as the target language model; wherein, the parameter integration includes: subtracting the same model parameters in the converged second language model from the same model parameter vector in the converged first language model.
11. The method according to claim 7, wherein, The target virtual object is associated with a target language model, wherein the target language model is used to output the target dialogue guidance information during the dialogue between the first virtual object and the second virtual object, and the method further includes: Real-time collection of online chat information in multiple friend recommendation scenarios; wherein, each set of online chat information includes: dialogue information between two player characters and dialogue guidance information output by non-player characters during the dialogue between the two player characters; From the multiple sets of online chat information, multiple sets of first online chat information are obtained, and the dialogue guidance information in the multiple sets of first online chat information with a frequency higher than or equal to a first preset threshold is used as positive samples for model optimization; wherein, the first online chat information represents the online chat information in which two player characters finally successfully add friends. From the multiple sets of online chat information, multiple sets of second online chat information are obtained, and the dialogue guidance information in the multiple sets of second online chat information with a frequency higher than or equal to a second preset threshold is used as negative samples for model optimization; wherein, the second online chat information represents the online chat information in which two player characters ultimately fail to add each other as friends; Based on the positive and negative samples optimized by the model, the model parameters in the target language model are optimized to obtain the optimized target language model.
12. A device for adding friends in a game, the device comprising: The detection module is configured to determine multiple candidate virtual objects of the first virtual object from the game scene when it detects that the first game client sends a friend-finding instruction to the target virtual object; wherein the target virtual object represents a non-player character in the game scene, the first virtual object represents a player character corresponding to the first game client, and the candidate virtual objects belong to player characters; The matching module is configured to determine a second virtual object from the plurality of candidate virtual objects; The recommendation module is configured to recommend the second virtual object as a potential friend to the first virtual object through the target virtual object.
13. An electronic device, comprising: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the method for adding friends in a game as described in any one of claims 1 to 11.
14. A computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the method for adding friends in a game as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Social relationship recommendation method and device in game and computer readable storage medium
CN108579095A
NPC (Non-player Character) artificial intelligence interaction method and system in online game
CN108837511A
Recommending friends in automated chatting
CN109643325A
Training method of dialogue behavior classification model and dialogue log processing method and device
CN115147131A
Question and answer search method and device and storage medium
CN116361638A