Method and device for displaying text in game, electronic equipment and readable storage medium
By using text placeholders and replacement rules in card games, dynamically generate and display card text, the problem of inefficient card text generation in card games is solved and the gaming experience is improved.
Patent Information
- Application Number
- CN202311763150.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2025-06-20
AI Technical Summary
The efficiency of card text generation in card games is low, which affects the efficiency of text display in the game, and thus affects the player's gaming experience.
Card text is dynamically generated and displayed by displaying game cards in game games in a graphical user interface, using text placeholders and pre-configured replacement rules to respond to changes in card events.
It improves the efficiency of card text display in the game, simplifies the generation process of card text, and improves the player's gaming experience.
Smart Images

Figure CN120168953A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of game technologies, and in particular, to a method for displaying text in a game, a device for displaying text in a game, an electronic device, and a computer-readable storage medium. Background Art
[0002] Currently, with the rapid development of network technologies, online games have gradually entered people's lives. More and more people play games through terminal devices (such as smart phones, computers, etc.). People play games to pass the leisure time and make their lives more colorful.
[0003] Card games are currently one of the more popular types of games. In card games, there are hundreds or thousands of game cards. The game cards need to display appropriate card text according to card events such as triggered card skills (or card abilities). That is, the card text of the game cards is variable text. However, currently, the generation efficiency of the card text is low, which in turn affects the text display efficiency in the game and the gaming experience of players. Summary of the Invention
[0004] Embodiments of the present invention provide a method, a device, an electronic device, and a computer-readable storage medium for displaying text in a game, so as to solve the problem that the text display efficiency in the game is not high and affects the gaming experience of players.
[0005] Embodiments of the present invention disclose a method for displaying text in a game. A graphical user interface is provided by a first terminal device. The graphical user interface displays a game play scene. The game play scene includes a first terminal account and a second terminal account participating in the game play. The first terminal account and the second terminal account fight against each other through game cards. The method includes:
[0006] Displaying the game cards in the game play in the graphical user interface, where the game cards include first card text, the first card text includes text placeholders, and the first card text is used to describe the game effects of the corresponding game cards in the game play;
[0007] Responding to a target card event triggered in the game play, determining a target game card in the game play scene, where the target game card is a card whose game effect changes under the influence of the target card event;
[0008] Determining second card text corresponding to the target game card, obtaining specified card content corresponding to the text placeholder in the second card text, and determining target card content corresponding to the specified card content based on a pre-configured replacement rule;
[0009] Generate the third card text corresponding to the target game card based on the second card text and the target card content, and display it in the target game card.
[0010] An embodiment of the present invention also discloses a text display device in a game. A graphical user interface is provided by a first terminal device. The graphical user interface displays a game match scene, which includes a first terminal account and a second terminal account participating in the game match. The first terminal account and the second terminal account fight against each other through game cards. The device includes:
[0011] A game card display module, configured to display game cards in the game match in the graphical user interface. Among them, the game card includes a first card text, the first card text includes text placeholders, and the first card text is used to describe the game effect of the corresponding game card in the game match;
[0012] A card event trigger module, configured to determine a target game card in the game match scene in response to a target card event triggered in the game match. Among them, the target game card is a game card whose game effect changes under the influence of the target card event;
[0013] A target card content determination module, configured to determine the second card text corresponding to the target game card, obtain the specified card content corresponding to the text placeholder in the second card text, and determine the target card content corresponding to the specified card content based on a pre-configured replacement rule;
[0014] A card text display module, configured to generate the third card text corresponding to the target game card based on the second card text and the target card content, and display it in the target game card.
[0015] An embodiment of the present invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0016] The memory is used to store a computer program;
[0017] When the processor is used to execute the program stored on the memory, it implements the method as described in the embodiment of the present invention.
[0018] An embodiment of the present invention also discloses a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method as described in the embodiment of the present invention.
[0019] An embodiment of the present invention also discloses a computer-readable storage medium, on which instructions are stored, and when executed by one or more processors, cause the processors to execute the method as described in the embodiment of the present invention.
[0020] The embodiments of the present invention include the following advantages:
[0021] In an embodiment of the present invention, a graphical user interface is provided by a first terminal device. A game play scene is displayed in the graphical user interface. The game play scene may include a first terminal account and a second terminal account participating in the game play. The first terminal account and the second terminal account can battle through game cards. Game cards in the game play scene are displayed in the graphical user interface. Among them, the game card includes a first card text, the first card text includes a text placeholder, and the first card text is used to describe the game effect of the corresponding game card in the game play scene. In response to a target card event triggered in the game play scene, a target game card in the game play scene is determined. The target game card is a game card whose game effect changes under the influence of the target card event. Then, a second card text corresponding to the target game card is determined, the specified card content corresponding to the text placeholder in the second card text is obtained, and the target card content corresponding to the specified card content is determined based on a pre-configured replacement rule. Finally, a third card text corresponding to the target game card is generated based on the second card text and the target card content, and the third card text is displayed in the target game card. In the embodiment of the present invention, the card text is divided according to a suitable replacement granularity to obtain a card text including a text placeholder. The text placeholder refers to the part of the card text that needs to be replaced. Specifically, when a target card event is triggered in the game play, the target game card affected by the target card event in the game play is obtained. Then, the specified card content corresponding to the text placeholder in the second card text of the target game card is obtained, and then the target card content corresponding to the specified card content is determined based on the pre-configured replacement rule. Finally, the third card text corresponding to the target game card can be obtained based on the second card text and the target card content of the target game card and displayed. In this way, the target game card affected by the target card event in the game play scene can be quickly changed to the corresponding card text. Furthermore, players can determine the impact of the target card event on the game effect in the game play scene according to the changed card text. The embodiment of the present invention supports the variable display of more flexible card text with a relatively simple solution, improves the display efficiency of card text in the game, and improves the gaming experience of players. Description of the Drawings
[0022] Figure 1 It is a flowchart of the steps of a method for text display in a game provided in an embodiment of the present invention;
[0023] Figure 2 One of the schematic diagrams for generating card text provided in an embodiment of the present invention;
[0024] Figure 3 Another schematic diagram for generating card text provided in an embodiment of the present invention;
[0025] Figure 4 The third schematic diagram for generating card text provided in an embodiment of the present invention;
[0026] Figure 5 The structural block diagram of a text display device in a game provided in an embodiment of the present invention;
[0027] Figure 6 The schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention. Detailed implementation manners
[0028] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners.
[0029] In a card game, the card text displayed on the game card is a very basic and important element. Through accurate description and expression, it conveys the card skills, restrictions, and other rules of the game card to players. The accuracy and clarity of the card text are crucial for the balance of the game and the experience of players. The card text is related to card events and is very complex. For a large card game with hundreds or thousands of game cards, the card events are necessarily very complex. Of course, the description of the corresponding card text will also be very complex, and the effective situations of card events are different in different scenarios. The card game prompts players about the effective situations of card events in corresponding situations, which helps players understand the card event mechanism and the actual card battle situation.
[0030] Therefore, the game card needs to display appropriate card text according to the current card events affecting it. Generally, the changes in the description of the card text can be divided into two categories: one is the change of some values in the card text, that is, the card events cause the changes of values such as damage and life in the card; the other is the change of the card text, that is, the change of the card event conditions, resulting in different effective card events, and the card text may be completely different from the previous card text. In the first case, only the corresponding values of the card text need to be modified. In the second case, usually when the card event is triggered, a new card text that conforms to the current card event is used.
[0031] Card text is associated with card events. In card games, card events are also complex and diverse, which leads to complex and diverse changes in card text. The above two methods of describing changes in card text seem to be able to adapt to any situation, but in actual operation, there are many difficult-to-implement places. For example, there is a general card event that can affect multiple game cards. When the card event takes effect on the game cards, the card text on different game cards is different. If a corresponding card text is generated for each game card, there will be various different versions of the card text. Even if the card event causes one or two words in the card text to be modified, a corresponding card text needs to be regenerated.
[0032] The problems derived from the above replacement of card text are essentially that the replacement granularity of card text is too large. For example, it is necessary to replace all the card text or nearly half of the card text. However, a smaller replacement granularity means a more complex card text replacement scheme, defining what kind of modifications need to be made to the data in which positions of the card text. However, a complex card text replacement scheme will also lead to a higher understanding cost and hinder the production of card text. Therefore, a variable card text replacement scheme needs to balance the conflict between a smaller card text replacement granularity and a simpler card text replacement scheme to obtain a card text replacement scheme that meets the requirements.
[0033] Currently, when card events change, the effect is usually achieved by replacing the card text. To ensure an appropriate replacement granularity, special processing is also carried out on some general card events so that when these card events change, the card text can be modified with the replacement granularity defined by the defined special rules. Such a method is relatively simple and has a better effect when the number of cases where card events trigger changes in card text is small.
[0034] When there are many changes in card text, the replacement granularity of card text changes is usually divided finer. At this time, a smaller replacement granularity is usually divided by associating card events and card text. For example, different situations of card events are associated with different card texts, and then in actuality, according to the state change of the card event, the part of the actual card text associated with the card event is replaced with the card text corresponding to the current card event.
[0035] There are also solutions that choose to standardize the rules of card text. Specifically, a section of card text is corresponded to a card event. Instead of directly modifying the card text, the presence of the description corresponding to the card event that takes effect is enhanced through manifestations such as color change to achieve the goal of variable card text.
[0036] If only the general card events are specially processed, when there are many changes in the card text, the corresponding special processing will increase, making the whole process complex and difficult to maintain.
[0037] For the card text divided by card events, associating card events with card text will cause the following problems:
[0038] 1. When multiple card events affect the same card text segment, it is difficult to establish the corresponding relationship between card events and card text.
[0039] 2. When a card event affects multiple card text segments, it is also difficult to handle the related changes.
[0040] 3. The state changes of card events will result in the card text of multiple card events, and these card texts will also be redundant.
[0041] If the scheme of dividing card text by card events continues to be refined, it will lead to the replacement scheme of card text becoming too complex and difficult to define the basis for description.
[0042] In summary, from the existing scheme, it can be seen that dividing the card text of game cards by card events is feasible, but there are still many problems. Therefore, in essence, the embodiments of the present invention also divide the card text based on card events to achieve variable card text. Then, the following problems need to be solved:
[0043] 1. When a single or multiple card events affect a certain value in the card text, how to dynamically calculate this value in the card text according to the card events;
[0044] 2. How to associate a card event with a card text segment;
[0045] 3. When multiple card events affect the same card text segment, how to define which card text is variable and how to modify these card texts;
[0046] 4. When a card event affects multiple card text segments, how to define which card text is variable and how to modify these card texts;
[0047] 5. Ensure that when dynamically generating the actual card text of the card, it is as efficient as possible.
[0048] In view of the above problems, in the embodiments of the present invention, the card text is divided into replacement granularities suitable for dealing with most variable card text situations. The variable text (specified card content) in the card text is marked with text placeholders, and corresponding replacement rules are pre-configured. When a game card is affected by one or more target card events, in response to the one or more target card events, the target game card affected by the target card event is determined, the second card text of the target game card is obtained, the part corresponding to the text placeholder in the second card text is used as the specified card content, and then the target card content corresponding to the specified card content is determined based on the replacement rules. Finally, the third card text after the game card is affected by the target card event can be obtained according to the second card text and the target card content and displayed.
[0049] Refer to Figure 1 , which shows a step flowchart of a text display method in a game provided in the embodiments of the present invention. A graphical user interface is provided through a first terminal device. The graphical user interface displays a game session scene, and the game session scene includes a first terminal account and a second terminal account participating in the game session. The first terminal account and the second terminal account fight against each other through game cards. Specifically, the following steps may be included:
[0050] Step 101: Display the game cards in the game session in the graphical user interface, where the game cards include first card text, the first card text includes text placeholders, and the first card text is used to describe the game effects of the corresponding game cards in the game session.
[0051] Run a game application on the first terminal device, and render a graphical user interface on the touch display of the first terminal device. The content displayed on the graphical user interface includes a game session scene. The game session scene includes a first terminal account corresponding to the first terminal device and a second terminal account corresponding to the second terminal device participating in the game session. The first terminal account and the second terminal account can fight against each other through game cards. Specifically, the first terminal account and the second terminal account can represent two players or opponents participating in the game session. When a player conducts a game session, the player logs in to their own terminal account on their respective terminal devices. Subsequently, in the game session, the player can operate the game cards in the game session on their own terminal device, select different strategies and actions, and trigger card events in the game session to fight against the opponent or the game system.
[0052] In an embodiment of the present invention, game cards in a game match are displayed in a graphical user interface, specifically, game cards held by a first terminal account and game cards held by a second terminal account. Among them, corresponding first card texts are respectively provided in the game cards, and the first card texts are used to describe the game effects of the corresponding game cards in the game match. For example, the first card text of a certain game card may be "Card Name: Freezing Magic; Mana Value: 50; Effect Description: Apply 50 points of spell damage to the selected target;...". In addition, the first card text further includes text placeholders. In computer programming, a text placeholder is a symbol that occupies a fixed position, and its function is to act as a kind of marker, indicating that the program needs to replace it with an actual value, object, or code snippet during execution. For example, when the first card text is "Card Name: Freezing Magic; Mana Value: 50; Effect Description: Apply 50 points of spell damage to the selected target;...", a corresponding text placeholder, such as
num
[0053] Step 102: In response to a target card event triggered in the game match scene, determine the target game card in the game match scene, where the target game card is a game card whose game effect changes under the influence of the target card event.
[0054] Exemplarily, card events may at least include events such as drawing cards, playing cards, being attacked, attacking, drawing supplementary cards, discarding cards, covering cards, etc. in a game match.
[0055] In an embodiment of the present invention, the target card event may be a card event triggered by the first terminal account or the second terminal account through their terminal devices during the game match. In response to the target card event, determine the game card whose game effect changes under the influence of the target card event in the game match as the target game card, where the target card event may be an event generated by a player operating one, multiple, or all game cards in the game match. In a specific example, the target card event may be that a player plays a game card restricting instant skills through the first terminal account in the game match, then the game cards with instant skills in the game match can be used as the target game cards.
[0056] Step 103: Determine the second card text corresponding to the target game card, obtain the specified card content corresponding to the text placeholder in the second card text, and determine the target card content corresponding to the specified card content based on a pre-configured replacement rule.
[0057] The embodiments of the present invention divide the changes in the card text of the target game card into three cases. (1) The target card event causes a change in the value in the card text; (2) Append the card text corresponding to a target card event; (3) Concatenate the card texts of multiple target card events. For these cases, the embodiments of the present invention can determine the card text that the target game card should display after triggering the target card event in the game round based on the pre-configured replacement rules.
[0058] In a specific implementation, after determining the target game card in the game round, determine the second card text corresponding to the target game card, and obtain the specified card content corresponding to the text placeholder in the second card text. The second card text may include some fixed text, as well as one or more specified card contents and the text placeholders corresponding to the specified card contents. For example, the second card text may be "
Text placeholder (Instant)
[0059] It should be noted that the embodiments of the present invention can be implemented based on the client of the terminal device, or can be implemented based on the client and the server of the terminal device. The embodiments of the present invention do not need to be limited thereto. It should be noted that since the card events in most card games are relatively complex, usually the card events, related replacement logics, data tables, etc. are placed on the server, and the server feeds the relevant data back to the client, thereby reducing the computing amount of the client.
[0060] Step 104, Generate the third card text corresponding to the target game card based on the second card text and the target card content, and display it in the target game card.
[0061] In an embodiment of the present invention, after determining the specified card content corresponding to the text placeholder of the second card text for the target game card and determining the target card content corresponding to the specified card content based on the pre-configured replacement rules, the third card text corresponding to the target game card can be generated according to the second card text and the target card content. As an example of the present invention, the target card content can be filled in the position corresponding to the originally placed specified card content in the second card text, and thus the third card text corresponding to the target game card can be obtained, so as to remind the player of the card skills or card abilities that the target game card has after triggering the target card event. Exemplarily, assuming that the target game card has an instant-cast skill, the card text of the target game card may include the corresponding description text "Instant-cast: XXX". If the target card event is to play a game card with a restricted instant-cast skill, then the target game card will be updated to a card text that does not include the description text corresponding to the instant-cast skill.
[0062] In the above method for displaying text in a game, a graphical user interface is provided by a first terminal device. The game board scene is displayed in the graphical user interface. The game board scene may include a first terminal account and a second terminal account participating in the game. The first terminal account and the second terminal account can battle through game cards. The game cards in the game board scene are displayed in the graphical user interface. Among them, the game card includes a first card text, and the first card text includes a text placeholder. The first card text is used to describe the game effect of the corresponding game card in the game board scene. In response to the target card event triggered in the game board scene, the target game card in the game board scene is determined. The target game card is the game card whose game effect changes under the influence of the target card event. Then, the second card text corresponding to the target game card is determined, the specified card content corresponding to the text placeholder in the second card text is obtained, and the target card content corresponding to the specified card content is determined based on the pre-configured replacement rule. Finally, the third card text corresponding to the target game card is generated based on the second card text and the target card content, and the third card text is displayed in the target game card. In the embodiment of the present invention, the card text is divided according to a suitable replacement granularity to obtain a card text including a text placeholder. The text placeholder refers to the part of the card text that needs to be replaced. Specifically, when a target card event is triggered in the game, the target game card affected by the target card event in the game is obtained. Then, the specified card content corresponding to the text placeholder in the second card text of the target game card is obtained, and then the target card content corresponding to the specified card content is determined based on the pre-configured replacement rule. Finally, the third card text corresponding to the target game card can be obtained based on the second card text and the target card content of the target game card and displayed. In this way, the target game card affected by the target card event in the game board scene can be quickly changed to the corresponding card text. Furthermore, the player can determine the impact of the target card event on the game effect in the game board scene according to the changed card text. The embodiment of the present invention adopts a relatively simple solution to support the variable display of more flexible card text, improves the display efficiency of the card text in the game, and improves the player's gaming experience.
[0063] In an embodiment of the present invention, the target card event has a corresponding event identifier, each game card has a corresponding event data table, each game card has a corresponding card identifier, the event data table has a corresponding card identifier, and the event data table includes the event identifier; the step 102 of determining the target game card in the game board scene includes:
[0064] Obtaining the event data table corresponding to the game card according to the card identifier of the game card;
[0065] The game cards corresponding to the event data table with an event identifier that matches the event identifier of the target card event are determined as the target game cards in the game round scenario.
[0066] In the embodiments of the present invention, each target card event has its corresponding event identifier. The event identifier (such as skill number, ability number, or card number) can be used to uniquely identify the corresponding card event. In some embodiments, the event identifier can be a number, letter, or combination. For example, the event identifier corresponding to card event A is 1000, and the event identifier corresponding to card event B is 1001.
[0067] In the embodiments of the present invention, game cards each have a corresponding event data table. Game cards have corresponding card identifiers, and event data tables also have corresponding card identifiers. The event data table also includes replacement rules corresponding to text placeholders and event identifiers. Therefore. Specifically, the card identifier (card ID) can be used to uniquely identify the corresponding game card and event data table. In some embodiments, the card identifier can be a number, letter, or combination. For example, the card identifier can be "Rebirth", "C0001".
[0068] In the embodiments of the present invention, in response to the target card events triggered in the game round, for example, in response to card event A and card event B triggered in the game round, the event data table corresponding to the game card can be obtained according to the card identifier of the game card. Then, it is determined whether there are event identifiers corresponding to card event A and card event B in the event data table. If so, the game cards corresponding to the event identifiers corresponding to card event A and card event B can be determined as the target game cards in the game round scenario. If not, it can be determined that there are no target game cards in the game round scenario, that is, there are no game cards in the game round scenario that are affected by card event A and card event B.
[0069] In one embodiment of the present invention, the event data table also includes replacement rules corresponding to text placeholders and event content corresponding to event identifiers. The replacement rules include replacement calculation formulas. 103. Determining the target card content corresponding to the specified card content based on the pre-configured replacement rules includes:
[0070] Input the specified card content and the event content corresponding to the event identifier of the target card event into the replacement calculation formula to obtain a calculation result;
[0071] Use the calculation result as the target card content corresponding to the specified card content.
[0072] In the embodiments of the present invention, for the situation where the values in the card text change due to the target card event, in the data preparation stage, a certain value in the initial card text is selected and referred to Figure 2 , for example, the "2" in the initial card text of the game card "When dealing damage, restore 2 points of life to all friendly Shikigami" can be used as the specified card content in the initial card text. The specified card content "2" in the initial card text is marked with a text placeholder, and the card text of the game card "When dealing damage, restore
text placeholder
[0073] 1. The text placeholder at the position of the specified card content in the card text. For example, when recording in the data table, the specified card content in the above card text, that is, "2", will be marked with a text placeholder. For example, it is marked with the text placeholder {num}.
[0074] 2. Replacement calculation formula: 2 + A + 3 * B.
[0075] 3. Event content: The event content corresponding to the event identifier. At this time, the event content can be a value, such as the event identifier 1000 and the event identifier 1001 and the corresponding values.
[0076] 4. The dynamic text type of the card event. Among them, the dynamic text type of the card event is data added to be compatible with other subsequent situations and can be omitted.
[0077] 5. Card ID.
[0078] In an embodiment of the present invention, when a card event is registered on a game card, the server obtains the corresponding event data table based on the card ID of the game card. Then, it checks whether there is an event identifier corresponding to the card event in the event data table. If there is, a callback method can be added. When the target card event is triggered in a game session, the callback method is automatically called, and the data corresponding to the target card event is sent from the event data table to the client. The data sent by the server to the client may include key-value pairs (key-value) composed of an event identifier and an event value. For example, the event identifier 1000 and the event value corresponding to the event identifier 1000. After receiving the data sent by the server, the client caches it locally for refreshing the target game card from the second card text to the third card text. Specifically, the client determines the specified card content corresponding to the text placeholder in the second card text, and inputs the specified card content and the event content (which can be a value) corresponding to the event identifier of the target card event in the event data table corresponding to the card identifier into the replacement calculation formula in the event data table for calculation to obtain a calculation result. Then, the calculation result is used as the target card content corresponding to the specified card content. Finally, the target card content replaces the specified card content in the second card text to obtain the third card text that the target game card should display after triggering the target card event.
[0079] In an embodiment of the present invention, the event data table further includes a replacement rule corresponding to the text placeholder, an event content corresponding to the event identifier, and a dynamic text type value. The replacement rule includes the dynamic text type value corresponding to the event identifier. The step 102 of determining the target card content corresponding to the specified card content based on the pre-configured replacement rule includes:
[0080] Determine the target card content corresponding to the specified card content according to the dynamic text type value corresponding to the event identifier of the target card event and the event content corresponding to the event identifier of the target card event.
[0081] In an embodiment of the present invention, for the case of adding a card text corresponding to a target card event, that is, when a target card event becomes effective, a certain card text needs to be displayed on the card text of the target game card. Conversely, when the target card event is ineffective, this card text is not displayed.
[0082] In the data preparation stage, refer to Figure 3, the initial card text is "Instantly causes 3 points of damage to a shikigami". The initial card text can be divided into two parts, one is the card text A "cause 3 points of damage to a shikigami" which is not affected by the card event, and the other is the card text B "Instantly" which is displayed or hidden depending on whether the card event is effective. The card text B can also be called hidden text. The card text B in the initial card text is marked with a text placeholder to obtain the card text "
Text placeholder
[0083] 1. Hidden text is a text placeholder where the card text should be.
[0084] 2. An event identifier and the event content corresponding to the event identifier, wherein the event content may be a hidden text.
[0085] 3. Dynamic text type of card events. Dynamic text type is used to define the way event identifiers or attribute values related to card events are converted into card text.
[0086] 4. Card ID.
[0087] In an embodiment of the present invention, when a card event is registered on a game card, the server obtains the corresponding event data table based on the card ID of the game card, and then searches the event data table for an event identifier corresponding to the card event. If so, a callback method can be added. When a target card event is triggered in a game match, the callback method is automatically called to send data corresponding to the target card event from the event data table to the client.
[0088] For the description of dynamic text types, in the specific implementation, the server can refresh card information such as card events and attribute values related to card events. Among them, the attribute values can include card event names, card event cooldown consumption, card event casting ranges, damage values, buffs, etc. And there are many different situations when converting these card information into card text displayed in game cards. For example, the specified card content corresponding to the text placeholder in the second card text can be empty. At this time, the event content (hidden text) corresponding to the event identifier of the card event can be directly added to the position of the specified card content in the second card text to obtain the third card text after the change of the game card. However, in actual game requirements, other methods are also needed to determine the changed card text. For example, the server refreshes the data when the A card event takes effect. The A card event data is: the key is the A card event ID, and the value is the card ID from which the A card event originates. However, in fact, what needs to be displayed on the card text of the game card is the card name corresponding to the card ID of this game card (such as "Freeze"). At this time, it is necessary to set the corresponding dynamic text type to limit that the card name needs to be displayed on the card text instead of the hidden text corresponding to the target card event. It can be seen that in the embodiments of the present invention, as many ways of converting card events into card text can be defined as many dynamic text types can be set. Similarly, the server also needs to select the appropriate dynamic text type according to the dynamic text type and send it to the client when refreshing the data related to card events.
[0089] In the embodiments of the present invention, the dynamic text type value corresponding to the event identifier of the card event can be set to the boolean type (bool type). Among them, when the dynamic text type value is of the boolean type, if the dynamic text type value is 1, it means that the card event takes effect on the game card; if the dynamic text type value is 0, it means that the card event is invalid for the game card.
[0090] Of course, the dynamic text type in the embodiments of the present invention can be set to other dynamic text types in addition to the boolean type. Exemplarily, in the embodiments of the present invention, the dynamic text type corresponding to the card event can include the integer type (int type), the list type (list type), or the dictionary type (dict type), etc. Different dynamic text types correspond to different card text display methods. In the embodiments of the present invention, in order to reduce the complexity of card text generation and improve the generation efficiency of card text, it can be set to adopt corresponding methods to generate card text for the dynamic text types of int type, list type, and dict type.
[0091] Exemplarily, the methods for generating card text of different dynamic text types can include:
[0092] 1. bool type: used to represent whether a card event takes effect on a game card;
[0093] 2. int type: event identifier, or the attribute value corresponding to a card event;
[0094] 3. list type / dict type: special attributes corresponding to a card event, or key-value pairs of multiple attribute values. For example, when these are of the dynamic text type, it can be 1) obtain the card names of multiple game cards and display them in the card text; 2) obtain multiple keyword names and display them in the card text.
[0095] Of course, the above dynamic text types are only examples. In actual applications, other dynamic text types and the corresponding card text generation methods can be set according to the game requirements, and the embodiments of the present invention do not need to be restricted in this regard.
[0096] In the embodiments of the present invention, after the client receives the data returned by the server, it caches the data locally, obtains the text corresponding to the target game card according to the dynamic text type in these data, or determines whether to use the event content (hidden text) corresponding to the event identifier of the target card event as the target card content to be filled in the specified card content position according to the dynamic text type value, and then caches it according to the key-value pair of the event identifier and the corresponding text. Fill the text into the position of the specified card content in the second card text of the card, and the third card text that the target game card should display after triggering the target card event can be obtained.
[0097] In an embodiment of the present invention, determining the target card content corresponding to the specified card content according to the dynamic text type value corresponding to the event identifier of the target card event and the event content corresponding to the event identifier of the target card event includes:
[0098] When the dynamic text type value corresponding to the event identifier of the target card event is of the boolean type, determine whether the target card event takes effect on the target game card according to the dynamic text type value; if it is determined according to the dynamic text type value that the target card event takes effect on the target game card, then use the event content corresponding to the event identifier of the target card event as the target card content corresponding to the specified card content;
[0099] When the dynamic text type value corresponding to the event identifier of the target card event is not of the boolean type, obtain the dynamic text corresponding to the dynamic text type value; use the dynamic text corresponding to the dynamic text type value as the target card content corresponding to the specified card content.
[0100] In an embodiment of the present invention, the specified card content corresponding to the text placeholder of the second card text may be empty. When the dynamic text type value corresponding to the event identifier of the target card event is of the boolean type, it is possible to determine whether the target card event takes effect on the target game card according to the dynamic text type value. Exemplarily, if the dynamic text type value is 1, it means that the target card event takes effect on the target game card; if the dynamic text type value is 0, it means that the target card event is invalid for the target game card. Therefore, when the dynamic text type value is 1, the event content (hidden text) corresponding to the event identifier of the target card event can be used as the target card content corresponding to the specified card content, and this target card content can be filled into the position corresponding to the specified card content in the second card text, so as to obtain the third card text that should be displayed on the target game card after triggering the target card event. When the dynamic text type value is 0, there is no need to modify the second card text, and it can be directly used as the third card text that should be displayed on the target game card after the target card event is triggered.
[0101] When the dynamic text type corresponding to the event identifier of the target card event is not of the boolean type, for example, it can be dynamic text types such as int type, list type, and dict type, etc., then the corresponding text can be obtained according to the dynamic text type as the replacement content for the specified card content for the text placeholder, that is, the key (key) of the corresponding text can be found according to the dynamic text type. For example, if the dynamic text type issued by card event 1002 is 3, then the text corresponding to "SKILL_CONTENT_1002_3" will be obtained as the target card content corresponding to the specified card content, and then this target card content can be used to replace the specified card content in the second card text, so as to obtain the third card text that should be displayed on the target game card after triggering the target card event.
[0102] In an embodiment of the present invention, the event data table further includes a replacement rule corresponding to the text placeholder and an event content corresponding to the event identifier. The replacement rule includes a text start, a text end, and a connector. The step 103 of determining the target card content corresponding to the specified card content based on a pre-configured replacement rule includes:
[0103] Merge the event content corresponding to the event identifier of the target card event with the text start, the text end, and the connector to obtain a merged text;
[0104] Use the merged text as the target card content corresponding to the specified card content.
[0105] In an embodiment of the present invention, for the case of splicing card texts of multiple card events, in the data preparation stage, the initial card text is divided into three parts: a text start, a text end, and a connector between card events. For example, refer toFigure 4 , the initial card text can be divided into fixed text and variable text. Among them, the variable text includes the text corresponding to multiple card events. For example Figure 4 Penetration, Swiftness, and Indomitability in , split the variable text to obtain the text at the beginning of the text "(Obtain", the text at the end of the text ").", and the separator between card events ",", and mark the variable text of the initial card text with text placeholders to obtain the card text "Enhancement: In this game, when Tsukuyomi eliminates a Shikigami, this card is randomly enhanced once.
Text placeholder
[0106] 1. The text placeholder at the position of the variable text in the card text;
[0107] 2. Multiple event identifiers and the event content corresponding to each event identifier. Among them, the event content can be a piece of text, such as: Penetration, Swiftness, Indomitability, etc.;
[0108] 3. The dynamic text type of the card event; among them, the dynamic text type of the card event is data added to be compatible with other subsequent situations and can be omitted in the current situation;
[0109] 4. The card ID;
[0110] 5. The text at the beginning, the text at the end, and the separator.
[0111] Among them, for the case where the separators between card events are the same, the separator recorded in the event data table is a string. If the separators between card events are different, then a tuple needs to be used. The tuple composed of the capabilities of the same separator is used as the key, and the separator string is used as the value to form key-value pairs.
[0112] In the embodiments of the present invention, when a card event is registered on a game card, the server obtains the corresponding event data table based on the card ID of the game card. Then, it checks whether there is an event identifier corresponding to the card event in the event data table. If so, a callback method can be added. When the target card event is triggered in a game round, the callback method is automatically called, and the data corresponding to the target card event is sent from the event data table to the client. In the embodiments of the present invention, after the client receives the data returned by the server, it caches the key-value pairs of the event identifier and the corresponding event content (such as text) locally, which is used to refresh the target game card from the second card text to the third card text. Specifically, the specified card content corresponding to the text placeholder in the second card text can be empty. The text at the beginning, the text at the end, the separator, and the event content corresponding to the card event are merged to obtain a merged text, and the merged text is used as the target card content corresponding to the specified card content. Then, the target card content is filled into the position of the specified card content in the second card text of the game card, and the third card text that the target game card should display after triggering the target card event can be obtained.
[0113] Applying the embodiments of the present invention can solve the problem that the card text of game cards is variable. Essentially, it is to subdivide the replacement granularity of the card text division to the level of card events. As an alternative embodiment of the present invention, a card event may have a corresponding card event text. For example, the card event text may include "Instant", "Indomitable", and "Swift", etc. In practical applications, the card event text may also be variable. In the embodiments of the present invention, the variable card event text solution can refer to the solution for the card text. Of course, it can also be a simplified solution of the card text solution.
[0114] Exemplarily, for the card event text, the embodiments of the present invention can be divided into the following two cases for processing:
[0115] 1. The value in the card event text is variable.
[0116] 2. The text visibility control in the card event text.
[0117] The following introduces the display process of the variable card event text according to these two cases.
[0118] 1. The value in the card event text is variable.
[0119] Similar to the variable value solution of the card text, one or more values in the card event text are also extracted, and the value is marked with a text placeholder. A replacement calculation formula is set for the value, and relevant attribute names are defined. Then, the data that needs to be recorded in the data table of the card event text includes:
[0120] 1.1 Placeholder for the position of the numerical value in the card event text,
[0121] 1.2 Replacement calculation formula.
[0122] 1.3 Attribute name.
[0123] 1.4 Event identifier.
[0124] When the server creates a card event, it checks whether the card event has attributes related to variable text. If so, it registers a callback method. When the relevant attributes change, the callback method is called to send the data to the client. The data sent by the server includes key-value pairs of the event identifier, attribute name, and attribute value. Different card events may have attributes with the same name. After receiving the data sent by the server, the client caches it locally and refreshes the card text. When splicing the card text, it will obtain the card event text corresponding to the card event. At this time, if it is found that the card event text is variable, it will call a method to obtain the card event text corresponding to the card event according to the attributes of the card event and the replacement calculation formula, and fill it into the placeholder of the second card text to obtain the card text that should actually be displayed in the game card.
[0125] 2. Text visibility control in card event text
[0126] Extract the text whose visibility needs to be controlled in the card event text, mark it with a placeholder in the text whose visibility of the card event text is, and then add which attributes the text of the visibility is controlled by, and fill in the control formula. Among them, the value of the formula can be of bool type, indicating whether this visible text is visible. Then the data that needs to be recorded in the data table is as follows:
[0127] 1. Placeholder for the position of the visible text in the card event text.
[0128] 2. Control formula.
[0129] 3. Visible text under control.
[0130] 4. Attribute name.
[0131] 5. Event identifier.
[0132] When the server creates a card event, it checks whether the card event has attributes related to variable text. If so, it registers a callback method. When the relevant attributes change, the callback method is called to send the data to the client. The data sent by the server includes key-value pairs of event identifiers, attribute names, and attribute values. After receiving the data sent by the server, the client caches it locally and refreshes the card text. When splicing the card text, it will obtain the card event text corresponding to the card event. At this time, it is found that the card event text is variable. A method is called to obtain the result of whether the visible text is displayed in the card event text according to the attribute value corresponding to the card event and the control formula. If it can be displayed, this visible text is added to the placeholder position of the card event text to obtain the card text that should actually be displayed in the game card.
[0133] The variable values in the above card event text and the control of text visibility in the card event text are mutually compatible. For example, the text with controlled visibility may contain variable values. In this case, the return value of the control formula becomes a value. For example, if the value is greater than 0, the visible text is visible in the card text, and the value is filled into the variable value of the visible text; otherwise, the visible text is not visible in the card text.
[0134] In the embodiment of the present invention, the refresh display process of the card text on the server is very simple and unified. In this way, it will not affect the server capability system, which is more important for the card game capability system. Too much consumption should not be incurred on the variable text of the game card. Similarly, the refreshed data structure and the splicing process of the card text are also very similar, so that the actual splicing logic will be simpler, and the efficiency of generating the card text or the card event text will be higher. In this way, the card text will not take too much time to refresh in the game card, thus affecting the player's gaming experience.
[0135] In summary, the core of the embodiments of the present invention is as follows: (1) Define a formula for the influence of card events on numerical values, add placeholder and default values at the position of the numerical values, and replace the calculation formula. At the same time, record the event identifier and dynamic text type of the card events that will have an impact. In one example, the dynamic text type can be divided into two types. One is whether the card event takes effect or not, with 1 for taking effect and 0 for not taking effect, which is substituted into the replacement calculation formula for calculation. The other is that the card event generates a numerical value, which is directly substituted into the replacement calculation formula for calculation. (2) Each card event has a piece of card event text, and this piece of card event text can also define variable numerical values and simple variable description rules. (3) When multiple card events affect a piece of card text, a limited number of text combination rules for multiple card events will be defined, and these rules are applied for variable text control. (4) When a card event affects multiple pieces of card text, this card event is divided into multiple sub-card events, and each sub-card event affects one piece of card text. (5) By pre-filling the placeholders and preparing the data required for text splicing and combination, the actual card text can be quickly generated. (6) The card event text is made variable by using limited variable rules.
[0136] Applying the embodiments of the present invention, a simple solution is adopted to support more flexible variable card texts of game cards. The division and replacement granularity of the card texts in the embodiments of the present invention are fine enough to handle most cases of variable card texts. When a more complex situation where multiple card events affect a piece of card text occurs, a limited number of combination rules are adopted to reduce the complexity of the variable solution, improve the efficiency of card text generation, and at the same time, this complex variable solution rarely appears in actual card games, has little impact on the effectiveness of the entire card refresh solution, and will not affect players.
[0137] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0138] Refer to Figure 5 , which shows a structural block diagram of a text display device in a game provided in the embodiments of the present invention. A graphical user interface is provided through a first terminal device. The graphical user interface displays a game match scene, and the game match scene includes a first terminal account and a second terminal account participating in the game match. The first terminal account and the second terminal account fight against each other through game cards. Specifically, it may include the following modules:
[0139] The game card display module 501 is used to display game cards in the game round in the graphical user interface, where the game cards include first card texts, and the first card texts are used to describe the game effects of the corresponding game cards in the game round;
[0140] The card event trigger module 502 is used to determine a target game card in the game round scene in response to a target card event triggered in the game round, where the target game card is a game card whose game effect changes under the influence of the target card event;
[0141] The target card content determination module 503 is used to determine a second card text corresponding to the target game card, obtain a specified card content corresponding to a text placeholder in the second card text, and determine a target card content corresponding to the specified card content based on a pre-configured replacement rule;
[0142] The card text display module 504 is used to generate a third card text corresponding to the target game card based on the second card text and the target card content, and display it in the target game card.
[0143] In an embodiment of the present invention, the target card event has a corresponding event identifier, the game cards each have a corresponding event data table, the game cards have corresponding card identifiers, the event data tables have corresponding card identifiers, and the event data tables include event identifiers; the card event trigger module 502 is used to:
[0144] Obtain the event data table corresponding to the game card according to the card identifier of the game card;
[0145] Determine the game card corresponding to the event data table with an event identifier that matches the event identifier of the target card event as the target game card in the game round scene.
[0146] In an embodiment of the present invention, the event data table further includes a replacement rule corresponding to the text placeholder and an event content corresponding to the event identifier, the replacement rule includes a replacement calculation formula, and the target card content determination module 503 is used to:
[0147] Input the specified card content and the event content corresponding to the event identifier of the target card event into the replacement calculation formula to obtain a calculation result;
[0148] Use the calculation result as the target card content corresponding to the specified card content.
[0149] In an embodiment of the present invention, the event data table further includes a replacement rule corresponding to the text placeholder, an event content corresponding to the event identifier, and a dynamic text type value. The replacement rule includes the dynamic text type value corresponding to the event identifier. The target card content determination module 503 is configured to:
[0150] Determine the target card content corresponding to the specified card content according to the dynamic text type value corresponding to the event identifier of the target card event and the event content corresponding to the event identifier of the target card event.
[0151] In an embodiment of the present invention, the target card content determination module 503 is configured to:
[0152] When the dynamic text type value corresponding to the event identifier of the target card event is of the boolean type, determine whether the target card event takes effect on the target game card according to the dynamic text type value;
[0153] If it is determined according to the dynamic text type value that the target card event takes effect on the target game card, then use the event content corresponding to the event identifier of the target card event as the target card content corresponding to the specified card content.
[0154] In an embodiment of the present invention, the dynamic text type value has a corresponding dynamic text. The target card content determination module 503 is configured to:
[0155] When the dynamic text type value corresponding to the event identifier of the target card event is not of the boolean type, obtain the dynamic text corresponding to the dynamic text type value;
[0156] Use the dynamic text corresponding to the dynamic text type value as the target card content corresponding to the specified card content.
[0157] In an embodiment of the present invention, the event data table further includes a replacement rule corresponding to the text placeholder and an event content corresponding to the event identifier. The replacement rule includes a text start, a text end, and a connector. The target card content determination module 503 is configured to:
[0158] Merge the event content corresponding to the event identifier of the target card event with the text start, the text end, and the connector to obtain a merged text;
[0159] Use the merged text as the target card content corresponding to the specified card content.
[0160] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, refer to the corresponding description in the method embodiment.
[0161] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, it implements each process of the text display method embodiment in the above game and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0162] An embodiment of the present invention further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, it implements each process of the text display method embodiment in the above game and can achieve the same technical effects. To avoid repetition, it will not be elaborated here. Among them, the computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.
[0163] An embodiment of the present invention further provides a computer program product. The program product is stored in a storage medium. The program product is executed by at least one processor to implement each process of the text display method embodiment in the above game and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0164] Figure 6 A schematic hardware structure diagram of an electronic device for implementing various embodiments of the present invention.
[0165] The electronic device 600 includes, but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, a processor 610, and a power supply 611, etc. Those skilled in the art can understand that Figure 6 the structure of the electronic device shown in does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine some components, or have different component arrangements. In an embodiment of the present invention, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a laptop computer, a palm computer, a vehicle-mounted terminal, a wearable device, and a pedometer, etc.
[0166] It should be understood that in the embodiments of the present invention, the radio frequency unit 601 can be used for receiving and sending signals during information reception and transmission or call processes. Specifically, after receiving the downlink data from the base station, it is given to the processor 610 for processing; in addition, the uplink data is sent to the base station. Generally, the radio frequency unit 601 includes, but is not limited to, antennas, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. In addition, the radio frequency unit 601 can also communicate with the network and other devices through a wireless communication system.
[0167] The electronic device provides users with wireless broadband Internet access through the network module 602, such as helping users send and receive emails, browse web pages, and access streaming media, etc.
[0168] The audio output unit 603 can convert the audio data received by the radio frequency unit 601 or the network module 602 or stored in the memory 609 into an audio signal and output it as sound. Moreover, the audio output unit 603 can also provide audio output related to specific functions executed by the electronic device 600 (for example, call signal reception sound, message reception sound, etc.). The audio output unit 603 includes a speaker, a buzzer, and a receiver, etc.
[0169] The input unit 604 is used to receive audio or video signals. The input unit 604 can include a graphics processing unit (GPU) 6041 and a microphone 6042. The graphics processing unit 6041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frames can be displayed on the display unit 606. The processed image frames can be stored in the memory 609 (or other storage media) or sent via the radio frequency unit 601 or the network module 602. The microphone 6042 can receive sounds and can process such sounds into audio data. The processed audio data can be converted into a format that can be sent to a mobile communication base station via the radio frequency unit 601 in the case of a telephone call mode and output.
[0170] The electronic device 600 further includes at least one sensor 605, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel 6061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 6061 and / or the backlight when the electronic device 600 is moved to the ear. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 605 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be elaborated here.
[0171] The display unit 606 is used to display information input by the user or information provided to the user. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
[0172] The user input unit 607 can be used to receive input digital or character information, and generate key signal inputs related to the user settings and function control of the electronic device. Specifically, the user input unit 607 includes a touch panel 6071 and other input devices 6072. The touch panel 6071, also known as a touch screen, can collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel 6071). The touch panel 6071 can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 610, and receives and executes the command sent by the processor 610. In addition, the touch panel 6071 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 6071, the user input unit 607 may further include other input devices 6072. Specifically, the other input devices 6072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, which will not be elaborated here.
[0173] Further, the touch panel 6071 may cover the display panel 6061. After the touch panel 6071 detects a touch operation on or near it, it is transmitted to the processor 610 to determine the type of touch event. Subsequently, the processor 610 provides a corresponding visual output on the display panel 6061 according to the type of touch event. Although in Figure 6 , the touch panel 6071 and the display panel 6061 are implemented as two independent components to realize the input and output functions of the electronic device, but in some embodiments, the touch panel 6071 and the display panel 6061 can be integrated to realize the input and output functions of the electronic device, and the specific details are not limited here.
[0174] The interface unit 608 is an interface for connecting an external device to the electronic device 600. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headset port, and so on. The interface unit 608 can be used to receive inputs from an external device (such as data information, power, etc.) and transmit the received inputs to one or more components within the electronic device 600 or can be used to transmit data between the electronic device 600 and the external device.
[0175] The memory 609 can be used to store software programs and various data. The memory 609 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory 609 can include a high-speed random access memory and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0176] The processor 610 is the control center of the electronic device, connecting various parts of the entire electronic device using various interfaces and lines. By running or executing software programs and / or modules stored in the memory 609, and calling data stored in the memory 609, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 610 may include one or more processing units; preferably, the processor 610 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 610.
[0177] The electronic device 600 may further include a power source 611 (such as a battery) for powering each component. Preferably, the power source 611 may be logically connected to the processor 610 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system.
[0178] In addition, the electronic device 600 includes some functional modules not shown, which will not be elaborated here.
[0179] It should be noted that in this article, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, method, article or device including that element.
[0180] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0181] The above has described the embodiments of the present invention in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit and scope protected by the claims of the present invention, and all of them belong to the protection scope of the present invention.
[0182] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0183] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0184] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0185] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0186] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0187] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention, or the part that contributes to the prior art, or this part 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 enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs that can store program codes.
[0188] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention and should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
Claims
1. A method for text display in a game, characterized in that, Provide a graphical user interface through a first terminal device, where the graphical user interface displays a game play scene, and the game play scene includes a first terminal account and a second terminal account participating in the game play. The first terminal account and the second terminal account battle through game cards. The method includes: Display the game cards in the game play in the graphical user interface, where the game cards include first card texts, and the first card texts include text placeholders, and the first card texts are used to describe the game effects of the corresponding game cards in the game play; In response to a target card event triggered in the game play, determine the target game card in the game play scene, where the target game card is a game card whose game effect changes under the influence of the target card event; Determine the second card text corresponding to the target game card, obtain the specified card content corresponding to the text placeholder in the second card text, and determine the target card content corresponding to the specified card content based on a pre-configured replacement rule; Generate a third card text corresponding to the target game card based on the second card text and the target card content, and display it in the target game card.
2. The method according to claim 1, characterized in that, The target card event has a corresponding event identifier, the game cards each have a corresponding event data table, the game cards have corresponding card identifiers, the event data tables have corresponding card identifiers, and the event data tables include event identifiers; determining the target game card in the game play scene includes: Obtain the event data table corresponding to the game card according to the card identifier of the game card; Determine the game card corresponding to the event data table with an event identifier that matches the event identifier of the target card event as the target game card in the game play scene.
3. The method according to claim 2, characterized in that, The event data table also includes a replacement rule corresponding to the text placeholder, an event content corresponding to the event identifier, and the replacement rule includes a replacement calculation formula. Determining the target card content corresponding to the specified card content based on a pre-configured replacement rule includes: Input the specified card content and the event content corresponding to the event identifier of the target card event into the replacement calculation formula to obtain a calculation result; Use the calculation result as the target card content corresponding to the specified card content.
4. The method according to claim 2, characterized in that, The event data table also includes a replacement rule corresponding to the text placeholder, an event content corresponding to the event identifier, and a dynamic text type value. The replacement rule includes the dynamic text type value corresponding to the event identifier. Determining the target card content corresponding to the specified card content based on a pre-configured replacement rule includes: Determine the target card content corresponding to the specified card content according to the dynamic text type value corresponding to the event identifier of the target card event and the event content corresponding to the event identifier of the target card event.
5. The method according to claim 4, characterized in that, Determining the target card content corresponding to the specified card content according to the dynamic text type value corresponding to the event identifier of the target card event and the event content corresponding to the event identifier of the target card event includes: When the dynamic text type value corresponding to the event identifier of the target card event is of boolean type, determining whether the target card event takes effect on the target game card according to the dynamic text type value; If it is determined according to the dynamic text type value that the target card event takes effect on the target game card, using the event content corresponding to the event identifier of the target card event as the target card content corresponding to the specified card content.
6. The method according to claim 4, characterized in that, The dynamic text type value has a corresponding dynamic text. Determining the target card content corresponding to the specified card content according to the dynamic text type value corresponding to the event identifier of the target card event and the event content corresponding to the event identifier of the target card event includes: When the dynamic text type value corresponding to the event identifier of the target card event is not of boolean type, obtaining the dynamic text corresponding to the dynamic text type value; Using the dynamic text corresponding to the dynamic text type value as the target card content corresponding to the specified card content.
7. The method according to claim 2, characterized in that, The event data table further includes replacement rules corresponding to text placeholders and event content corresponding to event identifiers. The replacement rules include a text start, a text end, and a connector. Determining the target card content corresponding to the specified card content based on the pre-configured replacement rules includes: Combining the event content corresponding to the event identifier of the target card event with the text start, the text end, and the connector to obtain a combined text; Using the combined text as the target card content corresponding to the specified card content.
8. A text display device in a game, characterized in that, Providing a graphical user interface through a first terminal device. The graphical user interface displays a game play scene, which includes a first terminal account and a second terminal account participating in the game play. The first terminal account and the second terminal account fight against each other through game cards. The device includes: A game card display module, configured to display game cards in the game play in the graphical user interface, where the game cards include a first card text, and the first card text includes text placeholders, and the first card text is used to describe the game effects of the corresponding game cards in the game play; A card event trigger module, configured to determine a target game card in the game play scene in response to a target card event triggered in the game play, where the target game card is a game card whose game effect changes under the influence of the target card event; A target card content determination module, configured to determine a second card text corresponding to the target game card, obtain the specified card content corresponding to the text placeholder in the second card text, and determine the target card content corresponding to the specified card content based on the pre-configured replacement rules; The card text display module is used to generate the third card text corresponding to the target game card based on the second card text and the target card content, and display it on the target game card.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store computer programs; When the processor is used to execute the program stored on the memory, it implements the method described in any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1-7.