CN113181641B - Rendering method and device of game roles in virtual scene and electronic equipment - Google Patents

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

Info

Publication number
CN113181641B
CN113181641B CN202110477556.XA CN202110477556A CN113181641B CN 113181641 B CN113181641 B CN 113181641B CN 202110477556 A CN202110477556 A CN 202110477556A CN 113181641 B CN113181641 B CN 113181641B
Authority
CN
China
Prior art keywords
game
role
character
target
target game
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.)
Active
Application number
CN202110477556.XA
Other languages
Chinese (zh)
Other versions
CN113181641A (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Geometry (AREA)
  • Computer Graphics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application discloses a method and a device for rendering game roles in a virtual scene and electronic equipment, wherein the method comprises the following steps: acquiring distance information of 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; according to the distance information between the first game character and each target game character, the current resolution of each target game character is obtained, the current resolution of each target game character is inversely proportional to the distance information, and the peak value of the current resolution of each target game character is not higher than the preset resolution; rendering each target game character according to the current resolution of each target game character.

Description

Rendering method and device of game roles in virtual scene and electronic equipment
Technical Field
The present application 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 performs rendering of game characters in a virtual scene, the game characters are generally required to be independently rendered by a display card of a terminal, and after the rendering of the game characters in the whole virtual scene is completed, the rendered game characters are displayed on a screen of the terminal. In an actual game, in order to ensure a rendering effect of game characters in a virtual scene, a preset resolution is generally set for all the game characters, and each game character is rendered based on the preset resolution. However, in a large network Game, such as a massively multiplayer online role Playing Game (Multiplayer Online Role-Playing Game, mmorg), hundreds of Game characters may need to be displayed on a terminal screen at the same time, and if a display card is required to render each Game character in real time based on a preset resolution, the upper limit of the operation capability of the GPU of the display card may be exceeded, which results in a phenomenon that a screen displayed on the screen of the Game is delayed, and may cause a Game flash back and damage to the display card.
Disclosure of Invention
The application aims to at least solve one of the technical problems in the prior art, and provides a method, a device and electronic equipment for rendering game characters in a virtual scene, which reduce the operand of a display card when a plurality of game characters are displayed and improve the rendering speed of a terminal screen to the game characters 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:
acquiring 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 inversely proportional to the distance information, and the peak value of the current resolution of each target game role is not higher than a preset resolution;
rendering each of the target game characters according to a current resolution of each of the target game characters.
In a second aspect, in an embodiment of the present application, there is further provided a rendering apparatus for 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;
the resolution obtaining module is used for obtaining the current resolution of each target game role according to the distance information of the first game role and each target game role, the current resolution of each target game role is inversely proportional 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 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 in the memory and capable of running on the processor, wherein the processor realizes the rendering method of the game characters in the virtual scene according to the embodiment when executing the program.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the method for rendering a game character in a virtual scene according to the above embodiments.
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 all roles do not need to be drawn by adopting preset resolution at the same time in a virtual scene with a large number of game roles, the load of the GPU of the display card can be reduced, the rendering speed of the terminal screen to the game roles in the virtual scene is improved, and meanwhile, the damage to the display card is reduced.
Drawings
The application is further described below with reference to the drawings and examples;
FIG. 1 is an application environment diagram of a method of rendering a game character in a virtual scene in one embodiment;
FIG. 2 is a flow chart of a method of rendering a game character in a virtual scene according to one 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 flow diagram of a method of selecting a target game character in one embodiment;
FIG. 5 is a flow chart of a method of rendering a game character in a virtual scene according to yet another embodiment;
FIG. 6 is a schematic diagram of a rendering apparatus for a game character in a virtual scene according to an embodiment;
FIG. 7 is a schematic diagram of a rendering apparatus for a game character in a virtual scene according to another embodiment;
Fig. 8 is a schematic structural view of a rendering apparatus of a game character in a virtual scene in 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, examples of which are illustrated in the accompanying drawings, wherein the accompanying drawings are used to supplement the description of the written description so that one can intuitively and intuitively understand each technical feature and overall technical scheme of the present application, but not to limit the scope of the present application.
In order that the inventive arrangements may be more readily understood, the following description is provided for the purpose of illustrating some of the concepts contemplated in the present application:
virtual scene: is a virtual scene that the application program displays when running on the terminal. The virtual scene may be a simulation environment for the real world, a semi-simulation and 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.
Game characters: the virtual portrait with high fidelity drawn by 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.
Player character: refers to a role controlled by a player in a role playing game.
Non-player character: the game characters are not operated by a real player in the game, are generally controlled by artificial intelligence of a computer, and are characters with own behavior modes.
Resolution ratio: for determining the degree of refinement of the image details. In general, the higher the resolution, the more pixels the image contains and the sharper the image.
When running the game related application, the display card of the terminal device renders and displays the virtual scene and game character of the application on the screen of the terminal device. In general, to ensure the rendering effect of the game characters in the 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 rendering mode needs to know the peak value of the game character required to be rendered in the virtual scene in advance, so that whether the display card GPU of the terminal equipment has enough computing capacity to support the rendering of the game character in the virtual scene can be judged according to the peak value, and when the display card GPU of the terminal equipment is determined to have enough computing capacity to support the rendering of the game character in the virtual scene, the application program is rerun, so that damage of the display card is avoided. However, in a large network Game, such as a massively multiplayer online role Playing Game (mmorg), the peak value of the Game characters is uncontrollable, and hundreds of Game characters may need to be displayed on the terminal screen at the same time, at this time, if each Game character needs to be rendered in real time by a display card based on a preset resolution, the upper limit of the operation capability of the GPU of the display card may be exceeded, which may cause a phenomenon that the screen displayed by the Game on the screen is delayed, and at the same time, may cause a Game flash back and damage to the display card.
In order to solve the above technical problems, embodiments of the present application are described in detail below with reference to the accompanying drawings. The rendering method of the game roles in the virtual scene provided by the embodiment of the application is applied to an environment comprising terminal equipment, a plurality of database examples and a plurality of storage examples. The above examples may be virtual machines, containers or servers, and in the embodiment of the present application, the servers are illustrated as examples. As shown in fig. 1, an application environment diagram of a method for rendering 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, and 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 a separate server 120 or a server group formed by a plurality of servers 120, or may be a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms. 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.
Wherein, the terminal device 110 is equipped with a game, and in the process of running the game, the terminal device 110 obtains the role information and operation information of the game role from the server 120 according to user operation or through a communication link, for example, the game role is moved towards a target direction or a target point, so that the terminal device 110 can determine the current virtual scene according to the role information and operation information of the game role; 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 instruction of the user, such as a selection operation for a game map. The memory or the server performs the operation according to the instruction or the request in the prior art, and therefore, the content, i.e., the form, of the instruction or the request is not particularly limited. After acquiring the current virtual scene, the terminal device 110 acquires the current resolution of each target game character according to the distance information between the first game character and each target game character in the current virtual scene, and renders each corresponding target game character according to each current resolution, wherein the current resolution of the target game character is inversely proportional to the distance information, and the peak value of the current resolution of the target game character 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 all roles do not need to be drawn by adopting preset resolution at the same time in a virtual scene with a large number of game roles, the load of the GPU of the display card can be reduced, the rendering speed of the terminal screen to the game roles in the virtual scene is improved, and meanwhile, the damage to the display card is reduced.
The method for rendering the game characters in the virtual scene provided by the embodiment of the application will be described and illustrated in detail through several specific embodiments. As an alternative embodiment, the method may be performed by the terminal device, or by a server and the terminal device together.
As shown in fig. 2, in one embodiment, a method of rendering a game character in a virtual scene is provided. The embodiment is mainly exemplified by the method applied to computer equipment. The computer device may specifically be the terminal device 110 in fig. 1 described above.
Referring to fig. 2, the method for rendering the game characters in the virtual scene specifically includes the following steps:
s11, obtaining distance information of 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.
In one embodiment, the first game character is a target terminal, i.e., a player character operated by the terminal device 110, i.e., a game character played and controlled by a player in a massively multiplayer online role playing game. The player can input an operation to the terminal device through an input device such as a keyboard, a joystick, or the like, and the terminal device generates a corresponding operation according to the operation input by the user to control the first game character. 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 an embodiment, the distance information between the first game character and the target game character, which is used to represent the distance between the first game character and the target game character, may 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. Wherein the virtual map of the game scene can comprise coordinates of a plurality of points which form the game scene.
S12, according to the distance information between the first game character and each target game character, the current resolution of each target game character is obtained, the current resolution of each target game character is inversely proportional to the distance information, and the peak value of the current resolution of each target game character is not higher than the preset resolution.
In one embodiment, a target game character closest to the 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, gradually decreasing the preset resolution of each remaining target game role from near to far according to the distance between each remaining target game role and the first game role, so as to acquire the current resolution of each remaining target game role. If the preset resolution is 4k, 3 target game characters exist, the distances between the 3 target game characters and the first game character are respectively 3m, 2m and 1m, then the target game character with the distance of 1m from the first game character is obtained from the target game characters, after the current resolution of the target game character is determined to be 4k, the current resolution of the target game character with the distance of 2m from the first game character is determined to be 2k, and the current resolution of the target game character with the distance of 3m from the first game character is determined to be 1080p. Wherein m is a distance unit in the virtual scene, and m is the same meaning. The value reduced when the preset resolution is decremented each time may be set according to the actual situation, and will not be described herein. It will be appreciated that the target game character, which is the same distance from the first game character, is the same current resolution. In addition, in order to ensure the game display effect, a lowest resolution is 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 character 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, rendering the target game role in the current virtual scene is not performed; or, when the current resolution of the target game character is lower than 360P, updating the current resolution of the target game character to 360P.
In one 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 comprises: determining the priority of each target game role according to a 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 the target game role is in direct proportion to the priority of the target game role. As an example of this embodiment, the preset distance interval may include [0,1m ], [2m,3m ], [4m, + ]. When the distance between the target game character and the first game character 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 and 3m, the priority is the second priority; when the target game character is at a distance of 4m from the first game character, ++ infinity in the inner time, the inner part of the container is provided with a plurality of grooves, its priority is the 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 appreciated that the preset distance interval and the setting of the priority may be determined according to practical situations, which is 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, so that 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 role A is 720P and the current resolution of the target game role B is 1080P, rendering and displaying the target game role A by adopting the resolution of 720P and rendering and displaying the target game role B by adopting the resolution of 1080P. Preferably, the target game character may be rendered using a character map corresponding to the resolution. If the current resolution of the target game role A is 720P, a role map with the resolution of 720P is selected from a plurality of role maps corresponding to the target game role to render the target game role. Of course, in addition to rendering the target game character by acquiring the character map, the target game character may be rendered according to the current resolution by other existing real-time rendering methods, and the specific rendering method 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 all roles do not need to be drawn by adopting preset resolution at the same time in a virtual scene with a large number of game roles, the load of the GPU of the display card can be reduced, the rendering speed of the terminal screen to the game roles in the virtual scene is improved, and meanwhile, the damage to the display card is reduced.
In order to make the number of the target game characters controllable, so that the display card is not damaged due to uncontrollable operand, and reduce operand of the GPU of the display card, in an embodiment, as shown in fig. 3, a flow chart of a rendering method of the game characters in the virtual scene in another embodiment is shown. In this embodiment, in addition to the steps shown in fig. 2, the method further includes:
s10, sequentially selecting a plurality of target game roles from the second game roles according to the distances between the first game roles and the second game roles in the current virtual scene until the number of the selected target game roles meets the preset condition.
In one embodiment, each second game character is all game characters in the current virtual scene except the first game character, 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 each second game role according to the sequence from the small distance to the large distance. If the number of the second game characters is 3 in the current virtual scene, 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, 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 is required to satisfy a preset condition. The preset conditions refer to the number of second game characters to be selected by the terminal equipment, and the preset conditions 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 limited to be selected in the preset condition is 10, 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 all the plurality of second game characters with the same distance are selected, the number of the second game characters to be selected is more than the number limited by the preset condition, for example, 13 second game characters exist in the current virtual scene, the number of the second game characters to be selected 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, at the moment, the terminal device can 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 selecting 9 second game characters after selecting them. If the number of the second game characters in the current virtual scene is smaller than the number in the preset condition, the terminal equipment sequentially selects each second game character from small to large as a target game character according to the distance between each second game character and the first game character, and then stops selecting.
And selecting a plurality of target game characters meeting the number of preset conditions to perform subsequent rendering processing through the distance between the first game character and each second game character in the current virtual scene, so that the number of game characters needing to perform subsequent rendering processing can be controlled in the virtual scene with a large number of game characters, the operand required by the GPU of the display card can be controlled, the operand exceeding of the upper limit of the operand of the GPU of the display card is avoided, the damage of the display card is further avoided, and the operand of the GPU of the display card is reduced.
In one embodiment, as shown in fig. 4, for S10, it includes:
s21, acquiring first position information of a first game role.
In an embodiment, the first location information of the first game character in the current virtual scene is acquired, and the first location 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 forming the virtual scene, and the first position information of the first game character refers to coordinates corresponding to the 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 the first location information being acquired by coordinates, the location information of the first game character may be acquired by acquiring a tag of an area where the first game character is located from the virtual map, acquiring the first location information corresponding to the tag according to the tag, or by other conventional means of acquiring the location information.
S22, sequentially selecting a plurality of second position information from a character list recorded with the second position information of each second game character according to the distance between the first position information and each second position information until the number of the selected second position information meets the 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 the current virtual scene, each virtual character includes a first game character and a second game character, the position information includes the first position information and the second position information, and the character information includes a game ID or a character name corresponding to the virtual character. The terminal equipment firstly acquires 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 or a server of the terminal equipment. When the character list is stored in the server, the terminal device may acquire or call the character list to the server by sending a related instruction, and 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 acquiring or calling the character list, the terminal device sequentially selects a plurality of second position information from the character list according to the position distance between the first position information and each second position information, so that a plurality of target game characters are correspondingly selected from each second game character according to the plurality of selected second position information. The position distance between the first position information and each second position information refers to the distance between the first game character and each second game character in the current virtual scene, for example, 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 respectively 2m, 3m and 1m. 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 from small to large of the position distance between the second position information and the first position information, for example, the terminal device selects the second position information with the position distance of 1m from the first position information, then selects the second position information with the position distance of 2m, and finally selects the second position information with the position distance of 3 m.
In an embodiment, the preset condition needs to be satisfied for the number of second location information selected from the character list by the terminal device. The preset condition refers to the number of second position information to be selected by the set terminal equipment, namely the number of target game characters to be finally drawn and displayed by the set terminal equipment. When the number of the second position information of the second game characters 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, 13 second position information of the second game characters are recorded in the character list, and the number of the second position information to be selected limited in the preset condition is 10, and 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 and the first position information of the plurality of second game characters are the same, and if all the plurality of second position information with the same position distance are selected, the number of the second position information exceeds the number limited by the preset condition, the terminal equipment can randomly select one or more second position information from the plurality of second position information with the same position distance until the preset condition is met, for example, 13 second position information is recorded in a character list, the number of the second position information to be selected is 10, which is limited by the preset condition, and after 9 second position information is sequentially selected from small to large according to the position information, the remaining 4 second position information are 10m, and at the moment, the terminal equipment can 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 the selection after selecting 9 pieces of the second location information. When the number of the second position information of the second game characters recorded in the character list is smaller than the number in the preset condition, the terminal equipment sequentially selects the second position information recorded in the character list from small to large according to the position distance between each second position information and the first position information, and then stops selecting.
S23, selecting a plurality of target game roles from the second game roles according to the selected 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. The terminal equipment determines a plurality of 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 particularly limited. Thus, the terminal device can determine the selected plurality of second game characters to be displayed on the screen of the terminal device, i.e., the target game character, based on the selected plurality of second position information.
Through the position distance between the second position information of each second game role and the first position information of the first game role in the current virtual scene, a plurality of target game roles meeting the number of preset conditions are selected to conduct rendering processing with different resolutions, so that in the virtual scene with a large number of virtual roles, all roles do not need to be drawn with the preset resolution at the same time, the number of game roles needing to be subjected to subsequent rendering processing can be controlled, the load of a Graphics Processing Unit (GPU) of a display card 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 the second game character enters the current virtual scene.
In this embodiment, the character list may be stored in a server or a terminal device, and when the server detects that the online second game character enters the current virtual scene when the character list is stored in the terminal device, the server obtains second position information of the second game character in the current virtual scene according to a virtual map corresponding to the current virtual scene, and further records second position information corresponding to the second game character entering the current virtual scene.
In one embodiment, a list of characters stored in a server records location information for each game character, the game character comprising a first game character and a second game character, the location information comprising first location information and second location information. The server determines the game character logged in by the terminal equipment according to the game character logged in by the terminal equipment of the calling character list as a first game character, wherein the current virtual scene of the first game character is the current virtual scene, and at the moment, the server sends other game characters except the first game character in the character list, namely second position information of a second game character, to the terminal equipment of the calling character list. At this time, when the second game character enters the virtual scene of the first game character, the server records the second position information of the second game character into a character list called by the terminal equipment for updating.
Through the role list, when the second game role enters the current virtual scene, the corresponding second position information is recorded, the role list can be updated in time, and the target game roles meeting the requirements can be accurately drawn and displayed at different moments.
In one embodiment, the character list deletes corresponding second location information when the second game character exits the current virtual scene. When the terminal equipment or the server detects that the online second game character exits from the current virtual scene, deleting the second position information corresponding to the second game character from the character list according to the character information of the second game character.
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, and therefore the target game character meeting the requirements can be accurately drawn and displayed at different times.
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 uncontrollable operand, in one 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 processes of the game characters in the non-target virtual scenes except the target game characters in each second game character.
In an embodiment, after the selection of the target game role is completed, the remaining second game roles are far away from the first game role, and the attention of the player is not high, so that the terminal device stops the rendering and display process of the game roles in the non-target virtual scene in each second game role after the selection of the target game role is completed.
After the target game role is selected, the drawing and display processes of the remaining second game roles are stopped, so that the GPU calculation amount of the display card is reduced, and the peak value of the GPU calculation amount of the display card is determinable when the display card renders the game roles in the current virtual scene, thereby ensuring that the GPU of the display card is not damaged due to uncontrollable calculation amount.
Typically during the course of a game, a player may initiate an interactive request with a target game character via a user terminal, where the player is typically only concerned with the target game character that needs to be interacted with. Therefore, in order to further reduce the amount of computation, in one embodiment, as shown in fig. 5, a flow chart of a rendering method of a game character in a virtual scene in yet another embodiment is shown. In this embodiment, in addition to the steps shown in fig. 2, the method further includes:
S14, obtaining an interaction request initiated to a designated role in each target game role.
In an embodiment, the interaction request initiated to the designated character in each target game character may be input by the user through the external device, and the user terminal receives the acquisition. The designated roles may be one or more, the interactive request may be a content such as a duel, chat or transaction in a 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.
S15, according to the interaction request, suspending rendering and display processes of the non-designated roles except the designated roles in the target game roles.
In one embodiment, the user terminal pauses the drawing and displaying process of each non-designated character according to the received user-entered interaction request with the designated character. The non-designated characters are other target game characters except the designated characters which initiate the interaction request in the target game characters displayed on the screen, and the requirement for displaying the non-designated characters after the user initiates the interaction request to the designated characters is smaller, namely, the non-designated characters do not need to be displayed when the first game character interacts with the designated characters. The user terminal pauses the drawing and display process for each non-designated character. And after the interaction of 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 character, the drawing and display processes of other target characters except the designated character are suspended according to the interaction request, so that other target game characters are not required to be displayed in the process of interacting with the designated character, the designated character can be better displayed to strengthen the interaction effect, other unnecessary operations are stopped, and the operation amount of the GPU of the display card is reduced.
In one embodiment, as shown in fig. 6, there is provided a rendering apparatus of a game character in a virtual scene, including:
the information obtaining module 101 is configured to obtain distance information between a first game role and each target game role in a current virtual scene, where 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.
The resolution obtaining module 102 is configured to obtain, according to distance information between the first game character and each target game character, a current resolution of 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.
A character display module 103 for rendering 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 all roles do not need to be drawn by adopting preset resolution at the same time in a virtual scene with a large number of game roles, the load of the GPU of the display card can be reduced, the rendering speed of the terminal screen to the game roles in the virtual scene is improved, and meanwhile, the damage to the display card is reduced.
In one embodiment, the resolution obtaining module 102 is specifically configured to: determining the priority of each target game role according to a 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 the target game role is in direct proportion to the priority of the target game role.
In one embodiment, as shown in fig. 7, a schematic structural diagram of a rendering device 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 embodiment further includes:
the character obtaining module 100 is configured to sequentially select a plurality of target game characters from the second game characters according to the distances between the first game character and the second game characters in the current virtual scene until the number of selected target game characters meets a preset condition.
In one embodiment, the role obtaining module 100 is specifically configured to: acquiring first position information of a first game role; sequentially selecting a plurality of second position information from a character list recorded with the second position information of each second game character according to the distance between the first position information and each 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 second position information.
In an embodiment, the character list records corresponding second location information when the second game character enters the current virtual scene.
In one embodiment, the character list deletes corresponding second location information when the second game character exits the current virtual scene.
In an embodiment, the role acquisition module 100 is further configured to: after sequentially selecting a plurality of target game characters from the second game characters, stopping the rendering and display process of the game characters in the non-target virtual scene except the target game characters in the second game characters.
In one embodiment, as shown in fig. 8, a schematic structural diagram of a rendering device 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 embodiment further includes:
The role interaction module 104 is used for obtaining interaction requests initiated to designated roles in all target game roles; according to the interaction request, the rendering and display processes of the non-designated characters except the designated characters in the target game characters are suspended.
In one embodiment, a computer apparatus is provided, as shown in FIG. 9, comprising a processor, a memory, a network interface, an input device, and a display screen connected by a system bus. The memory includes a nonvolatile 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 a processor, causes the processor to implement a method of rendering a character of a game 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 character in a virtual scene. It will be appreciated by persons skilled in the art that the architecture shown in fig. 9 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements are applicable, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, the rendering apparatus for game characters in a virtual scene provided by the present application may be implemented as a computer program, which may be executed on a computer device as shown in fig. 9. The memory of the computer device may store therein various program modules that constitute the rendering devices of the game characters in the virtual scene. The computer program constituted by the respective program modules causes the processor to execute the steps in the rendering method of a game character in a virtual scene of the respective embodiments of the present application described in the present specification.
In one embodiment, a computer-readable storage medium is provided, the computer-readable storage medium storing computer-executable instructions for causing a computer to perform the steps of a method for rendering a character of a game in a virtual scene as described above. The steps of the method for rendering the game characters in the virtual scene may be the steps of the method for rendering the game characters in the virtual scene in the above-described respective embodiments.
While the foregoing is directed to the preferred embodiments of the present application, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the application, such changes and modifications are also intended to be within the scope of the application.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in accordance with the embodiments may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed may comprise the steps 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 (Random Access Memory, RAM), or the like.

Claims (9)

1. A method for rendering a game character in a virtual scene, comprising:
acquiring 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 inversely proportional to the distance information, and the peak value of the current resolution of each target game role is not higher than the preset resolution; presetting a minimum resolution, if the current resolution of the target game character is lower than the minimum resolution, not rendering the target game character in the current virtual scene, or updating the current resolution according to the set minimum resolution when the current resolution of the game character is lower than the minimum resolution;
Rendering each of the target game characters according to a current resolution of each of the target game characters;
before obtaining the distance information between the first game role and each target game role in the current virtual scene, the method further comprises the following steps:
sequentially selecting a plurality of target game roles from the second game roles according to the distances between the first game roles and the second game roles in the current virtual scene and the sequence from the small distance to the large distance until the number of the selected target game roles meets a preset condition;
after rendering each of the target game characters according to the current resolution of each of the target game characters, further comprising:
acquiring an interaction request initiated to a designated role in each target game role;
according to the interaction request, the rendering and display processes of the non-designated roles except the designated roles in the target game roles are suspended.
2. The method of claim 1, wherein obtaining the current resolution of each target game character based on the distance information between the first game character and each target game character, comprises:
Determining the priority of each target game role according to a 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 the target game role is in direct proportion to the priority of the target game role.
3. The method of claim 1, wherein sequentially selecting the plurality of target game characters from the second game characters in order of decreasing distance 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 second position information from a character list recorded with the second position information of each second game character according to the distance between the first position information and each second position information from small to large until the number of the selected second position information meets the preset condition;
and selecting a plurality of target game roles from the second game roles according to the selected second position information.
4. A method of rendering a game character in a virtual scene according to claim 3, wherein the character list records the corresponding second position information when the second game character enters the current virtual scene.
5. The method of claim 3 or 4, wherein the character list deletes the corresponding second location information when the second game character exits the current virtual scene.
6. The method of claim 1, further comprising, after sequentially selecting a plurality of target game characters from the second game characters:
and stopping the rendering and displaying processes of the game characters in the non-target virtual scenes except the target game characters in the second game characters.
7. A rendering apparatus for a game character in a virtual scene, comprising:
the character acquisition module is used for sequentially selecting a plurality of target game characters from the second game characters according to the distances between the first game characters and the second game characters in the current virtual scene and the sequence from the small distance to the large distance until the number of the selected target game characters meets the preset condition;
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;
the resolution obtaining module is used for obtaining the current resolution of each target game role according to the distance information of the first game role and each target game role, the current resolution of each target game role is inversely proportional to the distance information, and the peak value of the current resolution of each target game role is not higher than the preset resolution; presetting a minimum resolution, if the current resolution of the target game character is lower than the minimum resolution, not rendering the target game character in the current virtual scene, or updating the current resolution according to the set minimum resolution when the current resolution of the game character is lower than the minimum resolution;
a character display module for rendering each of the target game characters according to a current resolution of each of the target game characters;
the role interaction module is used for obtaining interaction requests initiated to appointed roles in all target game roles; according to the interaction request, the rendering and display processes of the non-designated characters except the designated characters in the target game characters are suspended.
8. An electronic device, comprising: a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of rendering a game character in a virtual scene as claimed in any one of claims 1 to 6 when the program is executed.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any of claims 1-6.
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 CN113181641A (en) 2021-07-30
CN113181641B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114028807A (en) * 2021-11-05 2022-02-11 腾讯科技(深圳)有限公司 Rendering method, device and equipment of virtual object and readable storage medium
CN116863058B (en) * 2023-09-05 2023-11-14 湖南马栏山视频先进技术研究院有限公司 Video data processing system based on GPU

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (2)

* 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
US10311679B2 (en) * 2014-12-12 2019-06-04 Synergy Blue, Llc First person shooter, RPG and sports themed hybrid arcade-type, wager-based gaming techniques

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
叶槽编著.细节层级.《游戏美术设计》.2007, *
路朝龙编著.Unity 3D游戏开发从入门到精通.中国铁道出版社,2013,第54页. *

Also Published As

Publication number Publication date
CN113181641A (en) 2021-07-30

Similar Documents

Publication Publication Date Title
US11135511B2 (en) Creation of game-based scenes
CN113181641B (en) Rendering method and device of game roles in virtual scene and electronic equipment
EP3943172A1 (en) Virtual character control method and apparatus, device, and storage medium
CN112090071B (en) Virtual environment loading method and device, electronic equipment and computer storage medium
WO2021218460A1 (en) Virtual object control method and device, terminal, 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
CN113181644B (en) Game role rendering method and device and electronic equipment
CN113350787B (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
CN113350785A (en) Virtual character rendering method and device and electronic equipment
CN112999662A (en) Game role switching method and device and electronic equipment
CN115509671B (en) Interactive courseware playing method, device, equipment and storage medium
WO2024037139A1 (en) Method and apparatus for prompting information in virtual scene, electronic device, storage medium, and program product
CN116271830B (en) Behavior control method, device, equipment and storage medium for virtual game object
US11607613B2 (en) Method and apparatus for switching game mode, and electronic device
WO2024060924A1 (en) Interaction processing method and apparatus for virtual scene, and electronic device and storage medium
CN117753004A (en) Message display method, device, equipment, medium and program product
CN116983625A (en) Social scene-based message display method, device, equipment, medium and product
CN115707499A (en) Skill effect display method and device
CN116983629A (en) Video game assistance method and apparatus, electronic device, and readable storage medium
CN117654041A (en) Skill acquisition method, device, equipment, medium and product based on virtual scene

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