CN113181641A - Rendering method and device of game role in virtual scene and electronic equipment - Google Patents

Rendering method and device of game role in virtual scene and electronic equipment Download PDF

Info

Publication number
CN113181641A
CN113181641A CN202110477556.XA CN202110477556A CN113181641A CN 113181641 A CN113181641 A CN 113181641A CN 202110477556 A CN202110477556 A CN 202110477556A CN 113181641 A CN113181641 A CN 113181641A
Authority
CN
China
Prior art keywords
game
role
target
character
virtual scene
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110477556.XA
Other languages
Chinese (zh)
Other versions
CN113181641B (en
Inventor
刘舟
袁尧
沈琳焘
施坤省
黎煌达
张志稳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Sanqi Jiyao Network Technology Co ltd
Original Assignee
Guangzhou Sanqi Jiyao Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Sanqi Jiyao Network Technology Co ltd filed Critical Guangzhou Sanqi Jiyao Network Technology Co ltd
Priority to CN202110477556.XA priority Critical patent/CN113181641B/en
Publication of CN113181641A publication Critical patent/CN113181641A/en
Application granted granted Critical
Publication of CN113181641B publication Critical patent/CN113181641B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/822Strategy games; Role-playing games
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/10Geometric effects
    • G06T15/20Perspective computation
    • G06T15/205Image-based rendering
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/66Methods for processing data by generating or executing the game program for rendering three dimensional images

Abstract

The application discloses a rendering method and device of game characters in a virtual scene and electronic equipment, wherein the method comprises the following steps: obtaining distance information between a first game role and each target game role in a current virtual scene, wherein the first game role is a player role operated by a target terminal, and the target game role is a player role operated by a non-target terminal; acquiring the current resolution of each target game role according to the distance information between the first game role and each target game role, wherein the current resolution of each target game role is in inverse proportion to the distance information, and the peak value of the current resolution of each target game role is not higher than the preset resolution; and rendering each target game role according to the current resolution of each target game role.

Description

Rendering method and device of game role in virtual scene and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for rendering a game character in a virtual scene, and an electronic device.
Background
When the existing game plays the rendering of the game role in the virtual scene, the game role is generally required to be rendered by a display card of a terminal, and after the rendering of the game role in the whole virtual scene is completed, the rendered game role is displayed on a terminal screen. In an actual game, in order to ensure the rendering effect of game characters in a virtual scene, a preset resolution is usually set for all game characters, and each game character is rendered based on the preset resolution. However, in a large-scale network Game, such as a large Multiplayer Online Role-Playing Game (mmoptg), hundreds of Game characters may need to be displayed on a terminal screen at the same time, and if a display card is needed to render each Game character in real time based on a preset resolution, the upper limit of the operation capability of the display card GPU may be exceeded, which may cause a phenomenon of delay of a picture displayed on the screen of the Game, and may also cause a Game flash-back and damage to the display card.
Disclosure of Invention
The present application is directed to solve at least one of the technical problems in the prior art, and provides a method and an apparatus for rendering a game character in a virtual scene, and an electronic device, which reduce the amount of calculation of a display card when displaying a plurality of game characters, and increase the rendering speed of a terminal screen for the game character in the virtual scene.
In a first aspect, an embodiment of the present application provides a method for rendering a game character in a virtual scene, including:
obtaining distance information between a first game role and each target game role in a current virtual scene, wherein the first game role is a player role operated by a target terminal, and the target game role is a player role operated by a non-target terminal;
acquiring the current resolution of each target game role according to the distance information between the first game role and each target game role, wherein the current resolution of each target game role is in inverse proportion to the distance information, and the peak value of the current resolution of each target game role is not higher than the preset resolution;
and rendering each target game role according to the current resolution of each target game role.
In a second aspect, in an embodiment of the present application, there is further provided an apparatus for rendering a game character in a virtual scene, including:
the information acquisition module is used for acquiring distance information between a first game role and each target game role in the current virtual scene, wherein the first game role is a player role operated by a target terminal, and the target game role is a player role operated by a non-target terminal;
a resolution obtaining module, configured to obtain a current resolution of each target game character according to distance information between the first game character and each target game character, where the current resolution of the target game character is inversely proportional to the distance information, and a peak value of the current resolution of the target game character is not higher than a preset resolution;
and the role display module is used for rendering each target game role according to the current resolution of each target game role.
In a third aspect, an embodiment of the present application provides an electronic device, including: the virtual scene rendering method comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the rendering method of the game character in the virtual scene according to the embodiment.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where computer-executable instructions are stored, and the computer-executable instructions are configured to enable a computer to execute the method for rendering a game character in a virtual scene according to the foregoing embodiment.
The resolution of each target game role is sequentially decreased from near to far through the distance between the first game role and the target game role, so that in a virtual scene with a large number of game roles, all the roles do not need to be drawn by adopting a preset resolution at the same time, the load of a display card GPU can be reduced, the rendering speed of a terminal screen on the game roles in the virtual scene is improved, and the damage to the display card is reduced.
Drawings
The present application is further described with reference to the following figures and examples;
FIG. 1 is a diagram of an application environment of a method for rendering a game character in a virtual scene according to an embodiment;
FIG. 2 is a flowchart illustrating a method for rendering a game character in a virtual scene according to an embodiment;
FIG. 3 is a flowchart illustrating a method for rendering a game character in a virtual scene according to another embodiment;
FIG. 4 is a schematic flow chart diagram illustrating a method for selecting a target game character according to one embodiment;
FIG. 5 is a flowchart illustrating a rendering method of a game character in a virtual scene according to still another embodiment;
FIG. 6 is a diagram illustrating an exemplary configuration of an apparatus for rendering a game character in a virtual scene;
FIG. 7 is a schematic structural diagram of an apparatus for rendering a game character in a virtual scene according to another embodiment;
FIG. 8 is a schematic structural diagram of an apparatus for rendering a game character in a virtual scene in accordance with still another embodiment;
FIG. 9 is a block diagram of a computer device in one embodiment.
Detailed Description
Reference will now be made in detail to the present embodiments of the present application, preferred embodiments of which are illustrated in the accompanying drawings, which are for the purpose of visually supplementing the description with figures and detailed description, so as to enable a person skilled in the art to visually and visually understand each and every feature and technical solution of the present application, but not to limit the scope of the present application.
In order to make the solution of the present application easier to understand, the following explains some concepts involved in the present application:
virtual scene: is a virtual scene displayed when an application program runs on a terminal. The virtual scene may be a simulation environment of a real world, a semi-simulation semi-fictional virtual environment, or a pure fictional virtual environment. The virtual scene may be any one of a two-dimensional virtual scene, a 2.5-dimensional virtual scene, or a three-dimensional virtual scene.
The game role: the method refers to a virtual portrait with high reality degree drawn by a modeling rendering technology. The game character is not limited to a human character, and may be a character such as an animal, in which the game character includes a player character.
The player character: refers to a player-controlled character in a role-playing game.
The non-player character: the character is a character which is not manipulated by a real player in the game, is generally controlled by artificial intelligence of a computer and has a self behavior mode.
Resolution ratio: for determining the degree of fineness of the image detail. Generally, the higher the resolution, the more pixels an image contains and the sharper the image.
When the game-related application program is run, the display card of the terminal device renders and displays the virtual scene and the game role of the application program on the screen of the terminal device. Generally, to ensure the rendering effect of game characters in a virtual scene, a preset resolution for displaying the game characters is set in the application program, so that the display card renders each game character in the virtual scene based on the preset resolution. Generally, the peak value of the game character to be rendered in the virtual scene needs to be known in advance in the rendering mode, so that whether the display card GPU of the terminal device has enough computing capability to support the rendering of the game character in the virtual scene can be judged according to the peak value, and when it is determined that the display card GPU of the terminal device has enough computing capability to support the rendering of the game character in the virtual scene, the application program is operated again to avoid the damage of the display card. However, in a large-scale network Game, such as a large Multiplayer Online Role-Playing Game (mmoptg), a peak value of a Game Role is not controllable, and hundreds of Game roles may need to be simultaneously displayed on a terminal screen, and at this time, if a display card is required to render each Game Role in real time based on a preset resolution, an upper limit of an arithmetic capability of a GPU of the display card may be exceeded, which may cause a phenomenon of a delay of a picture displayed on the screen of the Game, and may also cause a Game flash back and a damage of the display card.
In order to solve the above technical problems, embodiments of the present application will be described in detail below with reference to the accompanying drawings. The rendering method of the game role in the virtual scene is applied to an environment comprising terminal equipment, a plurality of database instances and a plurality of storage instances. The above example may be a virtual machine, a container, or a server, and in the embodiment of the present application, a server is taken as an example for description. Fig. 1 is a diagram of an application environment of a rendering method of a game character in a virtual scene in one embodiment. In the application environment, the terminal device 110 is connected to the server 120 through a network, the terminal 110 may specifically be a desktop terminal 110 or a mobile terminal 110, and the mobile terminal may be one of a mobile phone, a tablet computer, a notebook computer, a wearable device, and the like. The server 120 may be implemented by an independent server 120 or a server cluster composed of a plurality of servers 120, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, middleware service, a domain name service, a security service, a CDN, and a big data and artificial intelligence platform. In this embodiment, the terminal device 110 may be used as a front end of a game client running a game, and the server 120 may be used as a background of the game client, so that after the server 120 obtains a data call request sent by a game user in the terminal device 110 through the game client, a long connection may be quickly established with the terminal device 110.
The terminal device 110 is loaded with a game, and in the process of running the game, the terminal device 110 acquires character information and operation information of a game character from the server 120 according to a user operation or through a communication link, for example, the game character is moved to a target direction or a target point, so that the terminal device 110 can determine a current virtual scene according to the character information and the operation information of the game character; alternatively, the terminal device 110 may also directly obtain the current virtual scene from the memory of the terminal device 110 or from the server 120 according to a request or an instruction of the user, such as a selection operation for a game map. The memory or the server executes the operation according to the instruction or the request, which belongs to the prior art, so that the content or the form of the instruction or the request is not particularly limited. After the current virtual scene is obtained, the terminal device 110 obtains the current resolution of each target game role according to the distance information between the first game role and each target game role in the current virtual scene, and renders each corresponding target game role according to each current resolution, wherein the current resolution of the target game role is inversely proportional to the distance information, and the peak value of the current resolution of the target game role is not higher than the preset resolution.
The resolution of each target game role is sequentially decreased from near to far through the distance between the first game role and the target game role, so that in a virtual scene with a large number of game roles, all the roles do not need to be drawn by adopting a preset resolution at the same time, the load of a display card GPU can be reduced, the rendering speed of a terminal screen on the game roles in the virtual scene is improved, and the damage to the display card is reduced.
Hereinafter, the rendering method of a game character in a virtual scene provided by the embodiments of the present application will be described and explained in detail through several specific embodiments. As an alternative embodiment, the method may be performed by the terminal device, or by both the server and the terminal device.
As shown in fig. 2, in one embodiment, a method for rendering a game character in a virtual scene is provided. The embodiment is mainly illustrated by applying the method to computer equipment. The computer device may specifically be the terminal device 110 in fig. 1 described above.
Referring to fig. 2, the rendering method of a game character in a virtual scene specifically includes the following steps:
and S11, obtaining the distance information between the first game character and each target game character in the current virtual scene, wherein the first game character is a player character operated by a target terminal, and the target game character is a player character operated by a non-target terminal.
In one embodiment, the first game role is a target terminal, i.e., a player role operated by the terminal device 110, i.e., a game role played and controlled by a player in a massively multiplayer online role-playing game. The player can input operation into the terminal device through an input device such as a keyboard, a game handle and the like, and the terminal device generates corresponding operation according to the operation input by the user so as to control the first game role. The target game character refers to a player character operated by a non-target terminal, which refers to a terminal other than the terminal device 110.
In one embodiment, the distance information of the first game character from the target game character, which is used for representing the distance between the first game character and the target game character, can be determined by the coordinates of the first game character in the virtual map of the current game scene and the coordinates of the target game character in the virtual map of the current game scene. The virtual map of the game scene can include the coordinates of a plurality of points forming the game scene.
S12, obtaining the current resolution of each target game role according to the distance information between the first game role and each target game role, wherein the current resolution of each target game role is in inverse proportion to the distance information, and the peak value of the current resolution of each target game role is not higher than the preset resolution.
In one embodiment, a target game character closest to a first game character is acquired from among the target game characters, and a current resolution of the target game character closest to the first game character is determined as a preset resolution. And then, sequentially decreasing the preset resolution of the rest target game characters from near to far according to the distance between the rest target game characters and the first game character, thereby obtaining the current resolution of the rest target game characters. If the preset resolution is 4k, 3 target game characters exist, and the distances between the 3 target game characters and the first game character are respectively 3m, 2m and 1m, the target game characters with the distance of 1m from the first game character are obtained from the target game characters, the current resolution of the target game characters is determined to be 4k, the current resolution of the target game characters with the distance of 2m from the first game character is determined to be 2k, and the current resolution of the target game characters with the distance of 3m from the first game character is determined to be 1080 p. Where m is a distance unit in a virtual scene, and m below has the same meaning. The reduced value of the preset resolution in each decrement can be set according to the actual situation, which is not described herein. It can be appreciated that the current resolution of the target game character, which is the same distance from the first game character, is the same. In addition, in order to ensure the game display effect, a minimum resolution can be preset, and if the current resolution of the target game role is lower than the preset resolution, the target game role is not rendered in the current virtual scene; or when the current resolution of the target game role is lower than the lowest resolution, updating the current resolution according to the set lowest resolution. If the set lowest resolution is 360P, when the current resolution of the target game role is lower than 360P, the target game role is not rendered in the current virtual scene; or, when the current resolution of the target game character is lower than 360P, the current resolution of the target game character is updated to 360P.
In an embodiment, obtaining the current resolution of each target game character according to the distance information between the first game character and each target game character includes: determining the priority of each target game role according to the preset distance interval to which each distance information belongs; and acquiring the current resolution of each target game role according to the priority of each target game role, wherein the priority is provided with the corresponding current resolution, and the current resolution of each target game role is in direct proportion to the priority of each target game role. As an example of this embodiment, the predetermined distance interval may include [0,1m ], [2m,3m ], [4m, + ∞ ]. When the distance between the target game role and the first game role is within [0,1m ], the priority is the first priority; when the distance between the target game role and the first game role is within [2m,3m ], the priority is a second priority; when the distance from the target game character to the first game character is within [4m, + ∞), the priority is a third priority. When the priority of the target game role is the third priority, the current resolution is 720P; when the priority of the target game role is the second priority, the current resolution is 1080P; when the priority of the target game character is the first priority, the current resolution is a preset resolution, such as 2K. It can be understood that the preset distance interval and the setting of the priority can be determined according to actual situations, and are not limited herein. By dividing the priority of the target game role, the lowest value of the current resolution can be controlled by setting the current resolution corresponding to the lowest priority, and the display effect of the game is ensured.
And S13, rendering each target game role according to the current resolution of each target game role.
In one embodiment, after determining the current resolution corresponding to each target game character, each target game character is rendered with its corresponding current resolution. If the current resolution of the target game character a is 720P and the current resolution of the target game character B is 1080P, the target game character a is rendered and displayed at the resolution of 720P, and the target game character B is rendered and displayed at the resolution of 1080P. Preferably, the target game character can be rendered using a character map corresponding to the resolution. If the current resolution of the target game character A is 720P, a character map with the resolution of 720P is selected from a plurality of character maps corresponding to the target game character to render the target game character. Of course, the target game role can be rendered according to the current resolution by other existing real-time rendering modes besides the step of rendering the target game role by obtaining the role map, and the selection of the specific rendering mode is not limited herein.
The resolution of each target game role is sequentially decreased from near to far through the distance between the first game role and the target game role, so that in a virtual scene with a large number of game roles, all the roles do not need to be drawn by adopting a preset resolution at the same time, the load of a display card GPU can be reduced, the rendering speed of a terminal screen on the game roles in the virtual scene is improved, and the damage to the display card is reduced.
In order to control the number of target game characters, so that the display card is not damaged due to uncontrollable computation amount, and reduce the computation amount of the GPU of the display card, in an embodiment, as shown in fig. 3, a flowchart of a rendering method of game characters in a virtual scene is shown in another embodiment. In this embodiment, in addition to the steps shown in fig. 2, the method further includes:
and S10, sequentially selecting a plurality of target game characters from the second game characters according to the distance between the first game character and each second game character in the current virtual scene until the number of the selected target game characters meets the preset condition.
In one embodiment, each of the second game characters is all game characters except the first game character in the current virtual scene, or all player characters except the first game character. The method comprises the steps of obtaining the distance between a first game role and each second game role in the current virtual scene, and then selecting a target game role from the second game roles according to the sequence of the distances from small to large. If 3 second game characters exist in the current virtual scene, and the distances between the first game character and the 3 second game characters are 2m,3m and 1m respectively, the second game character with the distance of 1m from the first game character is selected, then the second game character with the distance of 2m is selected, and finally the second game character with the distance of 3m is selected. The number of target game characters selected from the second game characters needs to satisfy a preset condition. The preset condition refers to the number of the second game roles to be selected by the terminal device, and can be set according to actual conditions. Preferably, the preset condition may be set according to the operation capability of the GPU of the display card. If the number of the second game characters in the current virtual scene is greater than or equal to the number in the preset condition, the terminal device sequentially selects the second game characters with the number limited by the preset condition from small to large according to the distance between each second game character and the first game character, if 13 second game characters exist in the current virtual scene, and the number of the second game characters to be selected is limited to 10 in the preset condition, at this time, the terminal device sequentially selects 10 second game characters from small to large in the current virtual scene according to the distance between each second game character and the first game character. When the position distances between the plurality of second game characters and the first game character are the same, and if the number of the plurality of second game characters with the same distance is larger than the number limited by the preset condition, the terminal device may randomly select one or more second game characters from the plurality of second game characters with the same distance until the preset condition is met, for example, 13 second game characters exist in the current virtual scene, the number of the second game characters to be selected limited by the preset condition is 10, and after 9 second game characters are sequentially selected from small to large according to the distance, the distances between the remaining 4 second game characters and the first game character are 10m, and at this time, the terminal device may randomly select one from the 4 second game characters to meet the number requirement of 10 limited by the preset condition; the terminal device may also stop the selection after selecting 9 second game characters. And if the number of the second game characters in the current virtual scene is smaller than that in the preset condition, the terminal equipment sequentially selects the second game characters from small to large as target game characters according to the distance between the second game characters and the first game character, and then stops selecting.
The method comprises the steps that a plurality of target game roles meeting the number of preset conditions are selected to perform subsequent rendering processing through the distance between a first game role and each second game role in a current virtual scene, so that the number of the game roles needing the subsequent rendering processing can be controlled in the virtual scene with a large number of game roles, the calculation amount required by a display card GPU can be controlled, the calculation capacity of the display card GPU is prevented from exceeding the upper limit, the damage of the display card is further avoided, and the calculation amount of the display card GPU is reduced.
In one embodiment, as shown in FIG. 4, for S10, comprising:
and S21, acquiring first position information of the first game character.
In an embodiment, the first position information of the first game character in the current virtual scene is acquired, and the first position information of the first game character in the current virtual scene may be acquired by calling a virtual map of the current virtual scene. The virtual map of the virtual scene may include coordinates of a plurality of points constituting the virtual scene, and the first position information of the first game character refers to coordinates corresponding to points of the first game character in the virtual map when the position of the first game character is acquired. Of course, in addition to obtaining the first position information through the coordinates, the position information of the first game character may be obtained by obtaining a tag of an area where the first game character is located from the virtual map, obtaining the first position information corresponding to the tag according to the tag, or by other conventional means for obtaining the position information.
And S22, sequentially selecting a plurality of pieces of second position information from the character list recorded with the second position information of each second game character according to the distance between the first position information and each piece of second position information until the number of the selected second position information meets a preset condition.
In an embodiment, the character list refers to a data set, a folder, or a data packet recorded with character information and position information of each virtual character in a current virtual scene, each virtual character includes a first game character and a second game character, the position information includes first position information and second position information, and the character information includes a game ID or a character name corresponding to the virtual character. The terminal device first obtains or calls a character list recorded with second position information of each second game character in the current virtual scene, wherein the character list can be stored in a local memory of the terminal device or a server. When the role list is stored in the server, the terminal device may obtain or call the role list from the server by sending a related instruction, where the related instruction may be automatically generated by the terminal device, and the content and form of the related instruction are not specifically limited. After the terminal device obtains or calls the role list, a plurality of second position information are sequentially selected from the role list according to the position distance between the first position information and each second position information, and therefore a plurality of target game roles are correspondingly selected from each second game role according to the plurality of selected second position information. The position distance between the first position information and each second position information refers to a distance between the first game character and each second game character in the current virtual scene, for example, there are 3 second game characters in the current virtual scene, and the position distances between the first game character and the 3 second game characters are 2m,3m, and 1m, respectively. The terminal device sequentially selects the second position information according to the position distance, and can select the second position information according to the sequence that the position distance between the second position information and the first position information is from small to large, for example, the second position information with the position distance of 1m from the first position information is selected first, then the second position information with the position distance of 2m is selected, and finally the second position information with the position distance of 3m is selected.
In an embodiment, the number of the second location information selected by the terminal device from the role list needs to satisfy a preset condition. The preset condition refers to the number of the second position information to be selected by the set terminal device, namely the number of the target game characters to be drawn and displayed finally by the set terminal device. When the number of the second position information of the second game character recorded in the character list is greater than or equal to the number in the preset condition, the terminal device sequentially selects the second position information of the number limited by the preset condition from small to large according to the position distance between each second position information and the first position information, for example, the second position information of 13 second game characters is recorded in the character list, and the number of the second position information to be selected limited in the preset condition is 10, at this time, the terminal device sequentially selects 10 second position information from the character list according to the sequence of the position information from small to large. When the position distances between the second position information of the second game characters and the first position information are the same, and if the number of the second position information with the same position distance is larger than the number limited by the preset condition, the terminal device may randomly select one or more second position information from the second position information with the same position distance until the preset condition is met, for example, 13 second position information are recorded in the character list, the number of the second position information to be selected limited by the preset condition is 10, and after 9 second position information are sequentially selected from the position information from small to large, the remaining 4 second position information are all 10m, and at this time, the terminal device may randomly select one second position information from the 4 second position information to meet the number requirement of 10 limited by the preset condition; the terminal device may also stop selecting 9 pieces of second location information. And when the number of the second position information of the second game role recorded in the role list is smaller than that in the preset condition, the terminal equipment stops selecting the second position information recorded in the role list from small to large according to the position distance between each piece of the second position information and the first position information.
S23, selecting a plurality of target game characters from the second game characters based on the selected plurality of second position information.
In one embodiment, the target game character refers to a second game character to be displayed on the screen of the terminal device. And the terminal equipment determines second game roles corresponding to the second position information according to the second position information selected from the role list, and then determines a plurality of target game roles to be displayed from the second game roles. The second game role is bound with the second position information and recorded in the role list, the second game role can be obtained according to the second position information in the role list, and the binding mode of the second game role and the second position information is not specifically limited. Therefore, the terminal device can determine the selected plurality of second game characters to be displayed on the screen of the terminal device, namely the target game character, according to the selected plurality of second position information.
According to the position distance between the second position information of each second game role in the current virtual scene and the first position information of the first game role, a plurality of target game roles meeting the number of preset conditions are selected to perform rendering processing with different resolutions, so that in the virtual scene with a large number of virtual roles, all the roles do not need to be simultaneously drawn with the preset resolution, and the number of the game roles needing to be subjected to subsequent rendering processing can be controlled, so that the burden of a display card GPU can be reduced, and the display speed of a terminal screen on the virtual roles is improved.
In one embodiment, the character list records corresponding second location information when a second game character enters the current virtual scene.
In this embodiment, the role list may be stored in the server or the terminal device, and when the role list is stored in the terminal device and the server detects that the online second game role enters the current virtual scene, the server obtains the second location information of the second game role in the current virtual scene according to the virtual map corresponding to the current virtual scene, and further records the second location information corresponding to the second game role entering the current virtual scene.
In one embodiment, the server stores a character list recording position information of each game character, the game character includes a first game character and a second game character, and the position information includes first position information and second position information. The server determines the game role logged in the terminal device as a first game role according to the game role logged in the terminal device calling the role list, the current virtual scene of the first game role is the current virtual scene, and at the moment, the server sends second position information of other game roles except the first game role in the role list, namely the second game role, to the terminal device calling the role list. At this time, when a second game character enters the virtual scene of the first game character, the server records the second position information of the second game character entering into the character list called by the terminal device for updating.
The corresponding second position information is recorded when the second game role enters the current virtual scene through the role list, the role list can be updated in time, and the target game role meeting the requirements can be accurately drawn and displayed at different moments.
In one embodiment, the character list deletes the corresponding second location information when the second game character exits the current virtual scene. And when the terminal equipment or the server detects that the online second game role exits the current virtual scene, deleting second position information corresponding to the second game role from the role list according to the role information of the second game role.
By deleting the corresponding second position information in the character list when the second game character exits the current virtual scene, the character list can be updated in time, so that the target game character meeting the requirements can be accurately drawn and displayed at different moments.
In order to further improve the controllability of the rendering number of the game characters in the virtual scene, so as to further ensure that the GPU of the display card is not damaged due to the uncontrollable operation amount, in an embodiment, after sequentially selecting a plurality of target game characters from the second game characters, the method further includes: and stopping the rendering and displaying process of the game characters in the non-target virtual scene except the target game character in each second game character.
In an embodiment, after the selection of the target game character is completed, the remaining second game characters are far away from the first game character, and the attention of the player is not high, so that the terminal device stops the rendering and displaying process of the game characters in the non-target virtual scene in each second game character after the selection of the target game character is completed.
After the target game role is selected, the drawing and display process of the remaining second game role is stopped, so that the GPU operation amount of the display card is reduced, and meanwhile, when the display card renders the game role in the current virtual scene, the peak value of the GPU operation amount is determinable, and the damage of the GPU of the display card caused by the uncontrollable operation amount is avoided.
Typically, during a game session, a player may initiate a request for interaction with a target game character via a user terminal, where the player typically only focuses on the target game character for which interaction is desired. Therefore, to further reduce the amount of computation, in an embodiment, as shown in fig. 5, a flowchart of a rendering method of a game character in a virtual scene in another embodiment is shown. In this embodiment, in addition to the steps shown in fig. 2, the method further includes:
s14, an interaction request initiated to a designated character in the target game characters is obtained.
In one embodiment, the interaction request initiated to the designated one of the target game characters may be input by the user through an external device, and the user terminal receives the acquisition. The designated role may be one or more, the interactive request may be the contents of a fight, a chat or a transaction in the game, and the form of the interactive request is not particularly limited. Wherein the designated character is one or more of the second game characters.
And S15, according to the interaction request, pausing the rendering and displaying process of each non-designated character except the designated character in each target game character.
In one embodiment, the user terminal suspends the drawing and displaying process of each non-designated character according to the received interaction request with the designated character input by the user. The non-designated characters are other target game characters except the designated character which is initiated with the interaction request in the target game characters displayed on the screen, because the requirement for displaying the non-designated characters is smaller after the user initiates the interaction request to the designated character, namely the non-designated characters do not need to be displayed when the first game character interacts with the designated character. The user terminal suspends the drawing and displaying process for each non-designated character. And after the interaction between the first game role and the designated role is finished, continuing the drawing and displaying process of each non-designated role. Preferably, when an interaction request is initiated to a designated character, the designated character is drawn with a preset resolution during the duration of the interaction until the interaction is finished, such as closing a chat interface or a transaction interface with the designated character.
By acquiring the interaction request initiated to the designated role and suspending the drawing and displaying processes of other target roles except the designated role according to the interaction request, other target game roles do not need to be displayed in the interaction process with the designated role, the interaction effect of the designated role is better displayed, other unnecessary operations are stopped at the same time, and the operation amount of the GPU of the display card is reduced.
In one embodiment, as shown in fig. 6, there is provided an apparatus for rendering a game character in a virtual scene, including:
the information obtaining module 101 is configured to obtain distance information between a first game character and each target game character in a current virtual scene, where the first game character is a player character operated by a target terminal, and the target game character is a player character operated by a non-target terminal.
The resolution obtaining module 102 is configured to obtain a current resolution of each target game character according to distance information between the first game character and each target game character, where the current resolution of the target game character is inversely proportional to the distance information, and a peak value of the current resolution of the target game character is not higher than a preset resolution.
And the character display module 103 is configured to render each target game character according to the current resolution of each target game character.
The resolution of each target game role is sequentially decreased from near to far through the distance between the first game role and the target game role, so that in a virtual scene with a large number of game roles, all the roles do not need to be drawn by adopting a preset resolution at the same time, the load of a display card GPU can be reduced, the rendering speed of a terminal screen on the game roles in the virtual scene is improved, and the damage to the display card is reduced.
In an embodiment, the resolution obtaining module 102 is specifically configured to: determining the priority of each target game role according to the preset distance interval to which each distance information belongs; and acquiring the current resolution of each target game role according to the priority of each target game role, wherein the priority is provided with the corresponding current resolution, and the current resolution of each target game role is in direct proportion to the priority of each target game role.
In an embodiment, as shown in fig. 7, a schematic structural diagram of a rendering apparatus for a game character in a virtual scene in another embodiment is shown. In this embodiment, in addition to the structure shown in fig. 6, the present invention further includes:
the role acquiring module 100 is configured to sequentially select a plurality of target game roles from each second game role according to a distance between the first game role and each second game role in the current virtual scene until the number of the selected target game roles meets a preset condition.
In an embodiment, the role acquiring module 100 is specifically configured to: acquiring first position information of a first game role; sequentially selecting a plurality of pieces of second position information from the character list in which the second position information of each second game character is recorded according to the distance between the first position information and each piece of second position information until the number of the selected second position information meets a preset condition; and selecting a plurality of target game characters from the second game characters according to the selected plurality of second position information.
In an embodiment, the character list records corresponding second position information when the second game character enters the current virtual scene.
In one embodiment, the character list deletes the corresponding second location information when the second game character exits the current virtual scene.
In an embodiment, the role acquiring module 100 is further configured to: and after a plurality of target game characters are sequentially selected from the second game characters, the rendering and displaying process of the game characters in the non-target virtual scene except the target game characters in the second game characters is stopped.
In an embodiment, as shown in fig. 8, a schematic structural diagram of a rendering apparatus for a game character in a virtual scene in yet another embodiment is shown. In this embodiment, in addition to the structure shown in fig. 6, the present invention further includes:
a role interaction module 104, configured to obtain an interaction request initiated to a designated role in each target game role; and according to the interaction request, pausing the rendering and displaying process of each non-designated character except the designated character in each target game character.
In one embodiment, a computer apparatus is provided, as shown in fig. 9, which includes a processor, a memory, a network interface, an input device, and a display screen connected by a system bus. Wherein the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program that, when executed by the processor, causes the processor to implement a rendering method for a game character in a virtual scene. The internal memory may also store a computer program that, when executed by the processor, causes the processor to perform a method of rendering a game character in a virtual scene. Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, the rendering apparatus for a game character in a virtual scene provided by the present application may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in fig. 9. The memory of the computer device may store therein various program modules constituting the rendering apparatus of the game character in the virtual scene. The computer program constituted by the program modules causes the processor to execute the steps in the method for rendering a game character in a virtual scene according to the embodiments of the present application described in the present specification.
In one embodiment, a computer-readable storage medium is provided, which stores computer-executable instructions for causing a computer to perform the steps of the method for rendering a game character in a virtual scene as described above. Here, the steps of the rendering method of the game character in the virtual scene may be the steps of the rendering method of the game character in the virtual scene in the above embodiments.
The foregoing is a preferred embodiment of the present application, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations are also regarded as the protection scope of the present application.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.

Claims (11)

1. A rendering method of a game character in a virtual scene is characterized by comprising the following steps:
obtaining distance information between a first game role and each target game role in a current virtual scene, wherein the first game role is a player role operated by a target terminal, and the target game role is a player role operated by a non-target terminal;
acquiring the current resolution of each target game role according to the distance information between the first game role and each target game role, wherein the current resolution of each target game role is in inverse proportion to the distance information, and the peak value of the current resolution of each target game role is not higher than the preset resolution;
and rendering each target game role according to the current resolution of each target game role.
2. The method of claim 1, wherein obtaining the current resolution of each of the target game characters according to the distance information between the first game character and each of the target game characters comprises:
determining the priority of each target game role according to the preset distance interval to which each piece of distance information belongs;
and acquiring the current resolution of each target game role according to the priority of each target game role, wherein the priority is provided with the corresponding current resolution, and the current resolution of the target game role is in direct proportion to the priority of the target game role.
3. The method for rendering game characters in a virtual scene according to claim 1, wherein before obtaining the distance information between the first game character and each target game character in the current virtual scene, the method further comprises:
and sequentially selecting a plurality of target game roles from the second game roles according to the distance between the first game role and each second game role in the current virtual scene until the number of the selected target game roles meets a preset condition.
4. The method of claim 3, wherein the step of sequentially selecting a plurality of target game characters from the second game characters according to the distance between the first game character and each second game character in the current virtual scene comprises:
acquiring first position information of the first game role;
sequentially selecting a plurality of pieces of second position information from a character list in which the second position information of each second game character is recorded according to the distance between the first position information and each piece of second position information until the number of the selected second position information meets the preset condition;
and selecting a plurality of target game characters from the second game characters according to the selected plurality of second position information.
5. The method as claimed in claim 4, wherein the character list records the corresponding second position information when the second game character enters the current virtual scene.
6. The method for rendering a game character in a virtual scene according to claim 4 or 5, wherein the character list deletes the corresponding second position information when the second game character exits from the current virtual scene.
7. The method for rendering game characters in a virtual scene of claim 3, wherein after sequentially selecting a plurality of the target game characters from the second game characters, the method further comprises:
and stopping the rendering and displaying process of the game characters in the non-target virtual scene except the target game character in each second game character.
8. The method of claim 1, wherein after rendering each of the target game characters according to its current resolution, further comprising:
acquiring an interaction request initiated to a designated role in the target game roles;
and according to the interaction request, pausing rendering and displaying processes of all non-specified roles except the specified role in all the target game roles.
9. An apparatus for rendering a game character in a virtual scene, comprising:
the information acquisition module is used for acquiring distance information between a first game role and each target game role in the current virtual scene, wherein the first game role is a player role operated by a target terminal, and the target game role is a player role operated by a non-target terminal;
a resolution obtaining module, configured to obtain a current resolution of each target game character according to distance information between the first game character and each target game character, where the current resolution of the target game character is inversely proportional to the distance information, and a peak value of the current resolution of the target game character is not higher than a preset resolution;
and the role display module is used for rendering each target game role according to the current resolution of each target game role.
10. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, characterized in that the processor implements a method for rendering a game character in a virtual scene according to any one of claims 1 to 8 when executing the program.
11. A computer-readable storage medium, in which a computer program is stored which is adapted to be loaded and executed by a processor to cause a computer device having said processor to carry out the method of any one of claims 1 to 8.
CN202110477556.XA 2021-04-29 2021-04-29 Rendering method and device of game roles in virtual scene and electronic equipment Active CN113181641B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110477556.XA CN113181641B (en) 2021-04-29 2021-04-29 Rendering method and device of game roles in virtual scene and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110477556.XA CN113181641B (en) 2021-04-29 2021-04-29 Rendering method and device of game roles in virtual scene and electronic equipment

Publications (2)

Publication Number Publication Date
CN113181641A true CN113181641A (en) 2021-07-30
CN113181641B CN113181641B (en) 2023-11-21

Family

ID=76982890

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110477556.XA Active CN113181641B (en) 2021-04-29 2021-04-29 Rendering method and device of game roles in virtual scene and electronic equipment

Country Status (1)

Country Link
CN (1) CN113181641B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116863058A (en) * 2023-09-05 2023-10-10 湖南马栏山视频先进技术研究院有限公司 Video data processing system based on GPU

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040002843A1 (en) * 2002-05-13 2004-01-01 Consolidated Global Fun Unlimited, Llc Method and system for interacting with simulated phenomena
US20160171835A1 (en) * 2014-12-12 2016-06-16 Synergy Blue, Llc First person shooter, rpg and sports themed hybrid arcade-type, wager-based gaming techniques
CN110404262A (en) * 2019-09-03 2019-11-05 网易(杭州)网络有限公司 Display control method, device, electronic equipment and storage medium in game
CN111741060A (en) * 2020-05-08 2020-10-02 广州三七互娱科技有限公司 Message pushing method and device, computer equipment and storage medium
CN112370784A (en) * 2021-01-15 2021-02-19 腾讯科技(深圳)有限公司 Virtual scene display method, device, equipment and storage medium
CN112370783A (en) * 2020-12-02 2021-02-19 网易(杭州)网络有限公司 Virtual object rendering method and device, computer equipment and storage medium
CN112402981A (en) * 2020-11-11 2021-02-26 完美世界(北京)软件科技发展有限公司 Game scene control method and device, storage medium and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040002843A1 (en) * 2002-05-13 2004-01-01 Consolidated Global Fun Unlimited, Llc Method and system for interacting with simulated phenomena
US20160171835A1 (en) * 2014-12-12 2016-06-16 Synergy Blue, Llc First person shooter, rpg and sports themed hybrid arcade-type, wager-based gaming techniques
CN110404262A (en) * 2019-09-03 2019-11-05 网易(杭州)网络有限公司 Display control method, device, electronic equipment and storage medium in game
CN111741060A (en) * 2020-05-08 2020-10-02 广州三七互娱科技有限公司 Message pushing method and device, computer equipment and storage medium
CN112402981A (en) * 2020-11-11 2021-02-26 完美世界(北京)软件科技发展有限公司 Game scene control method and device, storage medium and electronic equipment
CN112370783A (en) * 2020-12-02 2021-02-19 网易(杭州)网络有限公司 Virtual object rendering method and device, computer equipment and storage medium
CN112370784A (en) * 2021-01-15 2021-02-19 腾讯科技(深圳)有限公司 Virtual scene display method, device, equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
叶槽编著: "《游戏美术设计》", 31 March 2007, pages: 190 *
路朝龙编著: "Unity 3D游戏开发从入门到精通", 中国铁道出版社, pages: 54 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116863058A (en) * 2023-09-05 2023-10-10 湖南马栏山视频先进技术研究院有限公司 Video data processing system based on GPU
CN116863058B (en) * 2023-09-05 2023-11-14 湖南马栏山视频先进技术研究院有限公司 Video data processing system based on GPU

Also Published As

Publication number Publication date
CN113181641B (en) 2023-11-21

Similar Documents

Publication Publication Date Title
US11135511B2 (en) Creation of game-based scenes
US9751011B2 (en) Systems and methods for a unified game experience in a multiplayer game
EP3970819B1 (en) Interface display method and apparatus, and terminal and storage medium
JP5411386B1 (en) Server and method for providing game
AU2021254521B2 (en) Virtual character control method and apparatus, device, and storage medium
CN111672111A (en) Interface display method, device, equipment and storage medium
CN113082694B (en) Game mode switching method and device and electronic equipment
CN113069761B (en) Method and device for displaying virtual characters in game scene and electronic equipment
JP5411385B1 (en) Server and method for providing game
CN113181641B (en) Rendering method and device of game roles in virtual scene and electronic equipment
CN111330287A (en) Bullet screen display method and device in game, electronic equipment and storage medium
US20230088206A1 (en) Method and apparatus for controlling virtual object, device, storage medium, and program product
US20230078340A1 (en) Virtual object control method and apparatus, electronic device, storage medium, and computer program product
CN113181644B (en) Game role rendering method and device and electronic equipment
CN114307150B (en) Method, device, equipment, medium and program product for interaction between virtual objects
WO2023024078A1 (en) Virtual object control method and apparatus, electronic device, and storage medium
CN113181643A (en) Virtual character drawing method and device and electronic equipment
CN113069765A (en) Game picture rendering method and device and electronic equipment
WO2024037139A1 (en) Method and apparatus for prompting information in virtual scene, electronic device, storage medium, and program product
CN113350787A (en) Game role rendering method and device and electronic equipment
CN113350785A (en) Virtual character rendering method and device and electronic equipment
CN115509671A (en) Interactive courseware playing method, device, equipment and storage medium
CN117753004A (en) Message display method, device, equipment, medium and program product
CN112999662A (en) Game role switching method and device and electronic equipment
CN116983629A (en) Video game assistance method and apparatus, electronic device, and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant