Display control method of game, electronic device and readable storage medium
Patent Information
- Application Number
- CN202410030340.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-15
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2041-04-15
AI Technical Summary
[0006]本申请的目的在于,针对上述现有技术中的不足,提供一种游戏的显示控制方法、电子设备及可读存储介质,以解决现有技术中移动对象绘制无法适用于地图灵活缩放场景的问题
[0082]本申请所提供的游戏的显示控制方法、电子设备及可读存储介质,响应于地图从第一比例尺切换至第二比例尺,系统可以根据地图中各移动对象的行进轨迹,在地图上绘制显示各移动对象所组成的移动对象集合的行进趋势图形,从而实现在不同比例尺的地图下灵活显示与地图比例尺相匹配的行进信息,因此可以较好地适用于地图缩放的场景。
Smart Images

Figure CN117815658B_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application filed on April 15, 2021, with parent application number 202110407745X and title "Game Display Control Method, Apparatus, Electronic Device and Readable Storage Medium". Technical Field
[0002] This application relates to the field of game technology, and more specifically, to a game display control method, electronic device, and readable storage medium. Background Technology
[0003] With the continuous development of internet technology, the application of real-time map display is becoming increasingly widespread. For example, in certain application scenarios, the icons and movement trajectories of moving objects (such as airplanes, ships, and vehicles) can be displayed on a map in real time, and the map and the position of the moving objects are updated in real time as the moving objects move. In this application scenario, how to display moving objects and their movement trajectories is a problem that needs to be solved.
[0004] In existing technologies, moving objects and their trajectories can be displayed. For example, focusing on a single moving object, each object's icon and its trajectory can be displayed separately.
[0005] However, the existing trajectory display methods cannot reflect the overall movement trend of multiple moving objects, and the single, fixed display method is not suitable for scenarios where maps can be flexibly scaled. Summary of the Invention
[0006] The purpose of this application is to address the shortcomings of the prior art by providing a game display control method, electronic device, and readable storage medium, so as to solve the problem that the rendering of moving objects in the prior art cannot be applied to scenarios with flexible map scaling.
[0007] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0008] Firstly, the application provides a method for controlling the display of a game, including:
[0009] Display the trajectory of at least one moving object on the map at a first scale.
[0010] In response to switching from a first scale to a second scale, a trend graph of the movement of the at least one moving object as a set of moving objects is drawn on the map based on the movement trajectory of the at least one moving object, wherein the first scale is larger than the second scale.
[0011] As an optional implementation, the step of drawing and displaying a trend graph of the set of at least one moving object on the map based on the trajectory of the at least one moving object includes:
[0012] Based on the location and trajectory of the at least one moving object, a trend graph of the movement of the set of moving objects consisting of the at least one moving object is drawn on the map.
[0013] As an optional implementation, the movement trajectory is presented in the form of lines, and the movement trend graphic is a graphic drawn based on the lines of the movement trajectory. The movement trend graphic is used to represent the overall movement trend of the set of moving objects.
[0014] As an optional implementation, the number of moving objects is multiple; the step of drawing and displaying the movement trend graph of the moving object set consisting of the at least one moving object on the map based on the position and trajectory of the at least one moving object includes:
[0015] Based on the trajectories of multiple moving objects, at least one pair of moving objects is determined, each pair of moving objects including two moving objects, and the trajectories of the two moving objects intersect.
[0016] The intersection of the trajectories of the two moving objects in each moving object pair is used as the directional indicator point of each moving object pair;
[0017] Based on the directional points of each moving object pair and the position of the moving object in each moving object pair, a graph showing the movement trend of the moving object set composed of multiple moving objects is drawn on the map.
[0018] As an optional implementation, the number of moving objects is greater than or equal to three; the step of drawing and displaying the movement trend graph of the moving object set composed of multiple moving objects on the map based on the direction markers of each moving object pair and the positions of the moving objects in each moving object pair includes:
[0019] Using the direction markers of each moving object pair and the position of the moving object in each moving object pair as vertices, construct the moving triangle corresponding to each moving object pair;
[0020] Determine the intersection points between the corresponding moving triangles for each moving object pair;
[0021] Based on the directional points of each moving object pair and the overlapping points between the moving triangles corresponding to each moving object pair, a graph showing the movement trend of the moving object set composed of multiple moving objects is drawn on the map.
[0022] As an optional implementation, the step of drawing and displaying a movement trend graph of a set of multiple moving objects on the map based on the direction markers of each moving object pair and the overlap points between the moving triangles corresponding to each moving object pair includes:
[0023] On the map, draw direction indicators at the directional markers of each moving object pair, the direction indicators including: arrows;
[0024] Using the direction marker of the first moving object pair as the first starting point, and using one of the positions of the two moving objects in the first moving object pair as the first transit point, draw a first curve that starts from the first starting point and passes through the first transit point;
[0025] Using the direction marker of the second moving object pair as the second starting point, and using one of the positions of the two moving objects in the second moving object pair as the second transit point, draw a second curve that starts from the second starting point and passes through the second transit point, wherein the first moving object pair and the second moving object pair each include one edge moving object from the moving object set;
[0026] Using the direction markers of the two moving object pairs as the third starting point and the third ending point respectively, at least one third curve is drawn from the third starting point to the third ending point. The graphic composed of the direction marker, the first curve, the second curve, and each of the third curves is displayed as the movement trend graphic. If the two moving object pairs have an overlap point, the third curve passes through the overlap point.
[0027] As an optional implementation, determining the overlap point between the corresponding moving triangles of each moving object pair includes:
[0028] If the first moving triangle corresponding to the first moving object pair and the second moving triangle corresponding to the second moving object pair have multiple intersection points, then the overlap point between the first moving triangle and the second moving triangle is determined based on the distance of each intersection point from the direction indicator point of the first moving object pair and the distance from the direction indicator point of the second moving object pair.
[0029] As an optional implementation, determining the overlap point between the first and second moving triangles based on the distances of each intersection point to the direction markers of the first moving object pair and the second moving object pair includes:
[0030] Calculate the sum of the distances between each intersection point and the direction markers of the first moving object pair, as well as the distances between each intersection point and the direction markers of the second moving object pair.
[0031] The intersection point with the smallest sum of distances is taken as the intersection point between the first moving triangle and the second moving triangle.
[0032] As an optional implementation, the number of moving objects is two, and the number of moving object pairs is one; the step of drawing and displaying the movement trend graph of the moving object set composed of multiple moving objects on the map based on the direction markers of each moving object pair and the positions of the moving objects in each moving object pair includes:
[0033] Draw a direction marker on the point of the direction indicator of the moving object pair on the map, the direction marker including: an arrow;
[0034] Starting from the direction marker of the moving object pair, and taking the positions of the two moving objects in the moving object pair as transit points, draw the fourth curve and the fifth curve, which start from the starting point and pass through the transit points respectively.
[0035] The graphic formed by the direction of travel marker, the fourth curve, and the fifth curve is displayed as the travel trend graphic.
[0036] As an optional implementation, determining at least one pair of moving objects based on the trajectories of multiple moving objects includes:
[0037] Based on the trajectory of each moving object, determine at least one candidate moving object that intersects with the third moving object, as well as the intersection point corresponding to each candidate moving object;
[0038] Based on the distance between the position of the third moving object and the intersection point corresponding to each candidate moving object, and the distance between the position of each candidate moving object and the intersection point corresponding to each candidate moving object, the moving object pair corresponding to the third moving object is determined.
[0039] As an optional implementation, determining the pair of moving objects corresponding to the third moving object based on the distance between the position of the third moving object and the intersection point corresponding to each candidate moving object, and the distance between the position of each candidate moving object and the intersection point corresponding to each candidate moving object, includes:
[0040] Calculate the distance between the position of the third moving object and the intersection point corresponding to each candidate moving object, and calculate the sum of the distances between the position of each candidate moving object and the intersection point corresponding to each candidate moving object;
[0041] The candidate moving object with the smallest sum of distances is combined with the third moving object to form a moving object pair corresponding to the third moving object.
[0042] As an optional implementation, before drawing and displaying the movement trend graph of the set of at least one moving object on the map based on the movement trajectory of the at least one moving object, the method further includes:
[0043] The at least one moving object within a preset area in the map is combined into the moving object set.
[0044] Secondly, this application provides a display control device for a game, comprising:
[0045] The display module is used to display the trajectory of at least one moving object on the map at a first scale.
[0046] A drawing module is configured to respond to a switch from a first scale to a second scale, and to draw and display a trend graph of the set of at least one moving object on the map based on the trajectory of the moving object, wherein the first scale is larger than the second scale.
[0047] As an optional implementation, the drawing module is specifically used for:
[0048] Based on the location and trajectory of the at least one moving object, a trend graph of the movement of the set of moving objects consisting of the at least one moving object is drawn on the map.
[0049] As an optional implementation, the movement trajectory is presented in the form of lines, and the movement trend graphic is a graphic drawn based on the lines of the movement trajectory. The movement trend graphic is used to represent the overall movement trend of the set of moving objects.
[0050] As an optional implementation, the number of moving objects is multiple; the drawing module is specifically used for:
[0051] Based on the trajectories of multiple moving objects, at least one pair of moving objects is determined, each pair of moving objects including two moving objects, and the trajectories of the two moving objects intersect.
[0052] The intersection of the trajectories of the two moving objects in each moving object pair is used as the directional indicator point of each moving object pair;
[0053] Based on the directional points of each moving object pair and the position of the moving object in each moving object pair, a graph showing the movement trend of the moving object set composed of multiple moving objects is drawn on the map.
[0054] As an optional implementation, the number of moving objects is greater than or equal to three; the drawing module is specifically used for:
[0055] Using the direction markers of each pair of moving objects and the positions of the moving objects in each pair as vertices, construct the corresponding moving triangles for each pair of moving objects;
[0056] Determine the intersection points between the corresponding moving triangles for each moving object pair;
[0057] Based on the directional points of each moving object pair and the overlapping points between the moving triangles corresponding to each moving object pair, a graph showing the movement trend of the moving object set composed of multiple moving objects is drawn on the map.
[0058] As an optional implementation, the drawing module is specifically used for:
[0059] On the map, draw direction indicators at the directional markers of each moving object pair, the direction indicators including: arrows;
[0060] Using the direction marker of the first moving object pair as the first starting point, and using one of the positions of the two moving objects in the first moving object pair as the first transit point, draw a first curve that starts from the first starting point and passes through the first transit point;
[0061] Using the direction marker of the second moving object pair as the second starting point, and using one of the positions of the two moving objects in the second moving object pair as the second transit point, draw a second curve that starts from the second starting point and passes through the second transit point, wherein the first moving object pair and the second moving object pair each include one edge moving object from the moving object set;
[0062] Using the direction markers of the two moving object pairs as the third starting point and the third ending point respectively, at least one third curve is drawn from the third starting point to the third ending point. The graphic composed of the direction marker, the first curve, the second curve, and each of the third curves is displayed as the movement trend graphic. If the two moving object pairs have an overlap point, the third curve passes through the overlap point.
[0063] As an optional implementation, the drawing module is specifically used for:
[0064] If the first moving triangle corresponding to the first moving object pair and the second moving triangle corresponding to the second moving object pair have multiple intersection points, then the overlap point between the first moving triangle and the second moving triangle is determined based on the distance of each intersection point from the direction indicator point of the first moving object pair and the distance from the direction indicator point of the second moving object pair.
[0065] As an optional implementation, the drawing module is specifically used for:
[0066] Calculate the sum of the distances between each intersection point and the direction markers of the first moving object pair, as well as the distances between each intersection point and the direction markers of the second moving object pair.
[0067] The intersection point with the smallest sum of distances is taken as the intersection point between the first moving triangle and the second moving triangle.
[0068] As an optional implementation, the number of moving objects is two, and the number of moving object pairs is one; the drawing module is specifically used for:
[0069] Draw a direction marker on the point of the direction indicator of the moving object pair on the map, the direction marker including: an arrow;
[0070] Starting from the direction marker of the moving object pair, and taking the positions of the two moving objects in the moving object pair as transit points, draw the fourth curve and the fifth curve, which start from the starting point and pass through the transit points respectively.
[0071] The graphic formed by the direction of travel marker, the fourth curve, and the fifth curve is displayed as the travel trend graphic.
[0072] As an optional implementation, the drawing module is specifically used for:
[0073] Based on the trajectory of each moving object, determine at least one candidate moving object that intersects with the third moving object, as well as the intersection point corresponding to each candidate moving object;
[0074] Based on the distance between the position of the third moving object and the intersection point corresponding to each candidate moving object, and the distance between the position of each candidate moving object and the intersection point corresponding to each candidate moving object, the moving object pair corresponding to the third moving object is determined.
[0075] As an optional implementation, the drawing module is specifically used for:
[0076] Calculate the distance between the position of the third moving object and the intersection point corresponding to each candidate moving object, and calculate the sum of the distances between the position of each candidate moving object and the intersection point corresponding to each candidate moving object;
[0077] The candidate moving object with the smallest sum of distances is combined with the third moving object to form a moving object pair corresponding to the third moving object.
[0078] As an optional implementation, the drawing module is also used for:
[0079] The at least one moving object within a preset area in the map is combined into the moving object set.
[0080] Thirdly, this application provides an electronic device, including: a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the game display control method described in the first aspect above.
[0081] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the game display control method described in the first aspect.
[0082] The game display control method, electronic device, and readable storage medium provided in this application, in response to the map switching from a first scale to a second scale, the system can draw and display the movement trend graphic of the moving object set composed of each moving object on the map according to the movement trajectory of each moving object in the map, thereby realizing the flexible display of movement information matching the map scale under different scale maps, and thus can be well applied to map zooming scenarios. Attached Figure Description
[0083] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0084] Figure 1 This is a diagram showing the trajectory of each moving object on the map.
[0085] Figure 2 A flowchart illustrating the game display control method provided in this application embodiment;
[0086] Figure 3 A flowchart illustrating the display control method for a game provided in this application embodiment;
[0087] Figure 4 The flowchart illustrates the drawing process when there are 3 or more moving objects in the game display control method provided in this application embodiment.
[0088] Figure 5 A schematic diagram of the movement trajectory when the set of moving objects includes 6 moving objects;
[0089] Figure 6A schematic diagram for drawing a trend graph based on directional points and overlapping points;
[0090] Figure 7 This is a diagram illustrating the switch from displaying the movement trajectory to displaying the movement trend graph when there are 3 or more moving objects.
[0091] Figure 8 A flowchart illustrating the process of drawing a movement trend graph based on overlapping points and direction pointer points when there are three or more moving objects in the game display control method provided in this application embodiment;
[0092] Figure 9 A flowchart illustrating the drawing process when there are two moving objects in the game display control method provided in this application embodiment;
[0093] Figure 10 This is a diagram illustrating the switch from displaying the movement trajectory to displaying the movement trend graph when there are two moving objects.
[0094] Figure 11 A module structure diagram of a game display control device provided in an embodiment of this application;
[0095] Figure 12 This is a schematic diagram of the structure of the electronic device 120 provided in the embodiments of this application. Detailed Implementation
[0096] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0097] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0098] To enable those skilled in the art to utilize the content of this application, and in conjunction with the specific application scenario of "game scenario," the following implementation methods are provided. For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application primarily describes a game scenario, it should be understood that this is merely an exemplary embodiment.
[0099] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0100] In game scenarios, it's common to display a map and, in real-time, show icons and trajectories of moving objects (such as airplanes, ships, and vehicles) within the map. Currently, displaying the trajectories of moving objects on the map by showing each individual object's icon and trajectory fails to reflect the overall movement trend. Figure 1 To illustrate the movement trajectory of each moving object on the map, as shown below... Figure 1 As shown, after obtaining the movement trajectories of each moving object, the system displays the trajectory of each object individually. Displaying only the movement trajectories is a single, fixed display method and is unsuitable for scenarios where the map can be flexibly scaled. For example, when the map in a game scene is displayed at a large scale, the moving objects are relatively far apart, making it suitable to display the individual movement trajectories of each object. However, when the map is scaled down to a small scale, the multiple moving objects may be closer together, making it more suitable to display the overall movement trend of the closely spaced moving objects. The current single, fixed display method cannot meet the actual needs of such scenarios.
[0101] Based on the above-mentioned problems, this application proposes a display control method for games. When the map is scaled from a large scale to a small scale, the overall movement trend of the set of moving objects can be obtained in real time by utilizing the movement trajectory of each moving object. This allows for flexible switching of the movement trajectory display method of moving objects in map scaling scenarios, making it suitable for maps of different scales.
[0102] Figure 2 This is a flowchart illustrating a game display control method provided in an embodiment of this application. The executing entity of this method can be an electronic device executing a game program, such as a mobile phone, desktop computer, or laptop computer. For ease of understanding and description, the executing entity will be referred to as the "system" in the following embodiments. Figure 2 As shown, the method includes:
[0103] S201. Display the trajectory of at least one moving object on a map at a first scale.
[0104] Optionally, the game may involve scaling the map at different scales. For example, in one scenario, the system presents a complete game scene for the player to interact with, including a large-scale map and various moving objects displayed on that map along with their movement paths. The aforementioned first scale can represent this large scale. It should be understood that the large scale represented by the first scale is relative to the second scale described below, which will be compared and explained in step S202. In another scenario, for practical needs, the system may display a thumbnail of the game scene, and within that thumbnail, a small-scale map will be displayed.
[0105] For example, as in the first scenario described above, when the system needs to present a complete game scene, this step can be performed, which involves displaying the movement trajectory of at least one moving object on the map at a first scale. For instance, after a player logs in, the system can first perform this step to present the player with a map at a first scale and display the movement trajectory of each moving object on that map.
[0106] S202, in response to switching from the first scale to the second scale, draw a trend graph on the map showing the movement of the set of moving objects consisting of the at least one moving object, based on the movement trajectory of the at least one moving object.
[0107] The first scale mentioned above is larger than the second scale.
[0108] Map scale is the ratio of the length of a line segment on the map to the actual length of the corresponding line segment on the ground. A larger scale indicates more detailed content and higher geometric accuracy. A smaller scale represents a larger geographical area, but with lower geometric accuracy. In this embodiment, the first scale is larger than the second scale, meaning the map can display more detailed content, such as buildings and roads, at the first scale. Therefore, at the first scale, the system can display the movement trajectories of each moving object on the map.
[0109] Optionally, the specific values of the first scale and the second scale mentioned above can be preset values.
[0110] Optionally, under certain triggering conditions, the system can be triggered to scale the map from the first scale to the second scale. For example, if the system is currently displaying a map at the first scale and the player is currently in front of a house shown on the map, when the player enters the house, the system will display the interior of the house in full screen. At this time, the system will be triggered to scale the map to the second scale and display the second scale map in the upper right or lower right corner of the screen.
[0111] Simultaneously, in response to the map being scaled from the first scale to the second scale, the system performs this step, namely, drawing a trend image on the map showing the movement of the set of moving objects consisting of the at least one moving object, based on the movement trajectory of the at least one moving object.
[0112] Optionally, based on the game scene's runtime data, the system can acquire the movement trajectories of each moving object on the map in real time. Then, based on these trajectories, the system can draw and display a graphical representation of the movement trend of the entire group of moving objects on the map.
[0113] Once the system starts displaying the movement trend graph, as the movement trajectories of each moving object change continuously, the system updates the movement trend graph in real time using the changed trajectories to ensure continuous updating and adjustment of the movement trend graph.
[0114] It is worth noting that after the system displays the movement trend graphic on the map, the system no longer draws and displays the movement trajectory of each moving object. However, the system background can continuously acquire the movement trajectory of each moving object in real time. Therefore, when the map switches back from the second scale to the first scale, the system can continue to display the movement trajectory of each moving object on the map in real time based on the real-time acquired movement trajectory, and no longer draw and display the movement trend graphic.
[0115] In this embodiment, in response to the map switching from the first scale to the second scale, the system can draw and display the movement trend graphic of the moving object set composed of each moving object on the map according to the movement trajectory of each moving object in the map, thereby realizing the flexible display of movement information that matches the map scale under different scale maps, and thus it can be well applied to the scenario of map scaling.
[0116] As described above, when drawing a trend graph, the overall trend of a set of at least one moving object is drawn. In practice, the number of moving objects displayed on the map may be large. Accordingly, in this application, the moving objects can be first grouped into a set of moving objects in various ways, and then the trend graph of the moving object set can be drawn.
[0117] In one approach, at least one mobile object within a preset area on the map can be grouped into the aforementioned set of mobile objects.
[0118] The aforementioned preset area range can be flexibly set as needed. For example, using a certain marker on the map as the center, the marker and moving objects within a certain threshold distance from the marker can be grouped into a set of moving objects.
[0119] In another approach, at least one mobile object located within a preset area during a preset time period can be grouped into the aforementioned set of mobile objects.
[0120] This method takes into account not only the area range but also the time factor. For example, moving objects that enter a preset area range within 5 minutes can be grouped into a set of moving objects.
[0121] In another approach, the aforementioned set of moving objects can be formed by combining a preset number of moving objects within a preset area on the map.
[0122] In this approach, in addition to considering the area, the number of moving objects is also taken into account. For example, when there are many moving objects within a preset area, these moving objects can be divided into different moving object sets according to the distance between them, so that the number of moving objects in each moving object set is less than or equal to the preset number mentioned above.
[0123] As an optional implementation, the movement trajectories of the aforementioned moving objects are presented in the form of lines, and the movement trend graph of the moving object set composed of the aforementioned moving objects is a graph drawn based on the lines of the aforementioned movement trajectories. The movement trend graph is used to characterize the overall movement trend of the moving object set.
[0124] Referring to the above Figure 1 The trajectory of each moving object can be Figure 1 The example line format. For instance, the lines representing the trajectory of the same moving object can be divided into two parts: solid lines and dashed lines. Solid lines represent the trajectories that the moving object has already traversed, while dashed lines represent the trajectories that the moving object has not yet traversed.
[0125] A movement trend graph is a graphic representation of the overall movement trend of multiple moving objects. In this application, the movement trend graph is drawn based on lines of movement trajectories. The specific drawing process will be described in detail in the following embodiments.
[0126] In step S202 above, when the system draws a trend graph of the set of moving objects based on the trajectory of each moving object, in one approach, the drawing can be based solely on the trajectory of each moving object. For example, the intersection of the trajectories of each moving object can be used as the top of the trend graph, and the drawing can extend along the center in the opposite direction of the trajectory of each moving object. In another approach, the drawing can be based on both the position and the trajectory of each moving object simultaneously. Compared to the first approach, the trend graph drawn in this way can more accurately represent the overall trend of each moving object. The following embodiments of this application will describe in detail this method of drawing based on both position and trajectory simultaneously.
[0127] It is worth noting that the following embodiments are described for the case where there are multiple moving objects, that is, when the set of moving objects contains two or more moving objects, the movement trend graph of the set of moving objects can be drawn based on the method of the following embodiments. However, for the case where there is only one moving object, a thicker arrow shape can be drawn along the movement trajectory of the moving object, which will not be elaborated further in this application.
[0128] Figure 3 A flowchart illustrating the display control method for a game provided in this application embodiment is shown below. Figure 3 As shown, one possible way to draw a movement trend image based on the position of the moving object and movement estimation includes:
[0129] S301. Based on the travel trajectories of multiple moving objects, determine at least one pair of moving objects, each pair of moving objects including two moving objects, and the travel trajectories of the two moving objects intersect.
[0130] For example, the trajectory of each moving object can be represented by a series of position points. If there are the same or different position points in the trajectories of two moving objects, it can be determined that the trajectories of the two moving objects intersect, and the two moving objects are combined into a moving object pair.
[0131] S302. The intersection of the trajectories of the two moving objects in each moving object pair is taken as the direction indicator point of each moving object pair.
[0132] For example, if the trajectories of the two moving objects in a moving object pair contain the same location point, that location point can be directly used as the direction point of the moving object pair. If the trajectories of the two moving objects in a moving object pair do not contain the same location point but contain location points with a difference less than a certain threshold, one of the location points with a difference less than the threshold can be used as the direction point, or one of the location points with a difference less than the threshold can be used as the direction point.
[0133] S303. Based on the direction markers of each moving object pair and the position of the moving object in each moving object pair, draw and display the movement trend graph of the moving object set composed of multiple moving objects on the above map.
[0134] Optionally, the directional marker points determined above can represent the common trend of movement of two moving objects whose trajectories intersect. Therefore, drawing a trend graph based on the directional marker points and the positions of each moving object can make the trend graph more accurately represent the actual trend.
[0135] As an optional implementation, one possible way of step S301 above includes:
[0136] First, based on the trajectory of each moving object, at least one candidate moving object that intersects with the third moving object, and the intersection point corresponding to each candidate moving object, are determined. Then, based on the distance between the position of the third moving object and the intersection point corresponding to each candidate moving object, and the distance between the position of each candidate moving object and the intersection point corresponding to each candidate moving object, the moving object pair corresponding to the third moving object is determined.
[0137] The aforementioned third moving object can refer to any moving object in the set of moving objects.
[0138] For a third moving object, there may be one or more moving objects intersecting its trajectory. If there is only one, they can be directly paired. If there are multiple moving objects, these are first considered as candidate moving objects for the third moving object. Then, based on the distance between the position of the third moving object and the intersection point of each candidate moving object, as well as the distance between the position of each candidate moving object and the intersection point of each candidate moving object, the corresponding moving object pair for the third moving object is determined.
[0139] The intersection point corresponding to each of the candidate moving objects can refer to the intersection point between each candidate moving object and the third moving object.
[0140] Optionally, when determining the pair of moving objects corresponding to the third moving object based on the distance between the position of the third moving object and the intersection point corresponding to each candidate moving object, and the distance between the position of each candidate moving object and the intersection point corresponding to each candidate moving object, the following method can be used:
[0141] First, calculate the distance between the position of the third moving object and the intersection point of each candidate moving object, as well as the sum of the distances between the position of each candidate moving object and the intersection point of each candidate moving object. Then, pair the candidate moving object with the smallest sum of distances with the third moving object to form a moving object pair corresponding to the third moving object.
[0142] Among them, the move object pair corresponding to the third move object refers to the move object pair that contains the third move object.
[0143] For example, suppose the third moving object is object A, and the candidate moving objects intersecting with object A include object B, object C, and object D. The intersection point of object A with object B is intersection point b, the intersection point with object C is intersection point c, and the intersection point with object D is intersection point c. Then, calculate the following information respectively:
[0144] 1. Calculate the distance b1 from the position of object A to the intersection point b, and calculate the distance b2 from the position of object B to the intersection point b. Then calculate the sum of b1 and b2, b0.
[0145] 2. Calculate the distance c1 from the position of object A to the intersection point c, and calculate the distance c2 from the position of object C to the intersection point c, and calculate the sum of c1 and c2 c0.
[0146] 3. Calculate the distance d1 from the position of object A to the intersection point d, and calculate the distance d2 from the position of object D to the intersection point d, and calculate the sum d0 of d1 and d2.
[0147] 4. Select the minimum value among b0, c0, and d0 above. Assuming the minimum value is d0, then object A and object D will be combined into a move object pair.
[0148] The following explains how the method of drawing the movement trend graph based on the direction point and the position of the moving object in step S303 above is described.
[0149] When the set of movable objects contains two movable objects, or when the set contains three or more movable objects, different drawing methods can be used. These will be explained separately below.
[0150] First, when the number of moving objects in the set of moving objects is greater than or equal to 3, the movement trend graph can be drawn in the following way.
[0151] Figure 4 This is a flowchart illustrating the drawing process when there are three or more moving objects in the game display control method provided in this application embodiment. Figure 4 As shown, the drawing process may include:
[0152] S401. Using the direction index of each moving object pair and the position of the moving object in each moving object pair as vertices, construct the moving triangle corresponding to each moving object pair.
[0153] Figure 5 This is a schematic diagram illustrating the movement trajectory when the set of moving objects includes 6 moving objects. (Refer to...) Figure 5The set of moving objects includes object 1, object 2, object 3, object 4, object 5, and object 6. Using the aforementioned method, the direction marker points D1 for object 1 and object 2, D2 for object 3 and object 4, and D3 for object 5 and object 6 can be determined. Simultaneously, the individual positions of object 1, object 2, object 3, object 4, object 5, and object 6 can also be determined. Taking the moving object pair consisting of object 1 and object 2 as an example, a moving triangle can be constructed using the positions of object 1, object 2, and direction marker point D1 as vertices. This moving triangle can be called the moving triangle corresponding to object 1 and object 2. Similarly, the moving triangles corresponding to object 3, object 4, object 5, and object 6 can be obtained.
[0154] S402. Determine the intersection point between the corresponding moving triangles of each moving object pair.
[0155] Continue to refer to Figure 5 Based on the moving triangle formed by objects 3 and 4 and the moving triangle formed by objects 5 and 6, the intersection point between these two moving triangles can be determined as J1.
[0156] The specific process for determining the overlap point will be described in detail in the following embodiments.
[0157] S403. Based on the direction markers of each moving object pair and the overlapping points between the moving triangles corresponding to each moving object pair, draw and display the movement trend graph of the moving object set composed of multiple moving objects on the map.
[0158] After the aforementioned steps, the direction points of each moving object pair and the overlapping points between each moving triangle can be determined. As mentioned earlier, the direction points of the moving object pair represent the common movement trend of the two moving objects, while the overlapping points determined in this embodiment represent the common position between the moving object pairs. Therefore, based on these two types of position points, a movement trend graph that is consistent with the actual movement trend can be drawn more accurately.
[0159] Figure 6 A schematic diagram for drawing a trend graph based on directional points and overlapping points, referencing... Figure 6 Once the direction points and intersection points are determined, a trend graph with smooth edges can be drawn.
[0160] Figure 7 This is a diagram illustrating the switch from displaying the movement trajectory to displaying the movement trend graph when there are three or more moving objects. Figure 7 As shown, the collection of moving objects includes the following: Figure 5After the processing described in the above embodiment, the map switches to display the overall movement trend of the six moving objects.
[0161] The following explains the method for determining the intersection point of the moving triangles in step S402 above.
[0162] For two moving triangles, if they intersect, there may be one or more intersection points. If there is one intersection point, it can be directly taken as the overlapping point of the two moving triangles. If there are multiple intersection points, the overlapping point can be determined as follows.
[0163] Optionally, if the first moving triangle corresponding to the first moving object pair and the second moving triangle corresponding to the second moving object pair have multiple intersection points, then the overlap point between the first moving triangle and the second moving triangle is determined based on the distance of each intersection point from the direction indicator point of the first moving object pair and the distance from the direction indicator point of the second moving object pair.
[0164] The first moving object pair and the second moving object pair can refer to any two moving object pairs among the moving object pairs determined by the aforementioned process.
[0165] Optionally, when determining the intersection point between the first moving triangle and the second moving triangle based on the distances of each intersection point to the direction markers of the first moving object pair and the second moving object pair, the sum of the distances of each intersection point to the direction markers of the first moving object pair and the second moving object pair can be calculated first. Then, the intersection point with the smallest sum of distances can be taken as the intersection point between the first moving triangle and the second moving triangle.
[0166] by Figure 5 Taking the example of the moving objects, assuming that the moving triangles corresponding to objects 3 and 4 are the first moving triangles, and the moving triangles corresponding to objects 5 and 6 are the second moving triangles, then there are a total of 4 intersection points between the first and second moving triangles. In this embodiment, for each intersection point, the distance from it to the target point D2 and the distance from it to the target point D3 are calculated, and the sum of these two distances is calculated. A distance sum can be calculated for each intersection point. If the sum of the distances corresponding to a certain intersection point is the smallest, then that intersection point is taken as the intersection point of the first and second moving triangles.
[0167] The following explains the process of drawing the movement trend graph in step S403 above based on the direction indicator points of each moving object pair and the overlapping points between the moving triangles corresponding to each moving object pair.
[0168] Figure 8This is a flowchart illustrating the process of drawing a movement trend graph based on overlapping points and direction pointer points when there are three or more moving objects in the game display control method provided in this application embodiment. Figure 8 As shown, the drawing process includes:
[0169] S801. Draw a direction indicator on the direction marker of each moving object pair on the map. The direction indicator includes an arrow.
[0170] You can refer to Figure 6 Arrows can be drawn at the direction markers of each moving object pair to indicate the direction of travel. Specifically, Figure 6 The example shows three directional points, so three arrows are drawn accordingly to indicate the direction of travel.
[0171] S802. Using the direction marker of the first moving object pair as the first starting point and one of the positions of the two moving objects in the first moving object pair as the first transit point, draw the first curve that starts from the first starting point and passes through the first transit point.
[0172] S803. Using the direction marker of the second moving object pair as the second starting point, and using one of the positions of the two moving objects in the second moving object pair as the second transit point, draw a second curve that starts from the second starting point and passes through the second transit point.
[0173] The first moving object pair and the second moving object pair each include an edge moving object from the set of moving objects.
[0174] In this context, an edge moving object in the moving object set can refer to a moving object that is either above or below other moving objects in the moving object set. Figure 5 For example, Object 1 and Object 6 are edge moving objects in the moving object set.
[0175] After the above steps S802-S803, the first curve and the second curve can be drawn, and these two curves can be used as the edge lines in the trend graph.
[0176] S804. Using the direction markers of the two moving object pairs as the third starting point and the third ending point respectively, draw at least one third curve from the third starting point to the third ending point, and display the graphic composed of the above-mentioned direction markers, the above-mentioned first curve, the above-mentioned second curve and each of the third curves as the above-mentioned trend graphic. If the two moving object pairs have an overlap point, the above-mentioned third curve passes through the above-mentioned overlap point.
[0177] Continue to refer to Figure 5Since the two moving object pairs corresponding to points D1 and D2 do not overlap, a third curve from D1 to D2 can be drawn directly, and the completeness of this curve can use a preset value. The two moving object pairs corresponding to D2 and D3 do overlap, therefore, a third curve can be drawn through this overlap.
[0178] The following explains how to draw a trend graph when there are two moving objects in the moving object set.
[0179] When there are two move objects in the move object set, there is one move object pair.
[0180] Figure 9 The flowchart for drawing when there are two moving objects in the game display control method provided in this application embodiment is as follows: Figure 9 The drawing process includes:
[0181] S901. Draw a direction indicator on the point of the direction marker of the moving object pair on the map. The direction indicator includes an arrow.
[0182] The processing procedure for this step can be referred to the aforementioned step S801, and will not be repeated here.
[0183] S902. Taking the direction index point of the moving object pair as the starting point and the positions of the two moving objects in the moving object pair as the transit points, draw the fourth curve and the fifth curve respectively, which start from the starting point and pass through the transit points.
[0184] S903. The graphic consisting of the above-mentioned direction of travel marker, the above-mentioned fourth curve, and the above-mentioned fifth curve is displayed as the above-mentioned trend of travel graphic.
[0185] When there are two moving objects in the set of moving objects, arrows can be drawn at the direction points of the two moving objects, and curves can be drawn along the positions of the two moving objects respectively, so as to draw the movement trend graph.
[0186] Figure 10 This is a diagram illustrating the switch from displaying the movement trajectory to displaying the movement trend graph when there are two moving objects, as shown below. Figure 10 As shown, the set of moving objects includes two moving objects. After the processing described in the above embodiment, the map switches to displaying the overall movement trend of the two moving objects.
[0187] Based on the same inventive concept, this application also provides a game display control device corresponding to the game display control method. Since the principle of the device in this application is similar to the game display control method described above in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0188] Figure 11 A module structure diagram of the game display control device provided in the embodiments of this application is shown below. Figure 12 As shown, the device includes:
[0189] Display module 1101 is used to display the trajectory of at least one moving object on a map at a first scale.
[0190] The drawing module 1102 is used to respond to a switch from a first scale to a second scale, and to draw and display a trend graph of the set of at least one moving object on the map based on the trajectory of the at least one moving object, wherein the first scale is larger than the second scale.
[0191] As an optional implementation, the drawing module 1102 is specifically used for:
[0192] Based on the location and trajectory of the at least one moving object, a trend graph of the movement of the set of moving objects consisting of the at least one moving object is drawn on the map.
[0193] As an optional implementation, the movement trajectory is presented in the form of lines, and the movement trend graphic is a graphic drawn based on the lines of the movement trajectory. The movement trend graphic is used to represent the overall movement trend of the moving object set.
[0194] As an optional implementation, the number of moving objects is multiple; the drawing module 1102 is specifically used for:
[0195] Based on the trajectories of multiple moving objects, at least one pair of moving objects is determined, each pair of moving objects including two moving objects, and the trajectories of the two moving objects intersect.
[0196] The intersection of the trajectories of the two moving objects in each moving object pair is used as the directional indicator point of each moving object pair;
[0197] Based on the directional points of each moving object pair and the position of the moving object in each moving object pair, a graph showing the movement trend of the moving object set composed of multiple moving objects is drawn on the map.
[0198] As an optional implementation, the number of moving objects is greater than or equal to three; the drawing module 1102 is specifically used for:
[0199] Using the direction markers of each pair of moving objects and the positions of the moving objects in each pair as vertices, construct the corresponding moving triangles for each pair of moving objects;
[0200] Determine the intersection points between the corresponding moving triangles for each moving object pair;
[0201] Based on the directional points of each moving object pair and the overlapping points between the moving triangles corresponding to each moving object pair, a graph showing the movement trend of the moving object set composed of multiple moving objects is drawn on the map.
[0202] As an optional implementation, the drawing module 1102 is specifically used for:
[0203] On the map, draw direction indicators at the directional markers of each moving object pair, the direction indicators including: arrows;
[0204] Using the direction marker of the first moving object pair as the first starting point, and using one of the positions of the two moving objects in the first moving object pair as the first transit point, draw a first curve that starts from the first starting point and passes through the first transit point;
[0205] Using the direction marker of the second moving object pair as the second starting point, and using one of the positions of the two moving objects in the second moving object pair as the second transit point, draw a second curve that starts from the second starting point and passes through the second transit point, wherein the first moving object pair and the second moving object pair each include one edge moving object from the moving object set;
[0206] Using the direction markers of the two moving object pairs as the third starting point and the third ending point respectively, at least one third curve is drawn from the third starting point to the third ending point. The graphic composed of the direction marker, the first curve, the second curve, and each of the third curves is displayed as the movement trend graphic. If the two moving object pairs have an overlap point, the third curve passes through the overlap point.
[0207] As an optional implementation, the drawing module 1102 is specifically used for:
[0208] If the first moving triangle corresponding to the first moving object pair and the second moving triangle corresponding to the second moving object pair have multiple intersection points, then the overlap point between the first moving triangle and the second moving triangle is determined based on the distance of each intersection point from the direction indicator point of the first moving object pair and the distance from the direction indicator point of the second moving object pair.
[0209] As an optional implementation, the drawing module 1102 is specifically used for:
[0210] Calculate the sum of the distances between each intersection point and the direction markers of the first moving object pair, as well as the distances between each intersection point and the direction markers of the second moving object pair.
[0211] The intersection point with the smallest sum of distances is taken as the intersection point between the first moving triangle and the second moving triangle.
[0212] As an optional implementation, the number of moving objects is two, and the number of moving object pairs is one; the drawing module 1102 is specifically used for:
[0213] Draw a direction marker on the point of the direction indicator of the moving object pair on the map, the direction marker including: an arrow;
[0214] Starting from the direction marker of the moving object pair, and taking the positions of the two moving objects in the moving object pair as transit points, draw the fourth curve and the fifth curve, which start from the starting point and pass through the transit points respectively.
[0215] The graphic formed by the direction of travel marker, the fourth curve, and the fifth curve is displayed as the travel trend graphic.
[0216] As an optional implementation, the drawing module 1102 is specifically used for:
[0217] Based on the trajectory of each moving object, determine at least one candidate moving object that intersects with the third moving object, as well as the intersection point corresponding to each candidate moving object;
[0218] Based on the distance between the position of the third moving object and the intersection point corresponding to each candidate moving object, and the distance between the position of each candidate moving object and the intersection point corresponding to each candidate moving object, the moving object pair corresponding to the third moving object is determined.
[0219] As an optional implementation, the drawing module 1102 is specifically used for:
[0220] Calculate the distance between the position of the third moving object and the intersection point corresponding to each candidate moving object, and calculate the sum of the distances between the position of each candidate moving object and the intersection point corresponding to each candidate moving object;
[0221] The candidate moving object with the smallest sum of distances is combined with the third moving object to form a moving object pair corresponding to the third moving object.
[0222] As an optional implementation, the drawing module 1102 is also used for:
[0223] The at least one moving object within a preset area in the map is combined into the moving object set.
[0224] This application also provides an electronic device 120, such as... Figure 12The diagram shown is a structural schematic of an electronic device 120 provided in an embodiment of this application, including: a processor 121, a memory 122, and a bus 123. The memory 122 stores machine-readable instructions executable by the processor 121 (e.g., ...). Figure 11 The device displays the execution instructions corresponding to the display module 1101 and the drawing module 1102, etc. When the electronic device 120 is running, the processor 121 communicates with the memory 122 through the bus 123. When the machine-readable instructions are executed by the processor 121, the steps of the method described in the above method embodiment are executed.
[0225] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described game display control method.
[0226] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.
[0227] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the 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, or the part that contributes to the prior art, or a part 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.
[0228] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for displaying and controlling a game, characterized in that, include: Display the trajectory of at least one moving object on the map at a first scale. In response to switching from a first scale to a second scale, a trend graph of the moving object set consisting of the at least one moving object is drawn on the map based on the movement trajectory of the at least one moving object. The first scale is larger than the second scale, the movement trajectory is presented in the form of lines, and the trend graph is a graph drawn based on the lines of the movement trajectory. The trend graph is used to represent the overall movement trend of the moving object set.
2. The method according to claim 1, characterized in that, The step of plotting and displaying the movement trend of the group of at least one moving object on the map based on the movement trajectory of the at least one moving object includes: The intersection of the trajectories of each moving object is taken as the top of the trend graph, and the graph is drawn by extending it along the center in the opposite direction of the trajectories of each moving object to obtain and display the trend graph.
3. The method according to claim 1, characterized in that, The set of moving objects consists of at least one moving object within a preset area on the map.
4. The method according to claim 3, characterized in that, The step of plotting and displaying the movement trend of the group of at least one moving object on the map based on the movement trajectory of the at least one moving object includes: Based on the location and trajectory of the at least one moving object, a trend graph of the movement of the set of moving objects consisting of the at least one moving object is drawn on the map.
5. The method according to claim 4, characterized in that, The number of moving objects is multiple; the step of drawing and displaying a trend graph of the moving object set consisting of the at least one moving object on the map based on the position and trajectory of the at least one moving object includes: Based on the trajectories of multiple moving objects, at least one pair of moving objects is determined, each pair of moving objects including two moving objects, and the trajectories of the two moving objects intersect. The intersection of the trajectories of the two moving objects in each moving object pair is used as the directional indicator point of each moving object pair; Based on the directional points of each moving object pair and the position of the moving object in each moving object pair, a graph showing the movement trend of the moving object set composed of multiple moving objects is drawn on the map.
6. The method according to claim 5, characterized in that, The number of moving objects is greater than or equal to three; the step of drawing and displaying the movement trend graph of the moving object set composed of multiple moving objects on the map based on the direction markers of each moving object pair and the positions of the moving objects in each moving object pair includes: Using the direction markers of each moving object pair and the position of the moving object in each moving object pair as vertices, construct the moving triangle corresponding to each moving object pair; Determine the intersection points between the corresponding moving triangles for each moving object pair; Based on the directional points of each moving object pair and the overlapping points between the moving triangles corresponding to each moving object pair, a graph showing the movement trend of the moving object set composed of multiple moving objects is drawn on the map.
7. The method according to claim 5, characterized in that, The number of moving objects is two, and the number of moving object pairs is one; the step of drawing and displaying the movement trend graph of the moving object set composed of multiple moving objects on the map based on the direction markers of each moving object pair and the positions of the moving objects in each moving object pair includes: Draw a direction marker on the point of the direction indicator of the moving object pair on the map, the direction marker including: an arrow; Starting from the direction marker of the moving object pair, and taking the positions of the two moving objects in the moving object pair as transit points, draw the fourth curve and the fifth curve, which start from the starting point and pass through the transit points respectively. The graphic formed by the direction of travel marker, the fourth curve, and the fifth curve is displayed as the travel trend graphic.
8. The method according to any one of claims 5-7, characterized in that, The step of determining at least one pair of moving objects based on the trajectories of multiple moving objects includes: Based on the trajectory of each moving object, determine at least one candidate moving object that intersects with the third moving object, as well as the intersection point corresponding to each candidate moving object; Based on the distance between the position of the third moving object and the intersection point corresponding to each candidate moving object, and the distance between the position of each candidate moving object and the intersection point corresponding to each candidate moving object, the moving object pair corresponding to the third moving object is determined.
9. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the display control method for a game as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the display control method for the game as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Target unit movement method, device, storage medium and terminal
CN109568965A
Travel route setting system, travel route setting method and travel route setting program
JP2015049232A