Virtual scene interaction method and apparatus, and computer device, readable storage medium and program product
By recording the interaction time and frequency of virtual objects and multimedia resources, and dynamically updating the target controls and virtual scenes, the problem of the single interaction method in the existing technology is solved, and more flexible and diversified virtual scene interaction is achieved.
Patent Information
- Application Number
- PCT/CN2025/097936
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-08
- Filing Date
- 2025-05-29
- Publication Date
- 2026-11-12
AI Technical Summary
The current virtual scene interaction methods in games are too simplistic, resulting in poor interaction flexibility.
By recording the execution time and number of interaction commands between virtual objects and multimedia resources, the rendering parameters of the target control are dynamically updated, and a second multimedia resource is used to update the virtual scene when a preset threshold is reached, thereby triggering hidden easter eggs and providing visual feedback.
It improves the flexibility and diversity of virtual scene interaction, enriches the visual display effects of virtual scenes, and enhances the flexibility and diversity of interaction.
Smart Images

Figure CN2025097936_12112026_PF_FP_ABST
Abstract
Description
Virtual scene interaction methods, devices, computer equipment, readable storage media and program products Technical Field
[0001] This application relates to the field of human-computer interaction technology, and in particular to a virtual scene interaction method, device, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] In existing games, players can typically control their characters to move from one interactive scene to another through explicit interaction methods. For example, players can trigger a conversation with a non-player character (NPC) by clicking a prompt button, and then enter a new game instance or a more difficult arena by selecting different conversation options. However, because the current explicit interaction methods are too simplistic, they suffer from a lack of flexibility. Summary of the Invention
[0003] Therefore, it is necessary to provide a more flexible virtual scene interaction method, device, computer equipment, computer-readable storage medium, and computer program product to address the aforementioned technical problems.
[0004] Firstly, this application provides a virtual scene interaction method, including:
[0005] Displays the virtual scene in which the virtual object is located, the virtual scene including a first multimedia resource;
[0006] In response to an interaction command between the virtual object and the first multimedia resource, when the virtual object first appears within the timing interaction range of the first multimedia resource, the execution time of the interaction command is recorded and the target control is displayed.
[0007] Based on the ratio of the instruction execution time to a preset time threshold, the rendering parameters of the target control are dynamically updated, and the dynamically updated target control is displayed in real time.
[0008] In response to the instruction execution time reaching the preset time threshold, or the instruction execution count of the interactive instruction reaching the preset number of times threshold, the virtual scene is dynamically updated using a second multimedia resource, and the dynamically updated virtual scene is displayed.
[0009] In one embodiment, the timing interaction range includes a core region range and an edge region range; the method further includes:
[0010] When the virtual object is located within the edge area, a dynamic transparency value is determined based on the real-time distance between the virtual object and the first multimedia resource. The target control is then rendered according to the dynamic transparency value, and the rendered target control is displayed in a breathing animation style.
[0011] When the virtual object is located within the core area, the target control is rendered using a preset transparency value, and the rendered target control is displayed in a preset manner.
[0012] In one embodiment, the method further includes:
[0013] If the virtual object leaves the timed interaction range, a prompt to restart the timer is displayed, and the moment when the virtual object first appears within the timed interaction range is deleted, and the instruction execution time is reset to zero.
[0014] In one embodiment, the method further includes:
[0015] In response to the triggering operation of the interactive command, determine the time interval between the current triggering time and the previous triggering time of the interactive command;
[0016] If the time interval is less than the preset cooling time, the execution of the interactive command will be paused and a cooling prompt message will be displayed.
[0017] In one embodiment, the step of dynamically updating the virtual scene using a second multimedia resource and displaying the dynamically updated virtual scene includes:
[0018] Use any of the following methods to dynamically update and display the dynamically updated virtual scene:
[0019] The second multimedia resource is overlaid on the first multimedia resource in the virtual scene for rendering and display.
[0020] Virtual resource allocation information is generated based on the second multimedia resource, and the virtual resource allocation information is rendered and displayed in the virtual scene.
[0021] Target session information is generated based on the second multimedia resource, and the target session information is rendered and displayed in the virtual scene.
[0022] In one embodiment, the method further includes:
[0023] In response to a movement command for the virtual object, determine the real-time location information of the virtual object;
[0024] Based on the real-time location information and the target location information of the first multimedia resource in the virtual scene, the relative distance between the virtual object and the first multimedia resource is determined;
[0025] If the relative distance meets the loading range threshold, the first multimedia resource is loaded and displayed in the virtual scene;
[0026] Continue to respond to new movement commands for the virtual object, and update the relative distance based on the new real-time location information of the virtual object;
[0027] If the updated relative distance satisfies the area determination radius corresponding to the timed interaction range, the virtual object is determined to have entered the timed interaction range of the first multimedia resource.
[0028] In one embodiment, the method further includes:
[0029] In response to a movement command for the virtual object, detect whether the collider of the virtual object overlaps with the collision box corresponding to the timing interaction range;
[0030] If the collider and the collision box overlap, determine that the virtual object has entered the timing interaction range, and record the entry event time of the virtual object entering the timing interaction range;
[0031] Continuing to respond to a movement command for the virtual object, detect whether the collider of the virtual object overlaps with the collision box;
[0032] If the collider and the collision box do not overlap, determine that the virtual object leaves the timing interaction range, and record the departure event time of the virtual object leaving the timing interaction range;
[0033] If the time difference between the entry event time and the departure event time is greater than a preset time threshold, the preset stay time condition is determined to be met.
[0034] In one embodiment, the method further includes:
[0035] The grid state values in the virtual scene are updated at preset periodic intervals.
[0036] If the grid state value within the timed interaction range is a preset state value, the virtual object is determined to have entered the timed interaction range.
[0037] Secondly, this application also provides a virtual scene interaction device, including:
[0038] Scene display module, used to display the virtual scene where the virtual object is located, the virtual scene including a first multimedia resource;
[0039] An interaction recording module is used to respond to interaction commands between the virtual object and the first multimedia resource, and record the execution time or number of times the interaction command is executed;
[0040] The Easter egg trigger module is used to dynamically update the virtual scene using a second multimedia resource and display the dynamically updated virtual scene in response to the instruction execution time reaching a preset time threshold or the instruction execution count reaching a preset count threshold.
[0041] The interactive recording module includes:
[0042] The control display unit is configured to respond to the interactive instruction by starting to record the instruction execution time of the interactive instruction and displaying the target control at the moment when the virtual object first appears within the timing interaction range of the first multimedia resource;
[0043] The control update unit is used to dynamically update the rendering parameters of the target control according to the ratio of the instruction execution time to the preset time threshold, and to display the dynamically updated target control in real time.
[0044] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the virtual scene interaction method described in any of the embodiments of the first aspect.
[0045] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the virtual scene interaction method described in any of the embodiments of the first aspect.
[0046] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the virtual scene interaction method described in any of the embodiments of the first aspect.
[0047] The aforementioned virtual scene interaction method, device, computer equipment, computer-readable storage medium, and computer program product, by displaying a virtual scene containing a virtual object, the virtual scene including a first multimedia resource; responding to an interaction command between the virtual object and the first multimedia resource, at the moment when the virtual object first appears within the timing interaction range of the first multimedia resource, starting to record the command execution time of the interaction command and displaying a target control; dynamically updating the rendering parameters of the target control according to the ratio of the command execution time to a preset time threshold, and displaying the dynamically updated target control in real time; responding to the command execution time reaching the preset time threshold, or the number of command executions of the interaction command reaching a preset number threshold, dynamically updating the virtual scene using a second multimedia resource and displaying the dynamically updated virtual scene, can not only trigger hidden easter eggs by using the comparison result of the command execution time or the number of command executions with the threshold, but also provide different visual feedback from the performance effect of the virtual scene using the second multimedia resource, realizing a new scene interaction method based on the cumulative command execution time or the cumulative number of command executions, thereby improving the flexibility and diversity of scene interaction, but also dynamically update the display effect of the target control by using the ratio of the command execution time to the preset time threshold, thereby enriching the visual display effect of the virtual scene. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 is an application environment diagram of a virtual scene interaction method in one embodiment;
[0050] Figure 2 is a flowchart illustrating a virtual scene interaction method in one embodiment;
[0051] Figure 3 is a flowchart illustrating the core region 162 and the edge region 164 in one embodiment;
[0052] Figure 4A is a schematic diagram showing the second multimedia resource 142 in one embodiment;
[0053] Figure 4B is a schematic diagram showing virtual resource allocation information 144 in one embodiment;
[0054] Figure 4C is a schematic diagram showing target session information 146 in one embodiment;
[0055] Figure 5 is a flowchart illustrating the distance determination step in one embodiment;
[0056] Figure 6 is a flowchart illustrating the collision determination steps in one embodiment;
[0057] Figure 7 is a structural block diagram of a virtual scene interaction device 700 in one embodiment;
[0058] Figure 8 is an internal structure diagram of a computer device in one embodiment. Detailed Implementation
[0059] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0060] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0061] The virtual scene interaction method provided in this application embodiment can be applied to the application environment shown in Figure 1. The terminal 102 can communicate with the server 104 via a network. The server 104's data storage system can store game data, such as player character attribute parameters and game resources (e.g., maps, scenes). The terminal 102 can install and run a game program client. The virtual scene, virtual objects, or multimedia resources can be obtained by the client when downloading the game program's installation package, or they can be obtained by the client sending a game resource request to the server when updating the game program version. The terminal 102 can display the virtual scene through the client and respond to user operations by controlling virtual objects to perform corresponding actions within the virtual scene.
[0062] For example, terminal 102 can load corresponding game resources through a client running a game program and display the virtual scene 10 where the virtual object 12 is located to the user. The virtual scene 10 may include a first multimedia resource 14. Terminal 102 can respond to an interaction command triggered by the user between the virtual object 12 and the first multimedia resource 14. At the moment when the virtual object 12 first appears within the timing interaction range 16 of the first multimedia resource 14, terminal 102 starts recording the command execution time of the interaction command and displays the target control 18. Figure 1 only shows a schematic diagram of the interface layout of one virtual scene 10. Those skilled in the art will understand that, based on the same inventive concept of this application, the interface layout of the virtual scene 10 can be flexibly adjusted, for example, displaying the target control 18 in the upper left corner.
[0063] The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart TVs, smart in-vehicle systems, and projection devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. The server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0064] In an exemplary embodiment, as shown in FIG2, a virtual scene interaction method is provided. Taking the application of this method to terminal 102 in FIG1 as an example, the method includes the following steps S202 to S208. Wherein:
[0065] Step S202: Display the virtual scene where the virtual object is located. The virtual scene includes the first multimedia resource.
[0066] Virtual objects can be used to represent roles that users can manipulate in a virtual scene.
[0067] Virtual scenes can be used to represent digital environments constructed using computer technology for player interaction, such as game interface scenes.
[0068] The first multimedia resource may include, but is not limited to, non-player characters (NPCs), virtual props, and interactive scene model resources (such as mountains, trees, rivers, etc.) in a virtual scene.
[0069] Optionally, in some implementations, the terminal may store a preset computer program. The terminal can run the computer program to display virtual objects and the virtual scene in which the virtual objects reside in a visual interface. Alternatively, in other implementations, the terminal can establish a connection with a client, obtain rendering resource data of the virtual scene from the client, and render and display the virtual objects and the virtual scene in a visual interface.
[0070] Step S204: In response to the interaction command between the virtual object and the first multimedia resource, at the moment when the virtual object first appears within the timing interaction range of the first multimedia resource, start recording the command execution time of the interaction command and display the target control.
[0071] Interactive instructions can be used to instruct virtual objects to interact with the first multimedia resource. For example, interactive instructions can be used to control the virtual object to move to the trigger of the first multimedia resource, or to control the virtual object to have a conversation with the first multimedia resource, or to control the virtual object to perform corresponding actions of the first multimedia resource (such as performing a watering operation on the first multimedia resource with plant attributes, or performing a fishing operation on the first multimedia resource with fishpond attributes).
[0072] The timing interaction range can be used to characterize a preset area centered on the location of the first multimedia resource in the virtual environment. When a virtual object is within the timing interaction range, the execution time of instructions is continuously recorded.
[0073] The target control can include, but is not limited to, progress bar controls, dialog box controls, etc.
[0074] For example, the terminal can respond to a user-triggered interaction command between a virtual object and a first multimedia resource, controlling the virtual object to interact with the first multimedia resource. The position of the virtual object in the virtual scene is detected. At the moment the virtual object first appears within the timing interaction range of the first multimedia resource, the execution time of this interaction command is recorded, and the target control is displayed in the virtual scene.
[0075] Step S206: Based on the ratio of instruction execution time to preset time threshold, dynamically update the rendering parameters of the target control and display the dynamically updated target control in real time.
[0076] The rendering parameters may include, but are not limited to, the color parameters used for rendering, the rendering area, etc.
[0077] For example, the terminal may store a preset time threshold. The ratio of the real-time recorded instruction execution time to the preset time threshold is determined. The rendering parameters of the target control are dynamically updated based on this ratio. For example, if the ratio is 20%, 20% of the target control's area is rendered; if the ratio reaches 50%, 50% of the target control's area is rendered. Alternatively, if the ratio is 30%, the target control is rendered in red; if the ratio is 60%, the target control is rendered in green. The dynamically updated target control is displayed in real time.
[0078] In step S208, in response to the instruction execution time reaching a preset time threshold, or the number of times the interactive instruction is executed reaching a preset number threshold, the virtual scene is dynamically updated using the second multimedia resource, and the dynamically updated virtual scene is displayed.
[0079] The second multimedia resource can be used to represent hidden Easter egg resources that are different from the first multimedia resource. For example, the second multimedia resource may include, but is not limited to, animation effect resources, virtual prop resources, scene resources, and conversation resources.
[0080] For example, the terminal may store preset Easter egg triggering logic. In response to the instruction execution time of this interaction instruction reaching a preset time threshold, or the instruction execution count of repeatedly executing the same interaction instruction reaching a preset number of times threshold, the Easter egg triggering logic is executed: the virtual scene is dynamically updated using a second multimedia resource, and the dynamically updated virtual scene is displayed.
[0081] In the aforementioned virtual scene interaction method, the virtual scene containing the virtual object is displayed, and the virtual scene includes a first multimedia resource. In response to an interaction command between the virtual object and the first multimedia resource, the execution time of the interaction command is recorded at the moment the virtual object first appears within the timing interaction range of the first multimedia resource, and the target control is displayed. Based on the ratio of the command execution time to a preset time threshold, the rendering parameters of the target control are dynamically updated, and the dynamically updated target control is displayed in real time. In response to the command execution time reaching the preset time threshold, or the number of times the interaction command is executed reaching a preset number threshold, the virtual scene is dynamically updated using a second multimedia resource, and the dynamically updated virtual scene is displayed. This method not only triggers hidden easter eggs by comparing the command execution time or the number of times the interaction command is executed with the threshold, but also provides different visual feedback on the virtual scene's performance using the second multimedia resource, realizing a new scene interaction method based on the cumulative execution time or the cumulative number of times the command is executed, thereby improving the flexibility and diversity of scene interaction. Furthermore, it can dynamically update the display effect of the target control by using the ratio of the command execution time to the preset time threshold, thus enriching the visual display effect of the virtual scene.
[0082] In an exemplary embodiment, as shown in FIG3, the timing interaction range 16 may include a core region range 162 and an edge region range 164.
[0083] Step S206 may further include: when the virtual object is located in the edge area, determining the dynamic transparency value based on the real-time distance between the virtual object and the first multimedia resource, rendering the target control according to the dynamic transparency value, and displaying the rendered target control in a breathing animation manner; when the virtual object is located in the core area, rendering the target control using a preset transparency value, and displaying the rendered target control in a preset manner.
[0084] Optionally, in some implementations, the terminal can obtain the real-time distance between the virtual object and the first multimedia resource when it detects that the virtual object is located within the edge region range 164. Based on a preset linear relationship between transparency and distance (e.g., a linear relationship where the smaller the distance, the lower the transparency), a dynamic transparency value corresponding to the real-time distance is determined. The target control is rendered according to the current dynamic transparency value, and the rendered target control is displayed using a breathing animation effect (such as a loop animation). This achieves the effect of the target control's transparency changing linearly with distance.
[0085] Optionally, in other embodiments, the terminal may, upon detecting that the virtual object is located within the core area range 162, directly render the target control using a preset transparency value (e.g., 0%) corresponding to the core area range 162, and display the rendered target control in a preset manner (e.g., without breathing animation effects, i.e., without loop animation).
[0086] Optionally, in some embodiments, the core region 162 may be a region centered on the location of the first multimedia resource and with a radius equal to one-quarter of the radius of the timing interaction range 16. The edge region 164 may be used to represent other regions within the timing interaction range besides the core region.
[0087] In this embodiment, by rendering the target control in different ways when the virtual object is located in different areas within the timing interaction range, the display effect of the target control can be enriched, and the difference between the core area range and the edge area range can be displayed more intuitively.
[0088] In an exemplary embodiment, the scene interaction method provided by this application may further include: displaying a re-timing prompt when the virtual object leaves the timing interaction range, deleting the moment when the virtual object first appears within the timing interaction range, and resetting the instruction execution time to zero.
[0089] For example, if the terminal detects that a virtual object has left the timing interaction range, it can display a prompt to restart the timing in the virtual scene, delete the moment when the virtual object first appeared within the currently recorded timing interaction range, and reset the instruction execution time to zero. The recording of instruction execution time will only resume after the virtual object subsequently re-enters the timing interaction range.
[0090] In this embodiment, by displaying a reset prompt message and resetting the instruction execution time after the virtual object leaves the timed interaction range, it is possible to maintain the consistency of the scene interaction logic and prevent the virtual object from triggering the hidden easter egg of the second multimedia resource outside the timed interaction range.
[0091] In an exemplary embodiment, the scene interaction method provided by this application may further include: in response to the triggering operation of the interaction command, determining the time interval between the current triggering time and the previous triggering time of the interaction command; if the time interval is less than a preset cooldown time, pausing the execution of the interaction command and displaying a cooldown prompt message.
[0092] Optionally, in some implementations, the user can repeatedly trigger the virtual object to interact with the first multimedia resource. The terminal can respond to the triggering operation of the interaction command and determine the time interval between the current triggering time and the previous triggering time of the same interaction command. If the time interval is less than a preset cooldown time, the execution of the current interaction command is paused, and a cooldown prompt message is displayed in the virtual scene. The interaction command is executed again only after the time interval between triggering times reaches the preset cooldown time.
[0093] In this embodiment, by using a preset cooling time to constrain the triggering time of two adjacent interactive commands, it is possible to avoid the interference of repeatedly triggering the same interactive command multiple times in a short period of time on the normal operation of the virtual scene and ensure the display stability of the virtual scene.
[0094] In one example embodiment, step S208 may include: dynamically updating the virtual scene using any of the following methods, and displaying the dynamically updated virtual scene:
[0095] The second multimedia resource is overlaid on the first multimedia resource in the virtual scene for rendering and display.
[0096] Virtual resource allocation information is generated based on the second multimedia resource, and then rendered and displayed in the virtual scene.
[0097] Target session information is generated based on the second multimedia resource, and the target session information is rendered and displayed in the virtual scene.
[0098] Optionally, in some embodiments, as shown in FIG4A, the terminal can overlay the second multimedia resource 142 onto the first multimedia resource 14 in the virtual scene 10 for rendering and display. For example, the second multimedia resource 142 can be a special effects animation resource of the first multimedia resource 14, or it can be an interactive resource of the first multimedia resource 14.
[0099] Optionally, in other embodiments, as shown in FIG4B, the terminal can generate virtual resource allocation information 144 based on the second multimedia resource and render the virtual resource allocation information 144 in the virtual scene 10. Although FIG4B only shows one way of rendering the virtual resource allocation information 144 covering the entire virtual scene 10, those skilled in the art will understand that the terminal can also display the virtual resource allocation information 144 together with the first multimedia resource 14. The terminal can allocate the virtual resource corresponding to the virtual resource allocation information 144 to a virtual object so that the virtual object can subsequently use the virtual resource.
[0100] Optionally, in some implementations, as shown in FIG4C, the terminal may also generate target session information 146 corresponding to the first multimedia resource 14 based on the second multimedia resource. The target session information 146 is then rendered and displayed in the virtual scene 10. The target session information can be used to display new Easter egg plots, or to assign virtual props to virtual objects, or to prompt the user to enter a hidden Easter egg scene or copy.
[0101] In this embodiment, by providing multiple ways to overlay the second multimedia resource onto the first multimedia resource in the virtual scene for rendering and display, the display effect of the hidden Easter egg can be enriched.
[0102] In an exemplary embodiment, as shown in FIG5, a method for determining whether a virtual object has entered the timing interaction range is provided, including the following steps S502 to S510. Wherein:
[0103] Step S502: In response to a movement command for the virtual object, determine the real-time location information of the virtual object.
[0104] Step S504: Determine the relative distance between the virtual object and the first multimedia resource based on the real-time location information and the target location information of the first multimedia resource in the virtual scene.
[0105] Step S506: If the relative distance meets the loading range threshold, load and display the first multimedia resource in the virtual scene.
[0106] The loading range threshold can be greater than the area determination radius of the timing interaction range.
[0107] For example, the terminal can respond to a user-triggered movement command for a virtual object, manipulating the virtual object to move within a virtual scene and determining the virtual object's real-time location information. Using the virtual object's real-time location information and the target location information of the first multimedia resource within the virtual scene, the relative distance between the virtual object and the first multimedia resource is calculated. If the relative distance meets a loading range threshold, the virtual object is determined to have entered the visible range of the first multimedia resource, and the first multimedia resource is loaded and displayed within the virtual scene.
[0108] Step S508: Continue to respond to new movement commands for the virtual object and update the relative distance based on the new real-time position information after the virtual object moves.
[0109] Step S510: If the updated relative distance satisfies the area determination radius corresponding to the timing interaction range, determine that the virtual object enters the timing interaction range of the first multimedia resource.
[0110] For example, the terminal can continue to respond to new movement commands from the user for the virtual object, manipulating the virtual object to move within the virtual scene and obtaining new real-time location information for the virtual object. Using the new real-time location information of the virtual object and the target location information of the first multimedia resource, the relative distance between the virtual object and the first multimedia resource is updated. If the updated relative distance satisfies the area determination radius corresponding to the timing interaction range, it is determined that the virtual object has entered the timing interaction range of the first multimedia resource, and the operation of step S204 above is executed, starting to record the command execution time of the interaction command and displaying the target control.
[0111] In this embodiment, determining whether a virtual object has entered a preset area range by measuring the relative distance between the virtual object and the first multimedia resource improves the accuracy of position determination. Furthermore, since the first multimedia resource is loaded and displayed only after the virtual object has entered its visible range, it also helps reduce the rendering resource costs of the virtual scene.
[0112] In an exemplary embodiment, as shown in FIG6, a method for determining whether a virtual object has entered the timing interaction range is also provided, including the following steps S602 to S610. Wherein:
[0113] Step S602: In response to a movement command for a virtual object, detect whether the collider of the virtual object overlaps with the collision box corresponding to the timed interaction range.
[0114] Step S604: If the collider and the collision box overlap, determine that the virtual object has entered the timing interaction range and record the entry event time of the virtual object entering the timing interaction range.
[0115] Among them, the collider can be used to represent a three-dimensional closed model that encloses the entire virtual object.
[0116] A collision box is a functional module provided by the game engine for game developers to set up. It can provide collision simulation effects calculation for 3D models. Two different collision boxes / colliders can calculate the position, distance, and even collision determination of the different models they represent through the underlying logic provided by the game engine. In this embodiment, the collision box can be used to represent a three-dimensional closed model that encompasses the entire timed interaction range. Any physical collision within the virtual scene can be achieved through the interaction between colliders.
[0117] For example, the terminal can respond to a user-triggered movement command for a virtual object, manipulating the virtual object to move within a virtual scene, and using the positional information of the collider and the collision box to determine whether the collider of the virtual object overlaps with the collision box corresponding to the timed interaction range. If the collider and the collision box overlap, it can be determined that the virtual object has entered the timed interaction range, and the time when the virtual object enters the timed interaction range can be recorded as the entry event time.
[0118] Step S606: Continue responding to the movement command for the virtual object and detect whether the collider of the virtual object overlaps with the collision box.
[0119] Step S608: If the collider and the collider box do not overlap, determine that the virtual object has left the timing interaction range and record the departure event time of the virtual object leaving the timing interaction range.
[0120] Step S610: If the time difference between the entry time and the exit time is greater than a preset time threshold, it is determined that the preset stay time condition is met.
[0121] For example, the terminal can continue to respond to user-triggered movement commands for virtual objects, detecting whether the virtual object's real-time collider overlaps with the collision box within the timed interaction range. If the collider and collision box do not overlap, the terminal determines that the virtual object has left the timed interaction range and records the time when the virtual object leaves the timed interaction range as the departure event time. The terminal calculates the time difference between the entry event time and the departure event time. If the time difference is greater than a preset time threshold, the terminal determines that the time when the virtual object entered the timed interaction range meets a preset dwell time condition.
[0122] In this embodiment, by utilizing whether the collider and the collision box overlap, the entry event time and exit event time of the collider entering the collision area are determined. The time difference between the entry event time and the exit event time is used to determine whether the preset dwell time condition is met. The collision interaction can be used to determine whether the virtual object has stayed within the specified time interaction range for a preset time threshold, thereby improving the determination accuracy.
[0123] In one exemplary embodiment, a method for determining whether a virtual object has entered the timed interaction range is also provided, including: updating the grid state value in the virtual scene at preset period intervals; and determining that the virtual object has entered the timed interaction range if the grid state value within the timed interaction range is a preset state value.
[0124] For example, virtual scenes are typically divided using grids (such as quadrilaterals or hexagons). When a grid position is not occupied by a virtual object, its grid state value can be a first threshold. When a grid position is occupied by a virtual object, its grid state value can be a second threshold.
[0125] The terminal can read real-time grid status values at preset intervals to update the grid status values in the virtual scene. It then determines the grid status value at a location within the timed interaction range. If the grid status value within the timed interaction range is determined to be a preset value, the virtual object is confirmed to have entered the timed interaction range. The preset threshold can be a second threshold.
[0126] Optionally, in some implementations, the first threshold indicating that the device is not occupied can be 0, and the second threshold indicating that the device is occupied can be 1.
[0127] In this embodiment, by periodically reading the grid status values of the virtual scene and using preset status values to determine whether the grid positions within the timed interaction range are occupied by virtual objects, and thus determining whether the virtual objects have entered the timed interaction range, the determination efficiency can be improved.
[0128] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the steps or stages of other steps.
[0129] Based on the same inventive concept, this application also provides a virtual scene interaction device for implementing the virtual scene interaction method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more virtual scene interaction device embodiments provided below can be found in the limitations of the virtual scene interaction method described above, and will not be repeated here.
[0130] In an exemplary embodiment, as shown in FIG7, a virtual scene interaction device 700 is provided, including: a scene display module 702, an interaction recording module 704, and an Easter egg triggering module 706, wherein:
[0131] The scene display module 702 is used to display the virtual scene where the virtual object is located, and the virtual scene includes the first multimedia resource.
[0132] The interaction recording module 704 is used to respond to interaction commands between the virtual object and the first multimedia resource and record the execution time or number of times the interaction command is executed.
[0133] The Easter egg trigger module 706 is used to dynamically update the virtual scene using second multimedia resources and display the dynamically updated virtual scene in response to the instruction execution time reaching a preset time threshold or the instruction execution count reaching a preset count threshold.
[0134] The interactive recording module 704 includes: a control display unit, used to respond to an interactive command by starting to record the command execution time and displaying the target control when the virtual object first appears within the timing interaction range of the first multimedia resource; and a control update unit, used to dynamically update the rendering parameters of the target control based on the ratio of the command execution time to a preset time threshold, and to display the dynamically updated target control in real time.
[0135] In an exemplary embodiment, the timing interaction range includes a core area range and an edge area range. The control update unit is further configured to, when the virtual object is located in the edge area range, determine a dynamic transparency value based on the real-time distance between the virtual object and the first multimedia resource, render the target control according to the dynamic transparency value, and display the rendered target control in a breathing animation manner; when the virtual object is located in the core area range, render the target control using a preset transparency value, and display the rendered target control in a preset manner.
[0136] In an exemplary embodiment, the interaction recording module 704 is further configured to display a re-timing prompt message when the virtual object leaves the timing interaction range, delete the moment when the virtual object first appears within the timing interaction range, and reset the instruction execution time to zero.
[0137] In an exemplary embodiment, the interaction recording module 704 is further configured to, in response to the triggering operation of the interaction command, determine the time interval between the current triggering time and the previous triggering time of the interaction command; if the time interval is less than a preset cooling time, suspend the execution of the interaction command and display a cooling prompt message.
[0138] In an exemplary embodiment, the Easter egg trigger module 706 is further configured to dynamically update and display the dynamically updated virtual scene using any of the following methods: overlaying the second multimedia resource onto the first multimedia resource in the virtual scene for rendering and display; generating virtual resource allocation information based on the second multimedia resource and rendering and displaying the virtual resource allocation information in the virtual scene; generating target session information based on the second multimedia resource and rendering and displaying the target session information in the virtual scene.
[0139] In an exemplary embodiment, the virtual scene interaction device 700 includes a region determination module, configured to: determine the real-time location information of the virtual object in response to a movement command for the virtual object; determine the relative distance between the virtual object and the first multimedia resource based on the real-time location information and the target location information of the first multimedia resource in the virtual scene; load and display the first multimedia resource in the virtual scene if the relative distance meets a loading range threshold; continue to respond to new movement commands for the virtual object and update the relative distance based on the new real-time location information of the virtual object; and determine that the virtual object has entered the timing interaction range of the first multimedia resource if the updated relative distance meets the region determination radius corresponding to the timing interaction range.
[0140] In an exemplary embodiment, the region determination module is further configured to, in response to a movement command for the virtual object, detect whether the collider of the virtual object overlaps with the collision box corresponding to the timed interaction range; if the collider and collision box overlap, determine that the virtual object has entered the timed interaction range and record the entry event time of the virtual object entering the timed interaction range; continue to, in response to a movement command for the virtual object, detect whether the collider of the virtual object overlaps with the collision box; if the collider and collision box do not overlap, determine that the virtual object has left the timed interaction range and record the departure event time of the virtual object leaving the timed interaction range; if the time difference between the entry event time and the departure event time is greater than a preset time threshold, determine that a preset dwell time condition is met.
[0141] In an exemplary embodiment, the region determination module is further configured to update the grid state value in the virtual scene at preset period intervals; and determine that the virtual object has entered the timed interaction range if the grid state value within the timed interaction range is a preset state value.
[0142] Each module in the aforementioned virtual scene interaction device 700 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0143] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram is shown in Figure 8. The computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used for exchanging information between the processor and external devices. The communication interface of the computer device is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. The computer program executed by the processor can implement a virtual scene interaction method. The display unit of the computer device is used to form a visually visible image and may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0144] Those skilled in the art will understand that the structure shown in Figure 8 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or may combine certain components, or may have different component arrangements.
[0145] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0146] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.
[0147] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0148] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0149] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0150] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A virtual scene interaction method, characterized by, The method comprises: displaying a virtual scene in which a virtual object is located, the virtual scene comprising a first multimedia resource; in response to an interaction instruction between the virtual object and the first multimedia resource, starting to record an instruction execution time of the interaction instruction at a time when the virtual object first appears within a timing interaction range of the first multimedia resource, and displaying a target control; dynamically updating a rendering parameter of the target control according to a proportion of the instruction execution time to a preset time threshold, and displaying the target control after dynamic updating in real time; in response to the instruction execution time reaching the preset time threshold or the instruction execution number of the interaction instruction reaching a preset number threshold, dynamically updating the virtual scene by using a second multimedia resource, and displaying the virtual scene after dynamic updating.
2. The method of claim 1, wherein, The timing interaction range comprises a core area range and an edge area range; the method further comprises: in a case where the virtual object is located in the edge area range, determining a dynamic transparency value according to a real-time distance between the virtual object and the first multimedia resource, rendering the target control according to the dynamic transparency value, and displaying the rendered target control in a breathing animation effect manner; in a case where the virtual object is located in the core area range, rendering the target control by using a preset transparency value, and displaying the rendered target control in a preset manner.
3. The method of claim 1, wherein, The method further comprises: in a case where the virtual object leaves the timing interaction range, displaying a re-timing prompt information, and deleting a time when the virtual object first appears within the timing interaction range, resetting the instruction execution time to zero.
4. The method of claim 1, wherein, The method further comprises: in response to a triggering operation of the interaction instruction, determining a time interval between a current triggering time and a last triggering time of the interaction instruction; in a case where the time interval is less than a preset cooling time, pausing execution of the interaction instruction, and displaying a cooling prompt information.
5. The method of claim 1, wherein, The dynamically updating the virtual scene by using the second multimedia resource and displaying the virtual scene after dynamic updating comprises: dynamically updating and displaying the virtual scene by using any of the following manners: superimposing the second multimedia resource on the first multimedia resource in the virtual scene to render and display; generating virtual resource allocation information according to the second multimedia resource, and rendering and displaying the virtual resource allocation information in the virtual scene; generating target conversation information according to the second multimedia resource, and rendering and displaying the target conversation information in the virtual scene.
6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: in response to a moving instruction for the virtual object, determining real-time position information of the virtual object; determining a relative distance between the virtual object and the first multimedia resource according to the real-time position information and target position information of the first multimedia resource in the virtual scene; in a case where the relative distance meets a loading range threshold, loading and displaying the first multimedia resource in the virtual scene; continue to respond to new movement instructions for the virtual object, and update the relative distance according to new real-time position information of the virtual object; in a case where the updated relative distance satisfies a region determination radius corresponding to the timed interaction range of the first multimedia resource, determine that the virtual object enters the timed interaction range of the first multimedia resource.
7. The method according to any one of claims 1 to 5, characterized in that, The method further includes: in response to a movement instruction for the virtual object, detecting whether a collision body of the virtual object overlaps with a collision box corresponding to the timed interaction range; in a case where the collision body overlaps with the collision box, determining that the virtual object enters the timed interaction range, and recording an entry event time at which the virtual object enters the timed interaction range; continue to respond to movement instructions for the virtual object, and detect whether a collision body of the virtual object overlaps with the collision box; in a case where the collision body does not overlap with the collision box, determine that the virtual object exits the timed interaction range, and record an exit event time at which the virtual object exits the timed interaction range; in a case where a time difference between the entry event time and the exit event time is greater than a preset time threshold, determine that a preset stay time condition is satisfied.
8. The method according to any one of claims 1 to 5, characterized in that, The method further includes: update a grid state value in the virtual scene every preset periodic interval; in a case where the grid state value in the timed interaction range is a preset state value, determine that the virtual object enters the timed interaction range.
9. A virtual scene interaction apparatus, characterized by comprising: The device includes: a scene display module configured to display a virtual scene in which a virtual object is located, the virtual scene including a first multimedia resource; an interaction recording module configured to, in response to an interaction instruction between the virtual object and the first multimedia resource, record an instruction execution time or an instruction execution number of the interaction instruction; an egg trigger module configured to, in response to the instruction execution time reaching a preset time threshold or the instruction execution number reaching a preset number threshold, dynamically update the virtual scene using a second multimedia resource, and display the dynamically updated virtual scene; The interaction recording module includes: a control display unit configured to, in response to the interaction instruction, start recording the instruction execution time of the interaction instruction at a moment when the virtual object first appears in a timed interaction range of the first multimedia resource, and display a target control; a control update unit configured to dynamically update a rendering parameter of the target control according to a proportion of the instruction execution time to the preset time threshold, and display the target control in real time after the dynamic update. 10.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-9. The processor executes the computer program to implement the steps of the method of any one of claims 1 to 8.
11. A computer readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 8.
12. A computer program product comprising a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 8.
