Search

US-12616896-B2 - Game screen display method and apparatus, storage medium, and electronic device

US12616896B2US 12616896 B2US12616896 B2US 12616896B2US-12616896-B2

Abstract

The present invention discloses a game screen display method and apparatus, a storage medium, and an electronic device. The method includes: acquiring a current first position of a target virtual character in a game; acquiring a first background image from a pre-rendered background image that corresponds to the first position and a first foreground image that corresponds to the first position, respectively; generating a first game screen corresponding to the first position according to the first background image and the first foreground image; and causing a display of the first game screen by a target client of the game.

Inventors

  • Fuchun Zhang

Assignees

  • TENCENT TECHNOLOGY (SHENZHEN) COMPANY LIMITED

Dates

Publication Date
20260505
Application Date
20230316
Priority Date
20210702

Claims (20)

  1. 1 . A game screen display method performed by a computing device, the method comprising: acquiring a current first position of a target virtual character in a game; acquiring a first background image from a pre-rendered background image that corresponds to the first position and a first foreground image that corresponds to the first position, respectively, wherein: the pre-rendered background image is obtained by pre-rendering target background images corresponding to all regions on a game map; and acquiring the first background image from the pre-rendered background image that corresponds to the first position includes cropping the pre-rendered background image based on the first position; generating a first game screen corresponding to the first position according to the first background image and the first foreground image; and causing a display of the first game screen by a target client of the game.
  2. 2 . The method according to claim 1 , wherein the game is associated with a game map including a set of regions, each region corresponding to a respective portion of the pre-rendered background image and the first position being within one of the set of regions.
  3. 3 . The method according to claim 1 , wherein the method further comprises: when the target virtual character moves from the first position to a second position, acquiring a second foreground image corresponding to the second position and generating a second game screen corresponding to the second position according to the first background image and the second foreground image; and transmitting the second game screen to the target client, wherein the target client is configured to display the second game screen.
  4. 4 . The method according to claim 3 , wherein the generating a second game screen corresponding to the second position according to the first background image and the second foreground image comprises: performing deformation processing on the first background image according to the second position to obtain a second background image; and superimposing the second foreground image on the second background image to obtain the second game screen.
  5. 5 . The method according to claim 4 , wherein the performing deformation processing on the first background image according to the second position to obtain a second background image comprises: adjusting pixel values of the first background image to obtain the second background image.
  6. 6 . The method according to claim 1 , wherein the generating a first game screen corresponding to the first position according to the first background image and the first foreground image comprises: superimposing the first foreground image on the first background image to obtain the first game screen; or performing scaling processing on the first background image to obtain a scaled background image and superimposing the first foreground image on the scaled background image to obtain the first game screen.
  7. 7 . The method according to claim 1 , wherein the first foreground image is rendered in real time.
  8. 8 . The method according to claim 1 , wherein the causing a display of the first game screen by a target client of the game further comprises: transmitting the first game screen to the target client of the game at a terminal device, the target client being configured to display the first game screen when playing the game.
  9. 9 . The method according to claim 1 , wherein the acquiring a first background image from a pre-rendered background image that corresponds to the first position comprises: cropping a first static background image from the pre-rendered background image that corresponds to the first position, wherein the pre-rendered background image comprises a pre-rendered static background image or a pre-rendered dynamic background image; or cropping a first dynamic background image from the pre-rendered background image that corresponds to the first position, wherein the pre-rendered background image comprises a pre-rendered dynamic background image.
  10. 10 . A computing device, comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the computing device to perform a game screen display method, the method including: acquiring a current first position of a target virtual character in a game; acquiring a first background image from a pre-rendered background image that corresponds to the first position and a first foreground image that corresponds to the first position, respectively, wherein: the pre-rendered background image is obtained by pre-rendering target background images corresponding to all regions on a game map; and acquiring the first background image from the pre-rendered background image that corresponds to the first position includes cropping the pre-rendered background image based on the first position; generating a first game screen corresponding to the first position according to the first background image and the first foreground image; and transmitting the first game screen to a target client of the game at a terminal device, the target client being configured to display the first game screen when playing the game.
  11. 11 . The computing device according to claim 10 , wherein the game is associated with a game map including a set of regions, each region corresponding to a respective portion of the pre-rendered background image and the first position being within one of the set of regions.
  12. 12 . The computing device according to claim 10 , wherein the method further comprises: when the target virtual character moves from the first position to a second position, acquiring a second foreground image corresponding to the second position and generating a second game screen corresponding to the second position according to the first background image and the second foreground image; and transmitting the second game screen to the target client, wherein the target client is configured to display the second game screen.
  13. 13 . The computing device according to claim 12 , wherein the generating a second game screen corresponding to the second position according to the first background image and the second foreground image comprises: performing deformation processing on the first background image according to the second position to obtain a second background image; and superimposing the second foreground image on the second background image to obtain the second game screen.
  14. 14 . The computing device according to claim 13 , wherein the performing deformation processing on the first background image according to the second position to obtain a second background image comprises: adjusting pixel values of the first background image to obtain the second background image.
  15. 15 . The computing device according to claim 10 , wherein the generating a first game screen corresponding to the first position according to the first background image and the first foreground image comprises: superimposing the first foreground image on the first background image to obtain the first game screen; or performing scaling processing on the first background image to obtain a scaled background image and superimposing the first foreground image on the scaled background image to obtain the first game screen.
  16. 16 . The computing device according to claim 10 , wherein the acquiring a first background image from a pre-rendered background image that corresponds to the first position comprises: cropping a first static background image from the pre-rendered background image that corresponds to the first position, wherein the pre-rendered background image comprises a pre-rendered static background image or a pre-rendered dynamic background image; or cropping a first dynamic background image from the pre-rendered background image that corresponds to the first position, wherein the pre-rendered background image comprises a pre-rendered dynamic background image.
  17. 17 . A non-transitory computer-readable storage medium, storing a computer program that, when executed by a processor of a computing device, causes the computing device to perform a game screen display method, the method including: acquiring a current first position of a target virtual character in a game; acquiring a first background image from a pre-rendered background image that corresponds to the first position and a first foreground image that corresponds to the first position, respectively, wherein: the pre-rendered background image is obtained by pre-rendering target background images corresponding to all regions on a game map; and acquiring the first background image from the pre-rendered background image that corresponds to the first position includes cropping the pre-rendered background image based on the first position; generating a first game screen corresponding to the first position according to the first background image and the first foreground image; and transmitting the first game screen to a target client of the game at a terminal device, the target client being configured to display the first game screen when playing the game.
  18. 18 . The non-transitory computer-readable storage medium according to claim 17 , wherein the method further comprises: when the target virtual character moves from the first position to a second position, acquiring a second foreground image corresponding to the second position and generating a second game screen corresponding to the second position according to the first background image and the second foreground image; and transmitting the second game screen to the target client, wherein the target client is configured to display the second game screen.
  19. 19 . The non-transitory computer-readable storage medium according to claim 18 , wherein the generating a second game screen corresponding to the second position according to the first background image and the second foreground image comprises: performing deformation processing on the first background image according to the second position to obtain a second background image; and superimposing the second foreground image on the second background image to obtain the second game screen.
  20. 20 . The non-transitory computer-readable storage medium according to claim 17 , wherein the generating a first game screen corresponding to the first position according to the first background image and the first foreground image comprises: superimposing the first foreground image on the first background image to obtain the first game screen; or performing scaling processing on the first background image to obtain a scaled background image and superimposing the first foreground image on the scaled background image to obtain the first game screen.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation application of PCT Patent Application No. PCT/CN2022/096793, entitled “GAME SCREEN DISPLAY METHOD AND APPARATUS, STORAGE MEDIUM, AND ELECTRONIC DEVICE” filed on Jun. 2, 2022, which claims priority to Chinese Patent Application No. 202110753176.4, entitled “GAME SCREEN DISPLAY METHOD AND APPARATUS, STORAGE MEDIUM, AND ELECTRONIC DEVICE” and filed with the National Intellectual Property Administration, PRC on Jul. 2, 2021, all of which is incorporated herein by reference in its entirety. FIELD OF THE TECHNOLOGY The present invention relates to the field of computers, and specifically, to a game screen display method and apparatus, a storage medium, and an electronic device. BACKGROUND OF THE DISCLOSURE Rendering a game scene usually is selecting an angle of a camera in a three-dimensional space, and then rendering the game scene according to a camera position. In the related art, the rendering of game scenes does not distinguish between foreground and background. It takes a long rendering time to rotate the camera position to a certain angle and then render a game screen at the corresponding angle, resulting in a large delay. For a game scene requiring extremely low latency, game experience of a player is reduced. SUMMARY An embodiment of the present invention provides a game screen display method, including: acquiring a current first position of a target virtual character in a game; acquiring a first background image from a pre-rendered background image that corresponds to the first position and a first foreground image that corresponds to the first position, respectively; generating a first game screen corresponding to the first position according to the first background image and the first foreground image; and causing a display of the first game screen by a target client of the game. An embodiment of the present invention further provides a game screen display apparatus, including: a first acquisition module, configured to acquire a current first position of a target virtual character in a game; a second acquisition module, configured to acquire a first background image from a pre-rendered background image that corresponds to the first position and a first foreground image that corresponds to the first position, respectively; a generation module, configured to generate a first game screen corresponding to the first position according to the first background image and the first foreground image; and a transmission module, configured to transmit the first game screen to a target client of the game at a terminal device, the target client being configured to display the first game screen when playing the game. An embodiment of the present invention further provides a non-transitory computer-readable storage medium, the computer-readable storage medium storing a computer program, and the computer program, when executed by a processor of a computing device, causing the computing device to perform the foregoing game screen display method. An embodiment of the present invention further provides a computing device, including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the computing device to perform the foregoing game screen display method. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings described herein are intended to provide further understanding of the present invention and constitute a part of this application. Exemplary embodiments of the present invention and the description thereof are used for explaining the present invention rather than constituting the improper limitation to the present invention. In the accompanying drawings: FIG. 1 is a schematic diagram of an application environment of a game screen display method according to an embodiment of the present invention. FIG. 2 is a flowchart of a game screen display method according to an embodiment of the present invention. FIG. 3 is a schematic diagram 1 of a game screen according to an embodiment of the present invention. FIG. 4 is a schematic diagram of a target background image according to an embodiment of the present invention. FIG. 5 is a schematic diagram 2 of a game screen according to an embodiment of the present invention. FIG. 6 is a schematic diagram 3 of a game screen according to an embodiment of the present invention. FIG. 7 is a schematic diagram 4 of a game screen according to an embodiment of the present invention. FIG. 8 is a schematic diagram of an overall architecture according to an embodiment of the present invention. FIG. 9 is a schematic diagram of rendering a background image of a game according to an embodiment of the present invention. FIG. 10 is a schematic diagram of information exchange according to an embodiment of the present invention. FIG. 11 is a schematic structural diagram of a game screen display apparatus according to an embodiment of the present invention. FIG. 1