Checkpoint progress bar loading method, device, equipment, medium and product
By loading level resources asynchronously and calculating real-time progress bars, the problem of level progress bars in Unreal Engine 5 is solved, achieving more accurate loading feedback and better user experience.
Patent Information
- Application Number
- CN202411066464.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-12-06
AI Technical Summary
In Unreal Engine 5, the level progress bar display is not smooth due to resource load blockage, and cannot accurately reflect the load progress, resulting in poor user experience.
By loading the level resource file asynchronously before entering the level, and calculate the real-time loading progress based on the loaded amount and the weight of the resource file, divide the progress bar into multiple intervals, each interval has different display progress rules, and adjust the loading speed to Improve user experience.
It solves the problem of level progress bar display not smoothly, provides more accurate load progress feedback, reduces users' waiting anxiety, and improves user experience.
Smart Images

Figure CN119075318A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of resource loading, and in particular to a level progress bar loading method, device, equipment, medium and computer program product. Background Art
[0002] The development history of progress bar loading technology in games can be traced back to the early stages of the development of electronic games. With the continuous advancement of game technology and the continuous improvement of player experience, progress bar loading technology is also constantly developing and evolving.
[0003] In early console and PC games, due to hardware limitations and limited technical levels, the loading time of games was usually long. In order to give players a clear waiting feedback, progress bars came into being. These progress bars are usually presented in the form of simple text or graphics, and the loading instructions are usually very simple, such as simple text prompts such as "Loading...", "Now Loading", flashing cursors or static images. Since there is no clear time estimate, users can only wait passively, lacking visual feedback and interaction.
[0004] With the improvement of graphics processing technology and the complexity of game content, the loading time of games has become longer. In order to optimize the waiting experience of players, developers began to pay attention to the design and presentation of progress bars. 2D or simple 3D progress bars began to appear in games. They are usually presented as a horizontal or vertical bar filled with color, which gradually fills up as the data is loaded, intuitively showing the loading progress. The progress bar at this stage provides more intuitive visual feedback of the loading progress, but still lacks accurate time estimation and has a relatively simple design.
[0005] Entering the 21st century, with the increase in game capacity and the rise of online games, more and more games have begun to support online functions and multiplayer games. This means that the game may need to download additional data from the server or synchronize with other players during the loading process, and the loading time may be longer. In order to alleviate the anxiety of players waiting, game developers began to design more attractive progress bars, such as adding dynamic effects, animations, game logos (logos) or character images. In addition, the progress bar began to be closely integrated with the theme of the game, becoming a part of the game world view and artistic style.
[0006] The development history of loading progress bars in games is a process closely related to the continuous improvement of game technology and player experience. From simple text and graphics to more beautiful and diverse designs, progress bars not only provide players with clear loading feedback, but also become one of the important elements to enhance the gaming experience.
[0007] In Unreal Engine (UE) 5, when entering or switching levels, the level streaming technology is used to reduce the overall loading time, but each level still takes a certain amount of time to load. Users will still experience a short screen freeze, that is, loading delay. There are also some resources that are not in the level, especially large digital twin city maps, such as the 1:1 restored digital twin map of Shenzhen. In addition, after the user enters the scene, the 2D / 3D interactive resources that appear, such as real-time chat, tasks, activities, user-defined settings and other 2D interface resources, as well as traffic light control display, other users' head name display, notice board and other 3D interface resources, scene trigger effect resources such as morning fog, water vapor, pollen flying, fireworks particle special effects, weather effect resources, etc. are loaded when they are used, which leads to instantaneous freezes; in addition, when a resource fails to load, it will cause the loading to get stuck and the user cannot proceed to the next step; secondly, the map resource loading only knows the start and end, and the loading progress cannot be accurately known, which also leads to the problem that the progress bar loading progress cannot smoothly go from 0% to 100%.
[0008] Therefore, a level progress bar loading method is urgently needed to solve the problem that the level progress bar is not displayed smoothly due to resource loading blockage. Summary of the invention
[0009] The present application provides a level progress bar loading method, apparatus, device, medium and computer program product, which are used to solve the problem of unsmooth display of the level progress bar due to resource loading blockage.
[0010] In a first aspect, the present application provides a level progress bar loading method applicable to Level Streaming, the method comprising:
[0011] Before entering the level, according to the preset time step, the loaded amount of M target resource files loaded asynchronously is obtained; the M target resource files are resource files whose loading status is normal for some or all of the N resource files under the level; the N resource files include level basic resource files and level dynamic resource files;
[0012] Determine the real-time loading progress of the progress bar according to the loaded amounts of the M target resource files;
[0013] Determine the corresponding interval of the real-time loading progress on the progress bar, and display the progress bar according to the display progress rule of the corresponding interval; wherein the progress bar is divided into multiple intervals, each interval has a corresponding display progress rule and at least two intervals among the multiple intervals have different display progress rules.
[0014] In a possible implementation manner, the progress bar is divided into a front section, a middle section and a back section according to the progress direction;
[0015] The display progress rule corresponding to at least one of the front section and the back section is: adjusting the loading speed of the progress bar from fast to slow based on the real-time loading progress, and displaying the progress bar according to the real-time loading progress at the intersection with the middle section;
[0016] The display progress rule of the middle section is to display the progress bar according to the real-time loading progress.
[0017] In a possible implementation, determining the real-time loading progress of the progress bar according to the loaded amounts of the M target resource files includes:
[0018] Calculate the real-time loading progress of the progress bar according to the loaded amount of the M target resource files, the file size of the N resource files and the weight of each resource file;
[0019] The process of determining the weight of each resource file includes:
[0020] For any resource file, the first sub-weight of the resource file is determined by a first optimization function according to the file size of the resource file and the file size of the N resource files; the second sub-weight of the resource file is determined according to the loading order of the resource file and the loading order of the N resource files; the weight of the resource file is determined according to the first sub-weight and the second sub-weight of the resource file; wherein the first optimization function is a logarithmic function.
[0021] In a possible implementation, determining the first sub-weight of the resource file by using a first optimization function according to the file size of the resource file and the file sizes of the N resource files includes:
[0022] A first ratio of the file size of the resource file to the file sizes of the N resource files is determined, and the first ratio is processed by a first optimization function to obtain a first sub-weight.
[0023] In a possible implementation, determining the second sub-weight of the resource file according to the loading order of the resource file and the loading order of the N resource files includes:
[0024] Determine the reciprocal of the loading order of the resource file and the sum of the reciprocals of the loading orders of the N resource files, and determine a second ratio of the reciprocal of the resource file to the sum as the second sub-weight of the resource file.
[0025] In a possible implementation, displaying the progress bar according to the display progress rule of the corresponding interval includes:
[0026] When the corresponding interval is the front section interval, the real-time loading progress is processed by a second optimization function to obtain an ideal real-time loading progress, and the progress bar is updated according to the ideal real-time loading progress; wherein the second optimization function is a square root function; and the constant in the second optimization function is determined according to the maximum value of the front section interval; and / or
[0027] When the corresponding interval is the latter interval, the real-time loading progress is processed by the third optimization function to obtain the ideal real-time loading progress, and the progress bar is updated according to the ideal real-time loading progress; wherein the third optimization function is a quadratic function; the constant in the third optimization function is determined according to the minimum value of the latter interval.
[0028] In a possible implementation manner, before obtaining the loaded amounts of the M asynchronously loaded target resource files, the method further includes:
[0029] If the loading status of any level dynamic resource file is abnormal, the level dynamic resource file is loaded repeatedly; after K loading failures, the loading of the level dynamic resource file is skipped and the log information of the failure to load the level dynamic resource file is recorded;
[0030] The calculating the real-time loading progress of the progress bar according to the loaded amount of the M target resource files, the file size of the N resource files and the weight of each resource file includes:
[0031] The real-time loading progress of the progress bar is calculated according to the loaded amount of the M target resource files, the file size of the skipped level dynamic resource files, the file size of the N resource files and the weight of each resource file.
[0032] In a second aspect, the present application provides a progress bar loading device, the device comprising:
[0033] A loading module, used for obtaining the loaded amount of M target resource files asynchronously loaded according to a preset time step before entering the level; the M target resource files are resource files of which some or all of the N resource files under the level are in a normal loading state; the N resource files include level basic resource files and level dynamic resource files;
[0034] A display module is used to determine the real-time loading progress of the progress bar according to the loaded amount of the M target resource files; determine the corresponding interval of the real-time loading progress on the progress bar, and display the progress bar according to the display progress rule of the corresponding interval; wherein the progress bar is divided into multiple intervals, each interval has a corresponding display progress rule and at least two intervals among the multiple intervals have different display progress rules.
[0035] In a possible implementation, the display module is specifically used to divide the progress bar into a front section, a middle section and a rear section according to the progress direction; the display progress rule corresponding to at least one section of the front section and the rear section is: based on the real-time loading progress, the loading speed of the progress bar is adjusted from fast to slow, and the progress bar is displayed at the intersection with the middle section according to the real-time loading progress; the display progress rule of the middle section is to display the progress bar according to the real-time loading progress.
[0036] In a possible implementation, the display module is specifically used to calculate the real-time loading progress of the progress bar based on the loaded amount of the M target resource files, the file size of the N resource files and the weight of each resource file; wherein, the process of determining the weight of each resource file includes: for any resource file, according to the file size of the resource file and the file size of the N resource files, determining the first sub-weight of the resource file through a first optimization function; according to the loading order of the resource file and the loading order of the N resource files, determining the second sub-weight of the resource file; determining the weight of the resource file according to the first sub-weight and the second sub-weight of the resource file; wherein, the first optimization function is a logarithmic function.
[0037] In a possible implementation, the display module is specifically configured to determine a first ratio of the file size of the resource file to the file sizes of the N resource files, and to obtain a first sub-weight by processing the first ratio using a first optimization function.
[0038] In a possible implementation, the display module is specifically used to determine the reciprocal of the loading order of the resource files and the sum of the reciprocals of the loading orders of the N resource files, and determine a second ratio of the reciprocal of the resource file to the sum as the second sub-weight of the resource file.
[0039] In one possible implementation, the display module is specifically used to, when the corresponding interval is the front section, process the real-time loading progress through a second optimization function to obtain an ideal real-time loading progress, and update the progress bar according to the ideal real-time loading progress; wherein the second optimization function is a square root function; the constant in the second optimization function is determined according to the maximum value of the front section; and / or, when the corresponding interval is the back section, process the real-time loading progress through a third optimization function to obtain an ideal real-time loading progress, and update the progress bar according to the ideal real-time loading progress; wherein the third optimization function is a quadratic function; the constant in the third optimization function is determined according to the minimum value of the back section.
[0040] In a possible implementation manner, the loading module is further configured to, if the loading status of any level dynamic resource file is abnormal, repeatedly load the level dynamic resource file; after K loading failures, skip loading the level dynamic resource file and record log information of the failure to load the level dynamic resource file;
[0041] The display module is also used to calculate the real-time loading progress of the progress bar based on the loaded amount of the M target resource files, the file size of the skipped level dynamic resource files, the file size of the N resource files and the weight of each resource file.
[0042] In a possible implementation, the device further includes:
[0043] A configuration module is used to set the dynamic resource loading mapping configuration of each level; the dynamic resource loading mapping configuration includes at least one level dynamic resource file used in the level, and the dynamic resource loading mapping configuration contains the loading order of the level dynamic resource files.
[0044] In a third aspect, the present application provides an electronic device, which includes at least a processor and a memory, and the processor is used to implement the steps of any of the above methods when executing a computer program stored in the memory.
[0045] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which implements the steps of any of the aforementioned methods when executed by a processor.
[0046] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes: a computer program code, which enables the computer to execute the steps of any one of the above methods when the computer program code is executed on a computer.
[0047] In an embodiment of the present application, before entering a level, the loaded amount of M target resource files loaded asynchronously is obtained according to a preset time step; the M target resource files are resource files whose loading status is normal for some or all of the N resource files under the level, including level basic resource files and level dynamic resource files, so as to solve the problem of loading jams of dynamic resource files of the level encountered by users after entering the level, and further improve the loading efficiency; according to the loaded amount of the M target resource files, the real-time loading progress of the progress bar and the corresponding interval of the real-time loading progress on the progress bar are determined, and the progress bar is displayed according to the display progress rule of the corresponding interval, so that the user can clearly perceive the changes in progress in different intervals, reduce the anxiety of waiting for loading, and further improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the implementation methods in the embodiments of the present application or the related technologies, the following is a brief introduction to the drawings required for use in the embodiments or the related technology descriptions. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0049] Figure 1 A schematic diagram of a progress bar loading process provided for some embodiments of the present application;
[0050] Figure 2 A logarithmic function schematic diagram provided for some embodiments of the present application;
[0051] Figure 3 A schematic diagram of line changes of a commonly used function provided for some embodiments of the present application;
[0052] Figure 4 A schematic diagram of the intersection of a square root function and a linear function provided for some embodiments of the present application;
[0053] Figure 5 A schematic diagram of line changes of another commonly used function provided for some embodiments of the present application;
[0054] Figure 6 A schematic diagram of the structure of a resource loading system provided for some embodiments of the present application;
[0055] Figure 7 A schematic structural diagram of a progress bar loading device provided for some embodiments of the present application;
[0056] Figure 8 A schematic diagram of the structure of an electronic device provided for some embodiments of the present application. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solutions and advantages of this application clearer, this application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the embodiments described in this application are only part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0058] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0059] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0060] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0061] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0062] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application is described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some or all of the technical features therein by equivalents; and these modifications or replacements do not make the corresponding technical solutions. The following is a description of the exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to help understand, and they should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described here without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, some existing solutions in the industry such as software, components, and models may be mentioned, and they should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or must use the solution.
[0063] Before introducing the progress bar loading method provided in the embodiment of the present application, for ease of understanding, the key terms and technical background of the embodiment of the present application are first introduced. The essence of the technical solution deviates from the scope of the technical solution of each embodiment of the present application.
[0064] UE: is a game engine developed by EPic Games. It supports multiple platforms, including PC, consoles, mobile devices, virtual reality and augmented reality, etc. It has a powerful graphics rendering and blueprint system, which can create realistic game screens and quickly create game logic and interactive behaviors. UE is an open source game engine with huge community support. Developers can freely modify and customize the engine to meet their own needs. It is one of the preferred tools for game developers.
[0065] UI: It is the interface through which users interact with software, applications or devices. User interface design aims to enable users to intuitively operate and use software or devices, and provide a friendly and easy-to-understand interface so that users can easily complete tasks or obtain information. User interface design includes visual design, interaction design and user experience design, aiming to create a simple, intuitive and easy-to-use interface to improve user satisfaction and efficiency. Good user interface design can help users quickly get started and enjoy the use process, while reducing users' learning costs and operational difficulties.
[0066] Level: In UE5, a level is all or part of a "virtual world". It contains all the content that users can see and interact with during the exploration of the virtual world. These contents may include environments, available objects, other characters, etc. Level design is an important part of the virtual world experience, which determines the user's action path, challenge difficulty, and overall experience in the virtual world. In UE5, levels are usually created and managed through the blueprint visual programming system. Developers can use various tools and resources provided by UE5 to build levels, including terrain editors, object placement tools, lighting and shadow settings, etc. In addition, UE5 also supports multi-level design, and different levels can be divided by clear transitions, providing users with a rich and diverse exploration experience. Levels play a vital role in UE5. It is not only a carrier of virtual world content, but also one of the key factors affecting user experience. By carefully designing and optimizing levels, developers can create an engaging and challenging virtual world.
[0067] Level Streaming: is a powerful feature that allows developers to dynamically load and unload different levels in the game. Level Streaming allows the game world to be split into multiple independent levels, each of which can be loaded or unloaded separately. This allows the game world to be divided into smaller chunks, which can be dynamically loaded and unloaded based on the player's position or game events, thereby reducing memory usage and improving performance. Level Streaming is suitable for large open world games, complex levels, or games that require dynamic loading. Developers can place elements such as maps, buildings, props, etc. in different levels and load these levels as needed when the game is running to achieve seamless game world conversion and optimization. In UE5, developers can implement Level Streaming through Blueprint scripts or C++ code. They can set triggers or events in the level, and when the player enters the trigger range, the corresponding level is dynamically loaded; when the player leaves the range, the level is unloaded. This method can achieve a smooth transition and seamless loading experience. By using LevelStreaming properly, developers can optimize game performance, reduce memory usage and loading time. Only loading levels in the area around the player can reduce resource consumption and improve frame rate and fluency. Level Streaming can also be used for dynamic world building, allowing developers to dynamically generate terrain, buildings or other elements while the game is running and load them into the game, thus achieving a more flexible and diverse game world. In general, Level Streaming is a powerful feature in UE5 that can help developers optimize game performance, improve user experience, and achieve a more complex and dynamic game world.
[0068] .umap file: It is a file format used to represent maps or levels in UE. This file contains information such as level layout, scene elements, lighting, collision, etc., and can be opened and edited in the Unreal Engine Editor. .umap files are a very common file type in Unreal Engine and are used to create various scenes and maps in the game world.
[0069] .uasset file: It is a file format used to store assets in UE. These assets can include models, textures, animations, sounds, and other resources used in games. .uasset files save the data and properties of these assets and can be loaded and used in the Unreal Engine Editor. In Unreal Engine projects, various assets are usually managed and stored in the form of .uasset files.
[0070] JavaScript Object Notation (JSON): is a lightweight data exchange format based on a subset of JavaScript but independent of programming languages. JSON represents data in a text form that is easy to read and write, and is often used for data exchange between the front-end and back-end. In JSON, data is represented in the form of key-value pairs, with the key and value separated by a colon, and different key-value pairs separated by a comma, and the entire data structure is contained in curly braces {}. Common data types include strings, numbers, Boolean values, arrays, objects, etc.
[0071] Tick: In game development, tick is a common term used to represent the time step in the game engine or game world. Specifically, a tick represents the time interval between each frame of the game engine, usually in milliseconds (ms). In each tick, the game engine updates the states of various objects, characters, animations, etc. in the game world to ensure the operation and performance of the game. Each object or character in the game will be updated in each tick, including position, rotation, animation state, collision detection, etc. The game engine calculates the movement and interaction of objects based on the time interval of each tick, so as to achieve the continuous operation and interactive effect of the game. In game development, setting the tick time interval reasonably is crucial to the performance and performance of the game. A shorter tick time interval can improve the smoothness and accuracy of the game, but it will also increase the computational burden; while a longer tick time interval may cause the game to run less smoothly or accurately. In summary, tick is an important concept in game development, which is used to represent the time step in the game engine or game world, affecting the operation and performance of the game.
[0072] Psychological perception: refers to the subjective cognition and experience process of an individual towards external stimuli and internal experiences. It involves the individual's perception, understanding and evaluation of external things, emotions, thoughts, etc., and is the individual's subjective reflection of external and internal experiences. Psychological perception is an important concept in the field of psychology, which includes psychological processes such as perception, cognition, emotion, and attention. An individual's psychological perception is affected by many factors, including individual experience, cultural background, emotional state, and concentration. Different individuals may have different psychological perceptions of the same external stimuli, so psychological perception is a highly subjective process. Psychological perception plays an important role in daily life, and it affects an individual's understanding and response to the world. In terms of designing user interfaces, product experiences, etc., understanding users' psychological perceptions can help design products and experiences that better meet user expectations and needs. When designing user interface elements such as progress bars, the principles of psychological perception can be used to improve user experience. For example:
[0073] Perceived speed: Users’ perception of time is not linear. When waiting, users may perceive time as passing more slowly, especially at the beginning and end of the wait.
[0074] Expectations: Users have specific expectations about loading times. If the actual loading time exceeds the user's expectations, the user may be dissatisfied even if the progress bar shows accurate progress.
[0075] Feedback: Timely feedback can significantly influence user perception. Providing immediate and continuous feedback about loading progress can reduce user anxiety.
[0076] End effect: The user’s perception of task completion is important. Even if the loading time is the same, users may perceive the wait time as shorter if the progress bar provides a clear signal when it is over.
[0077] Scale effect: Users’ perception of progress is related to the overall size of the task. For larger tasks, even small changes in progress can feel significant.
[0078] Considering these psychological perception principles when designing progress bars can help create a more intuitive and user-friendly interface, thereby improving the user’s overall satisfaction and experience.
[0079] The development history of progress bar loading technology in games can be traced back to the early stages of the development of electronic games. With the continuous advancement of game technology and the continuous improvement of player experience, progress bar loading technology is also constantly developing and evolving.
[0080] In early console and PC games, due to hardware limitations and limited technical levels, the loading time of games was usually long. In order to give players a clear waiting feedback, progress bars came into being. These progress bars are usually presented in the form of simple text or graphics, and the loading instructions are usually very simple, such as simple text prompts such as "Loading...", "Now Loading", flashing cursors or static images. Since there is no clear time estimate, users can only wait passively, lacking visual feedback and interaction.
[0081] With the improvement of graphics processing technology and the complexity of game content, the loading time of games has become longer. In order to optimize the waiting experience of players, developers began to pay attention to the design and presentation of progress bars. 2D or simple 3D progress bars began to appear in games. They are usually presented as a horizontal or vertical bar filled with color, which gradually fills up as the data is loaded, intuitively showing the loading progress. The progress bar at this stage provides more intuitive visual feedback of the loading progress, but still lacks accurate time estimation and has a relatively simple design.
[0082] Entering the 21st century, with the increase in game capacity and the rise of online games, more and more games have begun to support online functions and multiplayer games. This means that the game may need to download additional data from the server or synchronize with other players during the loading process, and the loading time may be longer. In order to alleviate the anxiety of players waiting, game developers began to design more attractive progress bars, such as adding dynamic effects, animations, game logos or character images. In addition, the progress bar began to be closely integrated with the theme of the game, becoming a part of the game world view and artistic style.
[0083] The development history of loading progress bars in games is a process closely related to the continuous improvement of game technology and player experience. From simple text and graphics to more beautiful and diverse designs, progress bars not only provide players with clear loading feedback, but also become one of the important elements to enhance the gaming experience.
[0084] In UE5, when entering or switching levels, the level streaming technology is used to reduce the overall loading time, but each level still takes a certain amount of time to load. Users will still experience a short screen freeze, that is, loading delay. There are also some resources that are not in the level, especially large digital twin city maps, such as the 1:1 restored digital twin map of Shenzhen. In addition, after the user enters the scene, the 2D / 3D interactive resources that appear, such as real-time chat, tasks, activities, user-defined settings and other 2D interface resources, as well as traffic light control display, other users' head name display, notice board and other 3D interface resources, scene trigger effect resources such as morning fog, water vapor, pollen flying, fireworks particle effects, weather effect resources, etc. are loaded when they are used, which leads to instantaneous freezes; in addition, when a resource fails to load, it will cause the loading to get stuck, and the user cannot proceed to the next step; secondly, the map resource loading only knows the start and end, and the loading progress cannot be accurately known, which also leads to the problem that the level progress bar loading progress cannot smoothly go from 0% to 100%.
[0085] Based on this, in order to solve the problem that the level progress bar is not displayed smoothly due to resource loading blockage, the present application provides a level progress bar loading method, device, equipment, medium and computer program product. In the method, before entering the level, according to the preset time step, the loaded amount of M target resource files loaded asynchronously is obtained; the M target resource files are resource files with some or all of the N resource files under the level in a normal loading state; the N resource files include level basic resource files and level dynamic resource files; according to the loaded amount of the M target resource files, the real-time loading progress of the progress bar is determined; the corresponding interval of the real-time loading progress on the progress bar is determined, and the progress bar is displayed according to the display progress rule of the corresponding interval; wherein the progress bar is divided into multiple intervals, each interval has a corresponding display progress rule and at least two intervals of the multiple intervals have different display progress rules.
[0086] Embodiment 1:
[0087] Figure 1 A schematic diagram of a progress bar loading process is provided for some embodiments of the present application. Figure 1 As shown, the process includes the following steps:
[0088] S101: Before entering a level, obtain the loaded amount of M target resource files asynchronously loaded according to a preset time step; the M target resource files are resource files whose loading status is normal for some or all of the N resource files under the level; the N resource files include level basic resource files and level dynamic resource files.
[0089] The progress bar loading method in the embodiment of the present application is applied to an electronic device, wherein the electronic device may be a PC, a smart phone, or other device.
[0090] In the UE5 engine, when entering or switching levels, the level streaming technology is used to reduce the overall loading time, but each level still takes a certain amount of time to load. Users will still experience a short period of screen freeze, i.e. loading delay. In addition, after the user enters the scene, the 2D / 3D interactive resources and scene trigger effect resources that appear are loaded when they are used, which leads to momentary freezes.
[0091] Based on this, in the embodiment of the present application, resource files including level basic resource files and level dynamic resource files can be pre-configured for each level. Before entering any level, that is, during the loading process of the level progress bar, all resource files of the level including the level basic resource files and the level dynamic resource files are asynchronously loaded. This can solve the problem of users feeling stuck when dynamic resources are loaded after entering the level, and improve the loading efficiency of resource files.
[0092] In one possible implementation, a log record is written at the beginning and completion of loading each resource file, and the loading status of each resource file is detected. For example, if the loaded amount of any resource file does not change within a preset time period, it can be determined that the loading status of the resource file is abnormal. Correspondingly, if the loaded amount of any resource file gradually increases within the preset time period, it indicates that the loading status of the resource file is normal.
[0093] In order to more accurately obtain the loading progress of the level resource files, before entering the level, after the level progress bar loading is triggered, the loaded amount of the M target resources loaded asynchronously can be obtained according to the preset time step, where M is greater than or equal to 0, and the target resource files are resource files that are loaded normally. The level contains a total of N resource files, where N is greater than or equal to 1. The M target resource files are all resource files in the level, that is, some or all of the N resource files, and the loading status is normal.
[0094] S102: Determine the real-time loading progress of the progress bar according to the loaded amounts of the M target resource files.
[0095] The implementation loading progress of the progress bar may be determined according to the ratio of the loaded amount of the M target resources to the file size of the N resource files.
[0096] Specifically, suppose there are N resource files in the level to be displayed, of which S i is the file size of the i-th resource file, then the file size S of N resource files is:
[0097]
[0098] As of the current time t, a total of M target resource files have been asynchronously loaded, and the current loaded amount of each target resource file is F i (t), then at the current time t, the total amount C(t) of M target resource files loaded is:
[0099]
[0100] Then the real-time loading progress P at time t exp (t):
[0101]
[0102] Among them, S i is the file size of the i-th resource file, F i (t) is the current loaded amount of each target resource file, and C(t) is the total amount loaded for M target resource files.
[0103] S103: Determine the corresponding interval of the real-time loading progress on the progress bar, and display the progress bar according to the display progress rule of the corresponding interval; wherein the progress bar is divided into multiple intervals, each interval has a corresponding display progress rule and at least two intervals among the multiple intervals have different display progress rules.
[0104] Since users are particularly sensitive to the beginning and end stages of progress, this is due to differences in user perception. This psychological difference in perception may cause users to feel that the progress is very slow at the beginning of loading, and feel that they have been waiting for a long time when loading is almost finished. In order to improve the user experience and further enhance the display effect of the progress bar, in an embodiment of the present application, the progress bar can be divided into multiple intervals, each interval has a corresponding display progress rule, and at least two of the multiple intervals have different corresponding display progress rules. Determine the corresponding interval of the progress on the progress bar, and update the progress bar according to the display progress rule of the corresponding interval.
[0105] Specifically, for example, according to the loading direction of the progress bar, the first 10% of the progress bar can be divided into a front section, the middle 70% can be divided into a middle section, and the remaining 20% can be divided into a back section. The display progress rule corresponding to the front section and the back section is to update the progress bar from fast to slow, and the display progress rule corresponding to the middle section is to update the progress bar according to the actual speed.
[0106] In an embodiment of the present application, before entering a level, the loaded amount of M target resource files loaded asynchronously is obtained according to a preset time step; the M target resource files are resource files whose loading status is normal for some or all of the N resource files under the level; the N resource files include level basic resource files and level dynamic resource files, thereby solving the problem of level dynamic resource file loading jams encountered by users after entering the level, and further improving loading efficiency; according to the loaded amount of the M target resource files, the real-time loading progress of the progress bar is determined; the corresponding interval of the real-time loading progress on the progress bar is determined, and the progress bar is displayed according to the display progress rule of the corresponding interval, so that the user can clearly perceive the progress changes in different intervals, reduce the anxiety of waiting for loading, and further improve the user experience.
[0107] Embodiment 2:
[0108] In order to further improve the smoothness of the level bar display and improve the user experience, based on the above embodiments, in the embodiment of the present application, the progress bar is divided into a front section, a middle section and a back section according to the progress direction;
[0109] The display progress rule corresponding to at least one of the front section and the back section is: adjusting the loading speed of the progress bar from fast to slow based on the real-time loading progress, and displaying the progress bar according to the real-time loading progress at the intersection with the middle section;
[0110] The display progress rule of the middle section is to display the progress bar according to the real-time loading progress.
[0111] Since users are particularly sensitive to the starting and ending stages of progress, in order to enable users to perceive progress changes more quickly in the early stages of loading and reduce users' anxiety when loading is close to completion, in an embodiment of the present application, the progress bar is divided into three intervals according to the progress direction, namely, the front interval, the middle interval and the back interval.
[0112] The display progress rule corresponding to at least one of the first section and the second section is: adjusting the loading speed of the progress bar from fast to slow based on the loading progress. The display progress rule in the middle section is to display the progress bar according to the loading progress.
[0113] In order to ensure the smoothness of the progress bar display, the progress bar is displayed according to the real-time loading progress at the intersections of the front section and the back section with the middle section.
[0114] In an embodiment of the present application, the progress bar is divided into a front section, a middle section and a rear section according to the progress direction, and the display rule corresponding to at least one section in the front section and the rear section is to adjust the loading speed of the progress bar from fast to slow based on the real-time loading progress, display the progress bar according to the real-time loading progress in the middle section, and display the progress bar according to the real-time loading progress at the intersection of the sections, so that the user can perceive the progress change more quickly in the early stage of loading, and reduce the user's anxiety when the loading is close to completion, and further improve the smoothness of the progress bar display.
[0115] Embodiment 3:
[0116] To further improve, based on the above embodiments, in an embodiment of the present application, determining the real-time loading progress of the progress bar according to the loaded amounts of the M target resource files includes:
[0117] Calculate the real-time loading progress of the progress bar according to the loaded amount of the M target resource files, the file size of the N resource files and the weight of each resource file;
[0118] The process of determining the weight of each resource file includes:
[0119] For any resource file, the first sub-weight of the resource file is determined by a first optimization function according to the file size of the resource file and the file size of the N resource files; the second sub-weight of the resource file is determined according to the loading order of the resource file and the loading order of the N resource files; the weight of the resource file is determined according to the first sub-weight and the second sub-weight of the resource file; wherein the first optimization function is a logarithmic function.
[0120] In order to solve the problem of uneven progress bar display caused by inconsistent speed during resource file loading, a progress bar smoothing algorithm is used to dynamically update the progress bar. During the resource file loading process, not all resource files are equally important. Different resource files have different importance levels, and the corresponding impact on the progress bar is also different. Therefore, the real-time loading progress of the progress bar can be determined based on the weight of the resource file's impact on the progress bar, the amount of M target resource files loaded at the current moment, the file size of N resource files, and the weight of each resource file.
[0121] The weight of the resource file's impact on the progress bar is composed of two factors, one of which is the file size of the resource file, and the other is the order in which the resource files are loaded. Based on the weight, file size, and amount loaded of each resource file, the progress bar update can be controlled more accurately to ensure that the loading progress of key files, i.e., resource files with a higher level of importance, is properly reflected.
[0122] In order to comprehensively consider the two influencing factors of weight, the contributions of the two factors of file size and loading order to the weight are independent of each other, and the excessive influence of the extreme value of any one factor on the sum is avoided. Multiplication can simulate this nonlinear relationship. Therefore, multiplication is used in the embodiment of the present application to represent the influence of the two factors on the weight. Because in actual situations, the sizes of various files that need to be loaded are discrete, ranging from 0K to 1048576K (100M, and the level resource files are generally 10M to 100M). When the file size of a resource file is very small but the loading order is very front, then when the weight of the resource file is calculated directly according to the multiplication, it will be found that the weight of the resource file is not very ideal. Among them, the influence of the file size factor on the weight is nonlinear, that is, very discrete.
[0123] Based on this, in an embodiment of the present application, for any resource file, the first sub-weight of the resource file is determined by optimizing the ratio of the file size of the resource file to the file sizes of N resource files through a first optimization function, wherein the first optimization function is a logarithmic function; the second sub-weight of the resource file is determined according to the ratio of the reciprocal of the loading order of the resource file to the sum of the reciprocals of the loading orders of N resource files; and the weight of the resource file is determined according to the product of the first sub-weight and the second sub-weight of the resource file.
[0124] In order to enhance the display effect of the progress bar, based on the above embodiments, in an embodiment of the present application, the first sub-weight of the resource file is determined by a first optimization function according to the file size of the resource file and the file sizes of the N resource files, including:
[0125] A first ratio of the file size of the resource file to the file sizes of the N resource files is determined, and the first ratio is processed by a first optimization function to obtain a first sub-weight.
[0126] In order to further enhance the display effect of the progress bar, on the basis of the above embodiments, in the embodiment of the present application, the second sub-weight of the resource file is determined according to the loading order of the resource file and the loading order of the N resource files, including:
[0127] Determine the reciprocal of the loading order of the resource file and the sum of the reciprocals of the loading orders of the N resource files, and determine a second ratio of the reciprocal of the resource file to the sum as the second sub-weight of the resource file.
[0128] The following is a specific example to further illustrate the process of determining the weight of each resource file in the embodiment of the present application. i is the weight of the i-th file, requiring Two factors affect the weight:
[0129] File size: S i Indicates the size of the i-th resource file, S wi Indicates the file size S of the i-th resource file i The file size of the entire target resource file The proportion of
[0130] Loading order: Use L i Indicates the loading order of the i-th resource file. The smaller the value, the higher the priority. Starting from 1, it is accumulated in sequence. If there are 100 resource files in total, the loading order of the 100th resource file is 100.
[0131] L wi It indicates the proportion of the loading order of the i-th resource file in the loading order of the entire resource file. The higher the proportion, the earlier the loading order.
[0132] Then the weight of the i-th file is: S wi *L wi .
[0133] After normalization,
[0134] Among them, S wi Indicates the file size S of the i-th resource file i The file size of the entire target resource file The proportion of L wi Indicates the weight of the i-th resource file in the loading order of the entire target resource file.
[0135] In actual situations, the sizes of various files that need to be loaded are discrete. When a resource file is very small but is loaded very early, the weight of the resource file is not very ideal when the weight is directly calculated according to the formula in the above embodiment. For example, a level resource file of a level is only 9K, with a loading order of 1, while the UI resource file is 400K, with a loading order of 2, and the plot resource file is 9216K (9M), with a loading order of 3. According to the above formula, the percentage S of the file size of the three resource files in the entire target resource file is calculated. wi They are:
[0136]
[0137]
[0138]
[0139] The loading order of the three resource files accounts for the proportion of the loading order of the entire target resource file. wi They are:
[0140]
[0141]
[0142]
[0143] The weights of the three resource files W i They are:
[0144]
[0145]
[0146]
[0147] According to the above results, the weight of the level resource file with higher importance that is loaded first on the progress bar is only 0.27%, while the weight of the plot resource file with lower importance that is loaded last on the progress bar is 93.63%, so the display effect of the progress bar is not particularly ideal.
[0148] In order to improve the situation that the file size of the resource file is particularly discrete, the first optimization function, i.e., the logarithmic function, is used in the embodiment of the present application to improve this situation. Figure 2 A logarithmic function diagram is provided for some embodiments of the present application. Figure 2 As shown, because the unit for calculating the file size conversion is 1024, for example: 1K = 1024 bytes, 1M = 1024K, preferably, a logarithmic function with 1024 as the base can be used as the first optimization function. Preferably, in order to avoid the extreme case where the file size may be 0, a logarithmic function is used. 1024 (x+1) is used as the first optimization function to optimize the phenomenon that the file size is too discrete, resulting in unsatisfactory weights.
[0149] For the above three resource files, the file size ratio after logarithmic function optimization is W i They are:
[0150]
[0151]
[0152]
[0153] The loading order of the three resource files accounts for the proportion of the loading order of the entire target resource file L wi Unchanged, weight W i They are:
[0154]
[0155]
[0156]
[0157] According to the above results, the weight results after optimization using the first optimization function are much more ideal.
[0158] In an embodiment of the present application, the real-time loading progress of the progress bar is calculated based on the loaded amount of M target resource files, the file size of N resource files, and the weight of each resource file; wherein, for any resource file, a first sub-weight is determined by a first optimization function based on the file size of the resource file and the file size of N resource files; a second sub-weight is determined based on the loading order of the resource file and the loading order of N resource files; the weight of the resource file is determined based on the first sub-weight and the second sub-weight, wherein the first optimization function is a logarithmic function, thereby solving the problem of uneven display of the progress bar due to the huge difference in the loading order and file size of the resource files during the resource file loading process.
[0159] The real-time loading progress P at time t after adding the weight of the resource file w (t) is:
[0160]
[0161] Among them, S i is the file size of the i-th resource file, F i (t) represents the current loading percentage of each resource file, W represents the weight of the i-th resource file, Indicates the file size of the target resource file, W j Indicates the weight of the target resource file.
[0162] In a possible implementation, if the influence of the two factors of file size and loading order on the weight needs to be dynamically adjusted, a constant K can be added: w , then the first optimization function is log 1024 (K w *x+1). For example, if the weights of the 9K level resource file with loading order 1 and the 9216K (9M) plot resource file with loading order 3 are the same, then let W1=W3.
[0163] Right now
[0164] S w1 *L w1 =S w3 *L w3
[0165] log 1024 (K w *9+1)*0.5455=lg 1024 (K w *9216+1)*0.1818
[0166] Get K w =3.3842
[0167] At this time, the first optimization function is log 1024 (3.3842*x+1)
[0168] Substituting the above formula, we can calculate the file size ratios of the above three resource files as follows:
[0169]
[0170]
[0171]
[0172] The weights of the above three resource files are:
[0173]
[0174]
[0175]
[0176] At this point, if you want the loading order to have a greater impact on the weight, then the first optimization function log 1024 (K w *x+1) w >3.3842, if you want the file size to have a greater impact on the weight, then K w <3.3842. Specifically, the constant K in the first optimization function w It can be preset or calculated based on the file size and loading order of each resource file.
[0177] To sum up, the weight of the i-th file is:
[0178]
[0179] Real-time loading progress P at time t after adding file weight w (t) is
[0180]
[0181]
[0182] Among them, S i Indicates the file size of the i-th resource file, L i Indicates the loading order of the i-th resource file, K w Represents a constant in the first optimization function.
[0183] In an embodiment of the present application, the real-time loading progress calculated according to the optimized weight can more accurately reflect the impact of the loading progress of each resource file of different importance on the entire progress bar display, thereby enhancing the display effect of the progress bar.
[0184] Embodiment 4:
[0185] In order to further enhance the display effect of the progress bar, on the basis of the above embodiments, in an embodiment of the present application, the progress bar is displayed according to the display progress rule of the corresponding interval, including:
[0186] When the corresponding interval is the front section interval, the real-time loading progress is processed by a second optimization function to obtain an ideal real-time loading progress, and the progress bar is updated according to the ideal real-time loading progress; wherein the second optimization function is a square root function; and the constant in the second optimization function is determined according to the maximum value of the front section interval; and / or
[0187] When the corresponding interval is the latter interval, the real-time loading progress is processed by the third optimization function to obtain the ideal real-time loading progress, and the progress bar is updated according to the ideal real-time loading progress; wherein the third optimization function is a quadratic function; the constant in the third optimization function is determined according to the minimum value of the latter interval.
[0188] In order to improve the user experience and enable users to perceive the progress changes more quickly at the beginning of loading, the corresponding interval is the front interval, and the loading speed of the progress bar is adjusted from fast to slow based on the real-time loading progress. The real-time loading progress can be processed by the second optimization function, where the second optimization function is a square root function. In order to ensure the smoothness of the progress bar display, the progress bar is displayed at the intersection of the front interval and the middle interval according to the real-time loading progress. Therefore, the constant in the second optimization function is determined based on the maximum value of the front interval and the minimum value of the middle interval.
[0189] In order to improve the user experience and reduce the user's anxiety when the loading is close to completion, the user is more sensitive to the progress changes in the final stage, that is, in the same amount of time, the final stage will also feel that it is "working hard to complete", increasing the sense of accomplishment of completion. In the corresponding interval, the loading speed of the progress bar is adjusted from fast to slow based on the real-time loading progress. The real-time loading progress can be processed by the third optimization function, where the third optimization function is a quadratic function. In order to ensure the smoothness of the progress bar display, the progress bar is displayed at the intersection of the latter section and the middle section according to the real-time loading progress. Therefore, the constant in the third optimization function is determined based on the minimum value of the latter section and the maximum value of the middle section.
[0190] Specifically, the front - segment interval can be an interval from 0% to a certain ratio R1, where 0 < R1 < 50%, and generally R1 is taken as 10%. To make the progress bar change faster in the initial stage of loading, so within the front - segment interval, P new (t) ≥ P w (t). Represented by a mathematical function, x is the original real - time loading progress P w (t), f(x) is the ideal real - time loading progress, that is, the new real - time loading progress P new (t). Then the function f(x) needs to meet the following 4 conditions:
[0191] When x = 0, f(x) = 0;
[0192] When x = R1, f(x) = R1;
[0193] f(x) is monotonically increasing within the interval x ∈ [0, R1];
[0194] The change speed of f(x) is from fast to slow.
[0195] According to the above 4 conditions, the line - change rules of common reciprocal functions, N - th power functions, square - root functions, logarithmic functions, etc. can be considered. Figure 3 A schematic diagram of the line - change of a common function provided for some embodiments of this application. As Figure 3 shown, to make f(x) change faster when 0 ≤ x ≤ R1, that is, f(x)>x. Therefore, only the reciprocal function and the square - root function meet the requirements. Since when x ≥ 0 for the reciprocal function, f(x) ≥ +∞, which does not meet f(x) ≤ 1. Therefore, the square - root function that meets the requirements can be used as the second optimization function. It should be noted that as long as the polynomial combination function meets the above 4 requirements, it can be used as the second optimization function. For example, the quadratic - power function can also be used as the second optimization function.
[0196] For example, if the square - root function is used as the second optimization function, then the relationship between P(t) and P new (t) is:
[0197]
[0198] Among them, the constant k is used to adjust the continuity of the real - time loading progress. The value of k is determined by the maximum value of the front - segment interval. Because considering the continuous smoothness of the progress bar, at the end of the front - segment interval, that is, at the end of the starting area, P new (t) = P w (t). Otherwise, when the optimized progress bar ends at the starting area, that is, at the original 10% progress, there will be a problem that the progress waits at P new (t) until P w (t) reaches P new (t) before continuing to move forward.
[0199] Therefore, when x=R1, f(x)=R1, Figure 4 A schematic diagram of the intersection of a square root function and a linear function is provided for some embodiments of the present application. Figure 4 As shown, f(R1) = R1, that is Can determine constants Therefore, the ideal real-time loading progress at the end of the first preset interval, i.e. the starting zone, is equal to the original real-time loading progress:
[0200] When x approaches a positive number of 0, f'(x) approaches positive infinity, indicating that its slope becomes very steep, that is, the speed of change is very fast. As x increases, f'(x) is getting smaller, which indicates that the growth rate is slowing down, but the entire function graph is always upward and the slope is positive, that is, f'(x)>0, but the growth rate is decreasing. This makes the progress bar change quickly at the beginning of loading, which can immediately give users positive feedback, making users feel that the system responds quickly, and enhancing the instant satisfaction of user experience. As the progress growth rate gradually slows down, that is, although it is still growing, the growth rate slows down, and the user's psychological expectations are also properly managed. This design meets the user's psychological need for quick response at the beginning of loading. At the same time, when the progress bar approaches the linear growth stage, the user has already gained a good perception that the system is actively processing the task, laying a psychological foundation for the subsequent possible smooth progress changes.
[0201] Example: If R1 = 0.1, then So the ideal real-time loading progress in the starting area
[0202] Then when P w When (t) changes from 0.0 to 0.01, P new (t)From becomes
[0203] When P w When (t) changes from 0.09 to 0.1, P new (t)From becomes That is to say, when P w When (t) changes from 0.0% to 1%, the real-time loading progress after optimization based on the second optimization function changes from 0% to 3.16%, and when P w (t) When the percentage changes from 9% to 10%, the real-time loading progress after optimization based on the second optimization function changes from 9.49% to 10%, and the speed of the progress bar changes becomes smaller and smaller.
[0204] The middle section is a linear section, which includes the end of the front section, i.e., the starting section, to the beginning of the back section. Linear mapping is maintained within this section to provide a stable and realistic sense of progress.
[0205] In the linear area, the original real-time loading progress is maintained for update without adjustment, that is:
[0206] P new (t) = P w (t)(R1≤P w (t)≤R2 and R1 <P new (t)≤R2)
[0207] That is, P in the previous interval new When the value of (t) is greater than R1, it immediately switches to the linear region.
[0208] In an embodiment of the present application, if the calculated real-time loading progress is in the front interval, the real-time loading progress is processed according to the second optimization function to obtain the ideal real-time loading progress, and the progress bar is updated according to the ideal real-time loading progress; wherein the second optimization function is a square root function or a quadratic function, which satisfies the user's psychological need for quick response in the initial stage of loading. At the same time, when the progress bar approaches the middle interval, that is, the linear growth stage, the user has gained a good perception that the system is actively processing the task, which lays a psychological foundation for the subsequent possible smoother progress changes, and further optimizes the display effect of the progress bar.
[0209] The middle section is the linear area, which includes the end of the starting area to the beginning of the area to be completed, from R1 to R2.
[0210] The corresponding interval is the latter interval, which is the area that is about to be completed: the interval from the end of the linear area to 100% of the progress bar, from R2 to 100%. Expressed by mathematical functions, x is the original real-time loading progress P(t), and the third optimization function f(x) is the new progress, that is, the ideal real-time loading progress P new (t), four conditions need to be met:
[0211] When x=R2, f(x)=R2;
[0212] When x=1.0, f(x)=1.0;
[0213] f(x) is monotonically increasing in the interval x∈(R2,1];
[0214] The speed of f(x) changes from fast to slow.
[0215] Since the quadratic function has the characteristics of monotonically increasing on one side of the symmetry axis and changing speed from fast to slow, the square root function that meets the requirements can be used as the third optimization function. It should be noted that any polynomial combination function that meets the above four requirements can be used as the third optimization function. For example, the quadratic function can also be used as the third optimization function.
[0216] Figure 5 Another common function line change diagram provided for some embodiments of the present application. Figure 5 As shown, since the speed of change needs to be smaller and smaller, the quadratic function f(x) = b(x-R2) 2 +c, where b and c are constants. Since the parabola opens upward, b>0.
[0217] To find out the speed of change, we can first calculate its derivative f'(x) = 2bx-2b*R2. When x∈(R2,1], x-R2>0, so f'(x) = 2bx-2b*R2 = 2b*(x-R2)>0, which means that f(x) is increasing in the interval x∈(R2,1], but as x increases, f'(x) also increases, which means that f(x) is changing faster and faster, which is contrary to the requirement that the progress bar changes slower and slower, so it is located at Figure 5 At the top (top and bottom in the figure), the quadratic function opening upward is not suitable.
[0218] for Figure 5 The quadratic function f(x)=a(x-1) that opens downward in the middle and lower part (upper and lower in the figure) 2 +d, where a and d are constants. Since the parabola opens downward, a<0.
[0219] Similarly, to calculate its rate of change, first calculate its derivative f'(x) = 2ax-2a. When x∈(0.95, 1], f'(x) = 2ax-2a = 2a(x-1)>0, which means that f(x) is increasing in the interval x∈(R2, 1], but as x increases, f'(x) becomes smaller and smaller, which means that the speed of f(x) changes is getting slower and slower, which is consistent with the requirement that the progress bar changes slower and slower, so Figure 5 The quadratic function with the opening downward in the middle is f(x) = a(x-1) 2 +d meets the requirements and can be used as the third optimization function.
[0220] The values of constants a and d in the function can be calculated based on the minimum value of the latter interval. Specifically, according to f(R2)=R2, we can get a(R2 -1) 2 +d=R2;According to f(1.0)=1.0, we get a(1.0 -1) 2 +d=1.0; Based on the above, we can conclude d=1, that is, the third optimization function is:
[0221]
[0222] Example: If R2 = 0.95, then
[0223] f(x)=-20(x-1) 2 +1
[0224] Then when P w When (t) changes from 0.95 to 0.96, P new (t) from -20*(0.95-1) 2 +1 = 0.95 becomes -20*(0.96-1) 2 +1=0.968; and when P w When (t) changes from 0.99 to 1.0, P new (t) from -20*(0.99-1) 2 +1 = 0.998 becomes -20*(1.0-1) 2 +1=1.0. That is to say, when the progress changes from 95% to 96%, the optimized progress changes from 95% to 96.8%, and when the progress changes from 99% to 100%, the optimized progress changes from 99.8% to 100%. It is obvious that the speed of change is getting smaller and smaller.
[0225] According to the corresponding interval of the calculated real-time loading progress, the ideal real-time loading progress can be determined, that is, the new real-time loading progress P new (t), where when the real-time loading progress is in the front section, that is, P w (t)∈[0,R1], When the real-time loading progress is in the middle range, that is, P w (t)∈(R1, R2], P new (t) = P w (t); When the real-time loading progress is in the latter section, P w (t)∈(R2,1.0],
[0226] In an embodiment of the present application, if the calculated real-time loading progress is in the latter interval, the ideal real-time loading progress is determined based on the minimum value of the latter interval and the real-time loading progress based on a preset third optimization function, and the progress bar is updated according to the ideal real-time loading progress; wherein the third optimization function is a square root function or a quadratic function, which satisfies the user's greater sensitivity to the progress changes in the final stage, that is, within the same time, the user will also feel that the final stage is being "completed with effort", increasing the sense of accomplishment of completion.
[0227] In summary, as of the current time t, a total of M files have been asynchronously loaded, and the current loading percentage of each file is F i (t), calculate the real-time loading progress at time t:
[0228]
[0229] According to the real-time loading progress P after determining the weight of each resource file w (t) is:
[0230]
[0231] Among them, W i is the weight of the ith file, then
[0232] According to P w The preset progress interval where the value of (t) is located determines the ideal real-time progress, that is, the new progress value is P new (t), where:
[0233] P w (t)∈[0,R1],
[0234] P w (t)∈(R1, R2], P new (t) = P w (t)
[0235] P w (t)∈(R2,1.0],
[0236] At each preset time step (tick), according to P new (t) value to update the progress of the progress bar in real time, which satisfies the user's psychological need for quick response in the early stage of loading. At the same time, when the progress bar approaches the linear growth stage, the user has already gained a good perception that the system is actively processing tasks, which lays a psychological foundation for the subsequent relatively stable progress changes. The display effect of the progress bar is further optimized, and the user is more sensitive to the progress changes in the last stage, that is, in the same time, the last stage will also feel that it is "working hard to complete", increasing the sense of accomplishment of completion. The method in the embodiment of the present application truly displays the loading progress when the map / level is switched, solves the problem that the progress bar is stuck at 100% and cannot be entered or the progress bar enters before reaching 100%, and cannot truly reflect the loading progress.
[0237] Embodiment 5:
[0238] In order to further optimize the display effect of the progress bar, based on the above embodiments, in the embodiment of the present application, before obtaining the loaded amount of the M target resource files loaded asynchronously, the method further includes:
[0239] If the loading status of any level dynamic resource file is abnormal, the level dynamic resource file is loaded repeatedly; after K loading failures, the loading of the level dynamic resource file is skipped and the log information of the failure to load the level dynamic resource file is recorded;
[0240] The calculating the real-time loading progress of the progress bar according to the loaded amount of the M target resource files, the file size of the N resource files and the weight of each resource file includes:
[0241] The real-time loading progress of the progress bar is calculated according to the loaded amount of the M target resource files, the file size of the skipped level dynamic resource files, the file size of the N resource files and the weight of each resource file.
[0242] In order to avoid the problem that the dynamic resource file loading of a certain level is stuck and the user cannot proceed, the embodiment of the present application adopts an asynchronous resource file loading mechanism. A diary record will be written when loading each resource file starts and completes, and in order to display the progress bar more smoothly, the loading status of each resource file will be detected. For example, if the loaded amount of any resource file does not change within a preset time, it can be determined that the loading status of the resource file is abnormal. Correspondingly, if the loaded amount of any resource file gradually increases within a preset time, it means that the loading status of the resource file is normal.
[0243] In order to avoid the problem that the loading of a certain level dynamic resource file is stuck and the user cannot proceed, the resource asynchronous loading mechanism is adopted and a retry mechanism is added. If the loading status of any level dynamic resource file is abnormal, the level dynamic resource file will be loaded repeatedly, and the reload will be repeated up to a preset number of times, that is, K times. The preset number of times can be set according to user needs, for example, K is set to 3 times. If the loading status of the retry loading of the level dynamic resource file is normal within K times, the subsequent step of obtaining the loaded amount of the M target resource files loaded asynchronously is performed.
[0244] Since the asynchronous loading mechanism is adopted in the embodiment of the present application, that is, any resource file loading exception will skip the resource file and load the next resource file, and the thread loading retry of the resource file will not affect the resource file loading of other threads, thereby further improving the resource loading efficiency and enhancing the smoothness of the progress bar display.
[0245] In order to avoid the problem that the dynamic resource file loading of a certain level is stuck and the user cannot proceed, the resource loading management system enables the resource asynchronous loading mechanism and adds a fault-tolerant mechanism. After K loading failures, the loading of the level dynamic resource file is skipped and the log information of the resource file loading failure is recorded. This allows developers to more easily locate which specific resource file has a problem loading, thereby saving error checking costs.
[0246] In order to further enhance the efficiency of resource loading, in a possible implementation, the importance level corresponding to each resource file can be pre-set according to the importance of the resource file. Among them, the importance of the level resource file is the highest, followed by the UI resource file, and the remaining dynamic resource files such as effect resource files, plot resource files, scene resource files, sound effect resource files, etc. set their importance levels according to actual needs, and save the importance level of each resource file. For example, the importance level of the most important level resource is 5, the importance level of the dynamic resource is 3, and the importance level of the sound effect resource is 2. According to the importance level of each resource file saved in advance, the target importance level of the resource file that failed to load is determined. If the target importance level is lower than the preset value, for example, the preset value is 3, it means that the importance of the resource file is low. In order to avoid affecting the display of the progress bar, the resource file loading can be skipped, and the log information of the failure to load the resource file is recorded. When calculating the real-time loading progress, the real-time loading progress of the progress bar is calculated according to the loaded amount of the M target resource files, the file size of the skipped resource files, the file size of the N resource files, and the weight of each resource file.
[0247] Specifically, for non-critical resource files of lower importance, that is, resource files that do not affect the user experience, for example, the resource file of a stone model on the Shenzhen Bay seashore on the Shenzhen digital twin map is damaged and cannot be loaded normally, resulting in an abnormal loading status of the resource file. After K loading failures, the resource file will be skipped and the next resource file will be loaded without affecting the resource loading of other threads. This ensures that the entire resource loading process will not be interrupted and cause the progress bar to get stuck.
[0248] In an embodiment of the present application, if the loading status of any level dynamic resource file is abnormal, the level dynamic resource file is loaded repeatedly; after K loading failures, the loading of the level dynamic resource file is skipped and the log information of the failure to load the level dynamic resource file is recorded, which can more conveniently allow developers to locate which specific resource file has a problem with loading, thereby saving error detection costs; and when calculating the real-time loading progress, the real-time loading progress of the progress bar is calculated based on the loaded amount of M target resource files, the file size of the skipped level dynamic resource file, the file size of N resource files, and the weight of each resource file, so as to further improve the resource loading efficiency and enhance the smoothness of the progress bar display.
[0249] Embodiment 6:
[0250] In order to improve the loading efficiency of resource files and thus improve the smoothness of the level progress bar, based on the above embodiments, in the embodiment of the present application, before obtaining the loaded amount of the M target resource files loaded asynchronously, the method further includes:
[0251] For each level, a dynamic resource loading mapping configuration of the level is set; the dynamic resource loading mapping configuration includes at least one level dynamic resource file used in the level, and the dynamic resource loading mapping configuration contains the loading order of the level dynamic resource files.
[0252] In order to improve the loading efficiency of resource files and thus improve the smoothness of the level progress bar, a dynamic resource loading mapping configuration of the level can be set in advance for each level, including a level basic resource file and at least one level dynamic resource file used in the level, and the dynamic resource loading mapping configuration includes the loading order of the level basic resource file and the level dynamic resource file.
[0253] Specifically, a resource loading management system may be provided. Figure 6 A schematic diagram of a resource loading system provided in some embodiments of the present application. Figure 6As shown, the resource loading system can be regarded as a 1+N resource loading management system, that is, on the basis of the level basic resource files, N kinds of level dynamic resource files are added, wherein the level dynamic resource files include but are not limited to UI resource files, including 2DUI resource files, 3DUI resource files; effect resource files, including weather effect resource files, particle special effect resource files, model special effect resource files, etc.; plot resource files, dynamic scene resource files, and sound effect resource files. Among them, the level basic resource files and level dynamic resource files corresponding to each level are different. For example, a certain level does not require the loading of sound effect resource files, and some levels may not have the loading of plot resource files, so dynamic management of resource file loading is required. In an embodiment of the present application, a dynamic management resource loading management system is provided, which includes level basic resource file loading and level dynamic resource file loading, including UI resource file loading, effect resource file loading, plot resource file loading, dynamic scene resource file loading, sound effect resource file loading and other resource file loading, that is, a 1+N resource loading management system. The resource loading management system will configure and map the level dynamic resource files (that is, N) of each level, so that the resource files that need to be dynamically loaded for each level can be different.
[0254] Among them, the level basic resource file is the basic resource file of the level, which generally needs to be loaded first. Some level dynamic resource files are dependent on the level basic resource file. For example, only after loading the Shenzhen digital twin map, the level dynamic resource files such as Shenzhen 2DUI and Shenzhen typhoon weather effects can be loaded. Therefore, the loading order of the level basic resource file is generally earlier, and the loading order of the level dynamic resource file is relatively later.
[0255] By adding a resource loading management system, the smoothness of the user experience and the robustness and smoothness of resource loading are guaranteed.
[0256] The resource configuration process in the embodiment of the present application is further illustrated by taking a specific example below.
[0257] In order to ensure that different levels may need to load different dynamic resources, the resource loading management system first implements the level dynamic resource loading mapping configuration. This can be achieved using a flexible and easy-to-manage configuration method (JSON). Specifically, the configuration format is as follows:
[0258]
[0259] Note: The level name is the resource name in UE5, that is, the resource file name of the card, with the suffix .umap. Other resource configurations are the resource names in UE5, that is, the resource file names in the resource file, with the suffix .uasset.
[0260] For example: Shenzhen digital twin map (level resource file name: L_SZ), the dynamic resource files that need to be loaded include UI resource files: Shenzhen map Figure 2 D UI (UI_Map_SZ), traffic light 3D UI at the intersection (UI_Light); effect resource files: thunderstorm weather effect (NS_TS), neon light effect at night (NS_Neon), seaside wave effect (NS_Sea); plot resource files: overlooking the night view of Shenzhen (LS_OverLook), Shenzhen development process (LS_Develop); sound effect resource files: sea wave sound (Sound_Sea), car horn sound (Sound_Car).
[0261] For example, the Shanghai digital twin map (level resource file name: L_SH), the dynamic resource files that need to be loaded include UI resource files: Shanghai map Figure 2 D UI (UI_Map_SH); effect resource files: clear sky / fog weather effects (NS_Sun, NS_Cloud), car exhaust effects (NS_CEE), Shanghai night view (NS_Night).
[0262] Then the corresponding configuration is:
[0263]
[0264]
[0265] The json configuration table above maps the level to each resource file in the resource file that needs to be loaded, so that the dynamic resources configured can be loaded according to the needs when loading different levels. The dynamic resource loading mapping configuration also includes the loading order of the level dynamic resource files, where the configuration order of the dynamic resource files is the loading order.
[0266] In an embodiment of the present application, a dynamic resource loading mapping configuration of the level is set for each level; the dynamic resource loading mapping configuration includes at least one level dynamic resource file used in the level, and the dynamic resource loading mapping configuration includes the loading order of the level dynamic resource files, which can improve the loading efficiency of the resource files and thus improve the smoothness of the level progress bar.
[0267] Embodiment 7:
[0268] Based on the same technical concept, on the basis of the above embodiments, in the embodiments of the present application, a progress bar loading device is also provided. Figure 7 A schematic diagram of a progress bar loading device provided in some embodiments of the present application. Figure 7 As shown, the device comprises:
[0269] The loading module 701 is used to obtain the loaded amount of M target resource files asynchronously loaded according to a preset time step before entering the level; the M target resource files are resource files of which some or all of the N resource files under the level are in a normal loading state; the N resource files include level basic resource files and level dynamic resource files;
[0270] Display module 702 is used to determine the real-time loading progress of the progress bar according to the loaded amount of the M target resource files; determine the corresponding interval of the real-time loading progress on the progress bar, and display the progress bar according to the display progress rule of the corresponding interval; wherein the progress bar is divided into multiple intervals, each interval has a corresponding display progress rule and at least two intervals among the multiple intervals have different corresponding display progress rules.
[0271] In a possible implementation, the display module 702 is specifically used to divide the progress bar into a front section, a middle section and a rear section according to the progress direction; the display progress rule corresponding to at least one of the front section and the rear section is: based on the real-time loading progress, the loading speed of the progress bar is adjusted from fast to slow, and the progress bar is displayed at the intersection with the middle section according to the real-time loading progress; the display progress rule of the middle section is to display the progress bar according to the real-time loading progress.
[0272] In a possible implementation, the display module 702 is specifically used to calculate the real-time loading progress of the progress bar based on the loaded amount of the M target resource files, the file size of the N resource files and the weight of each resource file; wherein, the process of determining the weight of each resource file includes: for any resource file, according to the file size of the resource file and the file size of the N resource files, determining the first sub-weight of the resource file through a first optimization function; according to the loading order of the resource file and the loading order of the N resource files, determining the second sub-weight of the resource file; determining the weight of the resource file according to the first sub-weight and the second sub-weight of the resource file; wherein, the first optimization function is a logarithmic function.
[0273] In a possible implementation, the display module 702 is specifically configured to determine a first ratio of the file size of the resource file to the file sizes of the N resource files, and to process the first ratio using a first optimization function to obtain a first sub-weight.
[0274] In a possible implementation, the display module 702 is specifically used to determine the inverse of the loading order of the resource file and the sum of the inverses of the loading orders of the N resource files, and determine a second ratio of the inverse of the resource file to the sum as the second sub-weight of the resource file.
[0275] In one possible implementation, the display module 702 is specifically used to, when the corresponding interval is the front section, process the real-time loading progress through a second optimization function to obtain an ideal real-time loading progress, and update the progress bar according to the ideal real-time loading progress; wherein the second optimization function is a square root function; the constant in the second optimization function is determined according to the maximum value of the front section; and / or, when the corresponding interval is the back section, process the real-time loading progress through a third optimization function to obtain an ideal real-time loading progress, and update the progress bar according to the ideal real-time loading progress; wherein the third optimization function is a quadratic function; the constant in the third optimization function is determined according to the minimum value of the back section.
[0276] In a possible implementation manner, the loading module 701 is further configured to, if the loading status of any level dynamic resource file is abnormal, repeatedly load the level dynamic resource file; after K loading failures, skip loading the level dynamic resource file and record log information of the failure to load the level dynamic resource file;
[0277] The display module 702 is further used to calculate the real-time loading progress of the progress bar according to the loaded amount of the M target resource files, the file size of the skipped level dynamic resource files, the file size of the N resource files and the weight of each resource file.
[0278] In a possible implementation, the device further includes:
[0279] A configuration module is used to set the dynamic resource loading mapping configuration of each level; the dynamic resource loading mapping configuration includes at least one level dynamic resource file used in the level, and the dynamic resource loading mapping configuration contains the loading order of the level dynamic resource files.
[0280] In an embodiment of the present application, before entering a level, the loaded amount of M target resource files loaded asynchronously is obtained according to a preset time step; the M target resource files are resource files whose loading status is normal for some or all of the N resource files under the level, including level basic resource files and level dynamic resource files, so as to solve the problem of loading jams of dynamic resource files of the level encountered by users after entering the level, and further improve the loading efficiency; according to the loaded amount of the M target resource files, the real-time loading progress of the progress bar and the corresponding interval of the real-time loading progress on the progress bar are determined, and the progress bar is displayed according to the display progress rule of the corresponding interval, so that the user can clearly perceive the changes in progress in different intervals, reduce the anxiety of waiting for loading, and further improve the user experience.
[0281] Embodiment 8:
[0282] Based on the same inventive concept and on the basis of the above embodiments, in an embodiment of the present application, an electronic device is provided, which can realize the function of the progress bar loading device described above. Figure 8 A schematic diagram of the structure of an electronic device provided in some embodiments of the present application. Figure 8 As shown, the electronic device includes: a processor 801, a communication interface 802, a memory 803 and a communication bus 804, wherein the processor 801, the communication interface 802, and the memory 803 communicate with each other through the communication bus 804;
[0283] The memory 803 stores a computer program, and when the program is executed by the processor 801, the processor 801 executes any of the steps of the aforementioned progress bar loading method.
[0284] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0285] The communication interface 802 is used for communication between the above electronic device and other devices.
[0286] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0287] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0288] Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program that can be executed by a processor. When the program runs on the processor, the processor implements the steps of any of the progress bar loading methods described above.
[0289] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CD, DVD, BD, HVD, etc., and semiconductor storage such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD), etc.
[0290] Based on the same inventive concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the progress bar loading methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of the progress bar loading method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.
[0291] In an embodiment of the present application, before entering a level, the loaded amount of M target resource files loaded asynchronously is obtained according to a preset time step; the M target resource files are resource files whose loading status is normal for some or all of the N resource files under the level, including level basic resource files and level dynamic resource files, so as to solve the problem of loading jams of dynamic resource files of the level encountered by users after entering the level, and further improve the loading efficiency; according to the loaded amount of the M target resource files, the real-time loading progress of the progress bar and the corresponding interval of the real-time loading progress on the progress bar are determined, and the progress bar is displayed according to the display progress rule of the corresponding interval, so that the user can clearly perceive the changes in progress in different intervals, reduce the anxiety of waiting for loading, and further improve the user experience.
[0292] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0293] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0294] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0295] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0296] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A level progress bar loading method, characterized in that: Applicable to the level streaming loading technology LevelStreaming, the method includes: Before entering the level, according to the preset time step, the loaded amount of M target resource files loaded asynchronously is obtained; the M target resource files are resource files whose loading status is normal for some or all of the N resource files under the level; the N resource files include level basic resource files and level dynamic resource files; Determine the real-time loading progress of the progress bar according to the loaded amounts of the M target resource files; Determine the corresponding interval of the real-time loading progress on the progress bar, and display the progress bar according to the display progress rule of the corresponding interval; wherein the progress bar is divided into multiple intervals, each interval has a corresponding display progress rule and at least two intervals among the multiple intervals have different display progress rules.
2. The method according to claim 1, characterized in that The progress bar is divided into a front section, a middle section and a back section according to the progress direction; The display progress rule corresponding to at least one of the front section and the back section is: adjusting the loading speed of the progress bar from fast to slow based on the real-time loading progress, and displaying the progress bar according to the real-time loading progress at the intersection with the middle section; The display progress rule of the middle section is to display the progress bar according to the real-time loading progress.
3. The method according to claim 1, characterized in that The step of determining the real-time loading progress of the progress bar according to the loaded amounts of the M target resource files includes: Calculate the real-time loading progress of the progress bar according to the loaded amount of the M target resource files, the file size of the N resource files and the weight of each resource file; The process of determining the weight of each resource file includes: For any resource file, the first sub-weight of the resource file is determined by a first optimization function according to the file size of the resource file and the file size of the N resource files; the second sub-weight of the resource file is determined according to the loading order of the resource file and the loading order of the N resource files; the weight of the resource file is determined according to the first sub-weight and the second sub-weight of the resource file; wherein the first optimization function is a logarithmic function.
4. The method according to claim 3, characterized in that The determining the first sub-weight of the resource file by using a first optimization function according to the file size of the resource file and the file sizes of the N resource files includes: A first ratio of the file size of the resource file to the file sizes of the N resource files is determined, and the first ratio is processed by a first optimization function to obtain a first sub-weight.
5. The method according to claim 3, characterized in that: The determining the second sub-weight of the resource file according to the loading order of the resource file and the loading order of the N resource files includes: Determine the reciprocal of the loading order of the resource file and the sum of the reciprocals of the loading orders of the N resource files, and determine a second ratio of the reciprocal of the resource file to the sum as the second sub-weight of the resource file.
6. The method according to claim 2, characterized in that Displaying the progress bar according to the display progress rule of the corresponding interval includes: When the corresponding interval is the front section interval, the real-time loading progress is processed by a second optimization function to obtain an ideal real-time loading progress, and the progress bar is updated according to the ideal real-time loading progress; wherein the second optimization function is a square root function; and the constant in the second optimization function is determined according to the maximum value of the front section interval; and / or When the corresponding interval is the latter interval, the real-time loading progress is processed by the third optimization function to obtain the ideal real-time loading progress, and the progress bar is updated according to the ideal real-time loading progress; wherein the third optimization function is a quadratic function; the constant in the third optimization function is determined according to the minimum value of the latter interval.
7. The method according to claim 1, characterized in that Before obtaining the loaded amounts of the M target resource files asynchronously loaded, the method further includes: If the loading status of any level dynamic resource file is abnormal, the level dynamic resource file is loaded repeatedly; after K loading failures, the loading of the level dynamic resource file is skipped and the log information of the failure to load the level dynamic resource file is recorded; The calculating the real-time loading progress of the progress bar according to the loaded amount of the M target resource files, the file size of the N resource files and the weight of each resource file includes: The real-time loading progress of the progress bar is calculated according to the loaded amount of the M target resource files, the file size of the skipped level dynamic resource files, the file size of the N resource files and the weight of each resource file.
8. The method according to any one of claims 1 to 7, characterized in that: Before obtaining the loaded amount of the M target resource files loaded asynchronously, the method further includes: For each level, a dynamic resource loading mapping configuration of the level is set; the dynamic resource loading mapping configuration includes at least one level dynamic resource file used in the level, and the dynamic resource loading mapping configuration contains the loading order of the level dynamic resource files.
9. A progress bar loading device, characterized in that: The device comprises: A loading module, used for obtaining the loaded amount of M target resource files asynchronously loaded according to a preset time step before entering the level; the M target resource files are resource files of which some or all of the N resource files under the level are in a normal loading state; the N resource files include level basic resource files and level dynamic resource files; A display module is used to determine the real-time loading progress of the progress bar according to the loaded amount of the M target resource files; determine the corresponding interval of the real-time loading progress on the progress bar, and display the progress bar according to the display progress rule of the corresponding interval; wherein the progress bar is divided into multiple intervals, each interval has a corresponding display progress rule and at least two intervals among the multiple intervals have different display progress rules.
10. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods of claims 1-8 according to the obtained program instructions.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on a computer, the computer is enabled to execute the method according to any one of claims 1 to 8.
