Information processing method, apparatus and electronic device
Patent Information
- Application Number
- CN202211627135.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2042-12-16
AI Technical Summary
相关技术中,可以通过与对象的大小形状一致的遮罩图像确定对象的检测范围,但遮罩图像会增加游戏整体的资源量,占用内存,可能造成游戏运行的卡顿;另一种方式中,通过像素检测的方式检测对象的像素范围,该方式具有较大的运算量,也可能造成游戏运行的卡顿
[0009] The aforementioned information processing method, apparatus, and electronic device acquire a graphic set of a target object; wherein the graphic set includes multiple object graphics; each object graphic has a first preset shape; each object graphic includes object content representing a portion of the target object; the proportion of the graphic area occupied by the object content within the object graphic is greater than a preset proportion threshold; the multiple object graphics constitute a complete target object; the multiple object graphics are set in a game scene to display the target object on the scene screen; wherein the area occupied by the multiple object graphics in the game scene serves as the interaction area of the target object; in response to the triggering of this interaction area, a specified event corresponding to the target object is controlled and executed. In this method, the target object is divided into multiple object graphics of preset shapes, reducing the proportion of non-object content graphic areas, thus ensuring a higher proportion of object content within the object graphics and guaranteeing a high accuracy rate for object interaction triggering; this method does not require increasing the game's resource consumption or runtime computation, can accurately and efficiently define the interaction area, ensures smooth game operation, and improves the player's gaming experience.
Smart Images

Figure CN116139477B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of game technology, and in particular to an information processing method, apparatus, and electronic device. Background Technology
[0002] In 2D games, most objects on the game interface are in PNG (Portable Network Graphics) image format, such as button images, background images, and character images. Some objects have interactive requirements; for example, contact between objects can trigger subsequent game events, or players can issue game commands by clicking on objects. Therefore, the detection range of the PNG images of objects needs to be defined. One approach is to determine the detection range of an object using a mask image that matches the object's size and shape. However, mask images increase the overall resource consumption of the game, consuming more memory and potentially causing lag. Another approach is to detect the pixel range of an object using pixel detection, but this method requires significant computation and may also cause lag. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to provide an information processing method, apparatus and electronic device that, while achieving high accuracy in object range detection, reduces the memory usage and computational load of detection, making the game run more smoothly and improving the player's gaming experience.
[0004] In a first aspect, embodiments of the present invention provide an information processing method, which provides a graphical user interface through a terminal device; the graphical user interface includes a scene screen of a game scene; the method includes: acquiring a graphic set of a target object; wherein the graphic set includes multiple object graphics; the object graphics are of a first preset shape; the object graphics include object content of a portion of the target object; the proportion of the graphic area occupied by the object content in the object graphics is greater than a preset proportion threshold; the multiple object graphics form a complete target object; setting the multiple object graphics in the game scene to display the target object in the scene screen; wherein the area occupied by the multiple object graphics in the game scene serves as the interaction area of the target object; in response to the triggering of the interaction area, controlling the execution of a specified event corresponding to the target object.
[0005] Secondly, embodiments of the present invention also provide an information processing apparatus that provides a graphical user interface via a terminal device; the graphical user interface includes a scene screen of a game scene; the apparatus includes: an acquisition module, used to acquire a graphic set of a target object; wherein the graphic set includes multiple object graphics; the object graphics are a first preset shape; the object graphics include object content of a portion of the target object; the proportion of the graphic area occupied by the object content in the object graphics is greater than a preset proportion threshold; the multiple object graphics constitute a complete target object; a setting module, used to set the multiple object graphics in the game scene to display the target object in the scene screen; wherein the area occupied by the multiple object graphics in the game scene serves as the interaction area of the target object; and an execution module, used to control the execution of a specified event corresponding to the target object in response to the triggering of the interaction area.
[0006] Thirdly, embodiments of the present invention provide an electronic device, including 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-described information processing method.
[0007] Fourthly, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the above-described information processing method.
[0008] The embodiments of the present invention bring the following beneficial effects:
[0009] The aforementioned information processing method, apparatus, and electronic device acquire a graphic set of a target object; wherein the graphic set includes multiple object graphics; each object graphic has a first preset shape; each object graphic includes object content representing a portion of the target object; the proportion of the graphic area occupied by the object content within the object graphic is greater than a preset proportion threshold; the multiple object graphics constitute a complete target object; the multiple object graphics are set in a game scene to display the target object on the scene screen; wherein the area occupied by the multiple object graphics in the game scene serves as the interaction area of the target object; in response to the triggering of this interaction area, a specified event corresponding to the target object is controlled and executed. In this method, the target object is divided into multiple object graphics of preset shapes, reducing the proportion of non-object content graphic areas, thus ensuring a higher proportion of object content within the object graphics and guaranteeing a high accuracy rate for object interaction triggering; this method does not require increasing the game's resource consumption or runtime computation, can accurately and efficiently define the interaction area, ensures smooth game operation, and improves the player's gaming experience.
[0010] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.
[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0013] Figure 1 A flowchart of an information processing method provided in an embodiment of the present invention;
[0014] Figure 2 This is a schematic diagram illustrating the segmentation of an initial graphic from a first edge position, as provided in an embodiment of the present invention.
[0015] Figure 3 This is a comparative schematic diagram of the interactive areas of a target object provided in an embodiment of the present invention;
[0016] Figure 4 This is a schematic diagram of the structure of an information processing device provided in an embodiment of the present invention;
[0017] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] In existing technologies, there are two methods for setting the detection range of PNG images of various objects in a game interface. One method involves outputting a mask image that matches the size and shape of the object to determine its detection range. However, this method requires adding a mask image, increasing the overall resource consumption and memory usage of the game, potentially causing lag. The other method detects the pixel range of the object through pixel detection. This method can adjust parameters based on the object's appearance and size, but it involves significant computational overhead and may also cause lag.
[0020] Based on the above, the information processing method, apparatus and electronic device provided by the embodiments of the present invention can be applied to the interface design in games or other scenarios, for example, setting up an interactive area in obstacle avoidance games.
[0021] In one embodiment of this disclosure, the information processing method can run on a local terminal device or a server. When the information processing method runs 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.
[0022] In an optional implementation, various cloud applications, such as cloud gaming, can run under the cloud interaction system. Taking cloud gaming as an example, cloud gaming refers to a gaming method based on cloud computing. In the cloud gaming operating mode, the game program and the game screen presentation are separated. The storage and execution of information processing methods are completed on the cloud gaming server. The client device is used for data reception, transmission, and game screen presentation. For example, the client device can be a display device with data transmission capabilities located close to the user, such as a mobile terminal, television, computer, or PDA; however, the information processing is performed by the cloud gaming server in the cloud. When playing the game, the player operates the client device to send operation commands to the cloud gaming server. The cloud gaming server runs the game according to the operation commands, encodes and compresses the game screen and other data, returns it to the client device via the network, and finally, the client device decodes and outputs the game screen.
[0023] In an optional implementation, taking a game as an example, the local terminal device stores the game program and is used to display the game screen. The local terminal device is used to interact with the player through a graphical user interface (GUI), i.e., conventionally by downloading, installing, and running the game program via an electronic device. The local terminal device can provide the GUI to the player in various ways, such as rendering it on the terminal's display screen or providing it to the player via holographic projection. For example, the local terminal device can include a display screen for displaying the GUI, which includes game screens, and a processor for running the game, generating the GUI, and controlling the display of the GUI on the display screen.
[0024] In one possible implementation, embodiments of the present invention provide an information processing method that provides a graphical user interface (GUI) through a terminal device. The terminal device can be either a local terminal device as mentioned above, or a client device in a cloud interaction system as mentioned above. The GUI provided by the terminal device can display interface content according to the type of application being launched, such as game scene images, communication interaction windows, etc.
[0025] In this embodiment, a graphical user interface is provided through a terminal device; the graphical user interface includes a scene screen of the game scene; the scene screen can be a partial scene screen of the game scene or a complete scene screen, depending on the scaling ratio of the scene. When the scaling ratio of the scene is small, the graphical user interface can display the complete scene screen, and when the scaling ratio of the scene is large, the graphical user interface can display a partial scene screen.
[0026] To facilitate understanding of this embodiment, a detailed description of an information processing method disclosed in this embodiment of the invention will be provided first, such as... Figure 1 As shown, this information processing method provides a graphical user interface through a terminal device, wherein the terminal device can be either the aforementioned local terminal device or the aforementioned client device. The method includes the following steps:
[0027] Step S102: Obtain a graphic set of the target object; wherein, the graphic set includes multiple object graphics; the object graphics are a first preset shape; the object graphics include object content of the target object; the proportion of the graphic area occupied by the object content in the object graphics is greater than a preset proportion threshold; the multiple object graphics constitute a complete target object;
[0028] In 2D games or other interfaces, there can typically be various types of objects, such as virtual characters, virtual buildings, virtual buttons, etc. These objects are usually displayed in PNG image format within the game or other interface. Taking a 2D game interface as an example, in actual implementation, the number of each type of object can be multiple, and their shapes can also be implemented in various ways, such as circles, ovals, rhombuses, triangles, rectangles, etc.
[0029] The aforementioned acquisition of a set of graphics representing a target object, wherein the target object can be any object on the interface, and the set of graphics can include multiple object graphics, each of which is a first preset shape, such as a rectangle. Each object graphic in the set can include a portion of the target object's content and non-object content. The proportion of the graphic area occupied by the object content within the object graphic is greater than a preset ratio threshold. It can be understood that the larger the preset ratio threshold, the larger the graphic area occupied by the portion of the target object's content within the object graphic. In practical implementation, multiple object graphics containing portions of the target object's content from the set can be pieced together in a specific order to form a complete target object.
[0030] In this step, by setting the proportion of the graphic area occupied by the object content in the object graphic to be greater than a preset proportion threshold, multiple object graphics including part of the target object's object content are pieced together to form a complete target object, which greatly reduces the proportion of non-object content in the target object image.
[0031] In related technologies, the target object is in an object graphic. Since the object graphic is usually a regular shape, such as a rectangle, while the target object may be various irregular shapes, in order to display the target object completely in the object graphic, the object graphic will include a large number of non-target object areas, such as blank areas.
[0032] In this embodiment, the target object is divided, for example, into multiple rectangular object graphics. In this case, the object graphics can be scaled according to the size of the object content, and the non-object content area is clipped, so that the object content can include a smaller area of non-target object. Overall, compared with the method of one object graphic, the area of non-target object content included by multiple object graphics will be greatly reduced.
[0033] Step S104: Set multiple object graphics in the game scene to display the target object in the scene screen; wherein, the area occupied by the multiple object graphics in the game scene is the interactive area of the target object;
[0034] In 2D game scenes, there are usually object graphics containing various objects. Game tasks can be set for these objects based on their value and role in the game scenario, and the area where these objects occupy the scene can be designated as an interactive zone. When the player triggers this interactive zone, the corresponding game task can be executed.
[0035] In practice, multiple object graphics included in the target object graphic set can be placed in the game scene. Specifically, based on the partial object content of the target object included in the multiple object graphics, the multiple object graphics can be arranged closely in the game scene in a certain order to form a complete target object, which can then be displayed in the scene. Then, the area occupied by the multiple object graphics of the target object after being pieced together in the game scene serves as the interactive area of the target object.
[0036] In this embodiment, each object graphic of the target object may include a portion of the target object's content, and the area occupied by the object content in the object graphic is greater than a preset proportional threshold, which can reduce the area occupied by non-object content in the object graphic. In this step, the area occupied by multiple object graphics in the game scene is used as the interactive area of the target object, which greatly improves the accuracy of the interactive area.
[0037] Step S106: In response to the triggering of the interactive area, control the execution of the specified event corresponding to the target object.
[0038] The aforementioned interactive area can be triggered in several ways, such as by a collision occurring at the edge of the interactive area, or by setting a specific touch point within the interactive area for a designated touch operation. The specific event can be determined by factors such as the game type, game plot, and the type of the target object.
[0039] In practical implementation, the specific method for responding to the triggering of the interactive area and controlling the execution of a specified event corresponding to the target object can be determined based on the game type. For example, in obstacle avoidance games, when a virtual object collides with the edge of the interactive area of the target object, it indicates that the player has failed the challenge. At this time, controlling the execution of the specified event corresponding to the target object can be either indicating that the game task has failed or requiring a retry. Similarly, in exploration games, different exploration tasks, trading tasks, or dialogue tasks can be set for different types of objects on the game screen. When a virtual object touches the edge of the interactive area of the target object, the task corresponding to the target object can be executed. Alternatively, touch points can be set in the interactive area of each object. When the player performs a specified trigger operation at the touch point in the interactive area of the target object, such as clicking or long-pressing, the task corresponding to the target object can be executed.
[0040] The above information processing method obtains a graphic set of the target object; wherein the graphic set includes multiple object graphics; the object graphics are a first preset shape; the object graphics include object content of the target object; the proportion of the graphic area occupied by the object content in the object graphics is greater than a preset proportion threshold; the multiple object graphics form a complete target object; the multiple object graphics are set in a game scene to display the target object in the scene screen; wherein the area occupied by the multiple object graphics in the game scene is used as the interaction area of the target object; in response to the triggering of the interaction area, the specified event corresponding to the target object is controlled and executed.
[0041] In this method, the target object is divided into multiple object graphics of preset shapes, reducing the proportion of non-object content graphic areas, so that the object content occupies a higher proportion of the object graphics area, ensuring that the object interaction trigger has a high accuracy rate; this method does not increase the amount of game resources or runtime computing power, can accurately and efficiently define the interaction area, ensure smooth game operation, and improve the player's gaming experience.
[0042] In one specific implementation, an initial graphic containing the target object is obtained; wherein the initial graphic is a second preset shape; the initial graphic includes the target object and the non-object area surrounding the target object; the initial graphic is divided into multiple object graphics according to a preset segmentation rule, and the multiple object graphics are combined to form a graphic set of the target object; wherein the segmentation rule is used to: divide the initial graphic into object graphics of a first preset shape, and control the proportion of the graphic area occupied by the object content in the object graphics to be greater than a preset proportion threshold.
[0043] Typically, PNG image detection involves determining the image's length and width as boundaries. Therefore, PNG images in an interface are usually rectangular. Furthermore, the area occupied by the PNG image of the target object in the interface is usually the interactive area of that target object. When the target object is not rectangular, there will be non-object areas surrounding the PNG image of the target object. In this embodiment, an initial graphic containing the target object is first obtained, i.e., the PNG image corresponding to the target object in the interface. This initial graphic is a second preset shape, which can be a rectangle or a square. The initial graphic can include the target object and the non-object areas surrounding the target object.
[0044] Furthermore, according to a preset segmentation rule, the initial graphic can be divided into multiple object graphics. Each of these object graphics contains a portion of the object content, and the multiple object graphics can form a graphic set of the target object. It should be noted that the preset segmentation rule can be used to segment the initial graphic into object graphics of a first preset shape, and the proportion of the graphic area occupied by the object content in each object graphic is controlled to be greater than a preset proportion threshold. The larger this preset proportion threshold, the larger the graphic area occupied by the portion of the target object content included in the object graphic.
[0045] In this step, the initial graphic containing the target object is divided into multiple object graphics according to a preset segmentation rule. The proportion of the object content within each object graphic is ensured to be greater than a preset threshold. These multiple object graphics are then used as the graphic set for the target object. This step reduces the non-object content areas in the target object's PNG image without increasing the resources required to create interactive areas.
[0046] The following examples illustrate specific implementation methods for dividing an initial graphic into multiple object graphics.
[0047] The initial graphic is sequentially divided along its first dimension to obtain multiple object graphics. The size of the second dimension of each object graphic is determined based on the object content. The second dimension is perpendicular to the first dimension. The size of the first dimension of each object graphic is determined based on the proportion of the graphic area occupied by the object content within the object graphic.
[0048] In practice, the initial graphic is a two-dimensional image, which can be rectangular or square. One approach is to divide the initial graphic into two dimensions: a first dimension and a second dimension. Then, along the first dimension, the initial graphic is sequentially segmented to obtain multiple object graphics, each containing the object content of the target object. It should be noted that the first and second dimensions are perpendicular to each other; for example, the first dimension can be horizontal, and the second dimension can be vertical.
[0049] Furthermore, the size of the object graphic can be determined based on its first and second dimensions, which can be in pixels. The first dimension is determined by the proportion of the object content's area within the object graphic; that is, when setting the first dimension, the proportion of the object content's area within the object graphic must be greater than a preset threshold. The second dimension is determined by the object content; that is, the second dimension can be equal to the size of the object content in the second dimension.
[0050] The following examples further illustrate specific implementation methods for dividing the initial graphic into multiple object graphics.
[0051] In one approach, the initial graphic is segmented along its first dimension, starting from its first edge, to obtain an intermediate graphic. The size of the second dimension of this intermediate graphic is determined based on the object content. The size of the first dimension of the intermediate graphic is a preset size. If a non-object region exists within a preset length range along the second dimension of the intermediate graphic, the intermediate graphic is identified as an object graphic. If no non-object region exists within a preset length range along the second dimension of the intermediate graphic, the size of the first dimension of the intermediate graphic is increased until a non-object region exists within a preset length range along the second dimension, thus obtaining the object graphic. The remaining portion of the initial graphic is updated to the original graphic, and the process of segmenting the initial graphic along its first dimension, starting from its first edge, continues until the initial graphic is completely segmented.
[0052] Specifically, the first dimension can be a horizontal dimension or a vertical dimension; the first edge position can be the left edge, right edge, top edge, or bottom edge of the initial shape, etc. In actual implementation, the initial shape is segmented along its first dimension, starting from the first edge position, to obtain an intermediate shape. Specifically, this can be done by segmenting the initial shape along its horizontal dimension, starting from the left or right edge position; or by segmenting the initial shape along its vertical dimension, starting from the top or bottom edge position. This intermediate shape can include the object content of the target object and non-object areas.
[0053] It should be noted that the size of the second dimension of the middle graphic, that is, the size of the dimension perpendicular to the first dimension, can be determined based on the object content. For example, the size of the second dimension of the middle graphic can be equal to the size of the object content in the second dimension direction; the size of the first dimension of the middle graphic is a preset size. In an optional way, the preset size of the first dimension can be set to less than five pixels, such as 4 pixels.
[0054] In practical implementation, a preset length range can be set for the second dimension to determine the length of the second dimension occupied by the non-object area in the middle graphic. This preset length range can be set according to the type of terminal device. For example, for mobile devices, it can be set to: greater than 4 pixels; for PC (Personal Computer) devices, it can be set to: greater than 2 pixels. The following will take mobile devices as an example.
[0055] If, along the first dimension of the initial graphic, a preset size of 2 pixels is applied from the first edge of the initial graphic, and the resulting intermediate graphic contains a non-object region within a preset length range on the second dimension (i.e., the length of the non-object region on the second dimension is greater than 4 pixels), then the intermediate graphic can be identified as an object graphic. This preset length range ensures that the proportion of the graphic area occupied by the object content in the object graphic is greater than a preset threshold, and also ensures that the outline of the final target object formed by stitching the object graphics together is smoother.
[0056] If the initial graphic is segmented along its first dimension according to a preset size, starting from the first edge, and the resulting intermediate graphic does not contain any non-object regions within a preset length range in its second dimension (e.g., if the non-object region in the second dimension is less than 4 pixels), then the size of the first dimension of the intermediate graphic can be increased by adding an appropriate number of pixels to the preset size until the length of the non-object region in the second dimension is greater than 4 pixels. In this case, the intermediate graphic obtained by segmenting the initial graphic can be used as an object graphic.
[0057] Furthermore, the remaining parts of the initial graphic are updated to the initial graphic, and the above steps of dividing the initial graphic along the first dimension and according to the preset size of the first dimension from the first edge position of the initial graphic are continued until the initial graphic is completely divided to obtain multiple object graphics.
[0058] In another approach, the initial graphic is segmented along its first dimension, starting from its first edge, to obtain an intermediate graphic. The size of the second dimension of this intermediate graphic is determined based on the object content. The size of the first dimension of the intermediate graphic is a preset size. If the area occupied by the object content in the intermediate graphic is less than or equal to a preset area threshold, the intermediate graphic is identified as the object graphic. If the area occupied by the object content in the intermediate graphic is greater than the preset area threshold, the size of the first dimension of the intermediate graphic is increased until the area proportion is less than or equal to the preset area threshold. The remaining graphic of the initial graphic is updated to the original graphic, and the process of segmenting the initial graphic along its first dimension, starting from its first edge, continues until the initial graphic is completely segmented.
[0059] Specifically, the first dimension can be a horizontal dimension or a vertical dimension; the first edge position can be the left edge, right edge, top edge, or bottom edge of the initial shape, etc. In actual implementation, the initial shape is segmented along its first dimension, starting from the first edge position, to obtain an intermediate shape. Specifically, this can be done by segmenting the initial shape along its horizontal dimension, starting from the left or right edge position; or by segmenting the initial shape along its vertical dimension, starting from the top or bottom edge position. This intermediate shape can include the object content of the target object and non-object areas.
[0060] It should be noted that the size of the second dimension of the middle graphic, that is, the size of the dimension perpendicular to the first dimension, can be determined according to the object content. For example, the size of the second dimension of the middle graphic can be equal to the size of the object content in the second dimension direction; the size of the first dimension of the middle graphic is a preset size, which can be set to less than five pixels in one optional way.
[0061] It is understandable that the smaller the non-object area in the second dimension of the intermediate graphic, the larger the graphic area occupied by the object content in the intermediate graphic, that is, the larger the area ratio. In order to ensure that there is a non-object area within a preset range in the second dimension, in actual implementation, a preset area threshold can be set in advance. This preset area threshold can be used to ensure that there is object content in the intermediate graphic with a proportion that meets the preset ratio threshold, and there is also a part of non-object content area. This ensures that when multiple object graphics are pieced together, the complete target object content can be obtained, and the graphic of the target object is consistent with the target object content.
[0062] If the area occupied by the object content in the intermediate graphic is less than or equal to a preset area threshold, that is, if there is a non-object area within a preset length range on the second dimension of the intermediate graphic, and the area occupied by the object content in the intermediate graphic reaches a preset proportion threshold, then the intermediate graphic can be identified as an object graphic.
[0063] If the area occupied by the object content in the intermediate graphic is greater than the preset area threshold, that is, there is no non-object area within the preset length range in the second dimension of the intermediate graphic, then the size of the first dimension of the intermediate graphic can be increased, that is, an appropriate number of pixels can be added on the basis of the preset size, until the area ratio in the intermediate graphic is less than or equal to the preset area threshold, and the object graphic is obtained.
[0064] Furthermore, the remaining parts of the initial graphic are updated to the initial graphic, and the above steps of dividing the initial graphic along the first dimension and according to the preset size of the first dimension from the first edge position of the initial graphic are continued until the initial graphic is completely divided to obtain multiple object graphics.
[0065] In one specific implementation, the first preset shape is a rectangle; the first dimension is the length dimension of the rectangle; and the second dimension is the width dimension of the rectangle. That is, in actual implementation, the initial graphic is divided into multiple object graphics, wherein the shape of these multiple object graphics can be rectangular. The first and second dimensions of the initial graphic can be the length and width dimensions of the rectangle, respectively.
[0066] For easier understanding, please refer to Figure 2 Taking a rectangle as an example, the method for segmenting the initial graphic is introduced. The rectangle enclosed by the dotted lines in the diagram represents the initial graphic of the target object, and the circular area represents the complete target object. Using the length dimension of the rectangle as the first dimension and the width dimension as the second dimension, the initial graphic is segmented along the first dimension, starting from the first edge, according to the preset size of the first dimension, to obtain the intermediate graphic. The length of the intermediate graphic is the preset size of the first dimension, and the height of the intermediate graphic is the size of the second dimension. This second dimension can be determined based on the content of the target object. It should be noted that the preset size can be set between 1 and 5 pixels in actual implementation.
[0067] In related technologies, the initial graphic area is the interaction area of the target object. Because the non-target object area occupies a large proportion of the initial graphic, erroneous interactions are easily caused. However, in this embodiment, based on the initial graphic, the target object is divided into multiple object graphics for observation. Figure 2As can be seen, when the target object is a circle, multiple object graphics are small rectangular graphics arranged in sequence. The edges of the rectangular graphics are very close to the edges of the target object, eliminating a large number of non-object areas in the initial graphics, thus ensuring the accuracy of the object interaction area.
[0068] Figure 3 This application compares the use of an initial graphic as the interaction area in existing technologies with the interaction area set in this application. Taking a circular target object as an example, existing technologies use the initial graphic of the target object as the interaction area, as detailed in [reference needed]. Figure 3 The square formed by the dotted lines on the left side of the image, used as the interaction area, is much larger than the area occupied by the target object itself. (Observe...) Figure 3 As shown in the left-hand image, when multiple target objects are close together, their interaction areas can become occluded. This can easily lead to incorrect interaction decisions when a player clicks on the interaction area of a target object or when interacting with other objects.
[0069] In this application, the target object is divided into multiple object graphics, which are then stitched together to form the target object. The area occupied by these multiple object graphics in the scene is used as the interactive area, resulting in fewer non-object areas. (See reference...) Figure 3 The right-hand image shows this. Therefore, the interaction area of the target object overlaps significantly with the target object itself, improving the accuracy of the interaction area.
[0070] Specifically, after dividing the initial graphic into segments with a preset size in the first dimension, an intermediate graphic is obtained. Initially, the second dimension of the intermediate graphic is relatively small. At this point, the relationship between the area occupied by the object content (i.e., the overlapping area of the circle and the intermediate graphic) and a preset area threshold can be determined. If the area proportion is less than or equal to the preset area threshold, the intermediate graphic can be considered the object graphic. If the area proportion is greater than the preset area threshold, the preset size in the first dimension can be increased until the proportion of the graphic area occupied by the object content is less than or equal to the preset area threshold, at which point the intermediate graphic is considered the object graphic. Finally, the remaining portion of the initial graphic is updated to the initial graphic, and the above division steps are repeated.
[0071] In the subsequent segmentation process, as the size of the second dimension of the intermediate graphic increases, it can be determined whether there is a non-object region within a preset range in the second dimension of the intermediate graphic. This preset range, indicated by the arrow segment in the diagram, can be set to be greater than 4 pixels. If there is a non-object region greater than 4 pixels in the second dimension of the intermediate graphic, then the intermediate graphic can be used as the object graphic. If not, for example, if the length of the non-object region is 3 pixels, then the preset size of the first dimension can be increased to ensure that there is a non-object region greater than 4 pixels in the second dimension. In this case, the initial graphic is segmented, and the resulting intermediate graphic can be used as the object graphic. Finally, the remaining graphic of the initial graphic is updated to the initial graphic, and the above segmentation steps are continued.
[0072] This method segments the initial graphic of the target object into multiple object graphics, which are then stitched together to form the complete target object. This ensures that the image of the target object matches the content of the target object, solving the problem that when the target object is not a rectangle or square, there are non-object areas at the edges of the target object's image, which can occlude images of other objects and affect the player's gaming experience.
[0073] The following embodiment provides a specific implementation method for determining the first dimension of an initial graphic.
[0074] Based on the object shape of the target object, the first dimension of the initial graphic is determined; wherein, the first dimension indicates the cutting direction of the initial graphic.
[0075] In this embodiment, to make the detection range of PNG images more accurate—that is, to ensure that the shape of the PNG image of the target object matches the shape of the object content—in practice, the first dimension of the initial graphic can be determined based on the object shape of the target object. This first dimension indicates the cutting direction of the initial graphic. Thus, when the initial graphic is cut along the first dimension, the resulting graphic of the target object, obtained by stitching together multiple object graphics, most closely resembles the object content of the target object. This resulting graphic can be used as the final PNG image of the target object, improving the accuracy of the PNG image detection range. For example, if the object shape of the target object is elliptical, and the initial graphic of the target object is rectangular, the major axis of the ellipse can be used as the first dimension of the initial graphic. The initial graphic can then be cut along the direction of the major axis of the ellipse to obtain multiple object graphics.
[0076] The following examples further illustrate specific implementation methods for determining the first dimension of the initial graphic.
[0077] In one approach, multiple initial dimensions of the initial graphic are determined; for each initial dimension, the initial graphic is sequentially segmented along the initial dimension to obtain multiple object graphics corresponding to the initial dimension; the area of the non-object region in the multiple object graphics corresponding to each initial dimension is determined, and the initial dimension corresponding to the smallest area is determined as the first dimension; the multiple object graphics corresponding to the first dimension are determined as the final multiple object graphics.
[0078] In one alternative approach, after obtaining an initial graphic including the target object, multiple initial dimensions of the initial graphic can be determined based on the shape of the target object and the shape of the initial graphic. These initial dimensions may include horizontal dimensions, vertical dimensions, etc. Further, the initial graphic is systematically divided along each initial dimension to obtain multiple object graphics corresponding to each initial dimension. Each object graphic may include object content areas and non-object areas. Then, the area of the non-object areas in each of the multiple object graphics corresponding to each initial dimension is determined. This area can be the sum of the areas of the non-object areas in each object graphic corresponding to the initial dimension. The initial dimension corresponding to the smallest area is determined as the first dimension, and the multiple object graphics corresponding to the first dimension are determined as the final multiple object graphics, i.e., the multiple object graphics of the target object.
[0079] By using this step to determine the first dimension of the initial image, it can be ensured that the non-object area is minimized among the multiple object images obtained by sequentially segmenting the initial image, thereby improving the accuracy of the detection range of the target object's PNG image.
[0080] In another approach, if the target object has symmetry properties, the initial graphic is divided along the axis of symmetry of the target object to obtain half of the initial graphic; the half graphic is then divided sequentially to obtain multiple divided graphics; these multiple divided graphics are copied and flipped to obtain multiple flipped graphics; the multiple divided graphics and the multiple flipped graphics are then identified as multiple object graphics.
[0081] In another alternative approach, if the target object possesses symmetry—that is, its shape is symmetrical—the initial shape can be divided along its axis of symmetry to obtain half of the initial shape. Then, this half is sequentially divided to obtain multiple segmented shapes. When segmenting the half of the initial shape, the first dimension of the half can be determined as described above, and the half can be divided along this first dimension to obtain multiple segmented shapes. Further, these segmented shapes are copied and flipped to obtain multiple flipped shapes, which are symmetrical to the segmented shapes. Finally, the multiple segmented shapes and multiple flipped shapes are determined as multiple object shapes of the target object. This step improves the efficiency of segmenting the initial shape.
[0082] The following embodiments provide another specific implementation of segmenting the initial graphic.
[0083] The initial graphic is divided into a first graphic region and a second graphic region; wherein the first graphic region is triggered more frequently than the second graphic region is triggered; the first graphic region is divided into multiple first region graphics, and the second graphic region is divided into multiple second region graphics; the graphic area of the first region graphics is smaller than the graphic area of the second region graphics; the multiple first region graphics and the multiple second region graphics are determined as multiple object graphics.
[0084] In actual implementation, the probability of different regions of the target object being triggered may vary. Therefore, the initial graphic can be further divided into a first graphic region and a second graphic region, where the probability of the first graphic region being triggered is greater than that of the second graphic region. Further, the first graphic region can be systematically divided into multiple first-region graphics along a first dimension, and the second graphic region can also be systematically divided into multiple second-region graphics along the first dimension. It is important to note that when dividing the first graphic region, which has a higher probability of being triggered, the size of the division should be smaller than that of the second graphic region, which has a lower probability of being triggered, to ensure that the area of the first graphic region is smaller than the area of the second graphic region. Then, the multiple first-region graphics and multiple second-region graphics are defined as multiple object graphics.
[0085] In this step, the initial graphic is divided into two regions based on the frequency of triggering. The region with a high frequency of triggering is divided into smaller regions, while the region with a low frequency of triggering is divided into larger regions. This not only accurately defines the interactive area but also reduces the amount of work required in the early stages of production.
[0086] Furthermore, in response to a collision occurring at the edge of the aforementioned interactive area, the specified event corresponding to the target object is executed; or, in response to the touch point of the specified touch operation being located within the interactive area, the specified event corresponding to the target object is executed.
[0087] Specifically, the designated events mentioned above can be set according to factors such as game type and plot. For example, in obstacle avoidance games, the designated events could be failing the challenge or restarting the challenge; in exploration games, the designated events could be entering the interactive area to perform exploration tasks. When a collision occurs at the edge of the interactive area—for example, when a virtual character in the interface collides with the interactive area of a target object—the designated event corresponding to that target object can be executed. For instance, in obstacle avoidance games, when the virtual character collides with the interactive area, the virtual character fails the challenge. In exploration games, when the virtual character collides with the interactive area of a target object, it can enter that area to perform exploration tasks, and so on.
[0088] Alternatively, in response to a touch point being located within an interactive area, a specified event corresponding to the target object can be executed. Specifically, the specified touch operation can include actions such as tapping, long-pressing, and swiping. For example, in exploration games, when the touch point is located within an interactive area, the player can enter that interactive area and perform exploration tasks by tapping the touch point.
[0089] For the above method embodiments, see Figure 4 The diagram shows a structural schematic of an information processing device that provides a graphical user interface (GUI) via a terminal device; the GUI includes a scene view of a game scene; the device includes:
[0090] The acquisition module 42 is used to acquire a graphic set of the target object; wherein, the graphic set includes multiple object graphics; the object graphics are a first preset shape; the object graphics include object content of the target object; the proportion of the graphic area occupied by the object content in the object graphics is greater than a preset proportion threshold; the multiple object graphics constitute a complete target object;
[0091] Setting module 44 is used to set multiple object graphics in the game scene so as to display the target object in the scene screen; wherein, the area occupied by the multiple object graphics in the game scene is the interactive area of the target object;
[0092] The execution module 46 is used to control the execution of a specified event corresponding to the target object in response to the triggering of the interactive area.
[0093] The aforementioned information processing device acquires a set of graphics representing a target object; wherein the set of graphics includes multiple object graphics; each object graphic has a first preset shape; each object graphic includes object content representing a portion of the target object; the proportion of the graphic area occupied by the object content within the object graphic is greater than a preset proportion threshold; the multiple object graphics constitute a complete target object; the multiple object graphics are set in a game scene to display the target object on the scene screen; wherein the area occupied by the multiple object graphics in the game scene serves as the interaction area of the target object; in response to the triggering of this interaction area, a specified event corresponding to the target object is controlled and executed. In this method, dividing the target object into multiple object graphics of preset shapes reduces the proportion of non-object content graphic areas, ensuring a higher proportion of object content within the object graphics, thus guaranteeing a high accuracy rate for object interaction triggering; this method does not require increasing the game's resource consumption or runtime computation, can accurately and efficiently define the interaction area, ensures smooth game operation, and improves the player's gaming experience.
[0094] The aforementioned device further includes: a segmentation module, configured to: acquire an initial graphic containing a target object; wherein the initial graphic is a second preset shape; the initial graphic includes the target object and a non-object area surrounding the target object; segment the initial graphic into multiple object graphics according to a preset segmentation rule, and combine the segmented multiple object graphics into a graphic set of the target object; wherein the segmentation rule is configured to: segment the initial graphic into object graphics of a first preset shape, and control the proportion of the graphic area occupied by the object content in the object graphics to be greater than a preset proportion threshold.
[0095] The aforementioned segmentation module is also used to: sequentially segment the initial graphic along its first dimension to obtain multiple object graphics; wherein the size of the second dimension of the object graphics is determined based on the object content; the second dimension is perpendicular to the first dimension; and the size of the first dimension of the object graphics is determined based on the proportion of the graphic area occupied by the object content in the object graphics.
[0096] The aforementioned segmentation module is further configured to: segment the initial graphic along its first dimension, starting from the first edge position of the initial graphic, to obtain an intermediate graphic; wherein the size of the second dimension of the intermediate graphic is determined based on the object content; the size of the first dimension of the intermediate graphic is a preset size; if there is a non-object region within a preset length range on the second dimension of the intermediate graphic, the intermediate graphic is determined as an object graphic; if there is no non-object region within a preset length range on the second dimension of the intermediate graphic, the size of the first dimension of the intermediate graphic is increased until there is a non-object region within a preset length range on the second dimension, thus obtaining an object graphic; update the remaining graphic of the initial graphic to the initial graphic, and continue to execute the step of segmenting the initial graphic along its first dimension, starting from the first edge position of the initial graphic, until the initial graphic is completely segmented.
[0097] The first preset shape is a rectangle; the first dimension is the length dimension of the rectangle; and the second dimension is the width dimension of the rectangle.
[0098] The aforementioned segmentation module is also used to: segment the initial graphic along its first dimension, starting from the first edge of the initial graphic, to obtain an intermediate graphic; wherein the size of the second dimension of the intermediate graphic is determined based on the object content; the size of the first dimension of the intermediate graphic is a preset size; if the area of the graphic region occupied by the object content in the intermediate graphic is less than or equal to a preset area threshold, the intermediate graphic is determined as an object graphic; if the area of the graphic region occupied by the object content in the intermediate graphic is greater than the preset area threshold, the size of the first dimension of the intermediate graphic is increased until the area ratio is less than or equal to the preset area threshold; the remaining graphic of the initial graphic is updated to the initial graphic, and the step of segmenting the initial graphic along its first dimension, starting from the first edge of the initial graphic, continues until the initial graphic is completely segmented.
[0099] The aforementioned apparatus further includes: a determining module, configured to: determine a first dimension of the initial graphic based on the object shape of the target object; wherein the first dimension indicates the cutting direction of the initial graphic.
[0100] The aforementioned segmentation module is also used to: determine multiple initial dimensions of the initial graphic; for each initial dimension, sequentially segment the initial graphic along the initial dimension to obtain multiple object graphics corresponding to the initial dimension; determine the area of the non-object region in the multiple object graphics corresponding to each initial dimension, and determine the initial dimension corresponding to the smallest area as the first dimension; and determine the multiple object graphics corresponding to the first dimension as the final multiple object graphics.
[0101] The above-mentioned segmentation module is also used for: if the target object has symmetry properties, segmenting the initial graphic along the axis of symmetry of the target object to obtain half of the initial graphic; sequentially segmenting the half graphic to obtain multiple segmented graphics; copying and flipping the multiple segmented graphics to obtain multiple flipped graphics; and determining the multiple segmented graphics and the multiple flipped graphics as multiple object graphics.
[0102] The aforementioned segmentation module is further configured to: divide the initial graphic into a first graphic region and a second graphic region; wherein the first graphic region is triggered more frequently than the second graphic region is triggered; segment the first graphic region into multiple first region graphics, and segment the second graphic region into multiple second region graphics; the graphic area of the first region graphics is smaller than the graphic area of the second region graphics; and determine the multiple first region graphics and the multiple second region graphics as multiple object graphics.
[0103] The aforementioned execution module is also used to: control the execution of a specified event corresponding to the target object in response to a collision occurring at the edge of the interactive area; or, control the execution of a specified event corresponding to the target object in response to a touch point location of a specified touch operation being within the interactive area.
[0104] This embodiment also provides an electronic device, including 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-described information processing method. This electronic device can be a server or a terminal device.
[0105] See Figure 5 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-described information processing method.
[0106] Furthermore, Figure 5 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.
[0107] The memory 101 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0108] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. Processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may 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 gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0109] The processor in the aforementioned electronic device, by executing machine-executable instructions, can perform the following operations in the aforementioned information processing method:
[0110] Obtain a set of graphics representing the target object; wherein the set of graphics includes multiple object graphics; each object graphic is a first preset shape; each object graphic includes object content representing a portion of the target object; the proportion of the graphic area occupied by the object content in the object graphic is greater than a preset proportion threshold; the multiple object graphics constitute a complete target object; set the multiple object graphics in the game scene to display the target object in the scene screen; wherein the area occupied by the multiple object graphics in the game scene serves as the interactive area of the target object; in response to the triggering of this interactive area, control the execution of a specified event corresponding to the target object.
[0111] In this method, the target object is divided into multiple object graphics of preset shapes, reducing the proportion of non-object content graphic areas, so that the object content occupies a higher proportion of the object graphics area, ensuring that the object interaction trigger has a high accuracy rate; this method does not increase the amount of game resources or runtime computing power, can accurately and efficiently define the interaction area, ensure smooth game operation, and improve the player's gaming experience.
[0112] Obtain an initial graphic containing the target object; wherein the initial graphic is a second preset shape; the initial graphic includes the target object and the non-object area surrounding the target object; according to a preset segmentation rule, the initial graphic is segmented into multiple object graphics, and the segmented multiple object graphics are combined into a graphic set of the target object; wherein the segmentation rule is used to: segment the initial graphic into object graphics of a first preset shape, and control the proportion of the graphic area occupied by the object content in the object graphics to be greater than a preset proportion threshold.
[0113] In this step, the initial graphic containing the target object is divided into multiple object graphics according to a preset segmentation rule. The proportion of the object content within each object graphic is ensured to be greater than a preset threshold. These multiple object graphics are then used as the graphic set for the target object. This step reduces the non-object content areas in the target object's PNG image without increasing the resources required to create interactive areas.
[0114] The initial graphic is sequentially divided along its first dimension to obtain multiple object graphics. The size of the second dimension of each object graphic is determined based on the object content. The second dimension is perpendicular to the first dimension. The size of the first dimension of each object graphic is determined based on the proportion of the graphic area occupied by the object content within the object graphic.
[0115] Along the first dimension of the initial graphic, starting from the first edge position, the initial graphic is segmented to obtain an intermediate graphic; wherein, the size of the second dimension of the intermediate graphic is determined based on the object content; the size of the first dimension of the intermediate graphic is a preset size; if there is a non-object region within a preset length range in the second dimension of the intermediate graphic, the intermediate graphic is determined as an object graphic; if there is no non-object region within a preset length range in the second dimension of the intermediate graphic, the size of the first dimension of the intermediate graphic is increased until there is a non-object region within a preset length range in the second dimension, thus obtaining an object graphic; the remaining graphic of the initial graphic is updated to the initial graphic, and the step of segmenting the initial graphic along the first dimension starting from the first edge position of the initial graphic continues until the initial graphic is completely segmented.
[0116] The first preset shape is a rectangle; the first dimension is the length dimension of the rectangle; and the second dimension is the width dimension of the rectangle.
[0117] Along the first dimension of the initial graphic, starting from the first edge position, the initial graphic is segmented to obtain an intermediate graphic; wherein, the size of the second dimension of the intermediate graphic is determined based on the object content; the size of the first dimension of the intermediate graphic is a preset size; if the area of the graphic region occupied by the object content in the intermediate graphic is less than or equal to a preset area threshold, the intermediate graphic is determined as the object graphic; if the area of the graphic region occupied by the object content in the intermediate graphic is greater than the preset area threshold, the size of the first dimension of the intermediate graphic is increased until the area proportion is less than or equal to the preset area threshold; the remaining graphic of the initial graphic is updated as the initial graphic, and the step of segmenting the initial graphic along the first dimension starting from the first edge position of the initial graphic continues until the initial graphic is completely segmented.
[0118] This method segments the initial graphic of the target object into multiple object graphics, which are then stitched together to form the complete target object. This ensures that the image of the target object matches the content of the target object, solving the problem that when the target object is not a rectangle or square, there are non-object areas at the edges of the target object's image, which can occlude images of other objects and affect the player's gaming experience.
[0119] Based on the object shape of the target object, the first dimension of the initial graphic is determined; wherein, the first dimension indicates the cutting direction of the initial graphic.
[0120] Determine multiple initial dimensions of the initial graphic; for each initial dimension, sequentially divide the initial graphic along the initial dimension to obtain multiple object graphics corresponding to the initial dimension; determine the area of the non-object region in the multiple object graphics corresponding to each initial dimension, and determine the initial dimension corresponding to the smallest area as the first dimension; determine the multiple object graphics corresponding to the first dimension as the final multiple object graphics.
[0121] By using this step to determine the first dimension of the initial image, it can be ensured that the non-object area is minimized among the multiple object images obtained by sequentially segmenting the initial image, thereby improving the accuracy of the detection range of the target object's PNG image.
[0122] If the target object has symmetry properties, the initial graphic is divided along the axis of symmetry of the target object to obtain half of the initial graphic; the half graphic is then divided sequentially to obtain multiple divided graphics; these multiple divided graphics are copied and flipped to obtain multiple flipped graphics; the multiple divided graphics and the multiple flipped graphics are then identified as multiple object graphics.
[0123] This step can improve the efficiency of segmenting the initial graphic.
[0124] The initial graphic is divided into a first graphic region and a second graphic region; wherein the first graphic region is triggered more frequently than the second graphic region is triggered; the first graphic region is divided into multiple first region graphics, and the second graphic region is divided into multiple second region graphics; the graphic area of the first region graphics is smaller than the graphic area of the second region graphics; the multiple first region graphics and the multiple second region graphics are determined as multiple object graphics.
[0125] In this step, the initial graphic is divided into two regions based on the frequency of triggering. The region with a high triggering frequency is divided into smaller regions, while the region with a low triggering frequency is divided into larger regions. This not only accurately defines the interactive area but also reduces the resources required for initial production.
[0126] In response to a collision occurring at the edge of the aforementioned interactive area, the specified event corresponding to the target object is executed; or, in response to the touch point of a specified touch operation being located within the interactive area, the specified event corresponding to the target object is executed.
[0127] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the above-described information processing method.
[0128] The machine-executable instructions stored in the aforementioned machine-readable storage medium can be executed to perform the following operations in the aforementioned information processing method:
[0129] Obtain a set of graphics representing the target object; wherein the set of graphics includes multiple object graphics; each object graphic is a first preset shape; each object graphic includes object content representing a portion of the target object; the proportion of the graphic area occupied by the object content in the object graphic is greater than a preset proportion threshold; the multiple object graphics constitute a complete target object; set the multiple object graphics in the game scene to display the target object in the scene screen; wherein the area occupied by the multiple object graphics in the game scene serves as the interactive area of the target object; in response to the triggering of this interactive area, control the execution of a specified event corresponding to the target object.
[0130] In this method, the target object is divided into multiple object graphics of preset shapes, reducing the proportion of non-object content graphic areas, so that the object content occupies a higher proportion of the object graphics area, ensuring that the object interaction trigger has a high accuracy rate; this method does not increase the amount of game resources or runtime computing power, can accurately and efficiently define the interaction area, ensure smooth game operation, and improve the player's gaming experience.
[0131] Obtain an initial graphic containing the target object; wherein the initial graphic is a second preset shape; the initial graphic includes the target object and the non-object area surrounding the target object; according to a preset segmentation rule, the initial graphic is segmented into multiple object graphics, and the segmented multiple object graphics are combined into a graphic set of the target object; wherein the segmentation rule is used to: segment the initial graphic into object graphics of a first preset shape, and control the proportion of the graphic area occupied by the object content in the object graphics to be greater than a preset proportion threshold.
[0132] In this step, the initial graphic containing the target object is divided into multiple object graphics according to a preset segmentation rule. The proportion of the object content within each object graphic is ensured to be greater than a preset threshold. These multiple object graphics are then used as the graphic set for the target object. This step reduces the non-object content areas in the target object's PNG image without increasing the resources required to create interactive areas.
[0133] The initial graphic is sequentially divided along its first dimension to obtain multiple object graphics. The size of the second dimension of each object graphic is determined based on the object content. The second dimension is perpendicular to the first dimension. The size of the first dimension of each object graphic is determined based on the proportion of the graphic area occupied by the object content within the object graphic.
[0134] Along the first dimension of the initial graphic, starting from the first edge position, the initial graphic is segmented to obtain an intermediate graphic; wherein, the size of the second dimension of the intermediate graphic is determined based on the object content; the size of the first dimension of the intermediate graphic is a preset size; if there is a non-object region within a preset length range in the second dimension of the intermediate graphic, the intermediate graphic is determined as an object graphic; if there is no non-object region within a preset length range in the second dimension of the intermediate graphic, the size of the first dimension of the intermediate graphic is increased until there is a non-object region within a preset length range in the second dimension, thus obtaining an object graphic; the remaining graphic of the initial graphic is updated to the initial graphic, and the step of segmenting the initial graphic along the first dimension starting from the first edge position of the initial graphic continues until the initial graphic is completely segmented.
[0135] The first preset shape is a rectangle; the first dimension is the length dimension of the rectangle; and the second dimension is the width dimension of the rectangle.
[0136] Along the first dimension of the initial graphic, starting from the first edge position, the initial graphic is segmented to obtain an intermediate graphic; wherein, the size of the second dimension of the intermediate graphic is determined based on the object content; the size of the first dimension of the intermediate graphic is a preset size; if the area of the graphic region occupied by the object content in the intermediate graphic is less than or equal to a preset area threshold, the intermediate graphic is determined as the object graphic; if the area of the graphic region occupied by the object content in the intermediate graphic is greater than the preset area threshold, the size of the first dimension of the intermediate graphic is increased until the area proportion is less than or equal to the preset area threshold; the remaining graphic of the initial graphic is updated as the initial graphic, and the step of segmenting the initial graphic along the first dimension starting from the first edge position of the initial graphic continues until the initial graphic is completely segmented.
[0137] This method segments the initial graphic of the target object into multiple object graphics, which are then stitched together to form the complete target object. This ensures that the image of the target object matches the content of the target object, solving the problem that when the target object is not a rectangle or square, there are non-object areas at the edges of the target object's image, which can occlude images of other objects and affect the player's gaming experience.
[0138] Based on the object shape of the target object, the first dimension of the initial graphic is determined; wherein, the first dimension indicates the cutting direction of the initial graphic.
[0139] Determine multiple initial dimensions of the initial graphic; for each initial dimension, sequentially divide the initial graphic along the initial dimension to obtain multiple object graphics corresponding to the initial dimension; determine the area of the non-object region in the multiple object graphics corresponding to each initial dimension, and determine the initial dimension corresponding to the smallest area as the first dimension; determine the multiple object graphics corresponding to the first dimension as the final multiple object graphics.
[0140] By using this step to determine the first dimension of the initial image, it can be ensured that the non-object area is minimized among the multiple object images obtained by sequentially segmenting the initial image, thereby improving the accuracy of the detection range of the target object's PNG image.
[0141] If the target object has symmetry properties, the initial graphic is divided along the axis of symmetry of the target object to obtain half of the initial graphic; the half graphic is then divided sequentially to obtain multiple divided graphics; these multiple divided graphics are copied and flipped to obtain multiple flipped graphics; the multiple divided graphics and the multiple flipped graphics are then identified as multiple object graphics.
[0142] This step can improve the efficiency of segmenting the initial graphic.
[0143] The initial graphic is divided into a first graphic region and a second graphic region; wherein the first graphic region is triggered more frequently than the second graphic region is triggered; the first graphic region is divided into multiple first region graphics, and the second graphic region is divided into multiple second region graphics; the graphic area of the first region graphics is smaller than the graphic area of the second region graphics; the multiple first region graphics and the multiple second region graphics are determined as multiple object graphics.
[0144] In this step, the initial graphic is divided into two regions based on the frequency of triggering. The region with a high triggering frequency is divided into smaller regions, while the region with a low triggering frequency is divided into larger regions. This not only accurately defines the interactive area but also reduces the resources required for initial production.
[0145] In response to a collision occurring at the edge of the aforementioned interactive area, the specified event corresponding to the target object is executed; or, in response to the touch point of a specified touch operation being located within the interactive area, the specified event corresponding to the target object is executed.
[0146] The computer program products of the information processing methods, apparatuses, and electronic devices provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementations, please refer to the method embodiments, which will not be repeated here.
[0147] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0148] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.
[0149] If the aforementioned functions are implemented as 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 this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0150] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0151] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An information processing method, characterized in that, A graphical user interface is provided through the terminal device; The graphical user interface includes scene images of the game scene; the method includes: Obtain a graphic set of the target object; wherein, the graphic set includes multiple object graphics; the object graphics are a first preset shape; the object graphics include object content of the target object; the proportion of the graphic area occupied by the object content in the object graphics is greater than a preset proportion threshold; the multiple object graphics constitute the complete target object; The multiple object graphics are set in the game scene to display the target object in the scene screen; wherein, the area occupied by the multiple object graphics in the game scene serves as the interactive area of the target object; In response to the triggering of the interactive area, control the execution of the specified event corresponding to the target object; Before the step of obtaining the graphic collection of the target object, the method further includes: Obtain an initial graphic containing the target object; wherein the initial graphic is a second preset shape; the initial graphic includes the target object and the non-object area surrounding the target object; According to the preset segmentation rules, the initial graphic is segmented into the multiple object graphics, and the segmented multiple object graphics are combined into a graphic set of the target object; The segmentation rule is used to: segment the initial graphic into object graphics of the first preset shape, and control the proportion of the graphic area occupied by the object content in the object graphic to be greater than a preset proportion threshold.
2. The method according to claim 1, characterized in that, The step of dividing the initial graphic into the multiple object graphics according to the preset division rules includes: The initial graphic is sequentially segmented along its first dimension to obtain the multiple object graphics; Wherein, the size of the second dimension of the object graphic is determined based on the object content; the second dimension is perpendicular to the first dimension; the size of the first dimension of the object graphic is determined based on the proportion of the graphic area occupied by the object content in the object graphic.
3. The method according to claim 2, characterized in that, The step of sequentially segmenting the initial graphic along its first dimension to obtain the multiple object graphics includes: Along the first dimension of the initial graphic, starting from the first edge position, the initial graphic is segmented to obtain an intermediate graphic; wherein, the size of the second dimension of the intermediate graphic is determined based on the object content; the size of the first dimension of the intermediate graphic is a preset size; If there is a non-object region within a preset length range on the second dimension of the intermediate graphic, the intermediate graphic is determined to be an object graphic; If there is no non-object region within a preset length range in the second dimension of the intermediate graphic, increase the size of the first dimension of the intermediate graphic until there is a non-object region within a preset length range in the second dimension, thus obtaining the object graphic; The remaining parts of the initial graphic are updated to the initial graphic, and the process of segmenting the initial graphic along its first dimension, starting from the first edge position, continues until the initial graphic is completely segmented.
4. The method according to claim 2, characterized in that, The first preset shape is a rectangle; the first dimension is the length dimension of the rectangle; and the second dimension is the width dimension of the rectangle.
5. The method according to claim 2, characterized in that, The step of sequentially segmenting the initial graphic along its first dimension to obtain the multiple object graphics includes: Along the first dimension of the initial graphic, starting from the first edge position, the initial graphic is segmented to obtain an intermediate graphic; wherein, the size of the second dimension of the intermediate graphic is determined based on the object content; the size of the first dimension of the intermediate graphic is a preset size; If the area of the graphic region occupied by the object content in the intermediate graphic is less than or equal to a preset area threshold, the intermediate graphic is determined to be an object graphic. If the area of the object content in the intermediate graphic is greater than a preset area threshold, the size of the first dimension of the intermediate graphic is increased until the area ratio is less than or equal to the preset area threshold. The remaining parts of the initial graphic are updated to the initial graphic, and the process of segmenting the initial graphic along its first dimension, starting from the first edge position, continues until the initial graphic is completely segmented.
6. The method according to claim 2, characterized in that, Before the step of sequentially segmenting the initial graphic along its first dimension to obtain the multiple object graphics, the method further includes: Based on the object shape of the target object, a first dimension of the initial graphic is determined; wherein the first dimension indicates the cutting direction of the initial graphic.
7. The method according to claim 2, characterized in that, The step of sequentially segmenting the initial graphic along its first dimension to obtain the multiple object graphics includes: Determine multiple initial dimensions of the initial shape; For each initial dimension, the initial graphic is sequentially segmented along the initial dimension to obtain multiple object graphics corresponding to the initial dimension; Determine the area of the non-object region in the multiple object graphics corresponding to each initial dimension, and determine the initial dimension corresponding to the smallest area as the first dimension. The multiple object graphics corresponding to the first dimension are determined as the final multiple object graphics.
8. The method according to claim 1, characterized in that, The step of dividing the initial graphic into the multiple object graphics according to the preset division rules includes: If the target object has symmetry properties, the initial graphic is divided along the axis of symmetry of the target object to obtain half of the initial graphic; The half of the graphic is sequentially divided to obtain multiple divided graphics. The multiple divided graphics are copied and flipped to obtain multiple flipped graphics. The multiple segmented graphics and the multiple flipped graphics are identified as the multiple object graphics.
9. The method according to claim 1, characterized in that, The step of dividing the initial graphic into the multiple object graphics according to the preset division rules includes: The initial graphic is divided into a first graphic region and a second graphic region; wherein the first graphic region is triggered more frequently than the second graphic region. The first graphic region is divided into multiple first region graphics, and the second graphic region is divided into multiple second region graphics; the graphic area of the first region graphics is smaller than the graphic area of the second region graphics; The plurality of first region graphics and the plurality of second region graphics are identified as the plurality of object graphics.
10. The method according to claim 1, characterized in that, The steps for controlling the execution of a specified event corresponding to the target object in response to the triggering of the interactive area include: In response to a collision occurring at the edge of the interactive area, the specified event corresponding to the target object is executed. Alternatively, in response to a touch point location being within the interaction area for a specified touch operation, the specified event corresponding to the target object is executed.
11. An information processing device, characterized in that, A graphical user interface is provided through the terminal device; The graphical user interface includes scene images of the game scene; the device includes: An acquisition module is used to acquire a graphic set of a target object; wherein, the graphic set includes multiple object graphics; the object graphics are a first preset shape; the object graphics include object content of the target object; the proportion of the graphic area occupied by the object content in the object graphics is greater than a preset proportion threshold; the multiple object graphics constitute the complete target object; The setting module is used to set the multiple object graphics in the game scene so as to display the target object in the scene screen; wherein, the area occupied by the multiple object graphics in the game scene is the interactive area of the target object; The execution module is used to control the execution of a specified event corresponding to the target object in response to the triggering of the interactive area; A segmentation module is used to obtain an initial graphic containing the target object; wherein the initial graphic is a second preset shape; the initial graphic includes the target object and the non-object region surrounding the target object; According to the preset segmentation rules, the initial graphic is segmented into the multiple object graphics, and the segmented multiple object graphics are combined into a graphic set of the target object; The segmentation rule is used to: segment the initial graphic into object graphics of the first preset shape, and control the proportion of the graphic area occupied by the object content in the object graphic to be greater than a preset proportion threshold.
12. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the information processing method according to any one of claims 1-10.
13. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the information processing method according to any one of claims 1-10.