Game scene display method and device
By selecting target terrain blocks for seamless display based on the virtual character's position and field of view information in the game scene, the problem of poor game scene display effects in the existing technology is solved, the game experience is improved, and the cost and scale requirements are reduced.
Patent Information
- Application Number
- CN202110528116.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-14
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-05-14
AI Technical Summary
When the existing technology realizes the seamless loop display of game scenes, the teleportation of virtual characters or cameras leads to a reduced game experience. The production of spherical scenes is difficult and has strict scale requirements, and cannot effectively solve the problem of poor game scene display effects.
By obtaining the virtual three-dimensional terrain model in the game scene, based on the virtual character's position information and field of view information, the target terrain block is selected from multiple virtual terrain blocks and displayed in the preset area to achieve seamless loop display and avoid teleportation. Changes have reduced the scale of game scenes and production costs.
It realizes the seamless loop display of game scenes, improves the experience of gamers, reduces the cost and scale requirements of game scene production, avoids experience problems caused by teleportation, and simplifies the production of spherical scenes.
Smart Images

Figure CN113289334B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method and device for displaying a game scene. Background Art
[0002] At present, in some game scenes, due to the limited scale of the game scene, when the virtual character in the game moves to the boundary of the game scene, the game player's experience will be strange. In order to make up for the above-mentioned strange experience, it is necessary to enable the game scene to be displayed in a seamless loop, so as to achieve the effect of the game scene being boundless. In the prior art, the seamless loop display of the game scene is mainly achieved through the following two methods:
[0003] Method 1: It is realized by teleporting the virtual character or camera. In this method, when the virtual character moves to the boundary of the game scene, the game scene is teleported to achieve the effect of no boundary of the game scene.
[0004] Method 2: The game scene is set as a spherical scene. In this method, a spherical scene such as a planet is used to achieve a borderless effect of the game scene.
[0005] However, in the first approach, the virtual character or camera moves instantly, resulting in an instantaneous change in the environment around the virtual character, which easily attracts the attention of game players and reduces the game experience of game players. In order to compensate for the instantaneous change, game developers need to do more work.
[0006] In the second method, the production of the spherical scene is difficult. Usually, without the support of a mature game engine (e.g., Landscape and Terrain game engines) and game tools, the game system cannot be used normally. Moreover, the second method has requirements for the scale of the game scene. If the scale of the game scene is small, the curvature of the spherical surface of the spherical scene is large, which makes the game players feel weird and even affects the design of the game play. If the scale of the game scene is large, the production cost of the game scene will increase, and the requirements for the game play design will also be increased.
[0007] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0008] The embodiments of the present invention provide a method and device for displaying a game scene, so as to at least solve the technical problem in the prior art that the display effect is poor when the game scene is displayed in a loop.
[0009] According to one aspect of an embodiment of the present invention, a method for displaying a game scene is provided, comprising: obtaining a virtual three-dimensional terrain model in the game scene, wherein the virtual three-dimensional terrain model is composed of multiple virtual terrain blocks; determining position information and field of view information of a virtual character in the game scene; when the minimum distance between the position information and multiple edges of the virtual three-dimensional terrain model is less than a preset distance, selecting a target terrain block to be displayed from the multiple virtual terrain blocks based on the field of view information; and displaying the target terrain block in a preset area, wherein the preset area is an area outside an area corresponding to the virtual three-dimensional terrain model, or an area corresponding to the virtual three-dimensional terrain model.
[0010] Furthermore, the method for displaying a game scene also includes: after obtaining a virtual three-dimensional terrain model in the game scene, obtaining a model position of a virtual model contained in the virtual three-dimensional terrain model; and dividing the virtual three-dimensional terrain model into a plurality of virtual terrain blocks according to the model position.
[0011] Furthermore, the method for displaying the game scene also includes: before selecting the target terrain block to be displayed from multiple virtual terrain blocks based on the field of view information, obtaining a first bounding box corresponding to each virtual model in the game scene; performing a union operation on the first bounding boxes corresponding to all virtual models to obtain a second bounding box corresponding to the game scene.
[0012] Furthermore, the method for displaying a game scene also includes: after selecting a target terrain block to be displayed from a plurality of virtual terrain blocks based on field of view information, obtaining an offset position corresponding to a plurality of preset areas mapped to the target terrain block, wherein the plurality of preset areas include an area corresponding to a virtual three-dimensional terrain model, and other areas outside the area corresponding to the virtual three-dimensional terrain model and connected to the boundary of the virtual three-dimensional terrain model; calculating the distance between the position information of the virtual character and the offset position; determining the target offset position corresponding to the minimum distance; and determining the preset area where the target offset position is located as the position to be displayed corresponding to the target terrain block.
[0013] Furthermore, the method for displaying the game scene also includes: obtaining a first offset position corresponding to each preset area in a plurality of preset areas and area information corresponding to each preset area, wherein the area information at least includes length information and width information corresponding to each preset area; obtaining first position information of the target terrain block in the virtual three-dimensional terrain model; calculating the product of the first offset position and the area information to obtain a first result; calculating the sum of the first result and the first position information to obtain the offset position corresponding to the target terrain block mapped to each preset area.
[0014] Furthermore, the method for displaying a game scene also includes: obtaining a field of view corresponding to the field of view information; determining a virtual terrain block that does not intersect with the field of view from a plurality of virtual terrain blocks included in the first bounding box, to obtain a target terrain block.
[0015] Furthermore, the method for displaying the game scene also includes: comparing the size of the field of view with the size of the bounding box range of the second bounding box to obtain a comparison result; determining a setting method for setting the target terrain block at the position to be displayed based on the comparison result; and displaying the target terrain block at the position to be displayed.
[0016] Furthermore, the method for displaying a game scene also includes: when the field of view range is less than or equal to the bounding box range, moving the target terrain block to a position to be displayed.
[0017] Furthermore, the method for displaying a game scene also includes: when the field of view range is larger than the bounding box range, copying the target terrain block to the position to be displayed.
[0018] Furthermore, the method for displaying the game scene also includes: after copying the target terrain block to the position to be displayed, obtaining a third bounding box consisting of the virtual three-dimensional terrain model and the copied target terrain block; determining the virtual terrain blocks outside the field of view from the third bounding box; and destroying the virtual terrain blocks outside the field of view.
[0019] According to another aspect of an embodiment of the present invention, a display device for a game scene is also provided, including: an acquisition module, used to acquire a virtual three-dimensional terrain model in the game scene, wherein the virtual three-dimensional terrain model is composed of multiple virtual terrain blocks; a first determination module, used to determine the position information and field of view information of the virtual character in the game scene; a second determination module, used to select a target terrain block to be displayed from the multiple virtual terrain blocks based on the field of view information when the minimum distance between the position information and multiple edges of the virtual three-dimensional terrain model is less than a preset distance; and a display module, used to display the target terrain block in a preset area, wherein the preset area is an area outside the area corresponding to the virtual three-dimensional terrain model, or an area corresponding to the virtual three-dimensional terrain model.
[0020] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for displaying a game scene when running.
[0021] According to another aspect of an embodiment of the present invention, a processor is further provided, the processor being used to run a program, wherein the program is configured to execute the above-mentioned method for displaying a game scene when running.
[0022] In an embodiment of the present invention, a method of realizing a seamless looping scene effect based on the position information and field of view information of a virtual character is adopted. After a virtual three-dimensional terrain model including a plurality of virtual terrain blocks in a game scene is obtained, the position information and field of view information of the virtual character in the game scene are determined. Then, when the minimum distance between the position information and a plurality of edges of the virtual three-dimensional terrain model is less than a preset distance, a target terrain block to be displayed is selected from the plurality of virtual terrain blocks based on the field of view information, and the target terrain block is displayed in an area outside the area corresponding to the virtual three-dimensional terrain model or in an area corresponding to the virtual three-dimensional terrain model.
[0023] In the above process, the target terrain block to be displayed is determined according to the field of view information of the virtual character, and the target terrain block to be displayed is displayed in the area outside the virtual three-dimensional terrain model, which can achieve the effect of seamless loop display of the game scene. In addition, the process only realizes the seamless link of the game scene through the target terrain block, and does not teleport the game character or camera, thereby avoiding the instantaneous change caused by teleporting the virtual character or camera. In addition, the above scheme reduces the requirements for the scale of the game scene and reduces the production cost of the game scene.
[0024] It can be seen that the solution provided in the present application achieves the purpose of seamlessly looping the game scenes, thereby realizing the technical effect of improving the gaming experience of game players, and further solving the technical problem of poor display effect when looping the game scenes in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0026] Figure 1 is a flowchart of a method for displaying a game scene according to an embodiment of the present invention;
[0027] Figure 2 is a schematic diagram of an optional virtual three-dimensional terrain model according to an embodiment of the present invention;
[0028] Figure 3 is a schematic diagram of a plurality of optional virtual terrain blocks according to an embodiment of the present invention;
[0029] Figure 4 is a schematic diagram of an optional game scene according to an embodiment of the present invention;
[0030] Figure 5 is a schematic diagram of an optional game scene according to an embodiment of the present invention;
[0031] Figure 6 is a schematic diagram of an optional game scene according to an embodiment of the present invention;
[0032] Figure 7 It is a schematic diagram of a display device for a game scene according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] Example 1
[0036] According to an embodiment of the present invention, an embodiment of a method for displaying a game scene is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0037] In addition, it should be noted that the game terminal running the game can be used as the execution subject of this embodiment. Optionally, the game terminal can be but not limited to a smart phone, a tablet, a computer, etc.
[0038] Figure 1 is a flowchart of a method for displaying a game scene according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0039] Step S102, obtaining a virtual three-dimensional terrain model in the game scene, wherein the virtual three-dimensional terrain model is composed of a plurality of virtual terrain blocks.
[0040] In step S102, the virtual three-dimensional terrain model may be a terrain model in a game scene, for example, Figure 2 In addition, in the process of slicing the virtual 3D terrain model, the virtual 3D terrain model can be mapped into a 2D terrain model, and then the 2D terrain model can be sliced to obtain multiple virtual terrain models. Figure 2 The virtual 3D terrain model in the Figure 3 The multiple virtual terrain blocks shown in Figure 3 In the figure, each white rectangular box represents a virtual terrain block.
[0041] Step S104, determining the position information and field of view information of the virtual character in the game scene.
[0042] In step S104, the field of view information represents the area information of the area visible to the game player in the game scene, wherein the field of view information may be the projection of the spherical field of view corresponding to the game scene on the horizontal plane.
[0043] Step S106 : when the minimum distance between the position information and the multiple edges of the virtual three-dimensional terrain model is less than a preset distance, a target terrain block to be displayed is selected from the multiple virtual terrain blocks based on the field of view information.
[0044] It should be noted that, in step S106, the virtual three-dimensional terrain model may include multiple boundaries, for example, Figure 2 In the schematic diagram shown, the virtual three-dimensional terrain model is a quadrilateral including four sides. When the distance between the position of the virtual character and multiple sides of the virtual three-dimensional terrain model is less than a preset distance, it indicates that the virtual character is very close to the boundary of the virtual three-dimensional terrain model. If the virtual character continues to move toward the boundary, the area visible to the game player in the game scene will exceed the area of the virtual three-dimensional terrain model. At this time, the game terminal moves or copies the target terrain block so that when the virtual character continues to move toward the boundary, the area visible to the game player in the game scene can still display the virtual three-dimensional terrain model, thereby realizing a seamless loop display of the game scene.
[0045] In addition, it should be noted that the target terrain block is used to connect the boundaries of the virtual three-dimensional terrain model so that the game scene can be displayed in a seamless loop. The target terrain block can also be determined according to the direction and / or movement direction of the virtual character. For example, the target terrain block can be a terrain block at the boundary of the virtual three-dimensional terrain model that is opposite to the direction and / or movement direction of the virtual character.
[0046] In step S106, the position of the target terrain block to be displayed may be determined according to the position information of the virtual character, and the target terrain block among the multiple virtual terrain blocks may be determined according to the field of view information and the position information of each virtual terrain block.
[0047] Step S108 , displaying the target terrain block in a preset area, wherein the preset area is an area outside the area corresponding to the virtual three-dimensional terrain model, or an area corresponding to the virtual three-dimensional terrain model.
[0048] Optionally, after determining the target terrain block and the position to be displayed of the target terrain block in step S106, the game terminal displays the target terrain block at the position to be displayed when the game is running, wherein the position to be displayed is located in the above-mentioned preset area. It should be noted that in this solution, the camera or the virtual character is not teleported, but only the terrain block to be displayed among the multiple virtual terrain blocks in the virtual three-dimensional terrain model is displayed at the position to be displayed, thereby realizing a seamless link of the game scene.
[0049] Based on the scheme defined in the above steps S102 to S108, it can be known that in an embodiment of the present invention, a method of realizing a seamless looping scene effect based on the position information and field of view information of a virtual character is adopted. After obtaining a virtual three-dimensional terrain model containing multiple virtual terrain blocks in a game scene, the position information and field of view information of the virtual character in the game scene are determined. Then, when the minimum distance between the position information and multiple edges of the virtual three-dimensional terrain model is less than a preset distance, a target terrain block to be displayed is selected from the multiple virtual terrain blocks based on the field of view information, and the target terrain block is displayed in an area outside the area corresponding to the virtual three-dimensional terrain model, or in an area corresponding to the virtual three-dimensional terrain model.
[0050] It is easy to notice that in the above process, the target terrain block to be displayed is determined according to the virtual character's and field of view information, and the target terrain block to be displayed is displayed in the area outside the virtual three-dimensional terrain model, which can achieve the effect of seamless loop display of the game scene. In addition, the process only realizes the seamless link of the game scene through the target terrain block, and does not teleport the game character or camera, thereby avoiding the instantaneous change caused by teleporting the virtual character or camera. In addition, the above scheme reduces the requirements for the scale of the game scene and reduces the production cost of the game scene.
[0051] It can be seen that the solution provided in the present application achieves the purpose of seamlessly looping the game scenes, thereby realizing the technical effect of improving the gaming experience of game players, and further solving the technical problem of poor display effect when looping the game scenes in the prior art.
[0052] In an optional embodiment, after acquiring the virtual three-dimensional terrain model in the game scene, the game terminal acquires the model positions of the virtual models contained in the virtual three-dimensional terrain model, and divides the virtual three-dimensional terrain model into multiple virtual terrain blocks according to the model positions.
[0053] It should be noted that the virtual model in the virtual three-dimensional terrain model may be a static model, for example, a virtual model of a tree, a stone, a building, etc.
[0054] Optionally, the game terminal first maps the virtual three-dimensional terrain model into a two-dimensional terrain model, then projects a preset cutting range into the two-dimensional terrain model, and cuts the two-dimensional terrain model according to the cutting range based on a cutting tool (for example, the World Composition tool); finally, the virtual model is projected onto the two-dimensional plane corresponding to the two-dimensional terrain model, the virtual terrain block to which the virtual model belongs is determined, and the virtual model is divided into the corresponding virtual terrain block.
[0055] It should be noted that, in the above process, the preset block range can be set according to the size of the two-dimensional terrain model. In addition, in the process of slicing the two-dimensional terrain model, the block shape and block size corresponding to each virtual terrain block can be set according to the size of the two-dimensional terrain model, wherein the block shape and block size corresponding to each virtual terrain block can be the same or different. Preferably, in the present application, the block shape and block size corresponding to each virtual terrain block are the same. For example, Figure 3 The sizes and shapes of multiple virtual terrain blocks in are the same.
[0056] In addition, it should be noted that after the virtual three-dimensional terrain model is sliced to obtain multiple virtual terrain blocks, the game terminal can obtain the slicing meta information of each virtual terrain block. The slicing meta information of each virtual terrain block includes but is not limited to the position information of each virtual terrain block, the size of the bounding box corresponding to each virtual terrain block, and the scene file corresponding to each virtual terrain block. The position information of each virtual terrain block can be the anchor point position of each virtual terrain block, for example, the position of the geometric center point of each virtual terrain block.
[0057] In an optional embodiment, before selecting a target terrain block to be displayed from multiple virtual terrain blocks based on the field of view information, the game terminal first determines a bounding box corresponding to the game scene. Specifically, the game terminal obtains a first bounding box corresponding to each virtual model in the game scene, and performs a union operation on the first bounding boxes corresponding to all virtual models to obtain a second bounding box corresponding to the game scene.
[0058] It should be noted that a bounding box is a geometric body with a slightly larger volume and simple characteristics. In practical applications, a bounding box is usually used to approximately replace complex geometric objects. In this application, a bounding box is used to replace complex game scenes and virtual models.
[0059] In addition, it should be noted that since the game scene is composed of virtual models of the game scene, in the present application, the game terminal can perform a union calculation on the bounding boxes of all virtual models in the entire game scene to obtain the bounding box corresponding to the entire game scene (i.e., the second bounding box).
[0060] In an optional embodiment, after selecting the target terrain block to be displayed from multiple virtual terrain blocks based on the field of view information, the game terminal also needs to determine the position to be displayed of the target terrain block. Specifically, the game terminal obtains the offset position corresponding to the target terrain block mapped to multiple preset areas, and calculates the distance between the position information of the virtual character and the offset position, and then determines the target offset position corresponding to the minimum distance, and determines the preset area where the target offset position is located as the position to be displayed corresponding to the target terrain block. Among them, the multiple preset areas include the area corresponding to the virtual three-dimensional terrain model, and other areas outside the area corresponding to the virtual three-dimensional terrain model and connected to the boundary of the virtual three-dimensional terrain model, that is, the multiple preset areas include the area corresponding to the virtual three-dimensional terrain model where the virtual character is located and eight areas connected to the boundary of the virtual three-dimensional terrain model.
[0061] Optionally, the game terminal first obtains the offset position of the target terrain block mapped to each preset area, wherein the position information of the target terrain block in each preset area is the same, for example, the position coordinates of the target terrain block in the virtual three-dimensional terrain model are (x, y), and the corresponding position coordinates after the target terrain block is mapped to the area above the virtual three-dimensional terrain model are also (x, y). The game terminal can calculate the offset position of the target terrain block mapped to each preset area based on the position coordinates of the target terrain block in the preset area and the offset position corresponding to each preset position.
[0062] Specifically, the game terminal obtains the first offset position corresponding to each preset area in the plurality of preset areas and the area information corresponding to each preset area, and obtains the first position information of the target terrain block in the virtual three-dimensional terrain model, then calculates the product of the first offset position and the area information to obtain a first result, and calculates the sum of the first result and the first position information to obtain the offset position corresponding to each preset area mapped to the target terrain block. For example, if the offset position of the virtual three-dimensional terrain model where the virtual character is located is (0,0), then the offset position corresponding to the preset area located above the virtual three-dimensional terrain model is (0,1), and the offset position corresponding to the preset area located on the right side of the virtual three-dimensional terrain model is (1,0), and so on, to obtain the first offset position corresponding to each preset area. Then, the product of the first offset position corresponding to each preset area and the area information is calculated to obtain a first result, that is, the length and width corresponding to each preset area are respectively multiplied by the horizontal coordinate value and the vertical coordinate value of the first offset position. For example, for the preset area located above the virtual three-dimensional terrain model, its area information is (a, b), then the first result is (0, b); for the preset area located on the right side of the virtual three-dimensional terrain model, its area information is (a, b), then the first result is (0, b). Finally, the sum of the first result and the first position information is calculated to obtain the offset position corresponding to each preset area mapped to the target terrain block. For example, for the preset area located above the virtual three-dimensional terrain model, the offset position corresponding to the target terrain block in the preset area is (x, y+b); for the preset area located on the right side of the virtual three-dimensional terrain model, the offset position corresponding to the target terrain block in the preset area is (x+a, y).
[0063] Furthermore, after determining the offset position, the game terminal determines from the virtual three-dimensional terrain model and the eight areas around the virtual three-dimensional terrain model in which area the target terrain block is placed so as to minimize the distance between the position to be displayed and the current position of the game character, that is, when the distance between the position to be displayed and the current position of the game character is minimized, the position to be displayed is determined in the virtual three-dimensional terrain model where the target terrain block is located.
[0064] In an optional embodiment, after determining the position of the target terrain block to be displayed, the game terminal selects the target terrain block to be displayed from the multiple virtual terrain blocks based on the field of view information. Specifically, the game terminal obtains the field of view range corresponding to the field of view information, and determines the virtual terrain blocks that do not intersect with the field of view range from the multiple virtual terrain blocks included in the first bounding box, and obtains the target terrain block.
[0065] Optionally, the game terminal calculates the intersection between the field of view and the bounding box (i.e., the first bounding box) corresponding to each virtual terrain block. If the current virtual terrain block intersects with the field of view, the current virtual terrain block is determined to be a visible terrain block; if the current virtual terrain block does not intersect with the field of view, the current virtual terrain block is determined to be an invisible terrain block. Then, the game terminal determines the target terrain block from the invisible terrain block or the visible terrain block according to the position information of the virtual character.
[0066] In an optional embodiment, when the scene range corresponding to the game scene is larger than the field of view, after determining the position information of the virtual character, the game terminal determines the target terrain block from the invisible terrain blocks in combination with the direction and / or movement direction of the virtual character. Figure 4 In the game scene diagram shown, the position of the virtual character is M, the virtual character faces the right side and moves to the right side. At this time, the game terminal can determine the target terrain block from all virtual terrain blocks on the left side of the virtual terrain block corresponding to the position M. For example, Figure 4 In the example, virtual terrain blocks A and B are determined as target terrain blocks.
[0067] In another optional embodiment, when the scene range corresponding to the game scene is not larger than the field of view, after determining the position information of the virtual character, the game terminal determines the target terrain block from the visible terrain blocks in combination with the direction and / or movement direction of the virtual character. Figure 5 In the game scene diagram shown, the position of the virtual character is M, the virtual character faces the right and moves to the right. At this time, the game terminal can determine the target terrain block from all virtual terrain blocks on the left side of the virtual terrain block corresponding to position M.
[0068] In an optional embodiment, after determining the target terrain block and the position to be displayed of the target terrain block, the game terminal may display the target terrain block at the position to be displayed. Specifically, the game terminal compares the size of the field of view with the size of the bounding box range of the second bounding box to obtain a comparison result, and determines a setting method for setting the target terrain block at the position to be displayed according to the comparison result, and then displays the target terrain block at the position to be displayed.
[0069] It should be noted that the above setting methods include two methods: moving the target terrain block and copying the target terrain block. Different comparison results correspond to different setting methods.
[0070] Optionally, when the field of view is less than or equal to the bounding box range, the game terminal moves the target terrain block to the position to be displayed. Figure 4In the schematic diagram of the game scene shown, the field of view is smaller than the bounding box range, virtual terrain blocks A and B are target terrain blocks, and A' and B' are the positions to be displayed corresponding to virtual terrain blocks A and B. In this scene, the game terminal directly moves virtual terrain blocks A and B to positions A' and B' to be displayed, and then displays or loads the target terrain blocks at the positions to be displayed, while hiding or unloading the virtual terrain blocks at the original positions corresponding to virtual terrain blocks A and B.
[0071] It should be noted that, when the field of view is less than or equal to the bounding box range, if a copy operation is performed on the target terrain block, it will cause the problem of repeated appearance of the target terrain block. Therefore, in this embodiment, when the field of view is less than or equal to the bounding box range, the target terrain block is moved.
[0072] Optionally, when the field of view is larger than the bounding box, the target terrain block is copied to the position to be displayed. Figure 5 In the game scene diagram shown, the target terrain block C has not been instantiated, and the field of view is larger than the bounding box range. At this time, the game terminal instantiates the target terrain block C and copies the target terrain block C to the position D to be displayed.
[0073] In addition, after copying the target terrain block to the position to be displayed, the game terminal obtains a third bounding box composed of the virtual three-dimensional terrain model and the copied target terrain block, determines the virtual terrain blocks outside the field of view from the third bounding box, and destroys the virtual terrain blocks outside the field of view. That is, the instantiated virtual terrain blocks outside the field of view are destroyed.
[0074] It should be noted that, through the above operations, a seamless loop display of the game scene can be achieved. For example, Figure 6 In the game scene shown, through the solution provided by the present application, when the virtual character moves to the boundary of the game scene, the game player cannot perceive the discontinuity when crossing the boundary, thus avoiding the problem caused by the teleporting camera or the virtual character. Moreover, the solution provided by the present application does not interfere with the production of the game scene, and has low requirements on the size of the game scene. The existing game engine and tools can be used to achieve seamless loop display of the game scene, with high development efficiency, avoiding the problem of the spherical scene, making the game scene more continuous, and improving the game experience of the game player.
[0075] Example 2
[0076] According to an embodiment of the present invention, there is also provided an embodiment of a display device for a game scene, wherein: Figure 7 is a schematic diagram of a display device for a game scene according to an embodiment of the present invention, such as Figure 7As shown, the device includes: an acquisition module 701 , a first determination module 703 , a second determination module 705 and a display module 707 .
[0077] Among them, the acquisition module 701 is used to acquire the virtual three-dimensional terrain model in the game scene, wherein the virtual three-dimensional terrain model is composed of multiple virtual terrain blocks; the first determination module 703 is used to determine the position information and field of view information of the virtual character in the game scene; the second determination module 705 is used to select a target terrain block to be displayed from multiple virtual terrain blocks based on the field of view information when the minimum distance between the position information and multiple edges of the virtual three-dimensional terrain model is less than a preset distance; the display module 707 is used to display the target terrain block in a preset area, wherein the preset area is an area outside the area corresponding to the virtual three-dimensional terrain model, or an area corresponding to the virtual three-dimensional terrain model.
[0078] It should be noted that the above-mentioned acquisition module 701, first determination module 703, second determination module 705 and display module 707 correspond to steps S102 to S108 in the above-mentioned embodiments, and the examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiments.
[0079] Optionally, the display device of the game scene further includes: a first acquisition module and a division module. The first acquisition module is used to acquire the model position of the virtual model contained in the virtual three-dimensional terrain model after acquiring the virtual three-dimensional terrain model in the game scene; the division module is used to divide the virtual three-dimensional terrain model into multiple virtual terrain blocks according to the model position.
[0080] Optionally, the display device of the game scene further includes: a second acquisition module and a first processing module. The second acquisition module is used to acquire the first bounding box corresponding to each virtual model in the game scene before selecting the target terrain block to be displayed from multiple virtual terrain blocks based on the field of view information; the first processing module is used to perform a union operation on the first bounding boxes corresponding to all virtual models to obtain the second bounding box corresponding to the game scene.
[0081] Optionally, the display device of the game scene also includes: a third acquisition module, a first calculation module, a third determination module and a fourth determination module. The third acquisition module is used to obtain the offset position corresponding to the target terrain block mapped to multiple preset areas after selecting the target terrain block to be displayed from multiple virtual terrain blocks based on the field of view information, wherein the multiple preset areas include the area corresponding to the virtual three-dimensional terrain model, and other areas outside the area corresponding to the virtual three-dimensional terrain model and connected to the boundary of the virtual three-dimensional terrain model; the first calculation module is used to calculate the distance between the position information of the virtual character and the offset position; the third determination module is used to determine the target offset position corresponding to the minimum distance; the fourth determination module is used to determine that the preset area where the target offset position is located is the position to be displayed corresponding to the target terrain block.
[0082] Optionally, the third acquisition module includes: a sixth acquisition module, a seventh acquisition information, a second calculation module and a third calculation module. The sixth acquisition module is used to acquire the first offset position corresponding to each preset area in a plurality of preset areas and the area information corresponding to each preset area, wherein the area information at least includes the length information and the width information corresponding to each preset area; the seventh acquisition information is used to acquire the first position information of the target terrain block in the virtual three-dimensional terrain model; the second calculation module is used to calculate the product of the first offset position and the area information to obtain the first result; the third calculation module is used to calculate the sum of the first result and the first position information to obtain the offset position corresponding to each preset area mapped to the target terrain block.
[0083] Optionally, the second determination module includes: a fourth acquisition module and a sixth determination module. The fourth acquisition module is used to acquire the field of view corresponding to the field of view information; the sixth determination module is used to determine the virtual terrain block that does not intersect with the field of view from the multiple virtual terrain blocks included in the first bounding box, to obtain the target terrain block.
[0084] Optionally, the display module includes: a comparison module, a setting module and a first display module. The comparison module is used to compare the size of the field of view with the size of the bounding box range of the second bounding box to obtain a comparison result; the setting module is used to determine the setting method of setting the target terrain block at the position to be displayed according to the comparison result; and the first display module is used to display the target terrain block at the position to be displayed.
[0085] Optionally, the setting module includes: a second processing module and a third processing module. The second processing module is used to move the target terrain block to the position to be displayed when the field of view is less than or equal to the bounding box range; the third processing module is used to copy the target terrain block to the position to be displayed when the field of view is greater than the bounding box range.
[0086] Optionally, the display device of the game scene further includes: a fifth acquisition module, a seventh determination module and a fourth processing module. The fifth acquisition module is used to obtain a third bounding box consisting of the virtual three-dimensional terrain model and the copied target terrain block after copying the target terrain block to the position to be displayed; the seventh determination module is used to determine the virtual terrain block outside the field of view from the third bounding box; and the fourth processing module is used to destroy the virtual terrain block outside the field of view.
[0087] Example 3
[0088] According to another aspect of an embodiment of the present invention, a non-volatile storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the method for displaying the game scene in the above-mentioned embodiment 1 when running.
[0089] Example 4
[0090] According to another aspect of an embodiment of the present invention, a processor is further provided, the processor being used to run a program, wherein the program is configured to execute the method for displaying a game scene in the above-mentioned embodiment 1 when running.
[0091] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0092] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0093] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0094] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0095] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0096] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0097] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for displaying a game scene, characterized in that: include: Acquire a virtual three-dimensional terrain model in the game scene, wherein the virtual three-dimensional terrain model is composed of a plurality of virtual terrain blocks; Determining the position information and field of view information of the virtual character in the game scene; When the minimum distance between the position information and the multiple edges of the virtual three-dimensional terrain model is less than a preset distance, a target terrain block to be displayed is selected from the multiple virtual terrain blocks based on the field of view information, wherein the target terrain block is used to connect the boundary of the virtual three-dimensional terrain model, and the target terrain block is a terrain block in the virtual three-dimensional terrain model that is outside the field of view; The target terrain block is displayed in a preset area, wherein the preset area is an area outside the area corresponding to the virtual three-dimensional terrain model, or an area corresponding to the virtual three-dimensional terrain model.
2. The method according to claim 1, characterized in that After acquiring the virtual three-dimensional terrain model in the game scene, the method further includes: Acquiring a model position of a virtual model included in the virtual three-dimensional terrain model; The virtual three-dimensional terrain model is divided into the plurality of virtual terrain blocks according to the model positions.
3. The method according to claim 1, characterized in that: Before selecting a target terrain block to be displayed from the plurality of virtual terrain blocks based on the field of view information, the method further includes: Obtaining a first bounding box corresponding to each virtual terrain block in the game scene; A union operation is performed on the first bounding boxes corresponding to all virtual terrain blocks to obtain a second bounding box corresponding to the game scene.
4. The method according to claim 3, characterized in that After selecting a target terrain block to be displayed from the plurality of virtual terrain blocks based on the field of view information, the method further includes: Obtaining an offset position corresponding to the mapping of the target terrain block to a plurality of the preset areas, wherein the plurality of the preset areas include an area corresponding to the virtual three-dimensional terrain model and other areas outside the area corresponding to the virtual three-dimensional terrain model and connected to a boundary of the virtual three-dimensional terrain model; Calculating the distance between the position information of the virtual character and the offset position; Determine the target offset position corresponding to when the distance is minimum; The preset area where the target offset position is located is determined as the to-be-displayed position corresponding to the target terrain block.
5. The method according to claim 4, characterized in that Obtaining the offset position corresponding to the mapping of the target terrain block to the plurality of preset areas includes: Acquire a first offset position corresponding to each of the plurality of preset areas and area information corresponding to each of the preset areas, wherein the area information at least includes length information and width information corresponding to each of the preset areas; Acquire first position information of the target terrain block in the virtual three-dimensional terrain model; Calculate the product of the first offset position and the area information to obtain a first result; The sum of the first result and the first position information is calculated to obtain an offset position corresponding to mapping the target terrain block to each of the preset areas.
6. The method according to claim 4, characterized in that Selecting a target terrain block to be displayed from the plurality of virtual terrain blocks based on the field of view information includes: Acquire the field of view range corresponding to the field of view information; A virtual terrain block that does not intersect with the field of view is determined from a plurality of virtual terrain blocks included in the first bounding box to obtain the target terrain block.
7. The method according to claim 6, characterized in that Displaying the target terrain block in a preset area includes: Comparing the size of the field of view with the bounding box range of the second bounding box to obtain a comparison result; Determining a setting method for setting the target terrain block at the position to be displayed according to the comparison result; The target terrain block is displayed at the to-be-displayed position.
8. The method according to claim 7, characterized in that Determining a setting method for setting the target terrain block at the to-be-displayed position according to the comparison result includes: When the comparison result indicates that the field of view range is less than or equal to the bounding box range, the target terrain block is moved to the position to be displayed.
9. The method according to claim 7, characterized in that: Determining a setting method for setting the target terrain block at the to-be-displayed position according to the comparison result includes: When the comparison result indicates that the field of view range is larger than the bounding box range, the target terrain block is copied to the position to be displayed.
10. The method according to claim 9, characterized in that After copying the target terrain block to the position to be displayed, the method further includes: Acquire a third bounding box formed by the virtual three-dimensional terrain model and the copied target terrain block; Determine a virtual terrain block outside the field of view from the third bounding box; The virtual terrain blocks outside the field of view are destroyed.
11. A display device for a game scene, characterized in that: include: An acquisition module, used for acquiring a virtual three-dimensional terrain model in a game scene, wherein the virtual three-dimensional terrain model is composed of a plurality of virtual terrain blocks; A first determination module, used to determine the position information and field of view information of the virtual character in the game scene; a second determining module, configured to select a target terrain block to be displayed from the multiple virtual terrain blocks based on the field of view information when the minimum distance between the position information and multiple edges of the virtual three-dimensional terrain model is less than a preset distance, wherein the target terrain block is used to connect the boundary of the virtual three-dimensional terrain model, and the target terrain block is a terrain block in the virtual three-dimensional terrain model that is outside the field of view; The display module is used to display the target terrain block in a preset area, wherein the preset area is an area outside the area corresponding to the virtual three-dimensional terrain model, or an area corresponding to the virtual three-dimensional terrain model.
12. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a computer program, wherein the computer program is configured to execute the method for displaying a game scene as described in any one of claims 1 to 10 when running.
13. A processor, characterized in that: The processor is used to run a program, wherein the program is configured to execute the method for displaying a game scene as described in any one of claims 1 to 10 when running.
