Data playback method based on virtual scene, related device and storage medium
By calculating acceleration information during virtual scene playback to move virtual objects, the performance loss caused by the playback of virtual object position information in existing technologies is solved, achieving a movement effect that is closer to that of real objects and higher stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-09-02
- Publication Date
- 2026-04-28
AI Technical Summary
In the playback of recorded test cases based on virtual scenes, directly using the position information of virtual objects to play back movement results in significant client performance loss and makes it impossible to approximate the movement of real objects.
By acquiring the recording file of the virtual scene, the system determines the associated recording time point closest to the current playback time point in the movement event information. Based on the position information of this recording time point and the position information of the current playback time point, the system calculates the acceleration information and then moves the virtual object to the target position.
It reduces the performance overhead on the client side during playback and makes the movement of virtual objects more closely resemble the movement of real objects, thus improving the stability and accuracy of playback.
Smart Images

Figure CN117679731B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data playback method, related equipment and storage medium based on virtual scenes. Background Technology
[0002] During game testing, virtual scenes in the game are typically recorded to form test cases, and then the corresponding screen of the virtual scene in the game is played back by replaying the recorded test cases.
[0003] In related technologies, when playing back the movement of virtual objects in a virtual scene during recorded test cases based on a virtual scene, the position information of the virtual objects is directly used to play back the movement, which causes a significant loss to the client's performance during the playback process and cannot approximate the movement of real objects. Summary of the Invention
[0004] To address the problems of existing technologies, this application provides a data playback method, related equipment, and storage medium based on a virtual scene. The technical solution is as follows:
[0005] On the one hand, a data playback method based on a virtual scene is provided, the method comprising:
[0006] In response to a recording and playback command, a recording file of the virtual scene is obtained; the recording file includes movement event information, which includes the position information of virtual objects in the virtual scene at multiple recording time points;
[0007] Based on the interactive application, the virtual scene is replayed, and during the replay process, the associated recording time point closest to the current replay time point in the movement event information is determined; the associated recording time point includes a first recording time point before the current replay time point and a second recording time point after the current replay time point;
[0008] Based on the location information of the virtual object corresponding to the associated recording time point, the target location information of the virtual object corresponding to the current playback time point is determined;
[0009] Based on the location information of the virtual object corresponding to the associated recording time point, the target location information, and the current location information of the virtual object corresponding to the current playback time point, the acceleration information of the moving virtual object is determined;
[0010] Based on the acceleration information, the virtual objects in the virtual scene are moved to the target position indicated by the target position information.
[0011] On the other hand, a data playback device based on a virtual scene is provided, the device comprising:
[0012] The recording file acquisition module is used to acquire a recording file of the virtual scene in response to a recording and playback command; the recording file includes movement event information, which includes the position information of virtual objects in the virtual scene at multiple recording time points;
[0013] The playback module is used to play back the virtual scene based on the interactive application, and during the playback process, determine the associated recording time point in the movement event information that is closest to the current playback time point; the associated recording time point includes a first recording time point located before the current playback time point and a second recording time point located after the current playback time point;
[0014] The target location determination module is used to determine the target location information of the virtual object corresponding to the current playback time point based on the location information of the virtual object corresponding to the associated recording time point;
[0015] An acceleration information determination module is used to determine the acceleration information of the moving virtual object based on the position information of the virtual object corresponding to the associated recording time point, the target position information, and the current position information of the virtual object corresponding to the current playback time point;
[0016] The movement module is used to move virtual objects in the virtual scene to the target position indicated by the target position information based on the acceleration information.
[0017] In one exemplary embodiment, the acceleration information determination module includes:
[0018] An inertial vector determination module is used to determine inertial vector information based on first position information and second position information; the first position information refers to the position information of the virtual object corresponding to the first recording time point, and the second position information refers to the position information of the virtual object corresponding to the second recording time point;
[0019] The correction vector determination module is used to determine correction vector information based on the current position information and the target position information when the distance between the current position indicated by the current position information of the virtual object in the virtual scene and the target position is greater than a first preset distance threshold.
[0020] The first acceleration information determination submodule is used to linearly fuse the inertial vector information and the correction vector information to obtain the acceleration information of the moving virtual object.
[0021] In one exemplary embodiment, the acceleration information determination module further includes:
[0022] The second acceleration information determination submodule is used to use the inertial vector information as the acceleration information for moving the virtual object when the distance between the current position indicated by the current position information of the virtual object in the virtual scene and the target position is less than a preset distance threshold.
[0023] In one exemplary embodiment, the mobile module includes:
[0024] The first movement submodule is used to move virtual objects in the virtual scene based on the acceleration information;
[0025] The second movement submodule is used to set the position of the virtual object in the virtual scene corresponding to the current playback time point to the target position through the target interface in the interactive application when the distance between the position of the virtual object after movement and the target position is greater than a second preset distance threshold.
[0026] In one exemplary embodiment, the movement event information further includes orientation information of the virtual object in the virtual scene, and the device further includes:
[0027] The rotation angle determination module is used to determine the rotation angle based on the first orientation information and the second orientation information; the first orientation information refers to the orientation information of the virtual object corresponding to the first recording time point, and the second orientation information refers to the orientation information of the virtual object corresponding to the second recording time point;
[0028] An orientation correction module is used to correct the second orientation information when the rotation angle is greater than a preset angle value to obtain corrected second orientation information; the corrected second orientation information has the same mathematical symbols as the first orientation information;
[0029] The target orientation determination module is used to determine the target orientation information of the virtual object corresponding to the current playback time point based on the first orientation information and the corrected second orientation information;
[0030] A rotation module is used to change the orientation of virtual objects in the virtual scene based on the target orientation information.
[0031] In one exemplary embodiment, the recording file further includes interaction event information, which includes operation information corresponding to at least one interaction operation event; the device further includes:
[0032] The playback time interval determination module is used to determine the playback time interval corresponding to the current playback time point during playback.
[0033] The event matching time determination module is used to determine the event matching time range corresponding to the current playback time point based on half of the playback time interval and the current playback time point;
[0034] The target operation information determination module is used to determine the target operation information in the recording file based on the event matching time range; the occurrence time of the target interactive operation event corresponding to the target operation information falls within the event matching time range;
[0035] An interactive event execution module is used to execute the target interactive event at the current playback time point based on the target operation information if the target interactive operation event has not been executed before the current playback time point.
[0036] In one exemplary embodiment, the recording file includes a first recording file and a second recording file; the playback module includes:
[0037] The event information extraction module is used to extract the movement event information from the first recording file and the interaction event information from the second recording file;
[0038] The playback track determination module is used to determine a first playback track for replaying the movement event information and a second playback track for replaying the interactive event information based on the correspondence between the playback track and the event information.
[0039] A motion event playback module is used to play back the motion event information in the virtual scene running based on the interactive application, based on the first playback track.
[0040] An interactive event playback module is used to play back the interactive event information in the virtual scene running based on the second playback track.
[0041] In an exemplary implementation, when the first recorded file is one of multiple recorded files recorded on different devices; the motion event playback module is specifically used for:
[0042] Obtain the global playback time of the first recorded file; the global playback time is determined based on the offset value of the global time, the offset value of the global time represents the deviation between the global recording times of the multiple recorded files, and the global recording time of each recorded file is determined based on the local recording time and the recording time offset value of the corresponding recorded file;
[0043] The local playback time is determined based on the global playback time and the current time offset value;
[0044] In response to the arrival of the local playback time, the motion event information is replayed in the virtual scene running on the interactive application based on the first playback track.
[0045] On the other hand, an electronic device is provided, including a processor and a memory, wherein the memory stores at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the virtual scene-based data playback method of any of the above aspects.
[0046] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction or at least one program is stored therein, the at least one instruction or the at least one program being loaded and executed by a processor to implement the data playback method based on a virtual scene as described above.
[0047] On the other hand, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the virtual scene-based data playback method described above.
[0048] This application embodiment determines the closest associated recording time point in the movement event information to the current playback time point during the playback of a virtual scene. Based on the position information of the virtual object corresponding to the associated recording time point, it determines the target position information of the virtual object corresponding to the current playback time point. Then, based on the position information of the virtual object corresponding to the associated recording time point, the target position information, and the current position information of the virtual object corresponding to the current playback time point, it determines the acceleration information for moving the virtual object. Based on the acceleration information, it moves the virtual object in the corresponding virtual scene to the target position indicated by the target position information. Thus, when playing back the movement of virtual objects, it uses acceleration information instead of direct position information, which is more in line with the implementation principle of virtual object movement in Unreal Engine, and thus more closely resembles the movement of real objects. At the same time, it greatly reduces the performance loss to the client during the playback process. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1This is a schematic diagram of an implementation environment provided in an embodiment of this application;
[0051] Figure 2 This is a flowchart illustrating a data playback method based on a virtual scene provided in an embodiment of this application;
[0052] Figure 3 This is a flowchart illustrating another data playback method based on a virtual scene provided in an embodiment of this application;
[0053] Figure 4 This is a schematic diagram of local time alignment of moving events provided in an embodiment of this application;
[0054] Figure 5 This is a schematic diagram of the orientation information provided in an embodiment of this application;
[0055] Figure 6 This is a flowchart illustrating another data playback method based on a virtual scene provided in an embodiment of this application;
[0056] Figure 7 This is a flowchart illustrating another data playback method based on a virtual scene provided in an embodiment of this application;
[0057] Figure 8 This is a flowchart illustrating another data playback method based on a virtual scene provided in an embodiment of this application;
[0058] Figure 9 This is an example of global time alignment during multi-machine playback provided in the embodiments of this application;
[0059] Figure 10 This is a schematic diagram of the recording control interface provided in an embodiment of this application;
[0060] Figure 11 This is a partial schematic diagram of the recording result display interface provided in the embodiments of this application;
[0061] Figure 12 This is a schematic diagram of a system architecture provided in an embodiment of this application;
[0062] Figure 13 This is a structural block diagram of a data playback device based on a virtual scene provided in an embodiment of this application;
[0063] Figure 14 This is a hardware structure block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0064] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0065] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0066] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0067] Please see Figure 1 The diagram shown is an implementation environment provided in this application embodiment. The implementation environment includes a terminal 110 and a server 120, wherein the terminal 110 and the server 120 can communicate through a wired or wireless network connection.
[0068] Terminal 110 includes, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, and aircraft. Terminal 110 runs an interactive application that provides a virtual scene. This interactive application can be a standalone application or a subroutine within an application. For example, the interactive application can be a game application developed based on Unreal Engine, specifically Unreal Engine 4 (UE4). UE4 was primarily designed for developing first-person shooter games but has now been successfully applied to developing various types of games, including stealth games, fighting games, and role-playing games.
[0069] Server 120 can provide background services for applications in terminal 110, which may specifically include data processing and storage services. Server 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0070] In one exemplary embodiment, both terminal 110 and server 120 can be node devices in a blockchain system, capable of sharing acquired and generated information with other node devices in the blockchain system, thus enabling information sharing among multiple node devices. Multiple node devices in the blockchain system can be configured with the same blockchain, which consists of multiple blocks, and adjacent blocks are related, ensuring that any data tampering in any block can be detected by the next block. This prevents data tampering in the blockchain and guarantees the security and reliability of the data in the blockchain.
[0071] The embodiments of this application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.
[0072] In some examples, the data playback method based on virtual scenes provided in this application can be applied to game application testing scenarios. The playback method of this application can continuously play the recorded files of virtual scenes on a large number of Android and iOS devices, realize the stability testing of game matches (such as first-person shooter matches), ensure the quality of stability testing, save testing time and manpower, and improve testing efficiency.
[0073] Please see Figure 2 The diagram shown is a flowchart illustrating a data playback method based on a virtual scene provided in an embodiment of this application. This method can be applied to... Figure 1 The terminal in the process. It should be noted that this specification provides the operational steps of the methods described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many, and does not represent the only execution order. In actual system or product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown in the embodiments or drawings... Figure 2 As shown, the method may include:
[0074] S201, in response to the record / playback command, obtains the recording file of the virtual scene.
[0075] The recorded file includes movement event information, which includes the position information of virtual objects in the virtual scene at multiple recording time points.
[0076] Virtual objects in a virtual scene are movable objects within that scene. These movable objects can be virtual characters, virtual animals, etc., such as characters or animals displayed in a 3D virtual scene. For example, virtual objects are 3D models created based on animation skeletal technology. Each virtual object has a certain shape and volume in the 3D virtual scene and occupies a portion of the space within the scene. In specific implementations, virtual objects in a virtual scene can be master virtual objects controlled by a terminal, or other non-master virtual objects; this application does not specifically limit this.
[0077] Multiple recording time points can be obtained based on multiple recording frames determined by the recording frame rate, which refers to the number of frames played by the terminal per unit time during recording. Therefore, each recording frame can be considered a recording time point, or each key recording frame can be considered a recording time point. In specific implementation, movement event information in the recording file can indicate the recording time point by recording the recording frame identifier (such as the recording frame number) and the relative time of that recording frame relative to the starting recording time point. The position information of virtual objects in the virtual scene at each recording time point can be represented by the position coordinates of the virtual object in the world coordinate system of the virtual scene. For example, each recording time point can record the following information: FrameIndex (frame number): 1, TimeElapsed (relative time): 0.0377166, V0 (position information): "32545.460938, -9060.379883, 2528.28125".
[0078] S203, based on the interactive application, replay the above virtual scene, and determine the associated recording time point in the mobile event information that is closest to the current playback time point during the playback process.
[0079] The associated recording time points include the first recording time point before the current playback time point and the second recording time point after the current playback time point.
[0080] The current playback time point can be obtained based on multiple playback frames determined by the playback frame rate, which refers to the number of frames played by the terminal per unit time during playback. Therefore, each playback frame can be considered as a playback time point, or each key playback frame can be considered as a playback time point.
[0081] In one possible implementation, when the recording ends, the terminal uploads the recorded file to the server for storage. Then, when playing back, the terminal can parse the recording playback instruction after receiving it to obtain the identification information of the recorded file, and then obtain the corresponding recorded file from the server based on the identification information of the recorded file to obtain the recording file of the virtual scene.
[0082] In one specific implementation, when determining the closest associated recording time point in the motion event information to the current playback time point during playback, the current relative time of the current playback time point relative to the starting playback time point can be determined first. Then, the relative time of each recording time point relative to the starting recording time point can be determined. Then, the two target relative times closest to the current relative time can be found from the relative times corresponding to multiple recording time points. One target relative time is greater than the current relative time, and the other target relative time is less than the current relative time. The recording time points corresponding to these two target relative times are then determined as the associated recording time points of the current playback time point.
[0083] For example, assuming the current relative time of the current playback time point relative to the starting playback time point is 5.1s, and the relative times corresponding to multiple recording time points are 0, 1.3, 2.1, 3.6, 4.2, 5.8, 6.4, 7.1, and 8.9, then the two target relative times closest to the current relative time can be determined to be 4.2 and 5.8. The recording time point corresponding to 4.2 can be taken as the first recording time point, and the recording time point corresponding to 5.8 can be taken as the second recording time point, thus obtaining the associated recording time point corresponding to the current playback time point.
[0084] S205, based on the location information of the virtual object corresponding to the associated recording time point, determine the target location information of the virtual object corresponding to the current playback time point.
[0085] Specifically, interpolation can be performed based on the position information of the virtual object at the first recording time point and the position information of the virtual object at the second recording time point to obtain the target position information of the virtual object at the current playback time point. The target position indicated by the target position information can be considered as the position at the time of recording at the current playback time point.
[0086] S207, based on the location information of the virtual object corresponding to the associated recording time point, the target location information, and the current location information of the virtual object corresponding to the current playback time point, determine the acceleration information of the moving virtual object.
[0087] The acceleration information of the moving virtual object can be a normalized acceleration vector (e.g., -0.009953, 0.999951, 0.0, unit cm / s). 2 ).
[0088] Understandably, before determining the acceleration information of the virtual object, it is possible to first determine whether the virtual object is in motion. If it is in motion, step S207 can be executed; otherwise, if it is in a non-motion state, i.e., a stationary state, step S207 can be skipped.
[0089] In one exemplary implementation, such as Figure 3 As shown, step S207, when implemented, may include:
[0090] S301, Based on the first position information and the second position information, determine the inertial vector information;
[0091] The first location information refers to the location information of the virtual object corresponding to the first recording time point, and the second location information refers to the location information of the virtual object corresponding to the second recording time point.
[0092] In specific implementation, the unit vectors in the X direction and Y direction can be calculated based on the first and second position information, respectively. Then, the unit vectors in the X and Y directions are multiplied by a preset value to form the inertial vector information V. t The preset values can be set based on practical experience.
[0093] S303, determine whether the distance between the current position indicated by the current position information of the virtual object in the virtual scene and the target position is greater than a first preset distance threshold.
[0094] The target location is the location indicated by the target location information. The first preset distance threshold is the distance at which the virtual object oscillates and moves. Generally, the smaller the first preset distance threshold, the longer the virtual object oscillates when it moves. This first preset distance threshold can be set based on practical experience, for example, 5cm.
[0095] The current position information of a virtual object in a virtual scene refers to the position information of the virtual object at the current playback time point during the playback process.
[0096] Specifically, if the result of the judgment is that the distance between the current position and the target position is greater than the first preset distance threshold, then the following steps S305 to S307 can be executed; otherwise, if the result of the judgment is that the distance between the current position and the target position is less than or equal to the first preset distance threshold, then the following step S309 can be executed.
[0097] S305, based on the current location information and the target location information, determine the correction vector information.
[0098] In specific implementation, the vector information V is corrected. rIt can be obtained through the following formula:
[0099]
[0100] Among them, P R Represents target location information (x) R ,y R P represents the current position information (x, y); S is the scaling value, a positive number used to control the strength of the correction, which can be set based on practical experience; S T This represents the maximum threshold for the location, used to limit the final scaling value. It can be set according to the actual situation, for example, it can be 500cm.
[0101] S307 performs linear fusion of inertial vector information and correction vector information to obtain the acceleration information of the moving virtual object.
[0102] In practical implementation, to ensure that the movement state of the virtual object is not interrupted, an adjustment coefficient can be set for the correction vector during the above linear fusion. The magnitude of this adjustment coefficient can be determined based on a target angle threshold, which is the maximum allowable angle between the direction indicated by the acceleration information and the direction indicated by the inertial vector information. When this maximum allowable angle is exceeded, the movement state of the virtual object will be interrupted. Based on this, the acceleration information can be expressed by the following formula:
[0103] Acceleration information = V t +ratio*V r
[0104] Here, ratio represents the adjustment coefficient.
[0105] For example, if a virtual object is running and you don't want to interrupt the running state, the angle between the direction indicated by the acceleration information and the direction indicated by the inertial vector information cannot exceed 60 degrees. In other words, the ratio can be controlled based on the target angle threshold of 60 degrees so that the angle between the final acceleration information and the inertial vector information does not exceed 60 degrees.
[0106] S309 uses inertial vector information as acceleration information for the moving virtual object.
[0107] When the distance between the current position and the target position of the virtual object is less than or equal to a first preset distance threshold, it indicates that the virtual object is very close to the target position. To avoid oscillating movement of the virtual object, no correction vector information is calculated at this time; that is, the acceleration information at this time is equal to the inertial vector information V. t .
[0108] The above implementation method obtains accurate acceleration information by calculating the vector derivation between the current position and the target position, and avoids the oscillation effect that may occur when the distance between the current position and the target position of the virtual object is relatively small, thus ensuring the accuracy of moving the virtual object based on the acceleration information.
[0109] S209, based on the aforementioned acceleration information, move the virtual object in the virtual scene to the target position indicated by the target position information.
[0110] Specifically, during playback, the `AddMovementInput` function of `ACharacter` can be called to handle the movement of the virtual object, using acceleration information as the input parameter. In practical applications, to control the movement of the virtual object, a scaling value (e.g., 0.22) can also be used as the input parameter of the above function to adjust the final acceleration magnitude. The acceleration of the virtual object during movement is the product of the normalized acceleration vector and the scaling value. This acceleration is used to pull the virtual object closer to the target position.
[0111] In one exemplary embodiment, step S209 described above may include:
[0112] Virtual objects in a virtual scene are moved based on acceleration information;
[0113] If the distance between the virtual object's moved position and the target position is greater than the second preset distance threshold, then the position of the virtual object in the virtual scene corresponding to the current playback time point is set as the target position through the target interface in the interactive application.
[0114] The second preset distance threshold can be set based on actual experience, for example, it can be 50cm. The second preset distance threshold is used to force the virtual object to be set to the target position when it is still impossible to move the virtual object to the target position based on acceleration information, that is, to perform hard correction on the position of the virtual object.
[0115] In this interactive application, the target interface can be used to set the position of virtual objects in the virtual scene. That is, the virtual object can be instantly teleported to the set position through this target interface. It is understood that forcibly setting the virtual object's position to the target position (hard correction) would cause performance consumption in the interactive application and is inconsistent with the normal process. Therefore, in this embodiment, forced setting (hard correction) is only performed if, after moving the virtual object based on acceleration information, the distance between the moved position and the target position still exceeds a second preset distance threshold. This combination of methods ensures that the virtual object is accurately moved to the target position while minimizing the performance consumption of the interactive application.
[0116] As can be seen from the above technical solutions of the embodiments of this application, when replaying the movement of a virtual object, by determining the acceleration information and using the acceleration information to pull the virtual object to approach the target position, the movement of the virtual object during playback is more in line with the implementation principle of virtual object movement in Unreal Engine, and thus closer to the movement of real objects. At the same time, it greatly reduces the performance loss to the client during the playback process, has higher stability, and is easier to implement.
[0117] In addition, by determining the nearest associated recording time point to the current playback time point, and based on the location information of the virtual object corresponding to the associated recording time point, the target location information of the virtual object corresponding to the current playback time point can be determined, thus achieving local time alignment of movement events. This ensures that the playback duration of the recording corresponding to the same recording file is consistent on terminals with different playback frame rates, and that the movement of the virtual object is consistent.
[0118] like Figure 4 The diagram shown is a schematic representation of local time alignment of movement events provided in an embodiment of this application. The middle section represents game recording at a frame rate of 30 frames per second (i.e., recording frame rate of 30 frames per second). The top and bottom sections represent playback of the same recording file in games at 50 frames per second and 15 frames per second, respectively (i.e., playback frame rates of 50 frames per second and 15 frames per second, respectively). Figure 4 It can be seen that the playback duration of the video corresponding to the same recording file is consistent on terminals with different playback frame rates, and the movement of virtual objects is also consistent, thus enabling accurate and consistent playback on different playback devices.
[0119] In one exemplary implementation, the movement event information contained in the virtual scene recording file may further include the orientation information of virtual objects in the virtual scene. That is, when recording the virtual scene, the orientation information of virtual objects in the virtual scene is recorded at each recording time point. Typically, the orientation information can be recorded in the form of (pitch, yaw, roll), such as... Figure 5 The diagram showing orientation information indicates that pitch refers to the pitch angle around the X-axis, yaw refers to the yaw angle around the Y-axis, and roll refers to the roll angle around the Z-axis. Typically, the roll angle is zero. Therefore, when replaying a virtual scene, for the current playback time point, the rotation of the virtual object can also be replayed based on the orientation information of the virtual object corresponding to its associated recording time point.
[0120] Considering the unique characteristics of angles, directly calculating the target's orientation information using associated recording time points when replaying the rotation of a virtual object can result in poor rotation effects and wasted computational resources. For example, rotating from approximately -178° to 178°, the desired rotation is 4°, but current technologies do not consider the specific characteristics of angle rotation, resulting in an actual rotation of 356°. Therefore, if... Figure 6 As shown, the method in this application embodiment may further include:
[0121] S601, based on the first orientation information and the second orientation information, determines the rotation angle.
[0122] The first orientation information refers to the orientation information of the virtual object corresponding to the first recording time point, and the second orientation information refers to the orientation information of the virtual object corresponding to the second recording time point.
[0123] S603, determine whether the rotation angle is greater than the preset angle value.
[0124] The preset angle value is 180 degrees.
[0125] Specifically, if the result of the judgment is yes, then steps S605 to S607 can be executed; otherwise, step S609 can be executed.
[0126] S605, the second orientation information is corrected to obtain the corrected second orientation information.
[0127] The corrected second orientation information has the same mathematical symbols as the first orientation information.
[0128] S607, Based on the first orientation information and the corrected second orientation information, determine the target orientation information of the virtual object corresponding to the current playback time point.
[0129] Specifically, interpolation can be performed based on the first orientation information and the corrected second orientation information to obtain the target orientation information of the virtual object at the current playback time point.
[0130] S609, based on the first orientation information and the second orientation information, determine the target orientation information of the virtual object corresponding to the current playback time point.
[0131] Specifically, interpolation can be performed based on the first orientation information and the second orientation information to obtain the target orientation information of the virtual object at the current playback time point.
[0132] S611, based on target orientation information, changes the orientation of virtual objects in the virtual scene.
[0133] Specifically, based on the current orientation information of the virtual object at the current playback time point and the target orientation information, orientation change information (which can usually include the angle value of the pitch orientation change and the angle value of the yaw orientation change) can be determined, thereby causing the virtual object in the virtual scene to rotate based on the orientation change information.
[0134] In practical applications, you can call the AddPitchInput and AddYawInput functions of APlayController. The AddPitchInput function contains the angle value of the pitch orientation change, and the AddYawInput function contains the angle value of the yaw orientation change.
[0135] For example, assuming the roll angle is always zero, the first orientation information can be represented as (StartRot.X, StartRot.Y), and the second orientation information can be represented as (EndRot.X, EndRot.Y). Then, for each rotation direction (including the X-axis rotation direction and the Y-axis rotation direction), the target orientation value corresponding to that direction can be determined based on the above steps S601 to S609. Thus, the target orientation values of each direction constitute the target orientation information.
[0136] Taking the X-axis rotation direction as an example: Calculate the absolute value of the difference between EndRot.X and StartRot.X. If it is greater than 180, then EndRot.X is corrected. That is, calculate whether the difference between EndRot.X and StartRot.X is greater than zero. If it is greater than zero, then EndRot.X = EndRot.X - 360. Otherwise, if it is less than zero, then EndRot.X = EndRot.X + 360. If the absolute value of the difference between EndRot.X and StartRot.X is less than or equal to 180, then EndRot.X is not corrected.
[0137] Taking the Y-axis rotation direction as an example: Calculate the absolute value of the difference between EndRot.Y and StartRot.Y. If it is greater than 180, then EndRot.Y is corrected. That is, calculate whether the difference between EndRot.Y and StartRot.Y is greater than zero. If it is greater than zero, then EndRot.Y = EndRot.Y - 360. Otherwise, if it is less than zero, then EndRot.Y = EndRot.Y + 360. If the absolute value of the difference between EndRot.Y and StartRot.Y is less than or equal to 180, then EndRot.Y is not corrected.
[0138] The above implementation method corrects two angle values to have the same sign by judging the rotation angle, and determines the target orientation information corresponding to the current playback time point based on the corrected orientation information. Then, it changes the orientation of the virtual object in the virtual scene based on the target orientation information to realize the rotation playback of the virtual object. This improves the playback rotation effect while reducing the consumption of computing resources during the playback process.
[0139] In one exemplary implementation, the recording file of the virtual scene further includes interaction event information, which includes operation information corresponding to at least one interaction operation event.
[0140] Interactive events refer to UI (User Interface) click events, which are actually Slate events. Slate events occur when a user performs an input operation on a device within Unreal Engine. The corresponding operating system sends the input operation to the application, which caches the operation in the corresponding input device abstract object. At each system timing cycle (such as a tick clock cycle, where a tick is the unit of machine timing), the operating system calls the input device abstract object to convert the cached input event into an engine input event, including TouchStart / TouchEnd / MouseButtonDown / MouseButtonUp.
[0141] It should be noted that the interactive operation events in this application embodiment do not include the operation of the wheel, because recording the wheel operation to record the movement requires recording sliding information, which is difficult to record, has low stability, and is difficult to guarantee the accuracy of movement on different devices.
[0142] In specific implementation, when recording a virtual scene, interactive operation events, including TouchStart / TouchEnd / MouseButtonDown / MouseButtonUp, can be monitored. Upon receiving an interactive operation event, the system records the corresponding operation information. This information may include the recording frame identifier (recording frame number), occurrence time, path information, click event location information, and location ratio, etc., where the occurrence time is relative to the start recording time. Therefore, when playing back the virtual scene, the interactive operation event information can also be replayed. Specifically, for example... Figure 7 As shown, the method may further include:
[0143] S701, during playback, determine the playback time interval corresponding to the current playback time point.
[0144] The playback time interval corresponding to the current playback time point is the playback time interval closest to the current playback time point. For example, if the time interval between the current playback time point and the previous playback time point is 5 seconds, and the time interval between the current playback time point and the next playback time point is 5.5 seconds, then the playback time interval closest to the current playback time point is 5 seconds.
[0145] S703, based on half of the playback time interval and the current playback time point, determine the event matching time range corresponding to the current playback time point.
[0146] Specifically, the event matching time range corresponding to the current playback time point can be expressed as [current playback time point - playback time interval / 2, current playback time point + playback time interval / 2], where the current playback time point represents the current relative time relative to the starting playback time point. Taking a playback time interval of 5s and a current playback time point of 6s as an example, the event matching time range corresponding to the current playback time point is [3.5, 8.5].
[0147] S705 determines the target operation information in the recorded file based on the event matching time range.
[0148] Among them, the occurrence time of the target interactive operation event corresponding to the target operation information falls within the event matching time range.
[0149] For example, if the time of occurrence of an interactive operation event relative to the start recording time is 4.5 seconds, since 4.5 seconds falls within [3.5, 8.5], the operation information corresponding to the interactive operation event can be determined to be the target operation information.
[0150] S707: If the target interaction event has not been executed before the current playback time point, then the target interaction event is executed at the current playback time point based on the target operation information.
[0151] In practice, screen clicks can be achieved by triggering the OnTouchStarted and OnTouchEnded functions of FSlateApplication.
[0152] In the above implementation, for the current playback time point, if the occurrence time of the target interactive operation event corresponding to the target operation information in the recording file falls within the event matching time range determined based on the playback time interval, and the target interactive operation event has not been executed before the current playback time point, then the target interactive operation event is executed at the current playback time point. This ensures that the event triggering timing of the recording file corresponding to the same recording file is consistent on terminals with different frame rates, thereby improving the accuracy of interactive operation event playback.
[0153] In one exemplary implementation, to enrich the recording use cases, two playback tracks, denoted as Playback Track A and Playback Track B, are provided when playing back virtual scenes based on interactive applications. Each playback track can be configured with its allowed playback events. In practical applications, motion-related events (including the movement and rotation of virtual objects) can be played on Playback Track A while other events are blocked. Interactive operation events can be played on Playback Track B while motion-related events are blocked. By combining the events from the two playback tracks, the recording files can be combined, thereby enriching the recording use cases.
[0154] Based on this, in response to the recording and playback command, the terminal can obtain recording files of the virtual scene, which may include a first recording file and a second recording file. It can be understood that the first and second recording files are files recorded for the same virtual scene. They can be two recording files recorded separately by the same recording device for the same virtual scene, or they can be recording files recorded separately by different recording devices for the same virtual scene. Here, the recording device refers to the terminal device used to run the virtual scene based on the interactive application during recording. For example... Figure 8 As shown, when replaying a virtual scene based on an interactive application, it may include:
[0155] S801, extract motion event information from the first recording file and extract interaction event information from the second recording file.
[0156] S803, based on the correspondence between playback tracks and event information, determines a first playback track for playing back motion event information and a second playback track for playing back interactive event information.
[0157] The correspondence between playback tracks and event information can be preset based on actual needs. Playback tracks include a first playback track and a second playback track, while event information includes movement event information and interaction event information. To avoid virtual objects pulling each other during playback, which could negatively impact the playback effect, the first and second playback tracks do not simultaneously correspond to movement event information.
[0158] The S805, based on the first playback track, replays motion event information in a virtual scene running based on an interactive application.
[0159] Among them, the playback of movement event information in the virtual scene based on the first playback track includes the playback of the movement of the virtual object, that is, the execution of the relevant content of the aforementioned steps S203 to S209 of the present application embodiment, and may also include the playback of the rotation of the virtual object, that is, the execution of the relevant content of the aforementioned steps S601 to S611 of the present application embodiment, which will not be described in detail here.
[0160] The S807, based on the second playback track, replays interactive event information in a virtual scene running based on an interactive application.
[0161] Among them, replaying interactive event information in a virtual scene based on an interactive application based on the second playback track is the relevant content of the aforementioned steps S701 to S707 of this application embodiment, which will not be repeated here.
[0162] In the above implementation, by separating the movement event information and the interactive operation event information and playing them on two independent playback tracks during playback, the combination of recorded files can be realized, greatly expanding the richness of recorded test cases and improving the efficiency of interactive application testing.
[0163] In practical applications, sometimes multi-machine recording is performed on virtual scenes. This involves running the virtual scene on multiple terminal devices based on interactive applications and recording each terminal device to obtain a recording file for that virtual scene on each terminal device. This results in a multi-machine recording file of the virtual scene, which consists of multiple recording files of the virtual scene recorded on multiple different devices. The multi-machine recording files of the virtual scene are then uploaded to a server for storage. The identification information of each recording file includes testid and device ID. For multi-machine recording files generated from a single recording of a virtual scene, the testid is the same, but the device ID is different. Therefore, recording files with the same testid can be distinguished based on the device ID.
[0164] When replaying multi-machine recorded files of a virtual scene, each terminal device can parse the identification information of the recorded file to be replayed from the recording playback command. For example, if the recording playback command is "dorecord startreplay,insidegame_single_2022_1_13_1,26efc8d4", then "insidegame_single_2022_1_13_1" is the testid, and "26efc8d4" is the device ID at the time of recording. It should be noted that the device ID in the identification information of the multi-machine recorded files is only used to distinguish recorded files with the same testid, and does not require the terminal device at the time of playback to have the same device ID.
[0165] After each terminal device parses and obtains the identification information of the recording file it wants to play back, it can send a recording file retrieval request to the server based on this identification information. Understandably, when playing back multi-device recordings, the recording files requested by different terminal devices are different. When the server determines that the number of requesting devices is the same as the number of multi-device recording files, it sends the requested recording file to the corresponding terminal device based on the recording file retrieval request for each terminal device. Thus, each terminal device can play back the virtual scene based on the sent recording file, achieving multi-device playback of the virtual scene.
[0166] In this embodiment of the application, in order to achieve collaborative movement and operation of multiple machines when playing back multi-machine recording files of virtual scenes, the above-mentioned Figure 8 In the illustrated implementation, when the first recorded file is one of multiple recorded files recorded from different devices, it indicates a scenario of playing back multi-device recorded files. In this case, step S805 may include the following:
[0167] Get the global playback time of the first recorded file;
[0168] Based on the global playback time and the current time offset value, the local playback time is determined;
[0169] In response to the arrival of the aforementioned local playback time, the motion event information is replayed in the virtual scene running on the interactive application based on the first playback track.
[0170] The global playback time is determined based on the offset value of the global time. This offset value represents the deviation between the global recording times of multiple recording files obtained from recording virtual scenes on different devices. The global recording time of each of the above recording files is determined based on the local recording time and the recording time offset value of the corresponding recording file.
[0171] Taking the first recorded file as an example, the local recording time of the first recorded file is the time corresponding to the start of recording on the corresponding device. The recording time offset value refers to the offset of the local time of the corresponding device relative to the system time of the server. The global recording time of the first recorded file can be determined by the local recording time and the recording time offset value. For example, the global recording time is the sum of the local recording time and the recording time offset value. Similarly, for each recorded file in a multi-machine recording file of a virtual scene, the global recording time of that recorded file can be obtained, and thus the global time offset value between the multi-machine recording files can be determined. This global time offset value still needs to be maintained when playing back the multi-machine recording file. Therefore, when the server distributes the first recorded file, it will distribute the global playback time of the first recorded file based on the global time offset value between the multi-machine recording files. Thus, the terminal device playing back the first recorded file can obtain the global playback time of the first recorded file.
[0172] After obtaining the global playback time of the first recorded file, the terminal device can ensure the local playback time based on the global playback time and the current time offset value (that is, the local time offset value of the terminal device, i.e., the deviation of the local time of the terminal device from the system time of the server). Specifically, the local playback time can be obtained by subtracting the current time offset value from the global playback time. The first playback track, which is usually used to play back motion event information, is the main track and has the function of global time alignment. Therefore, when the local playback time is reached, the terminal device can play back the motion event information in the virtual scene based on the interactive application based on the first playback track. This makes each recorded file in the multi-machine recording file of the virtual scene globally time aligned in the playback of the corresponding device, realizing the coordination of multi-machine movement and operation.
[0173] The following example uses a multi-machine recording file of a virtual scene, which includes two recording files. Figure 9 As shown, the multi-machine recording files of the virtual scene are recording file A and recording file B, where delta T is the offset value of the global time, which represents the deviation between the global recording time of recording file A and the global recording time of recording file B.
[0174] When playing back the aforementioned recorded files A and B of the virtual scene, Device 1 and Device 2 respectively respond to the recording playback command and send a request to the server to obtain the recorded files. When the number of requests is 2, the server determines the global playback time T1' of recorded file A and the global playback time T2' of recorded file B based on delta T, where T2' = T1' + delta T. The server sends recorded file A and global playback time T1' to device 1, and simultaneously sends recorded file B and global playback time T2' to device 2. Device 1 then calculates its local playback time based on the difference between the global playback time T1' and its own time offset. When the local playback time is reached, it replays the movement event information in recorded file A in a virtual scene based on the interactive application, using its first playback track. Similarly, device 2 calculates its local playback time based on the difference between the global playback time T2' and its own time offset. When the local playback time is reached, it replays the movement event information in recorded file B in a virtual scene based on the interactive application, using its first playback track. This ensures that each recorded file in the multi-machine recording files is globally time-aligned during playback on the corresponding device, enabling collaborative movement and operation across multiple machines.
[0175] To facilitate understanding of the technical solutions in this application's embodiments, the following description uses a mobile terminal game application developed based on UE4 as an example. The technical solution in this application's embodiments involves adding a recording and playback plugin to the game application's Plugins directory and then compiling the package normally.
[0176] In practice, during the recording phase of the virtual scene, a recording control program can be run on a terminal (such as a personal computer) to display the recording control program interface. Figure 10 The diagram shows the recording control interface. Clicking the "Open Recording / Playback Plugin" button restarts the game application and enters a virtual scene (such as a single game or in-game battle, like a first-person shooter). Select the test type, click "Start Recording," and then operate normally on the real device. You can move virtual objects, click UI buttons, open panels, etc. After completing the operation, stop recording, and the recorded file will be automatically uploaded to the backend server. For multi-device recording, you need to specify the same recording test case prefix, then start recording on multiple devices simultaneously, and then stop recording. Each device will generate a recording file and upload it. Below is an example of a recording file:
[0177] For motion event information (position and orientation information), it is recorded per frame:
[0178]
[0179] For click event information, record:
[0180]
[0181] Additionally, the recording results can be displayed after the recording ends, such as... Figure 11 This is a partial schematic diagram of the recording result display interface provided in the embodiments of this application. Each recording file corresponds to a local recording time (StartTimeStamp) and a recording time offset value (ServerTimeOffeset), etc.
[0182] Recording the virtual scene of the game yields a recording file, which can then be used for accurate playback during the virtual scene replay phase, based on the aforementioned data playback method described in this application. In game testing applications, continuous playback on numerous Android and iOS devices enables stable testing of a single game session, ensuring the quality of the stability test and improving testing efficiency and accuracy.
[0183] Figure 12 This is a schematic diagram of a system architecture used to implement an embodiment of this application, mainly including a recording module and a playback module.
[0184] The recording module is used to record operation events (or slate events), movement events, and other custom events, ultimately saving them as a single recording file and uploading it. Specifically, the recording module calculates the recording time offset, records character position and orientation information, monitors slate events, and records custom events. When calculating the recording time offset, it synchronizes with the backend server to calculate the offset between the local recording time and the global time, correcting time differences between various local clients and ensuring all clients have the same base time. For recording character position and orientation information, it records the frame number, relative time, and value of these events during recording. It monitors slate events, including TouchStart / TouchEnd / MouseButtonDown / MouseButtonUp, and records their frame number, relative time, path information, click event location information, and location ratio. It also records custom events, such as UE4Command events, recording their frame number, relative time, and value.
[0185] The playback module's functions include: downloading recorded files, replaying movement event information and operation event (slate event) information based on the recorded files, and also including the playback of custom event information (such as command events and other events). For details on the implementation of the playback module's specific functions, please refer to the relevant descriptions in the embodiments of this application; they will not be repeated here.
[0186] Corresponding to the data playback methods based on virtual scenes provided in the above embodiments, this application also provides a data playback device based on virtual scenes. Since the data playback device based on virtual scenes provided in this application corresponds to the data playback methods based on virtual scenes provided in the above embodiments, the implementation methods of the aforementioned data playback methods based on virtual scenes are also applicable to the data playback device based on virtual scenes provided in this embodiment, and will not be described in detail in this embodiment.
[0187] Please see Figure 13 The diagram shown is a structural schematic of a data playback device based on a virtual scene provided in an embodiment of this application. The device has the function of implementing the data playback method based on a virtual scene in the above method embodiment. The function can be implemented by hardware or by hardware executing corresponding software.
[0188] like Figure 13 As shown, the device may include:
[0189] The recording file acquisition module 1310 is used to acquire a recording file of the virtual scene in response to a recording and playback command; the recording file includes movement event information, which includes the position information of virtual objects in the virtual scene at multiple recording time points;
[0190] The playback module 1320 is used to play back the virtual scene based on the interactive application, and during the playback process, it determines the associated recording time point in the movement event information that is closest to the current playback time point; the associated recording time point includes a first recording time point before the current playback time point and a second recording time point after the current playback time point;
[0191] The target location determination module 1330 is used to determine the target location information of the virtual object corresponding to the current playback time point based on the location information of the virtual object corresponding to the associated recording time point;
[0192] The acceleration information determination module 1340 is used to determine the acceleration information of the moving virtual object based on the position information of the virtual object corresponding to the associated recording time point, the target position information, and the current position information of the virtual object corresponding to the current playback time point;
[0193] The movement module 1350 is used to move a virtual object in the virtual scene to the target position indicated by the target position information based on the acceleration information.
[0194] In one exemplary embodiment, the acceleration information determination module 1340 includes:
[0195] An inertial vector determination module is used to determine inertial vector information based on first position information and second position information; the first position information refers to the position information of the virtual object corresponding to the first recording time point, and the second position information refers to the position information of the virtual object corresponding to the second recording time point.
[0196] The correction vector determination module is used to determine correction vector information based on the current position information and the target position information when the distance between the current position indicated by the current position information of the virtual object in the virtual scene and the target position is greater than a first preset distance threshold.
[0197] The first acceleration information determination submodule is used to linearly fuse the inertial vector information and the correction vector information to obtain the acceleration information of the moving virtual object.
[0198] In one exemplary embodiment, the acceleration information determination module 1340 further includes:
[0199] The second acceleration information determination submodule is used to take the inertial vector information as the acceleration information for moving the virtual object when the distance between the current position indicated by the current position information of the virtual object in the virtual scene and the target position is less than a preset distance threshold.
[0200] In one exemplary embodiment, the mobile module 1350 includes:
[0201] The first movement submodule is used to move virtual objects in the virtual scene based on the acceleration information;
[0202] The second movement submodule is used to set the position of the virtual object in the virtual scene corresponding to the current playback time point to the target position through the target interface of the interactive application when the distance between the position of the virtual object after movement and the target position is greater than the second preset distance threshold.
[0203] In one exemplary embodiment, the movement event information further includes orientation information of the virtual object in the virtual scene, and the device further includes:
[0204] The rotation angle determination module is used to determine the rotation angle based on the first orientation information and the second orientation information; the first orientation information refers to the orientation information of the virtual object corresponding to the first recording time point, and the second orientation information refers to the orientation information of the virtual object corresponding to the second recording time point.
[0205] An orientation correction module is used to correct the second orientation information when the rotation angle is greater than a preset angle value to obtain corrected second orientation information; the corrected second orientation information has the same mathematical symbols as the first orientation information;
[0206] The target orientation determination module is used to determine the target orientation information of the virtual object corresponding to the current playback time point based on the first orientation information and the corrected second orientation information;
[0207] The rotation module is used to change the orientation of virtual objects in the virtual scene based on the target orientation information.
[0208] In one exemplary embodiment, the recording file further includes interaction event information, which includes operation information corresponding to at least one interaction operation event; the device further includes:
[0209] The playback time interval determination module is used to determine the playback time interval corresponding to the current playback time point during playback.
[0210] The event matching time determination module is used to determine the event matching time range corresponding to the current playback time point based on half of the playback time interval and the current playback time point;
[0211] The target operation information determination module is used to determine the target operation information in the recording file based on the event matching time range; the occurrence time of the target interactive operation event corresponding to the target operation information falls within the event matching time range.
[0212] The interactive event execution module is used to execute the target interactive event at the current playback time point based on the target operation information if the target interactive operation event has not been executed before the current playback time point.
[0213] In one exemplary embodiment, the recording file includes a first recording file and a second recording file; the playback module includes:
[0214] The event information extraction module is used to extract the movement event information from the first recording file and the interaction event information from the second recording file;
[0215] The playback track determination module is used to determine a first playback track for replaying the movement event information and a second playback track for replaying the interactive event information based on the correspondence between the playback track and the event information.
[0216] The motion event playback module is used to play back the motion event information in the virtual scene running based on the interactive application, based on the first playback track.
[0217] The interactive event playback module is used to play back the interactive event information in the virtual scene running based on the interactive application, based on the second playback track.
[0218] In one exemplary implementation, when the first recorded file is one of multiple recorded files recorded from different devices; the motion event playback module is specifically used for:
[0219] Obtain the global playback time of the first recorded file; the global playback time is determined based on the offset value of the global time, which represents the deviation between the global recording times of the multiple recorded files, and the global recording time of each recorded file is determined based on the local recording time and the recording time offset value of the corresponding recorded file;
[0220] The local playback time is determined based on the global playback time and the current time offset.
[0221] In response to the arrival of the local playback time, the movement event information is replayed in the virtual scene running on the interactive application based on the first playback track.
[0222] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0223] This application provides an electronic device, which includes a processor and a memory. The memory stores at least one instruction or at least one program. The at least one instruction or at least one program is loaded and executed by the processor to implement any of the virtual scene-based data playback methods provided in the above method embodiments.
[0224] Memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. Memory can primarily include a program storage area and a data storage area. The program storage area can store the operating system, application programs required for the functions, etc.; the data storage area can store data created based on the use of the device, etc. Furthermore, memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, memory can also include a memory controller to provide the processor with access to the memory.
[0225] The methods and embodiments provided in this application can be executed in a computer terminal, server, or similar computing device; that is, the aforementioned electronic device may include a computer terminal, server, or similar computing device. Taking running on a terminal as an example... Figure 14 This is a hardware structure block diagram of a terminal that runs a data playback method based on a virtual scene, as provided in an embodiment of the present invention. Specifically:
[0226] The terminal may include an RF (Radio Frequency) circuit 1410, a memory 1420 including one or more computer-readable storage media, an input unit 1430, a display unit 1440, a sensor 1450, an audio circuit 1460, a WiFi (Wireless Fidelity) module 1470, a processor 1480 including one or more processing cores, and a power supply 1490, etc. Those skilled in the art will understand that... Figure 14 The terminal structure shown does not constitute a limitation on the terminal and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0227] RF circuit 1410 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and hands it over to one or more processors 1480 for processing; additionally, it transmits uplink data to the base station. Typically, RF circuit 1410 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, etc. Furthermore, RF circuit 1410 can also communicate wirelessly with networks and other terminals. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), email, SMS (Short Messaging Service), etc.
[0228] The memory 1420 can be used to store software programs and modules. The processor 1480 executes various functional applications and data processing by running the software programs and modules stored in the memory 1420. The memory 1420 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for the functions, etc.; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 1420 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1420 may also include a memory controller to provide access to the memory 1420 for the processor 1480 and the input unit 1430.
[0229] Input unit 1430 can be used to receive input numerical or character information, and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control. Specifically, input unit 1430 may include touch-sensitive surface 1431 and other input devices 1432. Touch-sensitive surface 1431, also known as a touch display screen or touchpad, can collect touch operations on or near the user (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch-sensitive surface 1431), and drive corresponding connection devices according to a pre-set program. Optionally, touch-sensitive surface 1431 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to processor 1480, and can receive and execute commands from processor 1480. In addition, the touch-sensitive surface 1431 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Besides the touch-sensitive surface 1431, the input unit 1430 may also include other input devices 1432. Specifically, other input devices 1432 may include, but are not limited to, one or more of the following: a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick.
[0230] Display unit 1440 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the terminal. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. Display unit 1440 may include display panel 1441, which may optionally be configured as an LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or similar display panel 1441. Further, touch-sensitive surface 1431 may cover display panel 1441. When touch-sensitive surface 1431 detects a touch operation on or near it, it transmits the information to processor 1480 to determine the type of touch event. Subsequently, processor 1480 provides corresponding visual output on display panel 1441 according to the type of touch event. Touch-sensitive surface 1431 and display panel 1441 can be two independent components to implement input and output functions. However, in some embodiments, touch-sensitive surface 1431 and display panel 1441 can be integrated to achieve input and output functions.
[0231] The terminal may also include at least one sensor 1450, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 1441 according to the ambient light level, and the proximity sensor can turn off the display panel 1441 and / or the backlight when the terminal is moved to the ear. As a type of motion sensor, a gravity acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used for applications that identify the terminal's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, tapping), etc. Other sensors that may be configured on the terminal, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0232] Audio circuitry 1460, speaker 1461, and microphone 1462 provide an audio interface between the user and the terminal. Audio circuitry 1460 converts received audio data into electrical signals, which are then transmitted to speaker 1461, where they are converted into sound signals for output. Conversely, microphone 1462 converts collected sound signals into electrical signals, which are received by audio circuitry 1460, converted back into audio data, processed by processor 1480, and then transmitted via RF circuitry 1410 to, for example, another terminal, or output to memory 1420 for further processing. Audio circuitry 1460 may also include an earphone jack to facilitate communication between a peripheral headset and the terminal.
[0233] WiFi is a short-range wireless transmission technology. The terminal, through the WiFi module 1470, can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 14 WiFi module 1470 is shown, but it is understood that it is not a necessary component of the terminal and can be omitted as needed without changing the nature of the invention.
[0234] The processor 1480 is the control center of the terminal, connecting various parts of the terminal via various interfaces and lines. It executes various functions and processes data by running or executing software programs and / or modules stored in the memory 1420 and calling data stored in the memory 1420. Optionally, the processor 1480 may include one or more processing cores; preferably, the processor 1480 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1480.
[0235] The terminal also includes a power supply 1490 (such as a battery) to power various components. Preferably, the power supply can be logically connected to the processor 1480 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 1490 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0236] Although not shown, the terminal may also include a camera, Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the terminal also includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors. The aforementioned one or more programs contain instructions for performing the data playback based on the virtual scene provided in the above method embodiments.
[0237] Embodiments of this application also provide a computer-readable storage medium, which can be disposed in an electronic device to store at least one instruction or at least one program related to implementing a data playback method based on a virtual scene. The at least one instruction or the at least one program is loaded and executed by the processor to implement any of the data playback methods based on virtual scenes provided in the above-described method embodiments.
[0238] Embodiments of this application also provide a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the virtual scene-based data playback method described above.
[0239] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0240] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0241] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0242] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0243] The above description is only a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A data playback method based on a virtual scene, characterized in that, The method includes: In response to a recording and playback command, a recording file of the virtual scene is obtained; the recording file includes movement event information, which includes the position information of virtual objects in the virtual scene at multiple recording time points; Based on the interactive application, the virtual scene is replayed, and during the replay process, the associated recording time point closest to the current replay time point in the movement event information is determined; the associated recording time point includes a first recording time point before the current replay time point and a second recording time point after the current replay time point; Based on the location information of the virtual object corresponding to the associated recording time point, the target location information of the virtual object corresponding to the current playback time point is determined; Based on the first position information and the second position information, inertial vector information is determined; the first position information refers to the position information of the virtual object corresponding to the first recording time point, and the second position information refers to the position information of the virtual object corresponding to the second recording time point. If the distance between the current position indicated by the current position information of the virtual object in the virtual scene and the target position is greater than a first preset distance threshold, correction vector information is determined based on the current position information and the target position information; The inertial vector information and the correction vector information are linearly fused to obtain the acceleration information of the moving virtual object; Based on the acceleration information, the virtual objects in the virtual scene are moved to the target position indicated by the target position information.
2. The method according to claim 1, characterized in that, The method further includes: If the distance between the current position indicated by the current position information of the virtual object in the virtual scene and the target position is less than a preset distance threshold, the inertial vector information is used as the acceleration information for moving the virtual object.
3. The method according to claim 1, characterized in that, The step of moving a virtual object in the virtual scene to the target position indicated by the target position information based on the acceleration information includes: The virtual objects in the virtual scene are moved based on the acceleration information; If the distance between the moved position of the virtual object and the target position is greater than a second preset distance threshold, then the position of the virtual object in the virtual scene corresponding to the current playback time point is set as the target position through the target interface in the interactive application.
4. The method according to any one of claims 1 to 3, characterized in that, The movement event information also includes the orientation information of the virtual object in the virtual scene, and the method further includes: The rotation angle is determined based on the first orientation information and the second orientation information; the first orientation information refers to the orientation information of the virtual object corresponding to the first recording time point, and the second orientation information refers to the orientation information of the virtual object corresponding to the second recording time point. When the rotation angle is greater than a preset angle value, the second orientation information is corrected to obtain corrected second orientation information; the corrected second orientation information has the same mathematical symbols as the first orientation information. Based on the first orientation information and the corrected second orientation information, the target orientation information of the virtual object corresponding to the current playback time point is determined; Based on the target orientation information, the orientation of virtual objects in the virtual scene is changed.
5. The method according to claim 1, characterized in that, The recording file further includes interaction event information, which includes operation information corresponding to at least one interaction operation event; the method further includes: During playback, determine the playback time interval corresponding to the current playback time point; Based on half of the playback time interval and the current playback time point, determine the event matching time range corresponding to the current playback time point; Based on the event matching time range, the target operation information in the recording file is determined; the occurrence time of the target interactive operation event corresponding to the target operation information falls within the event matching time range. If the target interactive event has not been executed before the current playback time point, then the target interactive event is executed at the current playback time point based on the target operation information.
6. The method according to claim 5, characterized in that, The recording files include a first recording file and a second recording file; The virtual scene replay based on the interactive application includes: Extract the movement event information from the first recording file, and extract the interaction event information from the second recording file; Based on the correspondence between playback tracks and event information, a first playback track for replaying the motion event information and a second playback track for replaying the interactive event information are determined. Based on the first playback track, the motion event information is replayed in the virtual scene running based on the interactive application; Based on the second playback track, the interactive event information is replayed in the virtual scene running based on the interactive application.
7. The method according to claim 6, characterized in that, When the first recorded file is one of multiple recorded files recorded on different devices; the step of replaying the motion event information in the virtual scene running based on the first playback track includes: Obtain the global playback time of the first recorded file; the global playback time is determined based on the offset value of the global time, the offset value of the global time represents the deviation between the global recording times of the multiple recorded files, and the global recording time of each recorded file is determined based on the local recording time and the recording time offset value of the corresponding recorded file; The local playback time is determined based on the global playback time and the current time offset value; In response to the arrival of the local playback time, the motion event information is replayed in the virtual scene running on the interactive application based on the first playback track.
8. A data playback device based on a virtual scene, characterized in that, The device includes: The recording file acquisition module is used to acquire a recording file of the virtual scene in response to a recording and playback command; the recording file includes movement event information, which includes the position information of virtual objects in the virtual scene at multiple recording time points; The playback module is used to play back the virtual scene based on the interactive application, and during the playback process, determine the associated recording time point in the movement event information that is closest to the current playback time point; the associated recording time point includes a first recording time point located before the current playback time point and a second recording time point located after the current playback time point; The target location determination module is used to determine the target location information of the virtual object corresponding to the current playback time point based on the location information of the virtual object corresponding to the associated recording time point; An acceleration information determination module is used to determine inertial vector information based on first position information and second position information; the first position information refers to the position information of the virtual object corresponding to the first recording time point, and the second position information refers to the position information of the virtual object corresponding to the second recording time point; when the distance between the current position indicated by the current position information of the virtual object in the virtual scene and the target position is greater than a first preset distance threshold, correction vector information is determined based on the current position information and the target position information; the inertial vector information and the correction vector information are linearly fused to obtain the acceleration information of the moving virtual object; The movement module is used to move virtual objects in the virtual scene to the target position indicated by the target position information based on the acceleration information.
9. An electronic device, characterized in that, The system includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the data playback method based on a virtual scene as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction or at least one program, which is loaded and executed by a processor to implement the data playback method based on a virtual scene as described in any one of claims 1 to 7.
11. A computer program, characterized in that, The method includes a computer program, characterized in that, when the computer program is executed by a processor, it implements the data playback method based on a virtual scene as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Game content playback method, terminal, readable storage medium and electronic equipment
CN112535865A
Game battle data display method and device, equipment and medium
CN113908539A