Component adsorption control method and device and electronic equipment
By setting the preset adsorption range and adjusting the adsorption range in the game editing scene, the problem of inaccurate adsorption of virtual objects is solved, and precise adsorption between components and an efficient editing experience are achieved.
Patent Information
- Application Number
- CN202410471559.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-18
- Publication Date
- 2024-08-30
AI Technical Summary
In the game editor, virtual objects cannot be effectively adsorbed when the actual physical distance is far away. Moreover, due to the deviation of the viewing angle and the 3D orientation of the object, the adsorption judgment is inaccurate and the multi-faceted adsorption is confusing, making it difficult to identify the adsorption surface.
By setting a preset adsorption range in the game editing scene and adjusting the adsorption range according to the movement operation, precise adsorption between components is achieved. The graphical user interface is used to display the scene to be edited, the movement direction is determined in response to the movement operation, and the adsorption range is adjusted to achieve the goal. Adsorption.
It improves the efficiency and accuracy of component adsorption, improves the player's game editing experience, meets the needs of large-scale movement and micro-operation, reduces the computational pressure of adsorption surface determination, and clearly determines the surface that needs to be adsorbed during the operation.
Smart Images

Figure CN118557969A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of game editing, and in particular to a component adsorption control method, device and electronic device. Background Art
[0002] In the related art, when a virtual object is moved in a game editor, when the actual physical distance between two virtual objects is far, effective adsorption cannot be achieved, and the position needs to be manually moved based on the current grid until it enters the adsorption determination response threshold range between the objects to respond to the adsorption determination and adsorption. At the same time, since there may be deviations between the viewing angle and the actual 3D position of the object, when adjustments need to be made on a specific axis, the actual positions of the x, y, and z axes of the 3D object based on the current viewing angle may overlap and have parallax in the current viewing angle during operation, resulting in confusion of multi-faceted adsorption, which leads to inaccurate adsorption determination and difficulty for players to identify the adsorption surface. Summary of the invention
[0003] The purpose of the present disclosure is to provide a component adsorption control method, device and electronic device to accurately determine the adsorption surface and adsorption range of the component, thereby improving the component adsorption efficiency and accuracy.
[0004] In a first aspect, the present disclosure provides a component adsorption control method, the method comprising: displaying a graphical user interface by running a game program, the graphical user interface including a game editing scene to be edited, the game editing scene including multiple scene components, the scene components being components set in the game editing scene in response to editing operations; the scene components being configured with a preset adsorption range; responding to a move operation on a first scene component in the game editing scene, determining a moving direction of the first scene component based on the move operation, and controlling the first scene component to move along the moving direction in the game editing scene; in the process of the first scene component moving along the moving direction, in response to a distance between the first scene component and the second scene component being less than a preset distance threshold, adjusting the preset adsorption range of the first scene component in the moving direction to obtain a target adsorption range; wherein the first scene component and the second scene component are both scene components in the game editing scene; in response to the target adsorption range of the first scene component in the moving direction satisfying a preset position relationship with the second scene component, controlling the first scene component to be adsorbed to the second scene component.
[0005] In a second aspect, the present disclosure provides a component adsorption control device, which includes: an interface display module, which is used to display a graphical user interface by running a game program, wherein the graphical user interface includes a game editing scene to be edited, and the game editing scene includes multiple scene components, and the scene components are components set in the game editing scene in response to editing operations; the scene components are configured with a preset adsorption range; a movement control module, which is used to respond to a movement operation on a first scene component in the game editing scene, determine a moving direction of the first scene component based on the movement operation, and control the first scene component to move along the moving direction in the game editing scene; a range determination module, which is used to adjust the preset adsorption range of the first scene component in the moving direction in response to the distance between the first scene component and the second scene component being less than a preset distance threshold during the movement of the first scene component in the moving direction to obtain a target adsorption range; wherein the first scene component and the second scene component are both scene components in the game editing scene; a component adsorption module, which is used to control the adsorption of the first scene component to the second scene component in response to the target adsorption range of the first scene component in the moving direction satisfying a preset position relationship with the second scene component.
[0006] In a third aspect, the present disclosure provides an electronic device, which includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned component adsorption control method.
[0007] In a fourth aspect, the present disclosure provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned component adsorption control method.
[0008] The embodiments of the present disclosure bring the following beneficial effects:
[0009] The present disclosure provides a component adsorption control method, device and electronic device. First, a graphical user interface is displayed by running a game program. The graphical user interface includes a game editing scene to be edited. The game editing scene includes multiple scene components. The scene components are components set in the game editing scene in response to editing operations. The scene components are configured with a preset adsorption range. Then, in response to a moving operation for a first scene component in the game editing scene, the moving direction of the first scene component is determined based on the moving operation, and the first scene component is controlled to move along the moving direction in the game editing scene. In the process of the first scene component moving along the moving direction, in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, the preset adsorption range of the first scene component in the moving direction is adjusted to obtain a target adsorption range. Then, in response to the target adsorption range of the first scene component in the moving direction and the second scene component satisfying a preset position relationship, the first scene component is controlled to be adsorbed to the second scene component. In this method, when the scene component moves along a certain direction, the target adsorption range of the scene component in the direction can be adjusted, so that the adsorption of the scene component and other scene components is quickly completed, thereby improving the game editing experience of the player.
[0010] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0011] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, the following specifically cites preferred implementation modes and describes them in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0013] Figure 1 A flowchart of a component adsorption control method provided by an embodiment of the present disclosure;
[0014] Figure 2 A schematic diagram of displaying an adsorption surface determination provided by an embodiment of the present disclosure;
[0015] Figure 3 A schematic diagram showing a preset adsorption range of a first scene component provided in an embodiment of the present disclosure;
[0016] Figure 4A schematic diagram showing the target adsorption range of the first scene component in the moving direction provided by an embodiment of the present disclosure;
[0017] Figure 5 A schematic diagram of adjusting the adsorption range based on the moving speed provided in an embodiment of the present disclosure;
[0018] Figure 6 A schematic diagram of the structure of a component adsorption control device provided in an embodiment of the present disclosure;
[0019] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. The components of the embodiments of the present disclosure described and shown in the drawings here can be arranged and designed in various different configurations.
[0021] Therefore, the following detailed description of the embodiments of the present disclosure provided in the accompanying drawings is not intended to limit the scope of the present disclosure claimed for protection, but merely represents selected embodiments of the present disclosure. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present disclosure.
[0022] During the UGC (User Generated Content) editing process, when the actual physical distance between two objects is far, effective adsorption cannot be achieved. It is necessary to manually move the position based on the current grid until the objects enter the adsorption judgment response threshold range before they can respond to the adsorption judgment and adsorption. The current game can only adjust the adsorption range according to the grid size, and cannot meet the differentiated adsorption requirements in large-range movement and micro-manipulation within the same grid size.
[0023] Since there may be a deviation between the viewing angle and the actual 3D position of the object, using global adsorption at this time will cause two problems: 1. The computing pressure is too high. During the operation, there is a possibility of a huge amount of adsorption due to the number of faces between each face of the object and other objects; 2. When it is necessary to adjust the specific axis, the actual position of the x, y, and z axes of the 3D object based on the current viewing angle may overlap and have parallax under the current viewing angle during operation, resulting in confusion of multi-faceted adsorption, which makes it difficult for players to identify the adsorption surface.
[0024] Based on the above problems, an embodiment of the present invention provides a component adsorption control method, device and electronic device. The technology can be applied to game editing scenarios, especially to component position movement scenarios in game editing scenarios.
[0025] The component adsorption control method in one embodiment of the present disclosure can be run on a local terminal device or a server. When the component adsorption control method is run on a server, the method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0026] In an optional implementation, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a game mode based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated, the storage and operation of the component adsorption control method are completed on the cloud game server, and the role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the cloud game server in the cloud is used for information processing. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0027] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.
[0028] In a possible implementation, the present disclosure provides a component adsorption control method, such as Figure 1 As shown, the method comprises the following specific steps:
[0029] Step S102, displaying a graphical user interface by running the game program, wherein the graphical user interface includes a game editing scene to be edited, wherein the game editing scene includes a plurality of scene components, and the scene components are components set in the game editing scene in response to editing operations; the scene components are configured with a preset adsorption range.
[0030] In a specific implementation, the above-mentioned graphical user interface is displayed when a game program is run on a terminal device. The game program can be a program of any game, and the terminal device can be the local terminal device mentioned above, or it can be a client device in the cloud interaction system mentioned above. For example, the terminal device can be a mobile phone, a tablet computer, or a personal computer. The above-mentioned game editing scene is a scene provided by running the game program, and can also be understood as a scene of the game editing stage provided by the game editor. In the game editing scene, editable components can be edited, and the edited editable components are determined as scene components and set in the game editing scene. In actual applications, when a player triggers a game editing instruction, the game editing scene can be displayed in the graphical user interface, and the game editing instruction can be determined according to the rules of the game. For example, the editing instruction can be an operation to enter the game editor; it can also be an operation to select a scene map for editing, etc.
[0031] In a specific embodiment, after the game editing scene is displayed in the graphical user interface, the scene component can be set in the game editing scene in the following manner: an editing window is displayed in the graphical user interface, and the editing window includes multiple editable components; in response to an editing operation on a target editable component among the multiple editable components, a scene component corresponding to the target editable component is controlled to be generated in the game editing scene. The above-mentioned target editable component can be any editable component included in the editing window. The specific operation of the above-mentioned editing operation on the target editable component can be determined according to the research and development requirements, and can also be determined according to the user's setting operation. For example, the editing operation can be an operation of dragging the target editable component into the game editing scene, or it can be an operation of clicking or long pressing the target editing component in the editing window, etc.
[0032] Specifically, the component type and component form of the editable components included in the above editing window can be set according to the research and development requirements. For example, the editing window can include multiple different types of editable components, including: terrain components, mechanism components, decoration components and combination components, etc., and each type of editable component also contains multiple editable components; the mechanism component also includes motion mechanism components, functional mechanism components, logic components, object components and floor components, among which the key motion mechanism also includes cylinders, gears, cross gears, clockwise turntables, etc.
[0033] In a specific implementation, at least some of the scene components included in the game editing scene are configured with a preset adsorption range. The preset adsorption range configured for each scene component may be the same or different. When a scene component in the game editing scene is moved to the preset adsorption range corresponding to a certain scene component, the two scene components will be automatically adsorbed together.
[0034] Step S104, responding to a moving operation on the first scene component in the game editing scene, determining a moving direction of the first scene component based on the moving operation, and controlling the first scene component to move along the moving direction in the game editing scene.
[0035] In a specific implementation, the above-mentioned first scene component can be any scene component in the game editing scene that is configured with a preset adsorption range. The moving operation of the first scene component can be determined according to research and development requirements. For example, the moving operation can be an operation of dragging the first scene component to move in the game editing scene, or it can be an operation of selecting the first scene component and triggering the moving control in the graphical user interface to display a preset coordinate system containing three axes on the first scene component, and then the player drags the first scene component in a certain axis, etc., wherein the axial direction dragged by the player is also the moving direction of the first scene component.
[0036] When the player performs a move operation to control the movement of the first scene component, the moving direction corresponding to the move operation can be determined as the moving direction of the first scene component. In a specific embodiment, the moving direction can be the positive direction of the X-axis, the negative direction of the X-axis, the positive direction of the Y-axis, the negative direction of the Y-axis, the positive direction of the Z-axis, or the negative direction of the Z-axis. During the duration of the move operation, the first scene component will move along the moving direction in the game editing scene according to the move operation, and when the move operation ends, the first scene component stops moving.
[0037] In a specific embodiment, in the process of controlling the movement of the first scene component in the game editing scene based on the moving operation, it is necessary to determine the moving direction of the first scene component based on the moving operation, that is, to determine the moving direction of the moving operation as the moving direction of the first scene component. For example, if the moving direction of the moving operation is the positive direction of the Y axis, then based on the moving operation, the first scene component is controlled to move along the positive direction of the Y axis, and the moving direction of the first scene component is the positive direction of the Y axis; if the moving direction of the moving operation is the negative direction of the X axis, then based on the moving operation, the first scene component is controlled to move along the negative direction of the X axis, and the moving direction of the first scene component is the negative direction of the X axis.
[0038] Step S106, during the movement of the first scene component along the moving direction, in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, the preset adsorption range of the first scene component in the moving direction is adjusted to obtain a target adsorption range; wherein the first scene component and the second scene component are both scene components in the game editing scene.
[0039] The first scene component and the second scene component are different from each other. Both the first scene component and the second scene component are scene components with preset adsorption ranges in the game editing scene. In the process of controlling the first scene component to move along the moving direction through the moving operation, if the distance between the first scene component and the second scene component is less than the preset distance threshold, the preset adsorption range of the first scene component in the moving direction can be adjusted to obtain the target adsorption range of the first scene component in the moving direction. The preset distance threshold can be determined according to R&D requirements or player settings. For example, the preset distance threshold can be 0.5 meters or 1 meter.
[0040] In a specific implementation, when the distance between the first scene component and the second scene component is less than a preset distance threshold, the adsorption range of the first scene component in the moving direction can be increased, thereby facilitating the rapid completion of the adsorption of the first scene component and the second scene component.
[0041] Step S108, in response to the target adsorption range of the first scene component in the moving direction and the second scene component satisfying a preset position relationship, controlling the first scene component to be adsorbed to the second scene component.
[0042] In specific implementation, the specific position relationship corresponding to the above preset position relationship can be determined according to research and development requirements. For example, the preset position relationship can be that the target adsorption range of the first scene component in the moving direction and the preset adsorption range corresponding to the second scene component have an intersection; the preset position relationship can also be that the target adsorption range of the first scene component in the moving direction intersects with the second scene component, etc. Specifically, during the movement of the first scene component along the moving direction, if the target adsorption range of the first scene component in the moving direction meets the preset position relationship with the second scene component, the first scene component will be adsorbed together with the second scene component.
[0043] In the above-mentioned component adsorption control method, when a scene component moves along a certain direction, the target adsorption range of the scene component in the moving direction can be adjusted, so as to quickly complete the adsorption of the scene component and other scene components, thereby improving the player's game editing experience.
[0044] The following embodiments are used to describe the method of configuring the preset adsorption range corresponding to the scene component.
[0045] In the specific implementation, we first need to introduce how the scene components in the game editing scene are configured with a preset adsorption range. Specifically, the preset adsorption range configured for the scene component is determined based on the size of the scene component and a preset adsorption coefficient; the preset adsorption coefficient is determined based on the distance between the scene component and the virtual camera in the game editing scene; wherein the preset adsorption coefficient is proportional to the distance between the scene component and the virtual camera. Specifically, the product of the size of the scene component and the preset adsorption coefficient can be determined as the preset adsorption range of the scene component, or the sum of the size of the scene component and the preset adsorption coefficient can be determined as the preset adsorption range of the scene component, and so on.
[0046] The virtual camera is used to capture the game editing scene to form a scene screen in the graphical user interface. Generally, the farther the distance between the scene component in the game editing scene and the virtual camera, the greater the preset adsorption coefficient corresponding to the scene component, that is, the preset adsorption coefficient can be enlarged or reduced in proportion to the distance between the scene component and the virtual camera. In a specific embodiment, the preset adsorption coefficient is greater than 1.
[0047] In the specific implementation, assuming that the actual size of the current scene component is x, and the preset adsorption coefficient corresponding to the current scene component is y, then the preset adsorption range of the current scene component configuration is x*y.
[0048] In an optional embodiment, in response to a zoom operation on the first scene component, the proportion of the display area of the first scene component in the graphical user interface is adjusted based on the zoom operation; in response to the proportion of the display area of the first scene component in the graphical user interface exceeding a preset ratio threshold, the preset adsorption coefficient corresponding to the first scene component is controlled to increase, so as to increase the preset adsorption range corresponding to the first scene component. In a specific implementation, the above-mentioned zoom operation can be an operation of enlarging the proportion of the display area of the first scene component in the graphical user interface, or an operation of reducing the proportion of the display area of the first scene component in the graphical user interface, etc. The above-mentioned preset ratio threshold can be determined according to research and development needs, for example, the preset ratio threshold is 50% or 60%, etc.
[0049] Specifically, when the proportion of the display area of the first scene component in the graphical user interface exceeds a preset ratio threshold, the method of controlling the increase of the preset adsorption coefficient corresponding to the first scene component can be determined according to research and development needs. For example, the preset adsorption coefficient corresponding to the first scene component can be multiplied by a fixed value greater than 1. The enlargement multiple of the preset adsorption coefficient can also be determined according to the proportion of the display area of the first scene component in the graphical user interface, and the preset adsorption coefficient can be multiplied by the enlargement multiple. Among them, the larger the proportion corresponding to the first scene component, the larger the enlargement multiple of the preset adsorption coefficient.
[0050] For example, in the scene screen currently displayed by the graphical user interface, the display area of the first scene component accounts for n% of the graphical user interface, and it is determined that the player needs to perform fine operations. At this time, the result of multiplying the preset adsorption coefficient corresponding to the first scene component by n is determined as the increased preset adsorption coefficient, thereby increasing the preset adsorption range of the first scene component, making it easier for the player to perform fine operations on the first scene component.
[0051] In an optional embodiment, in the scene screen currently displayed in the graphical user interface, if there are no other scene components near the first scene component, that is, there is no scene component in the game editing scene whose distance from the first scene component is less than a preset distance threshold, the preset adsorption coefficient of the first scene component is determined based on the distance between the current virtual camera and the first scene component. Based on this, the preset adsorption range configured for the first scene component is the product of the size of the first scene component and the preset adsorption coefficient of the first scene component, that is, the periphery of the first scene component is expanded by one circle, and the expanded range is determined as the current preset adsorption range. Figure 3 FIG. 1 is a schematic diagram showing a preset adsorption range of a first scene component provided by an embodiment of the present invention. Figure 3 The dark triangle in the figure is the first scene component, and the triangle surrounded by dotted lines outside the dark triangle represents the preset adsorption range of the first scene component.
[0052] The following examples are used to describe the manner of adjusting the preset adsorption range.
[0053] In the scene screen currently displayed in the graphical user interface, if other scene components (i.e., adsorbable scene components) appear in the current X-axis, Y-axis, or Z-axis direction of the first scene component, that is, there is a scene component in the game editing scene whose distance from the first scene component is less than the preset distance threshold, the preset adsorption coefficient of the first scene component will be determined based on the distance between the current virtual camera and the first scene component, and the adsorption coefficient of the moving direction (i.e., the axis that produces the coordinate change) will be amplified along the moving direction of the first scene component in real time. Specifically, the preset adsorption coefficient includes: adsorption coefficients corresponding to multiple preset directions, and the moving direction is one of the multiple preset directions; it can also be understood that the preset adsorption coefficient is split into adsorption coefficients corresponding to three axes, that is, split into adsorption coefficients corresponding to the X-axis, adsorption coefficients corresponding to the Y-axis, and adsorption coefficients corresponding to the Z-axis.
[0054] Based on the above description, the specific process of adjusting the preset adsorption range of the first scene component in the moving direction to obtain the target adsorption range may include: increasing the adsorption coefficient of the first scene component in the moving direction to obtain the target adsorption coefficient; and determining the target adsorption range of the first scene component in the moving direction according to the target adsorption coefficient.
[0055] In specific implementation, the method of increasing the adsorption coefficient of the first scene component in the moving direction can be determined according to research and development needs. For example, since the adsorption coefficient is usually greater than 1, the square of the adsorption coefficient in the moving direction can be determined as the target adsorption coefficient; the product of the adsorption coefficient in the moving direction and a fixed value can also be determined as the target adsorption coefficient, etc.
[0056] Furthermore, when determining the target adsorption range of the first scene component according to the target adsorption coefficient, it is first necessary to determine the target adsorption surface of the first scene component in the moving direction and determine the area of the target adsorption surface; then the product of the area of the target adsorption surface and the target adsorption coefficient is determined as the target adsorption range of the first scene component in the moving direction.
[0057] In a specific implementation, when the first scene component moves along the moving direction in the game editing scene based on the moving operation, if the distance between the first scene component and the second scene component is less than a preset distance threshold, it is first necessary to determine the target adsorption surface of the first scene component in the moving direction. Specifically, the determination method of the target adsorption surface includes at least one of the following:
[0058] Method 1: determine the model surface of the first scene component close to the second scene component in the moving direction as the target adsorption surface, wherein the model surface is the surface of the virtual model constituting the first scene component, or the surface of the collision body constituting the first scene component.
[0059] Method 2: The model surface of the first scene component that satisfies the preset position relationship with the moving direction is determined as the target adsorption surface, wherein the model surface is the surface of the virtual model constituting the first scene component, or the surface of the collision body constituting the first scene component. The above preset position relationship can be determined according to research and development requirements. For example, the target adsorption surface can be a surface of the first scene component that is perpendicular to the moving direction, or a surface that is at a specified angle to the moving direction, etc.
[0060] In specific implementation, in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, it is necessary not only to determine the target adsorption surface of the first scene component in the moving direction, but also to determine the adsorbable surface of the second scene component in the moving direction. Thus, in response to the intersection of the target adsorption range of the first scene component in the moving direction and the preset adsorption range configured by the second scene component, the target adsorption surface of the first scene component is controlled to be adsorbed to the adsorbable surface corresponding to the second scene component. It can also be understood that if the target adsorption range of the first scene component in the moving direction overlaps with the preset adsorption range corresponding to the adsorbable surface of the second scene component, the first scene component and the second scene component are automatically adsorbed, and the target adsorption surface of the first scene component is adsorbed on the adsorbable surface of the second scene component. This method reduces the computational pressure of adsorption surface determination, while clearly judging the surface that needs to be adsorbed during the operation and effectively conveying it to the player, so that the scene components can be accurately adsorbed.
[0061] In an optional embodiment, the above-mentioned method of determining the adsorbable surface of the second scene component in the moving direction includes: determining the model surface of the second scene component close to the first scene component in the moving direction as the adsorbable surface of the second scene component in the moving direction, or determining the model surface of the second scene component that satisfies a preset position relationship with the moving direction as the adsorbable surface, wherein the model surface is the surface of the virtual model constituting the second scene component, or the surface of the collision body constituting the second scene component.
[0062] like Figure 2 FIG. 1 is a schematic diagram showing a display of determining an adsorption surface provided by an embodiment of the present invention. Figure 2 The triangle in the figure represents the first scene component, and the rounded rectangle represents the second scene component. Figure 2 The rectangular coordinate system is displayed in the figure. Since the negative direction of the Y axis is a dotted line, it means that the first scene component moves along the negative direction of the Y axis, that is, the moving direction of the first scene component is the negative direction of the Y axis. Then, in the negative direction of the Y axis, the surfaces that the first scene component and the second scene component are close to are the lower surface of the triangle and the upper surface of the rounded rectangle. Therefore, the lower surface of the triangle can be determined as the target adsorption surface of the first scene component, and the upper surface of the rounded rectangle can be determined as the adsorbable surface of the second scene component. It should be noted that Figure 2 The scene components in the game editing scene are represented by two-dimensional models. In fact, the scene components in the game editing scene are three-dimensional models. The above method can accurately determine the adsorption surfaces corresponding to the first scene component and the second scene component, which is convenient for the subsequent adsorption of the first scene component and the second scene component.
[0063] In an optional embodiment, the target adsorption range is a cuboid, wherein the bottom of the target adsorption range of the first scene component in the moving direction is the target adsorption surface, and the height is the target adsorption coefficient. Figure 3Shown is a schematic diagram of the target adsorption range of the first scene component in the moving direction provided by an embodiment of the present invention. Figure 3 The dark triangle is the first scene component, and the dark rounded rectangle is the second scene component. The first scene component moves in the direction of the arrow, that is, it moves in the negative direction of the Y axis. At this time, the preset adsorption range of the first scene component in the negative direction of the Y axis increases, and the rectangular dotted box is used to indicate the increased adsorption range, so that the preset adsorption range in the negative direction of the Y axis plus the increased adsorption range is the target adsorption range in the negative direction of the Y axis of the first scene component.
[0064] It should be noted that when the first scene component moves along the moving direction, it only responds to the adsorption surface and adsorption range in the moving direction, and the adsorption surface is usually determined based on the numerical change in the axial direction corresponding to the moving direction.
[0065] In another optional embodiment, the moving speed of the first scene component in the moving direction can be controlled according to the moving operation, and the adsorbable range of the first scene component in the moving direction can be adjusted. Specifically, based on the moving operation, the moving speed of the first scene component in the moving direction is determined; in response to the moving speed being within the preset speed threshold range, the target adsorption range of the first scene component in the moving direction is controlled to remain unchanged; in response to the moving speed being less than the minimum value of the preset speed threshold range, the target adsorption range of the first scene component in the moving direction is controlled to decrease; in response to the moving speed being greater than the maximum value of the preset speed threshold range, the target adsorption range of the first scene component in the moving direction is controlled to increase.
[0066] In specific implementation, the minimum and maximum values corresponding to the above preset speed threshold range can be set according to R&D requirements or player operation, and are not specifically limited here. According to the moving speed of the first scene component in the moving direction corresponding to the moving operation, the adsorption range of the first scene component in the moving direction can be adjusted. Specifically, when the moving speed of the first scene component in the moving direction is within the preset speed threshold range, the target adsorption range of the first scene component in the moving direction is kept unchanged; when the moving speed of the first scene component in the moving direction is less than the minimum value of the preset speed threshold range, the target adsorption range of the first scene component in the moving direction will be reduced on the basis of the current adsorption range; when the moving speed of the first scene component in the moving direction is greater than the maximum value of the preset speed threshold range, it is equivalent to a large displacement of the first scene component in a short time, and the target adsorption range of the first scene component in the moving direction will be increased on the basis of the current adsorption range. This method can make the components adsorb faster. For example, when making a large map, it may take a long time to slide the first scene component to the scene component that needs to be adsorbed. Using this judgment mechanism, the first scene component can be adsorbed to the adsorbable scene component more quickly.
[0067] like Figure 5 FIG. 1 is a schematic diagram of adjusting the adsorption range based on the moving speed provided by an embodiment of the present invention. Figure 5 The square corresponding to the finger position in represents the first scene component, that is, the scene component controlled and moved by the player, and the moving direction of the first scene component is the direction of the arrow; Figure 5 The square not at the finger position is the second scene component, and the adsorption range corresponding to the adsorbable surface of the second scene component remains unchanged. The adsorption range corresponding to the adsorbable target of the first scene component will be enlarged in the moving direction, so Figure 5 The first figure in the first row of shows that when the moving speed of the first scene component is within the preset speed threshold range, the adsorption range of the first scene component in the moving direction remains unchanged; Figure 5 The first figure in the second row of shows that when the moving speed of the first scene component is less than the minimum value of the preset speed threshold range, the adsorption range of the first scene component in the moving direction becomes smaller; Figure 5 The first figure in the third row in shows that when the moving speed of the first scene component is greater than the maximum value of the preset speed threshold range, the adsorption range of the first scene component in the moving direction becomes larger.
[0068] In the above method, during the UGC operation process, the differentiated adsorption requirements in the large-range movement and micro-manipulation cases within the same grid size are met; while reducing the computational pressure of adsorption surface judgment, the surfaces that need to be adsorbed during the operation are clearly judged and effectively communicated to the UGC editor; at the same time, the expansion of the long-distance adsorption range and the close-range adsorption micro-manipulation adsorption judgment are met, thereby improving the adsorption efficiency of scene components.
[0069] Corresponding to the above method embodiment, the embodiment of the present invention also provides a component adsorption control device, such as Figure 6 As shown, the device comprises:
[0070] The interface display module 60 is used to display a graphical user interface by running the game program. The graphical user interface includes a game editing scene to be edited. The game editing scene includes multiple scene components. The scene components are components set in the game editing scene in response to editing operations; the scene components are configured with a preset adsorption range.
[0071] The movement control module 61 is used to respond to the movement operation of the first scene component in the game editing scene, determine the movement direction of the first scene component based on the movement operation, and control the first scene component to move along the movement direction in the game editing scene.
[0072] The range determination module 62 is used to adjust the preset adsorption range of the first scene component in the moving direction to obtain the target adsorption range in response to the distance between the first scene component and the second scene component being less than a preset distance threshold during the movement of the first scene component along the moving direction; wherein the first scene component and the second scene component are both scene components in the game editing scene.
[0073] The component adsorption module 63 is used to control the adsorption of the first scene component to the second scene component in response to the target adsorption range of the first scene component in the moving direction and the second scene component satisfying a preset position relationship.
[0074] The above-mentioned component adsorption control device can adjust the target adsorption range of the scene component in a certain direction when the scene component moves in the direction of movement, so as to quickly complete the adsorption of the scene component with other scene components and enhance the player's game editing experience.
[0075] Specifically, the movement control module 61 is used to determine the moving direction of the moving operation as the moving direction of the first scene component.
[0076] In a specific implementation, the preset adsorption range of the above-mentioned scene component configuration is determined based on the product of the size of the scene component and a preset adsorption coefficient; the preset adsorption coefficient is determined based on the distance between the scene component and the virtual camera in the game editing scene; wherein, the preset adsorption coefficient is proportional to the distance between the scene component and the virtual camera.
[0077] Furthermore, the above-mentioned device also includes a zoom module, which is used to: respond to a zoom operation on the first scene component, and adjust the proportion of the display area of the first scene component in the graphical user interface based on the zoom operation; in response to the proportion of the display area of the first scene component in the graphical user interface exceeding a preset proportion threshold, control to increase the preset adsorption coefficient corresponding to the first scene component to increase the preset adsorption range corresponding to the first scene component.
[0078] Specifically, the above-mentioned preset adsorption coefficient includes: adsorption coefficients corresponding to multiple preset directions, and the moving direction is one of the multiple preset directions; the above-mentioned range determination module 62 is used to: increase the adsorption coefficient of the first scene component in the moving direction to obtain the target adsorption coefficient; according to the target adsorption coefficient, determine the target adsorption range of the first scene component in the moving direction.
[0079] Furthermore, the above-mentioned range determination module 62 is also used to: determine the target adsorption surface of the first scene component in the moving direction, and determine the area of the target adsorption surface; and determine the product of the area of the target adsorption surface and the target adsorption coefficient as the target adsorption range of the first scene component in the moving direction.
[0080] In a specific implementation, the step of determining the target adsorption surface of the first scene component in the moving direction includes at least one of the following: determining the model surface of the first scene component close to the second scene component in the moving direction as the target adsorption surface, wherein the model surface is the surface of the virtual model constituting the first scene component, or the surface of the collision body constituting the first scene component; and determining the model surface of the first scene component that satisfies a preset position relationship with the moving direction as the target adsorption surface, wherein the model surface is the surface of the virtual model constituting the first scene component, or the surface of the collision body constituting the first scene component.
[0081] Furthermore, the device further includes an adsorption surface determination module, which is used to: in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, determine the adsorbable surface of the second scene component in the moving direction. Based on this, the component adsorption module 63 is used to: in response to the target adsorption range of the first scene component in the moving direction intersecting with the preset adsorption range configured for the second scene component, control the target adsorption surface of the first scene component to be adsorbed onto the adsorbable surface corresponding to the second scene component.
[0082] In a specific implementation, the above-mentioned adsorption surface determination module is used to: in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, determine the model surface of the second scene component close to the first scene component in the moving direction as the adsorbable surface of the second scene component in the moving direction, or determine the model surface of the second scene component that satisfies a preset position relationship with the moving direction as the adsorbable surface, wherein the model surface is the surface of the virtual model constituting the second scene component, or the surface of the collision body constituting the second scene component.
[0083] Furthermore, the above-mentioned device also includes a range adjustment module, which is used to: determine the moving speed of the first scene component in the moving direction based on the moving operation; in response to the moving speed being within a preset speed threshold range, control the target adsorption range of the first scene component in the moving direction to remain unchanged; in response to the moving speed being less than the minimum value of the preset speed threshold range, control the target adsorption range of the first scene component in the moving direction to decrease; in response to the moving speed being greater than the maximum value of the preset speed threshold range, control the target adsorption range of the first scene component in the moving direction to increase.
[0084] The component adsorption control device provided in the embodiment of the present disclosure has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0085] The present disclosure also provides an electronic device, such as Figure 7As shown, the electronic device includes a processor and a memory, the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the above-mentioned component adsorption control method.
[0086] Specifically, the specific process of the above-mentioned component adsorption control method includes: displaying a graphical user interface by running a game program, the graphical user interface includes a game editing scene to be edited, the game editing scene includes multiple scene components, and the scene components are components set in the game editing scene in response to editing operations; the scene components are configured with a preset adsorption range; in response to a move operation on a first scene component in the game editing scene, determining a moving direction of the first scene component based on the move operation, and controlling the first scene component to move along the moving direction in the game editing scene; in the process of the first scene component moving along the moving direction, in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, adjusting the preset adsorption range of the first scene component in the moving direction to obtain a target adsorption range; wherein the first scene component and the second scene component are both scene components in the game editing scene; in response to the target adsorption range of the first scene component in the moving direction satisfying a preset position relationship with the second scene component, controlling the first scene component to be adsorbed to the second scene component.
[0087] In the above-mentioned component adsorption control method, when a scene component moves along a certain direction, the target adsorption range of the scene component in the moving direction can be adjusted, so as to quickly complete the adsorption of the scene component and other scene components, thereby improving the player's game editing experience.
[0088] In an optional embodiment, the step of determining the moving direction of the first scene component based on the moving operation includes: determining the moving direction of the moving operation as the moving direction of the first scene component.
[0089] In an optional embodiment, the preset adsorption range of the above-mentioned scene component configuration is determined based on the product of the size of the scene component and a preset adsorption coefficient; the preset adsorption coefficient is determined based on the distance between the scene component and a virtual camera in the game editing scene; wherein, the preset adsorption coefficient is proportional to the distance between the scene component and the virtual camera.
[0090] In an optional embodiment, the above method also includes: in response to a zoom operation on the first scene component, adjusting the proportion of the display area of the first scene component in the graphical user interface based on the zoom operation; in response to the proportion of the display area of the first scene component in the graphical user interface exceeding a preset proportion threshold, controlling to increase a preset adsorption coefficient corresponding to the first scene component to increase a preset adsorption range corresponding to the first scene component.
[0091] In an optional embodiment, the above-mentioned preset adsorption coefficient includes: adsorption coefficients corresponding to multiple preset directions, and the moving direction is one of the multiple preset directions; the above-mentioned step of adjusting the preset adsorption range of the first scene component in the moving direction to obtain the target adsorption range includes: increasing the adsorption coefficient of the first scene component in the moving direction to obtain the target adsorption coefficient; determining the target adsorption range of the first scene component in the moving direction according to the target adsorption coefficient.
[0092] In an optional embodiment, the step of determining the target adsorption range of the first scene component in the moving direction according to the target adsorption coefficient includes: determining the target adsorption surface of the first scene component in the moving direction, and determining the area of the target adsorption surface; and determining the product of the area of the target adsorption surface and the target adsorption coefficient as the target adsorption range of the first scene component in the moving direction.
[0093] In an optional embodiment, the above-mentioned step of determining the target adsorption surface of the first scene component in the moving direction includes at least one of the following: determining the model surface of the first scene component close to the second scene component in the moving direction as the target adsorption surface, wherein the model surface is the surface of the virtual model constituting the first scene component, or the surface of the collision body constituting the first scene component; and determining the model surface of the first scene component that satisfies a preset position relationship with the moving direction as the target adsorption surface, wherein the model surface is the surface of the virtual model constituting the first scene component, or the surface of the collision body constituting the first scene component.
[0094] In an optional embodiment, the above method also includes: in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, determining the adsorbable surface of the second scene component in the moving direction; in response to the target adsorption range of the first scene component in the moving direction satisfying a preset position relationship with the second scene component, controlling the step of adsorbing the first scene component to the second scene component, including: in response to the target adsorption range of the first scene component in the moving direction intersecting with the preset adsorption range configured by the second scene component, controlling the target adsorption surface of the first scene component to be adsorbed to the adsorbable surface corresponding to the second scene component.
[0095] In an optional embodiment, the above-mentioned step of determining the adsorbable surface of the second scene component in the moving direction in response to the distance between the first scene component and the second scene component being less than a preset distance threshold includes: in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, determining the model surface of the second scene component close to the first scene component in the moving direction as the adsorbable surface of the second scene component in the moving direction, or determining the model surface of the second scene component that satisfies a preset position relationship with the moving direction as the adsorbable surface, wherein the model surface is the surface of the virtual model constituting the second scene component, or the surface of the collision body constituting the second scene component.
[0096] In an optional embodiment, the above method also includes: based on the moving operation, determining the moving speed of the first scene component in the moving direction; in response to the moving speed being within a preset speed threshold range, controlling the target adsorption range of the first scene component in the moving direction to remain unchanged; in response to the moving speed being less than the minimum value of the preset speed threshold range, controlling the target adsorption range of the first scene component in the moving direction to decrease; in response to the moving speed being greater than the maximum value of the preset speed threshold range, controlling the target adsorption range of the first scene component in the moving direction to increase.
[0097] Further, Figure 7 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .
[0098] The memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0099] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and completes the steps of the method of the above embodiment in combination with its hardware.
[0100] The embodiment of the present disclosure also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by the processor, the computer-executable instructions prompt the processor to implement the above-mentioned component adsorption control method. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0101] Specifically, the specific process of the above-mentioned component adsorption control method includes: displaying a graphical user interface by running a game program, the graphical user interface includes a game editing scene to be edited, the game editing scene includes multiple scene components, and the scene components are components set in the game editing scene in response to editing operations; the scene components are configured with a preset adsorption range; in response to a move operation on a first scene component in the game editing scene, determining a moving direction of the first scene component based on the move operation, and controlling the first scene component to move along the moving direction in the game editing scene; in the process of the first scene component moving along the moving direction, in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, adjusting the preset adsorption range of the first scene component in the moving direction to obtain a target adsorption range; wherein the first scene component and the second scene component are both scene components in the game editing scene; in response to the target adsorption range of the first scene component in the moving direction satisfying a preset position relationship with the second scene component, controlling the first scene component to be adsorbed to the second scene component.
[0102] In the above-mentioned component adsorption control method, when a scene component moves along a certain direction, the target adsorption range of the scene component in the moving direction can be adjusted, so as to quickly complete the adsorption of the scene component and other scene components, thereby improving the player's game editing experience.
[0103] In an optional embodiment, the step of determining the moving direction of the first scene component based on the moving operation includes: determining the moving direction of the moving operation as the moving direction of the first scene component.
[0104] In an optional embodiment, the preset adsorption range of the above-mentioned scene component configuration is determined based on the product of the size of the scene component and a preset adsorption coefficient; the preset adsorption coefficient is determined based on the distance between the scene component and a virtual camera in the game editing scene; wherein, the preset adsorption coefficient is proportional to the distance between the scene component and the virtual camera.
[0105] In an optional embodiment, the above method also includes: in response to a zoom operation on the first scene component, adjusting the proportion of the display area of the first scene component in the graphical user interface based on the zoom operation; in response to the proportion of the display area of the first scene component in the graphical user interface exceeding a preset proportion threshold, controlling to increase a preset adsorption coefficient corresponding to the first scene component to increase a preset adsorption range corresponding to the first scene component.
[0106] In an optional embodiment, the above-mentioned preset adsorption coefficient includes: adsorption coefficients corresponding to multiple preset directions, and the moving direction is one of the multiple preset directions; the above-mentioned step of adjusting the preset adsorption range of the first scene component in the moving direction to obtain the target adsorption range includes: increasing the adsorption coefficient of the first scene component in the moving direction to obtain the target adsorption coefficient; determining the target adsorption range of the first scene component in the moving direction according to the target adsorption coefficient.
[0107] In an optional embodiment, the step of determining the target adsorption range of the first scene component in the moving direction according to the target adsorption coefficient includes: determining the target adsorption surface of the first scene component in the moving direction, and determining the area of the target adsorption surface; and determining the product of the area of the target adsorption surface and the target adsorption coefficient as the target adsorption range of the first scene component in the moving direction.
[0108] In an optional embodiment, the above-mentioned step of determining the target adsorption surface of the first scene component in the moving direction includes at least one of the following: determining the model surface of the first scene component close to the second scene component in the moving direction as the target adsorption surface, wherein the model surface is the surface of the virtual model constituting the first scene component, or the surface of the collision body constituting the first scene component; and determining the model surface of the first scene component that satisfies a preset position relationship with the moving direction as the target adsorption surface, wherein the model surface is the surface of the virtual model constituting the first scene component, or the surface of the collision body constituting the first scene component.
[0109] In an optional embodiment, the above method also includes: in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, determining the adsorbable surface of the second scene component in the moving direction; in response to the target adsorption range of the first scene component in the moving direction satisfying a preset position relationship with the second scene component, controlling the step of adsorbing the first scene component to the second scene component, including: in response to the target adsorption range of the first scene component in the moving direction intersecting with the preset adsorption range configured by the second scene component, controlling the target adsorption surface of the first scene component to be adsorbed to the adsorbable surface corresponding to the second scene component.
[0110] In an optional embodiment, the above-mentioned step of determining the adsorbable surface of the second scene component in the moving direction in response to the distance between the first scene component and the second scene component being less than a preset distance threshold includes: in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, determining the model surface of the second scene component close to the first scene component in the moving direction as the adsorbable surface of the second scene component in the moving direction, or determining the model surface of the second scene component that satisfies a preset position relationship with the moving direction as the adsorbable surface, wherein the model surface is the surface of the virtual model constituting the second scene component, or the surface of the collision body constituting the second scene component.
[0111] In an optional embodiment, the above method also includes: based on the moving operation, determining the moving speed of the first scene component in the moving direction; in response to the moving speed being within a preset speed threshold range, controlling the target adsorption range of the first scene component in the moving direction to remain unchanged; in response to the moving speed being less than the minimum value of the preset speed threshold range, controlling the target adsorption range of the first scene component in the moving direction to decrease; in response to the moving speed being greater than the maximum value of the preset speed threshold range, controlling the target adsorption range of the first scene component in the moving direction to increase.
[0112] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a terminal device, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0113] In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present disclosure. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0114] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A component adsorption control method, characterized in that: The method comprises: A graphical user interface is displayed by running the game program, wherein the graphical user interface includes a game editing scene to be edited, wherein the game editing scene includes a plurality of scene components, wherein the scene components are components set in the game editing scene in response to an editing operation; and the scene components are configured with a preset adsorption range; In response to a movement operation on a first scene component in the game editing scene, determining a movement direction of the first scene component based on the movement operation, and controlling the first scene component to move along the movement direction in the game editing scene; In the process of the first scene component moving along the moving direction, in response to the distance between the first scene component and the second scene component being less than a preset distance threshold, adjusting a preset adsorption range of the first scene component in the moving direction to obtain a target adsorption range; wherein the first scene component and the second scene component are both scene components in the game editing scene; In response to the target adsorption range of the first scene component in the moving direction satisfying a preset position relationship with the second scene component, the first scene component is controlled to be adsorbed to the second scene component.
2. The method according to claim 1, characterized in that The step of determining the moving direction of the first scene component based on the moving operation comprises: The moving direction of the moving operation is determined as the moving direction of the first scene component.
3. The method according to claim 1, characterized in that The preset adsorption range of the scene component configuration is determined based on the size of the scene component and the preset adsorption coefficient; The preset adsorption coefficient is determined based on the distance between the scene component and the virtual camera in the game editing scene; wherein the preset adsorption coefficient is proportional to the distance between the scene component and the virtual camera.
4. The method according to claim 3, characterized in that The method further comprises: In response to a zoom operation on the first scene component, adjusting a display area ratio of the first scene component in the graphical user interface based on the zoom operation; In response to the proportion of the display area of the first scene component in the graphical user interface exceeding a preset ratio threshold, a preset adsorption coefficient corresponding to the first scene component is controlled to increase so as to increase a preset adsorption range corresponding to the first scene component.
5. The method according to claim 3, characterized in that: The preset adsorption coefficient includes: adsorption coefficients corresponding to a plurality of preset directions, and the moving direction is one of the plurality of preset directions; The step of adjusting the preset adsorption range of the first scene component in the moving direction to obtain a target adsorption range includes: increasing the adsorption coefficient of the first scene component in the moving direction to obtain a target adsorption coefficient; According to the target adsorption coefficient, a target adsorption range of the first scene component in the moving direction is determined.
6. The method according to claim 5, characterized in that The step of determining the target adsorption range of the first scene component in the moving direction according to the target adsorption coefficient comprises: Determining a target adsorption surface of the first scene component in the moving direction, and determining an area of the target adsorption surface; The product of the area of the target adsorption surface and the target adsorption coefficient is determined as the target adsorption range of the first scene component in the moving direction.
7. The method according to claim 6, characterized in that The step of determining the target adsorption surface of the first scene component in the moving direction includes at least one of the following: Determining a model surface of the first scene component close to the second scene component in the moving direction as the target adsorption surface, wherein the model surface is a surface of a virtual model constituting the first scene component, or a surface of a collision body constituting the first scene component; and A model surface of the first scene component that satisfies a preset position relationship with the moving direction is determined as the target adsorption surface, wherein the model surface is the surface of a virtual model constituting the first scene component, or the surface of a collision body constituting the first scene component.
8. The method according to claim 6, characterized in that The method further comprises: In response to the distance between the first scene component and the second scene component being less than a preset distance threshold, determining an adsorbable surface of the second scene component in the moving direction; In response to the target adsorption range of the first scene component in the moving direction and the second scene component satisfying a preset position relationship, the step of controlling the first scene component to be adsorbed to the second scene component comprises: In response to the target adsorption range of the first scene component in the moving direction intersecting with the preset adsorption range configured for the second scene component, the target adsorption surface of the first scene component is controlled to be adsorbed onto the adsorbable surface corresponding to the second scene component.
9. The method according to claim 8, characterized in that In response to the distance between the first scene component and the second scene component being less than a preset distance threshold, the step of determining an adsorbable surface of the second scene component in the moving direction comprises: In response to the distance between the first scene component and the second scene component being less than a preset distance threshold, a model surface of the second scene component close to the first scene component in the moving direction is determined as an adsorbable surface of the second scene component in the moving direction, or a model surface of the second scene component that satisfies a preset positional relationship with the moving direction is determined as the adsorbable surface, wherein the model surface is a surface of a virtual model constituting the second scene component, or a surface of a collision body constituting the second scene component.
10. The method according to claim 1, characterized in that The method further comprises: Based on the movement operation, determining a movement speed of the first scene component in the movement direction; In response to the moving speed being within a preset speed threshold range, controlling the target adsorption range of the first scene component in the moving direction to remain unchanged; In response to the moving speed being less than a minimum value of the preset speed threshold range, controlling the target adsorption range of the first scene component in the moving direction to decrease; In response to the moving speed being greater than a maximum value of the preset speed threshold range, the target adsorption range of the first scene component in the moving direction is controlled to increase.
11. A component adsorption control device, characterized in that: The device comprises: An interface display module, used for displaying a graphical user interface by running a game program, wherein the graphical user interface includes a game editing scene to be edited, wherein the game editing scene includes a plurality of scene components, wherein the scene components are components set in the game editing scene in response to an editing operation; and wherein the scene components are configured with a preset adsorption range; A movement control module, for responding to a movement operation on a first scene component in the game editing scene, determining a movement direction of the first scene component based on the movement operation, and controlling the first scene component to move along the movement direction in the game editing scene; a range determination module, configured to adjust a preset adsorption range of the first scene component in the moving direction to obtain a target adsorption range in response to a distance between the first scene component and the second scene component being less than a preset distance threshold during the movement of the first scene component along the moving direction; wherein the first scene component and the second scene component are both scene components in the game editing scene; The component adsorption module is used to control the adsorption of the first scene component to the second scene component in response to the target adsorption range of the first scene component in the moving direction and the second scene component satisfying a preset position relationship.
12. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor executes the machine executable instructions to implement the component adsorption control method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the component adsorption control method according to any one of claims 1 to 10.
Citation Information
Cited By
Game scene editing method and apparatus, device, and storage medium
WO2026175070A1
