CN113082705B - Game scene switching method, game scene switching device, computer equipment and storage medium - Google Patents

Game scene switching method, game scene switching device, computer equipment and storage medium Download PDF

Info

Publication number
CN113082705B
CN113082705B CN202110500077.5A CN202110500077A CN113082705B CN 113082705 B CN113082705 B CN 113082705B CN 202110500077 A CN202110500077 A CN 202110500077A CN 113082705 B CN113082705 B CN 113082705B
Authority
CN
China
Prior art keywords
scene
game
game scene
switching
running state
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
CN202110500077.5A
Other languages
Chinese (zh)
Other versions
CN113082705A (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.)
Tencent Technology Shanghai Co Ltd
Original Assignee
Tencent Technology Shanghai 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 Tencent Technology Shanghai Co Ltd filed Critical Tencent Technology Shanghai Co Ltd
Priority to CN202110500077.5A priority Critical patent/CN113082705B/en
Publication of CN113082705A publication Critical patent/CN113082705A/en
Application granted granted Critical
Publication of CN113082705B publication Critical patent/CN113082705B/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
    • 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

Abstract

The application provides a game scene switching method, a device, computer equipment and a storage medium, wherein the method comprises the following steps: acquiring a scene switching instruction input by a user, and determining a first game scene currently in a foreground running state in a game and a second game scene to which the scene switching instruction indicates switching, wherein the second game scene is in a background running state; controlling to end rendering processing of the first game scene and maintain data processing of scene states of the first game scene so that the first game scene is in a background running state; and controlling to start rendering processing of the second game scene so as to switch the second game scene in the background running state to the foreground running state. The scheme of the application reduces the time required for switching the game scene and improves the switching speed of the game scene.

Description

Game scene switching method, game scene switching device, computer equipment and storage medium
Technical Field
The present application relates to the field of game technologies, and in particular, to a game scenario switching method, apparatus, computer device, and storage medium.
Background
Games typically provide multiple game scenes to enrich the game content and enhance the game experience of the player.
During the game running process, the game can switch the currently running game scene to the game scene selected by the user according to the game scene selected by the user. When the game scene is switched, the currently running game scene needs to be destroyed, and the game scene to be switched to is created.
However, creating a game scene involves complex logic processing such as creation and rendering of various scene elements within the game scene, so that creating a game scene takes a long time, resulting in an excessively long time for switching of the game scene.
Disclosure of Invention
In view of the above, the present application provides a method, an apparatus, a computer device and a storage medium for switching game scenes, so as to increase the switching speed of game scenes and reduce the time required for switching game scenes.
In order to achieve the above object, in one aspect, the present application provides a game scene switching method, including:
acquiring a scene switching instruction input by a user, and determining a first game scene currently in a foreground running state in a game and a second game scene to which the scene switching instruction indicates switching, wherein the second game scene is in a background running state;
Controlling to end rendering processing of the first game scene and maintain data processing of scene states of the first game scene so that the first game scene is in a background running state;
and controlling to start rendering processing of the second game scene so as to switch the second game scene in the background running state to the foreground running state.
In one possible implementation manner, the maintaining the data processing on the scene state of the first game scene further includes:
destroying at least one first scene element loaded in the first game scene and configured as a very resident element, wherein the very resident element belongs to a dynamic scene element in a game;
after the control starts the rendering process of the first game scene, further comprising:
determining at least one second scene element to be loaded in the second game scene and configured as a very resident element;
the at least one second scene element is created for the second game scene.
In yet another possible implementation, the creating the at least one second scene element for the second game scene includes:
one second scene element is created for the second game scene each time one frame of the second game scene is output until the at least one second scene element in the second game scene is created.
In yet another possible implementation manner, for any one of the first game scene and the second game scene, the very resident element in the game scene is a dynamic scene element meeting a condition with respect to one or both of an importance level and a memory occupation amount of the game scene.
In yet another possible implementation, the very resident elements in the game scene are determined by:
determining the importance level of dynamic scene elements in a game scene relative to the game scene and the memory occupation amount of the dynamic scene elements;
determining a first score of the dynamic scene element based on the importance level of the dynamic scene element relative to the game scene, wherein the higher the importance level of the dynamic scene element relative to the game scene is, the higher the first score is;
determining a second score of the dynamic scene element based on the memory occupation amount of the dynamic scene element, wherein the lower the memory occupation amount of the dynamic scene element is, the higher the second score is;
a dynamic scene element having a weighted sum of the first score and the second score less than a set threshold is determined to be a very resident element.
In yet another possible implementation manner, before the obtaining the scene change instruction input by the user, the method further includes:
Obtaining a game starting instruction and information of a plurality of game scenes configured in a game;
respectively constructing a plurality of game scenes in the memory, and starting data processing of scene states of the game scenes;
determining a target game scene belonging to the plurality of game scenes and configured as an initial game scene;
and starting rendering processing of the target game scene so that the target game scene is in a foreground running state and other game scenes except the target game scene are in a background running state.
In still another aspect, the present application further provides a game scene switching device, including:
the switching determining unit is used for obtaining a scene switching instruction input by a user, determining a first game scene currently in a foreground running state in a game and a second game scene to which the scene switching instruction indicates switching, wherein the second game scene is in a background running state;
a first switching control unit configured to control ending of rendering processing of the first game scene and to maintain data processing of a scene state of the first game scene so that the first game scene is in a background running state;
And the second switching control unit is used for controlling and starting the rendering processing of the second game scene so as to switch the second game scene in the background running state into the foreground running state.
In yet another aspect, the present application also provides a computer device, including: the device comprises a processor and a memory, wherein the processor and the memory are connected through a communication bus;
the processor is used for calling and executing the program stored in the memory;
the memory is used for storing a program for implementing the game scene switching method according to any one of the above.
In yet another aspect, the present application further provides a computer readable storage medium having stored thereon a computer program loaded and executed by a processor to implement the game scene switching method according to any one of the above.
As can be seen from the above, when the game scene is switched from the foreground running state to the background running state, the present application controls the rendering process of the game scene to be ended, but maintains the data processing of the scene state of the game scene, so that the game scene can still maintain the latest scene state. On the basis, when the game scene is required to be switched to according to the scene switching instruction input by the user, only the rendering processing of the game scene is required to be controlled to be started, and the game scene is not required to be reconstructed and the scene state is calculated, so that the game scene can be switched more quickly, and the switching efficiency of the game scene is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a game system according to an embodiment of the present application;
FIG. 2 shows a schematic diagram of a selectively switchable game scenario in a game;
FIG. 3 is a schematic flow chart of a method for switching game scenes according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of a game starting method according to an embodiment of the present application;
FIG. 5 is a schematic flow chart of determining a very resident element according to an embodiment of the present application;
FIG. 6 is a schematic flow chart of a method for switching game scenes according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a game scenario with only resident elements loaded, provided in an embodiment of the present application;
FIG. 8 is a schematic illustration of a game scenario with the very resident elements loaded on the basis of FIG. 7;
FIG. 9 is a schematic flow chart of a game scenario configuration in a game development process according to an embodiment of the present application;
FIG. 10 is a schematic flow chart of a method for switching game scenes according to an embodiment of the present application;
FIG. 11 is a schematic diagram of a composition structure of a game scene switching device according to an embodiment of the present application;
fig. 12 is a schematic diagram of another composition structure of a game scene switching device according to an embodiment of the present application;
fig. 13 is a schematic diagram of a composition structure of a computer device according to an embodiment of the present application.
Detailed Description
The scheme of the application is applicable to any game involving switching of game scenes. For example, the scheme of the application can be applied to network games, and the network games can be web games or hand games and the like.
The scheme of the application can reduce the time consumption of switching the game scenes in the game and improve the game scene switching efficiency.
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
For ease of understanding, a game system to which the scheme of the present application is applied will be described.
Fig. 1 is a schematic diagram showing the construction of a game system to which the scheme of the present application is applied.
As can be seen from fig. 1, the game system comprises: a game server 101 and a terminal 102 running a game.
The terminal may be a client where the game application is located, and the game server is a server of the game application.
The terminal can also be the terminal where the browser running the web game is located, and correspondingly, the terminal accesses the game server through the browser and runs the web game in the browser.
The terminal may be a mobile phone, a notebook computer, a desktop computer, or the like, which is not limited.
The game server may have one or more, and in the case where there are a plurality of game servers, the plurality of game servers may constitute a server cluster or a distributed server system, without limitation.
The terminal 102 may establish a communication connection with the game server through a game application or a browser, so as to implement relevant game data in the interactive game running process between the terminal and the game server. For example, the terminal may return operation behavior data or game state data of a game player of the terminal to the game server, or may acquire game screens or game state data of other game players from the game server, or the like, without limitation.
In the present application, a game running on a terminal is configured with a plurality of game scenes.
Accordingly, the game mentioned in the present application may be any of various kinds of games involving switching of game scenes on the terminal side. For example, the Game may be a strategy Game (SLG), which is a Game that is themed to achieve various forms of winning, and which provides a player with an environment that can think about the problem to handle more complex things, allowing the player to freely control, manage and use people or things in the Game, by which the player can achieve the goal required by the Game by means of the freedom and the way the player works against enemies.
The game scene refers to an environment where objects such as people and objects in a game are located, and is usually a virtual scene designed and built by game developers, not a real world scene.
A game scene will typically include a plurality of scene elements, which refer to the individual constituent elements required to make up the game scene. For example, scene elements of a game scene may include: background of the game scene, objects present within the game scene. Depending on the game, the objects presented within the game scene may also differ, e.g., the objects within the game scene may be: game characters, animals, articles, mountains, flowers and plants, and the like.
From the above, different game scenes in the game correspond to different game contents.
It will be appreciated that the game play scenarios of the game may be divided into a main game play scenario and a plurality of common game play scenarios, the main game play scenario being considered as the default initiated game play scenario in the game. For example, after a game is initiated, the game may automatically enter a primary game scene. The main game scene can also be the game scene with the most game content in the game, namely the main line of the game commonly called. The game scenes other than the main game scene may be referred to as a normal game scene. The specific implementation of the switching between the main game scene and the common game scene and the switching between the common game scenes are the same, so that the game scenes can be the main game scene or the common game scene, and the method is not limited.
To facilitate an understanding of switching between game scenarios, a game example is described below.
For example, referring to FIG. 2, a schematic diagram of a selectively switchable game scenario in a game is shown.
In fig. 2, a schematic diagram of a game screen 201 corresponding to a game scene is shown in the game interface. For ease of description. It is assumed that the game screen 201 can be regarded as a game screen of a main game scene of the game. Corresponding to the above. In this primary game scenario, a game player may fight against a plurality of different forces.
In the game screen 201 of the main game scene, scene icons of a plurality of other game scenes are displayed, and as shown in fig. 2, at least: scene icon 202 for the in-city scene, icon 203 for the out-of-city scene.
If the user clicks on the scene icon 202 of the in-city scene, the user switches to the game screen corresponding to the in-city scene, as shown in FIG. 2 as an example diagram 204 of the in-city scene. In an in-city scenario, a game player may perform a related game operation of recruiting horses, preparing grain, etc.
If the user wishes to perform a game operation related to an extraurban scene, the user may click on the icon 203 of the extraurban scene displayed in the main game scene, and as shown in fig. 2, the game may switch from the main game scene to the game screen 205 of the extraurban scene shown in fig. 2, so that the game player may perform the related game operation in the game screen of the extraurban scene. For example, a mine, a town, etc. that all players have in the game may be displayed in an out-of-town scenario, and other players may be robbed for mine, or town, etc. to increase the assets of the game player in the game.
Of course, fig. 2 is merely an illustration, and in practical applications, the number and types of game scenes may also be different according to the games, and accordingly, the number and types of scene icons corresponding to the game scenes may also be different.
It should be noted that the game system of fig. 1 is merely an exemplary illustration, and other possible forms of composition of the game system are possible in practical application, and any scenario involving switching of game play scenes running on the terminal side is applicable to the present application, which is not limited thereto.
Considering that the game scene in the game belongs to a small game scene with fewer scene elements, the requirement on the switching efficiency of the game scene is higher, so that the switching speed of the game scene can be obviously improved by applying the application, and the switching is not perceived.
The game scene switching method of the present application will be described in detail with reference to the following flowcharts.
Fig. 3 shows a flowchart of a game scene switching method according to an embodiment of the present application, where the method of the embodiment is applied to a terminal running a game.
The method of the embodiment can comprise the following steps:
s301, a scene switching instruction input by a user is obtained, and a first game scene currently in a foreground running state in a game and a second game scene to which the scene switching instruction indicates switching are determined.
The scene switching instruction is used for requesting switching of a game scene of a game.
For example, a user may input a scene switching instruction for instructing to switch to a certain game scene clicked by the user to the game by clicking an icon of the certain game scene in the game interface.
The game scene in the foreground running state in the game refers to the game scene in which the game is located, namely the game scene currently output by the game. For example, at a certain moment, a game can only present one game scene, and the game scene presented by the game is the game scene in which the game is located, namely, the game scene in the foreground running state in the application.
For convenience of distinction, when the scene-switching instruction is obtained, a game scene in a foreground running state in the game is referred to as a first game scene, and a game scene to which the scene-switching instruction is requested to be switched is referred to as a second game scene.
S302, control ends rendering processing of the first game scene and maintains data processing of the scene state of the first game scene so that the first game scene is in a background running state.
In the application, for a game scene which does not need to be output in the game, the game scene is controlled to be in a background running state. In the background running state of the game scene, the terminal does not perform rendering related processing on the game scene, but maintains data processing on the scene state of the game scene in the memory.
It is understood that the rendering process of the game scene is to be able to output the picture of the game scene in the game, and therefore, in the case where the game does not need to output the first game scene, the terminal may end the rendering process of the first game scene.
The rendering process of the game scene can include any process related to the display effect of the relevant picture of the game scene.
For example, the rendering process of the game scene includes, in addition to the conventional screen rendering, one or more of rendering process modes such as a game scene illumination rendering process and a post-processing rendering of the game scene.
The illumination rendering process may include, among other things, in-game cameras and light attribute related rendering processes.
Post-Processing (Post-Processing) rendering is a technique that reprocesss a picture after conventional picture rendering. Post-processing (Post-Process Effect) is a technique for reprocessing a rendered picture, which is an important rendering technique in the field of games to improve the presentation quality of a final game picture.
The application still maintains the data processing of the scene state of the game scene under the condition that the game scene is in the background running state so as to keep the game scene in the latest state, and avoid reconstructing the game scene and calculating the scene state of the game scene when the game scene is switched to the game scene again later.
Wherein the data processing of the scene state of the game scene may include processing related to any data state change within the game scene.
It is understood that the scene state of a game scene refers to the accumulation of the influence of each event on the game scene and its scene elements, and the snapshot of data presented at a certain point in time. Thus, the data processing of the scene state of the game scene may include: and processing data related to state change of each element in the game scene, triggering events related to the game scene and the like.
For example, a series of events in a game affect and change the current outcome of data in a game scene in a sequence (e.g., time of occurrence, order of precedence, etc.). Thus, for a game scenario that is running in the processing background, the trigger event associated with the game scenario may be an event outside of the game scenario that can trigger a change in the state of the game scenario.
For example, the data processing of the scene state of the game scene may include: and processing data related to state change of each element in the game scene, triggering events related to the game scene and the like.
The trigger event associated with the game scene may be an event which can trigger the state change of the game scene outside the game scene. For example, if a certain object B in the game scene B is destroyed in the game, a certain object a in the game scene a also loses a skill, and an event of destruction of the device B in the game scene B belongs to a trigger event associated with the scene a, and a change of the skill state of the object a in the game scene a needs to be calculated according to the trigger event.
S303, controlling to start rendering processing of the second game scene so as to switch the second game scene in the background running state to the foreground running state.
It will be appreciated that the second game scenario in which the user selects the switch is one of the game scenarios in the background run state in the game.
Under the condition that the game scene is in the background running state, the terminal still maintains the data processing of the scene state of the game scene in the memory, so that the second game scene is already in the memory and the scene state is the latest scene state, and therefore, the second game scene does not need to be created in the memory again. On this basis, in order to output the game screen of the second game scene at the terminal, it is necessary to start rendering processing of the second game scene to resume the display output of the game screen of the second game scene, and finally make the game present the second game scene.
In one possible implementation, the game may be configured with rendering attribute information of each game scene, where the rendering attribute information may include rendering attributes related to a rendering mode such as illumination rendering and post-processing rendering. On the basis, the second game scene can be rendered based on the rendering attribute information configured by the second game scene.
The inventors of the present application have found that: at present, in the process of switching game scenes, the current game scene of the game is destroyed, and another game scene to be switched to is created in the memory. Thus, each time a switch is made to a game scene, all scene elements in the game scene need to be reconstructed, and the current scene state of the game scene needs to be recalculated, which inevitably takes a long time and affects the game experience of the game player.
When the game scene is switched from the foreground running state to the background running state, the application controls the rendering processing of the game scene to be ended so as to reduce unnecessary calculation expenditure; while maintaining data processing of the scene state of the game scene so that the game scene can still maintain the latest scene state. On the basis, when a certain game scene is required to be switched according to a scene switching instruction input by a user, only the rendering processing of the game scene is required to be controlled, and the game scene is not required to be reconstructed and the scene state is calculated, so that a large amount of concentrated time expenditure during the game scene switching is avoided, the game scene switching can be realized more quickly, the game scene switching efficiency is improved, and further, the game scene switching is not perceived.
In addition, if the current game scene switching mode is adopted, the game scene needs to be reconstructed every time a game scene is switched to, and a large amount of overhead of logic operation is necessarily generated by the terminal in a short time, so that the terminal generates centralized and large amount of performance overhead, and the game switching is blocked. In the application, when switching to a certain game scene, the game scene does not need to be reconstructed, so that the concentrated and large performance cost of the terminal in a short time can be reduced, and the situation of blocking during game switching can be reduced.
It will be appreciated that the game has been initiated and run prior to obtaining the user entered scene change instruction. In the process of starting the game, the game can take a default game scene preset as a game scene which is required to be presented by the game, and the game can load and output the game scene.
In order to improve the game scene switching speed and reduce the situation of clamping in the game switching process, a plurality of game scenes of the game configuration are constructed in the memory at the same time in the game starting process, but only the game scenes which are required to be displayed by default are rendered.
Referring now to fig. 4, a schematic flow chart of game starting in the present application is shown in fig. 4, and the method of this embodiment is applied to a terminal running a game.
The game start process may include the steps of:
s401, obtaining a game starting instruction and obtaining information of a plurality of game scenes configured in a game.
The game starting instruction is used for instructing the terminal to start and load the game.
Wherein the information of the game scene may include information related to the game scene. For example, the information of the game scene at least includes a scene identifier of the game scene, where the scene identifier is used to uniquely identify the game scene.
As another example, the information of the game scene may also include rendering attribute information of the game scene configuration, and so on.
As another example, the information of the game scene may also include information of a function or effect in which the game scene is configured to be turned on, and the like. For example, a global neon effect can be set in the game, in practical application, whether a certain game scene is started or not can be respectively configured according to the needs, and if the game scene is set with the neon effect, the neon effect needs to be presented when the game scene is presented.
It can be understood that if the game is a game application installed on the terminal side, the terminal side can directly obtain information of a game scene configured in the game application. If the game is a game loaded and executed by a browser on the terminal side, information of a plurality of game scenes of the game configuration may also be acquired from the game server side.
S402, respectively constructing a plurality of game scenes in the memory, and starting data processing of scene states of the game scenes.
It will be appreciated that the game scene of the game is created after the game is started, and that creating the game scene is actually loading and running in memory the scene elements involved in the game scene.
It is understood that scene elements in a game scene are divided into static scene elements and dynamic scene elements.
Wherein, the static scene element refers to a scene element inherent in the game scene and not changed along with the operation behavior of a game player, for example, the static scene element in the game scene generally refers to a static element of which the position does not move in the game process, for example, the static scene element can comprise the background of the game scene, the building and the topography inherent in the game scene, and the like.
Dynamic scene elements refer to scene elements that can change (e.g., change in presence or absence of presence, etc.) as a game player's operational behavior in a game scene. For example, dynamic scene elements are generally elements that can interact with a game player in terms of displacement, e.g., dynamic scene elements may include some props, animals, soldiers, etc. that dynamically appear in a game scene as a function of scene state.
Of course, the static scene element and the dynamic scene element in the game scene are not inherent certain types of elements, and in practical application, certain scene elements can be designed as dynamic scene elements or as static scene elements according to requirements.
It will be appreciated that at game start-up, the game scene created at this step may be a static scene element in the created game scene, since the game scene that needs to be presented has not yet been determined and some of the dynamic scene elements in each game scene need not be presented.
In one possible implementation, during the game start-up process, a set of static scene elements in the game may be obtained first, and each static scene element in the set of static scene elements may be loaded in memory. The static scene element is configured with scene identification of at least one game scene to which the static scene element belongs. Each static game scene may belong to one or more game scenes, and thus each static scene element may be configured with a scene identification of at least one game scene.
Correspondingly, for each game scene, determining at least one static scene element belonging to the game scene according to the scene identification of the game scene and the scene identification of at least one game scene configured by each loaded static scene element, and constructing the game scene containing the at least one static scene element in the memory. For example, after each static scene element is loaded in the memory, for a certain game scene, an association relationship between the game scene and each static scene element belonging to the game scene may be established, so as to construct the game scene including at least one static scene element.
Of course, when the game scene is built in the memory, the method further includes setting rendering attribute information of the game scene according to the rendering attribute information configured by the game scene, and of course, the method may also include initializing the game scene, and the like, which is not limited.
The specific process of starting the data processing of the scene state of the game scene and the purpose thereof can be referred to the related description of the previous embodiment, and will not be described herein.
S403, determining a target game scene which belongs to the plurality of game scenes and is configured as an initial game scene.
The initial game scene refers to a game scene which is configured to be displayed by default after the game is started.
S404, starting rendering processing of the target game scene so that the target game scene is in a foreground running state and other game scenes except the target game scene are in a background running state.
It can be understood that, on the premise that the data processing on the scene state of the target game scene is started, the rendering processing on the target game scene is started, so that the game can output the target game scene, and the user of the terminal can see the target game scene presented by the game and perform game operation behaviors in the target game scene.
For other game fields which are built in the memory of the terminal but do not start rendering processing in the game, the other game fields are only processing for maintaining the scene states in the memory of the terminal, so that the switching of the game scenes can be realized as soon as possible when the game scenes are switched.
In one possible implementation, the obtained information of the game scenes may include rendering attribute information of each game scene. Accordingly, the terminal can start rendering processing of the game scene according to the rendering attribute information of the target game scene.
Therefore, in the process of starting the game, each game scene of the game configuration is created in the memory at the same time, and the data processing of the scene states of a plurality of game scenes is maintained, but only the target game scene needing to be presented in the game is rendered, so that on the premise of ensuring the normal presentation of the target game scene, each game scene can be maintained to be in the latest scene state, and the follow-up realization of switching the target game scene into other game scenes except the target game scene more efficiently is facilitated.
It will be appreciated that in a game scenario in a foreground run state, some dynamic scenario elements will be dynamically loaded in the game scenario based on the user's game interaction behavior. If there are more dynamic scene elements in the game scene, after the game scene is switched from the foreground running state to the background running state, data processing on the relevant states of the dynamic scene elements in the game scene still needs to be maintained in the memory, so that the performance consumption of the terminal is larger.
On the basis, in order to further reduce the performance consumption of the terminal, at least part of dynamic scene elements in the game scene can be configured into very resident elements in advance according to the actual requirements of the game scene. The non-resident element refers to a scene element which is not required to be maintained in a memory in the game scene in the background running state, so that the non-resident element belongs to a preconfigured dynamic scene element which can be destroyed in the background running state of the game scene.
Correspondingly, when the game scene is switched to the background running state, the resident elements belonging to the game scene in the memory can be destroyed.
The scene element configured as the very resident element in the game scene may be a scene element meeting the set condition.
For example, in one possible implementation, considering that some scene elements with lower importance in the game scene have less influence on the scene state change of the game scene, the dynamic scene elements with importance levels meeting the conditions with respect to the game scene in the game scene may be determined as the very resident elements. For example, a dynamic scene element in a game scene that is configured as a very resident element is a dynamic scene element having an importance level lower than a set level with respect to the game scene.
In another possible implementation manner, considering that more memory space is occupied by the dynamic scene elements in the game scene, excessive performance consumption may be caused, so that the dynamic scene elements with memory occupation meeting the condition in the game scene can be configured as very resident elements. For example, a very resident element in a game scene refers to a dynamic scene element whose memory usage exceeds a set threshold.
Of course, in practical application, the very resident elements in the game scene may also be dynamic scene elements meeting the conditions with respect to the importance level and the memory occupation amount of the game scene. For example, a very resident element in a game scene is a dynamic scene element with an importance level below a set threshold and a memory footprint exceeding the set threshold.
As shown in FIG. 5, which illustrates a flow chart of one implementation of determining very resident elements in a game scene in the present application, the present embodiment may include:
s501, determining the importance level of a dynamic scene element in a game scene relative to the game scene and the memory occupation amount of the dynamic scene element.
The importance level of the dynamic scene element in the game scene can be defined according to the game content, for example, the importance level of the dynamic scene element can be determined according to the game content, and the importance level of the dynamic scene element can exist as one attribute information of the dynamic scene element.
The memory occupation amount of the dynamic scene element can be obtained according to the historical running state test, or can be obtained in other modes, and the method is not limited.
S502, determining a first score of each dynamic scene element in the game scene based on the importance level of the dynamic scene element relative to the game scene.
Wherein the higher the importance level of the dynamic scene element relative to the game scene, the higher the first score.
S503, determining a second score of the dynamic scene element based on the memory occupation amount of the dynamic scene element.
The lower the memory occupation amount of the dynamic scene element, the higher the second score of the dynamic scene element.
S504, determining the dynamic scene element with the weighted sum of the first score and the second score smaller than the set threshold value as the very resident element.
If the importance level corresponds to the first weight coefficient and the memory occupancy corresponds to the second weight coefficient, a first product of the first score and the first weight coefficient and a second product of the second score and the second weight coefficient are calculated, and the sum of the first product and the second product is a weighted sum of the first score and the second score.
If the weighted sum corresponding to a dynamic scene element in the game scene is smaller than a set threshold value, the importance degree of the dynamic scene element relative to the game scene is lower, and the memory occupation amount is higher.
For example, assume that dynamic scene elements in a game scene can be classified into 10 importance levels, namely level 1 to level 10, where level 1 represents the lowest importance level and level 10 represents the highest importance level. Meanwhile, the memory occupation amount of the dynamic scene element can be divided into four gears, namely a low gear, a medium gear, a high gear and an ultra-high gear, wherein the low gear represents the lowest memory occupation amount, and the ultra-high gear represents the highest memory occupation amount.
Correspondingly, scores corresponding to different importance levels and scores corresponding to gears with different memory occupation amounts can be set.
The first score corresponding to the importance level is assumed to be the importance level, and if the importance level is 5, the score of the importance level is 5. Similarly, the fraction of the memory corresponding to the gear is a second fraction, for example, the second fraction corresponding to the low gear may be 10, the second fraction corresponding to the medium gear is 7.5, the fraction corresponding to the high gear is 5, and the fraction corresponding to the high gear is 2.5.
Meanwhile, it is assumed that the first weight coefficient corresponding to the importance level is 0.8, and the second weight coefficient corresponding to the memory occupation amount is 0.2.
On the basis, the scores of the dynamic scene elements can be calculated according to the importance level and the memory occupation amount of the dynamic scene elements in the game scene, and the scores are as follows: the first fraction corresponding to the importance level is 0.8+the second fraction corresponding to the gear of the memory occupation amount is 0.2. It can be seen that scores within 10 are provided.
If the score of the dynamic scene element is not lower than 8 points, the dynamic scene element belongs to a resident element which is not destroyed in a background running state; and if the score of the dynamic scene element is below 8 points, the dynamic scene element will be configured as a very resident element.
Of course, this is merely illustrative, and there may be other ways to determine the very resident elements in combination with the importance level and memory footprint of the dynamic scene elements in the game scene, which is not limited.
It can be understood that under the condition that the game scene is switched to the background running state, the data processing on the scene state of the game scene is maintained, meanwhile, the resident elements in the memory are destroyed, and the resident elements are kept in the memory, so that the scene switching time required for subsequently re-switching the game scene to the foreground running state can be reduced, the performance consumption of the terminal can be reduced, and the performance consumption of the terminal and the time consumption of the game scene switching are both considered.
To facilitate an understanding of this benefit, the following description is provided in connection with FIG. 6. Fig. 6 is a schematic flow chart of another embodiment of a game scenario switching method provided by the present application, where the method of the present embodiment is applied to a terminal.
The method of the embodiment can comprise the following steps:
s601, a scene switching instruction input by a user is obtained, and a first game scene currently in a foreground running state in a game and a second game scene to which the scene switching instruction indicates switching are determined.
The second game scene is in a background running state when a scene switching instruction is received.
S602, controlling to end rendering processing of a first game scene and maintain data processing of scene states of the first game scene, and destroying at least one first scene element which is loaded in the first game scene and is configured as a very resident element so that the first game scene is in a background running state;
wherein, the very resident elements in the first game scene belong to dynamic scene elements in the game, and the specific description can be referred to above, and will not be repeated here.
Destroying the first scene element refers to clearing the first scene element in the first game scene in the memory, and releasing the memory space occupied by the first scene element.
By destroying the first scene element, not only occupied memory resources can be reduced, but also resources consumed by the terminal for calculating the element state of the first scene element can be reduced, so that the performance consumption of the terminal can be reduced.
In one possible implementation manner, a scene element of the game scene may be configured with an element attribute, and tag information of whether the scene element belongs to a very resident element may be recorded in the element attribute, so that whether the dynamic scene element belongs to the very resident element may be determined according to the tag information of the dynamic scene element.
Ending the rendering process of the first game scene can reduce the performance consumption, and can avoid outputting the scene picture of the first game scene.
S603, control starts the rendering process of the second game scene to switch the second game scene in the background running state to the foreground running state.
In the application, after the rendering processing of the second game scene is started, the game picture of the second game scene is output, so that the game presents the second game scene, and the second game scene is in a foreground running state.
S604, at least one second scene element to be loaded and configured as a very resident element in the second game scene is determined.
For example, a non-resident element in the second game scene that needs to be loaded and has not been loaded into memory may be determined from a scene state of the second game scene.
The order of the steps S604 and S603 is not limited to that shown in fig. 6, and in practical application, the steps may be performed simultaneously.
S605, the at least one second scene element is created for the second game scene.
Wherein, creating the second scene element for the second game scene refers to loading and running the second scene element belonging to the second game scene in the memory.
Therefore, in the process of switching from the first game scene to the second game scene, the application can end the rendering processing of the first game scene so as to reduce the calculation cost caused by the rendering processing. In addition, while maintaining the data processing of the scene state of the first game scene, the resident elements with lower importance degree or larger memory occupation amount in the first game scene are destroyed, so that the performance cost of the terminal is further reduced.
When the second game scene is switched to the foreground running state, the resident element to be loaded in the second game scene is created in the memory again according to the scene state, so that when the resident element is needed, the resident element is created again, and the integrity of relevant logic such as the scene state of the second game scene is ensured. While less performance overhead and relatively less time-consuming is required to create only a portion of the very resident elements to be loaded relative to reconstructing the second game scenario.
It will be appreciated that if there are many very resident elements to be created in the second game scene to be switched to, then creating these very resident elements collectively will necessarily also incur a lot of time consumption, resulting in slow switching of game scenes and possibly a lot of performance overhead concentrated in a short time.
In an optional implementation manner, in order to further reduce time consumption and centralized performance consumption caused by creating the resident elements in the game scene switching process, the application can also implement frame creation of each resident element in an asynchronous loading manner, specifically:
each time a frame of the second game scene is output, a second scene element is created for the second game scene until at least one second scene element in the second game scene is created.
Wherein creating a second scene element for a second game scene refers to loading the second game element into memory.
The application adopts an asynchronous loading mode to realize that only one second scene element is loaded on each frame of the second game scene picture, so that the time cost and the performance cost required by creating each very resident element in the second game scene can be shared to the multi-frame second game scene picture output after the game scene is switched, a great deal of time cost and performance cost caused by creating a plurality of very resident elements in one frame of game scene picture are avoided, and the time cost and the performance cost consumed by creating the very resident elements are avoided being intensively generated at one moment of the game scene switching, thereby being beneficial to improving the game scene switching efficiency and reducing the intensive great deal of performance cost.
For example, as shown in fig. 7 and 8, fig. 7 shows a schematic diagram of a game scene containing only resident elements after switching, and fig. 8 shows a schematic diagram of a game scene after creating the required various resident elements on the basis of fig. 7.
As shown in FIG. 7, after the game is switched to the game scenario shown in FIG. 7, resident elements in the game scenario are loaded and presented, such as in FIG. 7, the resident elements may include at least a terrain structure 701 and a background element 702. Since the memory of the resident element is small and the effect on the picture of the game scene is large, the resident element needs to be presented immediately when the game enters the game scene. Meanwhile, in the case that the game scene is switched to the background running state, the resident elements still remain running in the memory.
As the frames of the game scene in fig. 7 are output frame by frame, the various elements that are not resident in the game scene are also loaded into memory and presented into the frames of the game scene, as shown in fig. 8. The screen of the game scene of fig. 8 may include a game character 803 or the like as a very resident element in addition to the resident elements such as the topographic structure 801 and the background element 802.
It will be appreciated that the game run by the terminal may include a scene manager of the game, which is a scene manager program for comprehensively managing respective game scenes in the game. The scene manager can control loading, switching and the like of the game scene.
In an alternative manner, a game scene controller for controlling the operation of the game scene can be configured for each game scene in the game of the application, and the game scene controller is a game scene control program corresponding to the game scene. Accordingly, the game scene controller may control the controller of the scene manager to start creation of the game scene, start or end rendering processing of the game scene, and the like.
In the game development process, the relevant configuration of the game scene can be realized by configuring the game scene controller corresponding to the game scene.
For ease of understanding, a flow diagram of the game scenario configuration of the present application is shown in fig. 9, which is a related configuration flow executed in the game development process. The process may include:
s901, obtaining first configuration information configured for a game scene.
For convenience of distinction, the present application refers to configuration information configured for a game scene as first configuration information, and configuration information configured for a game scene controller corresponding to a game scene later as second configuration information.
Wherein the first configuration information may include information related to the game scene construction and display.
For example, the first configuration information of the game scene may include some or all of a name of the game scene, a scene identification of the game scene, rendering attribute information of the game scene, and a switch configuration result of at least one function switch.
The rendering attribute information of the game scene is attribute information related to illumination rendering or post-processing rendering in the game scene. For example, the rendering attribute information of the post-processing rendering may include attribute information that controls display effects such as rain, fog, or shadow in the game.
Wherein the function switches are used for controlling a game scene to be used for controlling a function to be started or stopped in the game scene, each function switch is used for controlling a function, and the function can be an effect function or a responsive behavior function in the game scene. The switch configuration result of the function switch represents whether to start the function corresponding to the function switch in the game scene.
It can be understood that, in the game development process, the game development computer can provide a configuration interface of the game scene, and an input box or a selection field of a plurality of configuration items related to the game scene can be displayed in the configuration interface of the game scene, and accordingly, a game developer can perform configuration of the related configuration items on the configuration interface, so that the game development computer can obtain the first configuration information.
S902, obtaining second configuration information configured for a game scene controller corresponding to the game scene, and obtaining a configuration file containing the first configuration information and the second configuration information.
It will be appreciated that the game scene controller is a program to be developed for creating the game scene and controlling the operation of the game scene, and therefore, in order to be able to generate a script of the game scene controller, a developer is required to configure data information related to the game scene controller, that is, second configuration information.
For example, the second configuration information may be related information that is outside the first configuration information and is managed for the game scene. Of course, in practical applications, in the case that some special customization information is not required to be configured for the game scene, the second configuration information may not be configured, so that the configuration file only includes the first configuration information.
S903, generating a game scene control script of the game scene controller based on the configuration file.
The game scene control script of the game scene controller is actually a script forming the game scene controller, and the function of the game scene controller can be realized by running the game scene control script after the game is started.
A game scene control script that can be used to construct and manage the virtual scene can be generated based on the configuration file, and the specific process of generating the game scene control script from the configuration file is not limited by the present application. For example, a script generation option can be provided on the game development computer, and after the developer triggers the script generation option, the game development computer can be triggered to generate the game scene control script in combination with the configuration file, so that the one-key generation of the game scene control script is realized.
S904, element attribute information configured for each scene element in the game scene is obtained.
The element attribute information of the scene element may include one or two of a scene identifier of a game scene to which the scene element belongs, and tag information of the scene element. The marking information of the scene element is used for representing whether the scene element belongs to the marking information of the very resident element in the game scene to which the scene element belongs.
For example, for static scene elements, the element attribute information may include only scene identification, while for dynamic scene elements, the tag information may also need to be included.
It should be understood that fig. 9 is only one implementation manner of configuring relevant information such as a game scene controller and scene elements of a game scene, and other manners of configuring relevant information of a game scene may be used in practical applications, which is not limited to this application.
The game scene switching method of the present application will be described below taking an example in which a game scene creation and switching are implemented by a game scene controller that controls each game scene through a scene manager.
Fig. 10 is a schematic flow chart illustrating another implementation of a game scenario switching method according to an embodiment of the present application, where the method of the present embodiment may include:
s1001, obtaining a game starting instruction and starting a game scene manager.
S1002, a scene manager obtains a static scene element set in a game, and loads each static scene element in the static scene set in a memory.
The static scene element is configured with scene identification of at least one game scene to which the static scene element belongs.
S1003, starting, by the scene manager, a game scene controller of each of a plurality of game scenes configured in the game, and instructing each game scene controller to create a game scene.
S1004, the game scene controller determines at least one static scene element belonging to the game scene according to the scene identification of the configured game scene and the scene identification of at least one game scene configured by each static scene element loaded in the memory, and establishes the association relationship between the at least one static scene element and the game scene so as to establish the game scene.
For example, the game scene controller may maintain a container of the game scene in the memory, and then add the at least one static scene element into the container corresponding to the game scene, so as to complete the association relationship between the at least one game scene element and the game scene.
It can be understood that the game scene controller implements the related operations such as creating the above game scene by running the game scene control script, which will not be described herein.
S1005, the game scene controller sets rendering attribute information of its corresponding game scene, and controls to start data processing of the scene state of the game scene.
For example, the game scene controller may set relevant rendering attribute information, such as rendering attribute information of relevant rendering modes of illumination, camera, post-processing, and the like, according to the configured rendering attribute information of the game scene.
In one possible scenario, where a state computation process responsible for scene state computation may be running in the game, the game scene controller may instruct the state computation process to initiate and maintain relevant computation of the scene state of the game scene.
Of course, as can be seen from the foregoing embodiment of fig. 9, in the game scene control script of the game scene controller, besides the scene identifier and the rendering attribute information of the game scene, there may be other information such as the switch configuration result of the function switch, and accordingly, the game scene controller may also control the creation of the game scene based on the switch configuration result of the function switch during the process of creating the game scene, and specifically, the creation of the relevant game scene may be performed according to the actual situation, which is not limited.
S1006, the scene manager determines a target game scene configured as an initial game scene among the plurality of game scenes.
S1007, the scene controller instructs the game scene controller corresponding to the target game scene to switch the target game scene to the foreground running state, so that other game scenes except the target game scene are in the background running state.
It will be appreciated that although the creation of the game scene in step S1004 above refers only to the construction of static scene elements in the game scene, after the game scene is run, the game scene also constructs some dynamic game elements in real time as the scene state of the game scene changes.
S1008, the game scene controller of the target game scene controls and starts the rendering process of the target game scene according to the configured rendering attribute information of the game scene so that the target game scene is in a foreground running state.
In one possible implementation, a rendering process may be run in the game, through which the rendering process of the game scene is completed. Accordingly, the game scene controller of the target game scene may instruct the rendering process to start the rendering process of the target game scene, and output the picture of the rendered target game scene.
S1009, the scene manager obtains the scene switching instruction input by the user, and determines the first game scene currently in the foreground running state in the game and the second game scene to which the scene switching instruction indicates switching.
It is to be understood that this step S1009 may be performed after the game is started and when the scene switching instruction is received, and accordingly, if the game scene where the game is currently located is still the target game scene configured as the initial game scene, the first game scene is the target game scene. If the target game scene has been switched to another game scene before the current moment, the first game scene is outside the target game scene and belongs to the game scene presented by the current game.
S1010, the scene manager instructs a first game scene controller corresponding to the first game scene to switch the first game scene from a foreground operation state to a background operation state, and instructs a second game scene controller corresponding to the second game scene to switch the second game scene from the background operation state to the foreground operation state.
S1011, the first game scene controller controls the rendering process of the first game scene to be ended, destroys the very resident elements in the first game scene in the memory, and maintains the data processing of the scene state of the first game scene so that the first game scene is in a background running state.
For example, the first game scene controller instructs the rendering process to end rendering of the first game scene or the like, but does not instruct the state processing process to end data processing of the scene state of the first game scene to maintain the data processing of the scene state of the first game scene.
S1012, the second game scene controller controls the start of rendering processing of the second game scene to switch the second game scene from the background operation state to the foreground operation state.
The second game scene controller determines at least one resident element to be created according to the scene state of the second game scene, and creates a second scene element for the second game scene each time a frame of the second game scene is output until the at least one second scene element is created.
In this embodiment, the scene controller may control creation and switching of the game scene through the game scene controller of the game scene, so that control of the game scene can be more efficiently and reasonably implemented.
Corresponding to the game scene switching method, the application also provides a game scene switching device.
As shown in fig. 11, which shows a schematic view of a composition structure of a game scene switching device of the present application, the device may be applied to the aforementioned terminal, and the device may include:
a switching determining unit 1101, configured to obtain a scene switching instruction input by a user, determine a first game scene currently in a foreground running state in a game and a second game scene to which the scene switching instruction indicates switching, where the second game scene is in a background running state;
a first switching control unit 1102 configured to control ending of rendering processing of the first game scene and maintaining data processing of a scene state of the first game scene so that the first game scene is in a background running state;
the second switching control unit 1103 is configured to control and start rendering processing of the second game scene, so as to switch the second game scene in the background running state to the foreground running state.
In one possible implementation, the method further includes:
the element destroying unit is used for destroying at least one first scene element which is loaded in the first game scene and is configured as a very resident element while the first switching control unit maintains the data processing of the scene state of the first game scene, and the very resident element belongs to a dynamic scene element in the game;
an element determination unit configured to determine at least one second scene element to be loaded and configured as a very resident element in the second game scene after the second switching control unit controls the start of the rendering process of the first game scene;
an element creation unit for creating the at least one second scene element for the second game scene.
In one alternative, the element creation unit includes:
an element asynchronous construction unit is used for creating a second scene element for the second game scene each time a frame of picture of the second game scene is output until the at least one second scene element in the second game scene is created.
In one possible implementation, for any one of the first game scene and the second game scene, the very resident element in the game scene is a dynamic scene element meeting the condition of one or both of an importance level and a memory occupation amount relative to the game scene.
In one possible implementation, the very resident elements in the game scene are determined by:
determining the importance level of a dynamic scene element in a game scene relative to the game scene and the memory occupation amount of the dynamic scene element;
determining a first score of the dynamic scene element based on the importance level of the dynamic scene element relative to the game scene, wherein the higher the importance level of the dynamic scene element relative to the game scene is, the higher the first score is;
determining a second score of the dynamic scene element based on the memory footprint of the dynamic scene element, wherein the lower the memory footprint of the dynamic scene element is, the higher the second score is;
a dynamic scene element having a weighted sum of the first score and the second score less than a set threshold is determined to be a very resident element.
As shown in fig. 12, which shows still another schematic structural diagram of the game scene switching device of the present application, the device of this embodiment is different from the previous embodiment of the scene switching device in that: the present embodiment includes, in addition to the units of the switching determination unit 1101, the first switching control unit 1102, the second switching control unit 1103, and the like, the following:
A start triggering unit 1104 for obtaining a game start instruction and information of a plurality of game scenes configured in the game before the scene switching instruction input by the user is obtained by the switching determining unit;
a scene construction unit 1105, configured to construct the plurality of game scenes in the memory, and start data processing on scene states of the plurality of game scenes;
a scene determination unit 1106 for determining a target game scene belonging to the plurality of game scenes, the target game scene being configured as an initial game scene;
a scene state control unit 1107 for starting rendering processing of the target game scene so that the target game scene is in a foreground running state and so that other game scenes than the target game scene are in a background running state.
In an alternative manner, the information of the plurality of game scenes obtained by the starting triggering unit includes: scene identification of a plurality of game scenes configured in a game and rendering attribute information of each of the plurality of game scenes;
the scene construction unit includes:
the static loading unit is used for obtaining a static scene element set in the game and loading each static scene element in the static scene set in the memory, wherein the static scene element is configured with a scene identifier of at least one game scene to which the static scene element belongs;
The scene element association unit is used for determining at least one static scene element belonging to each game scene according to the scene identifier of the game scene and the scene identifier of at least one game scene configured by each loaded static scene element, and constructing the game scene containing the at least one static scene element in the memory;
a processing start unit for starting data processing of scene states of the plurality of game scenes;
the scene state control unit is specifically configured to, when starting the rendering process of the target game scene, start the rendering process of the game scene according to the rendering attribute information of the target game scene.
As shown in fig. 13, which is a block diagram of one implementation manner of a computer device provided by an embodiment of the present application, the computer device may be the aforementioned terminal, and the computer device may include:
a memory 1301 for storing a program;
the processor 1302 is configured to call and execute a program stored in the memory, and the program is specifically configured to execute the game scene switching method provided in any one of the foregoing embodiments.
The processor 1302 may be a central processing unit CPU or a specific integrated circuit ASIC (Application Specific Integrated Circuit).
The computer device may also include a communication interface 1303 and a communication bus 1304, where the memory 1301, the processor 1302, and the communication interface 1303 communicate with each other via the communication bus 1304.
The embodiment of the present application further provides a readable storage medium, on which a computer program is stored, where the computer program is loaded and executed by a processor, to implement each step of the above game scene switching method, and a specific implementation process may refer to descriptions of corresponding parts of the above embodiment, which is not repeated in this embodiment.
The application also proposes a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the above aspect of the game scene switching method or the aspect of the game scene switching device, and the specific implementation process may refer to the description of the above corresponding embodiment, which is not repeated.
The above describes in detail a game scene switching method, apparatus, computer device and storage medium provided by the present application, and specific examples are applied to illustrate the principles and embodiments of the present application, where the above examples are only used to help understand the method and core ideas of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
It is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include, or is intended to include, elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A game scene switching method, comprising:
acquiring a scene switching instruction input by a user, and determining a first game scene currently in a foreground running state in a game and a second game scene to which the scene switching instruction indicates switching, wherein the second game scene is in a background running state;
controlling to finish rendering processing of the first game scene and maintain data processing of scene states of the first game scene so that the first game scene is in a background running state, and destroying at least one first scene element loaded in the first game scene and configured as a very resident element, wherein the very resident element refers to a scene element which does not need to be maintained in a memory in the game scene in the background running state, and belongs to a dynamic scene element in a game;
And controlling to start rendering processing of the second game scene so as to switch the second game scene in a background running state into a foreground running state, determining at least one second scene element which is to be loaded in the second game scene and is configured as a very resident element, and creating the at least one second scene element for the second game scene.
2. The method of claim 1, wherein the creating the at least one second scene element for the second game scene comprises:
one second scene element is created for the second game scene each time one frame of the second game scene is output until the at least one second scene element in the second game scene is created.
3. The method of claim 1, wherein for any one of the first game scene and the second game scene, the very resident elements in the game scene are dynamic scene elements that satisfy a condition with respect to one or both of an importance level and a memory footprint of the game scene.
4. A method according to claim 3, wherein the non-resident elements in the game scene are determined by:
Determining the importance level of dynamic scene elements in a game scene relative to the game scene and the memory occupation amount of the dynamic scene elements;
determining a first score of the dynamic scene element based on the importance level of the dynamic scene element relative to the game scene, wherein the higher the importance level of the dynamic scene element relative to the game scene is, the higher the first score is;
determining a second score of the dynamic scene element based on the memory occupation amount of the dynamic scene element, wherein the lower the memory occupation amount of the dynamic scene element is, the higher the second score is;
a dynamic scene element having a weighted sum of the first score and the second score less than a set threshold is determined to be a very resident element.
5. The method of claim 1, further comprising, prior to said obtaining the user-entered scene change instruction:
obtaining a game starting instruction and information of a plurality of game scenes configured in a game;
respectively constructing a plurality of game scenes in the memory, and starting data processing of scene states of the game scenes;
determining a target game scene belonging to the plurality of game scenes and configured as an initial game scene;
And starting rendering processing of the target game scene so that the target game scene is in a foreground running state and other game scenes except the target game scene are in a background running state.
6. The method of claim 5, wherein obtaining information for a plurality of game scenes configured in a game comprises:
obtaining scene identifiers of a plurality of game scenes configured in a game, and rendering attribute information of each of the plurality of game scenes;
the building the game scenes in the memory respectively comprises the following steps:
acquiring a static scene element set in a game, and loading each static scene element in the static scene element set in a memory, wherein the static scene element is configured with scene identifiers of at least one game scene to which the static scene element belongs;
for each game scene, determining at least one static scene element belonging to the game scene according to the scene identification of the game scene and the scene identification of at least one game scene configured by each loaded static scene element, and constructing the game scene containing the at least one static scene element in a memory;
The starting the rendering process of the target game scene comprises the following steps:
and starting the rendering processing of the game scene according to the rendering attribute information of the target game scene.
7. A game scene switching device, characterized by comprising:
the switching determining unit is used for obtaining a scene switching instruction input by a user, determining a first game scene currently in a foreground running state in a game and a second game scene to which the scene switching instruction indicates switching, wherein the second game scene is in a background running state;
a first switching control unit configured to control ending of rendering processing of the first game scene and to maintain data processing of a scene state of the first game scene so that the first game scene is in a background running state;
the element destroying unit is used for destroying at least one first scene element loaded and configured as a very resident element in the first game scene while the first switching control unit maintains data processing on the scene state of the first game scene, wherein the very resident element refers to the scene element which does not need to be maintained in an internal memory in the game scene when the game scene is in a background running state, and the very resident element belongs to a dynamic scene element in the game;
A second switching control unit for controlling the rendering process of the second game scene to be started so as to switch the second game scene in the background running state to the foreground running state;
an element determination unit configured to determine at least one second scene element to be loaded and configured as a very resident element in the second game scene after the second switching control unit controls starting of rendering processing of the second game scene;
an element creation unit for creating the at least one second scene element for the second game scene.
8. A computer device, comprising: the device comprises a processor and a memory, wherein the processor and the memory are connected through a communication bus;
the processor is used for calling and executing the program stored in the memory;
the memory is configured to store a program for implementing the game scene switching method according to any one of claims 1 to 6.
9. A computer-readable storage medium, having stored thereon a computer program, the computer program being loaded and executed by a processor, implementing the game scene switching method according to any of claims 1-6.
CN202110500077.5A 2021-05-08 2021-05-08 Game scene switching method, game scene switching device, computer equipment and storage medium Active CN113082705B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110500077.5A CN113082705B (en) 2021-05-08 2021-05-08 Game scene switching method, game scene switching device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110500077.5A CN113082705B (en) 2021-05-08 2021-05-08 Game scene switching method, game scene switching device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113082705A CN113082705A (en) 2021-07-09
CN113082705B true CN113082705B (en) 2023-09-15

Family

ID=76664648

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110500077.5A Active CN113082705B (en) 2021-05-08 2021-05-08 Game scene switching method, game scene switching device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113082705B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113546408A (en) * 2021-07-26 2021-10-26 网易(杭州)网络有限公司 Game scene processing method, device, equipment, medium and program product

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102982159A (en) * 2012-12-05 2013-03-20 上海创图网络科技发展有限公司 Three-dimensional webpage multi-scenario fast switching method
CN103729558A (en) * 2013-12-26 2014-04-16 北京像素软件科技股份有限公司 Scene change method
CN104268104A (en) * 2014-10-10 2015-01-07 重庆邮电大学 Game development memory control method and system
CN106502670A (en) * 2016-10-20 2017-03-15 网易(杭州)网络有限公司 A kind of scene of game changing method and device
CN107577537A (en) * 2017-09-06 2018-01-12 广东欧珀移动通信有限公司 Resource allocation method and Related product
WO2019199848A1 (en) * 2018-04-10 2019-10-17 Google Llc Memory management in gaming rendering
CN110377527A (en) * 2018-04-13 2019-10-25 华为技术有限公司 A kind of method and relevant device of memory management
CN110990100A (en) * 2019-11-29 2020-04-10 珠海豹趣科技有限公司 Method and device for processing node object in game scene
CN112739432A (en) * 2018-10-09 2021-04-30 深圳市欢太科技有限公司 Game control method and related product

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6576023B2 (en) * 2014-08-13 2019-09-18 コナミゲーミング インコーポレーテッド Gaming machine, game providing method and program

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102982159A (en) * 2012-12-05 2013-03-20 上海创图网络科技发展有限公司 Three-dimensional webpage multi-scenario fast switching method
CN103729558A (en) * 2013-12-26 2014-04-16 北京像素软件科技股份有限公司 Scene change method
CN104268104A (en) * 2014-10-10 2015-01-07 重庆邮电大学 Game development memory control method and system
CN106502670A (en) * 2016-10-20 2017-03-15 网易(杭州)网络有限公司 A kind of scene of game changing method and device
CN107577537A (en) * 2017-09-06 2018-01-12 广东欧珀移动通信有限公司 Resource allocation method and Related product
WO2019199848A1 (en) * 2018-04-10 2019-10-17 Google Llc Memory management in gaming rendering
CN110377527A (en) * 2018-04-13 2019-10-25 华为技术有限公司 A kind of method and relevant device of memory management
CN112739432A (en) * 2018-10-09 2021-04-30 深圳市欢太科技有限公司 Game control method and related product
CN110990100A (en) * 2019-11-29 2020-04-10 珠海豹趣科技有限公司 Method and device for processing node object in game scene

Also Published As

Publication number Publication date
CN113082705A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
US8113959B2 (en) Method and system for rendering the scenes of a role playing game in a metaverse
CN108499103B (en) Scene element display method and device
CN109794064A (en) Interact plot implementation method, device, terminal and storage medium
CN112988400B (en) Video memory optimization method and device, electronic equipment and readable storage medium
WO2022089189A1 (en) Interactive plot jump method, interactive plot interface display method and apparatus, and device
CN104063240B (en) A kind of map-indication method and device
CN113209633A (en) Mirror image processing method and device, electronic equipment and readable storage medium
CN113082694B (en) Game mode switching method and device and electronic equipment
JP2010524081A (en) Local theme settings for remote applications
CN113663325B (en) Team creation method, joining method, device and storage medium in virtual scene
KR102610422B1 (en) Method and apparatus, device, and storage medium for processing avatar usage data
CN110047123A (en) A kind of map rendering method, device, storage medium and computer program product
CN114185508B (en) Method for left-right screen splitting on Linux compatible android system
CN113082705B (en) Game scene switching method, game scene switching device, computer equipment and storage medium
CN110928397B (en) User interface refreshing method and device, storage medium and electronic device
CN104104645A (en) Cross-platform resource management method and system
CN114443945A (en) Display method of application icons in virtual user interface and three-dimensional display equipment
US8992330B1 (en) System and method for facilitating data model substitutions for pre-existing data objects
CN106534227B (en) Method and apparatus for extending distributed consistency services
US20230088206A1 (en) Method and apparatus for controlling virtual object, device, storage medium, and program product
CN114669052A (en) Game control method, device, equipment and storage medium
CN114237903A (en) Memory allocation optimization method, memory allocation optimization device, electronic equipment, memory allocation optimization medium and program product
CN114130022A (en) Method, apparatus, device, medium, and program product for displaying screen of virtual scene
CN113144606A (en) Skill triggering method of virtual object and related equipment
CN117076143B (en) Equipment resource processing method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40048770

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant