Virtual resource laying method and device, equipment and storage medium
Patent Information
- Application Number
- CN202311008215.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2043-08-10
AI Technical Summary
[0004]可以看出,现有的铺设方式主要根据玩家的放置操作进行道路的依次铺设,因此,铺设过程中存在铺设效率较低的问题
[0018] This application provides a virtual resource laying method, apparatus, device, and storage medium. The method can provide a graphical user interface through a terminal device, which may include a game map. The method includes: marking a first laying point in response to a trigger operation on a first laying point in the game map; marking a second laying point in response to a trigger operation on a second laying point in the game map; and determining the line connecting the first and second laying points as a target laying line in response to a determination operation on the first and second laying points, and filling the target laying path corresponding to the target laying line with target filling resources. By applying this application, a target laying path can be quickly laid based on the target laying line connecting the first and second laying points. Compared with the prior art, players do not need to lay the path through multiple placement operations, which can effectively improve laying efficiency.
Smart Images

Figure CN116899213B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of game technology, and in particular to a method, apparatus, device and storage medium for laying virtual resources. Background Technology
[0002] With the rapid development of internet technology, the gaming industry has entered a new era. Game developers have created a wide variety of games to meet the needs of different users, such as action games, adventure games, role-playing games, fighting games, shooting games, card games, and construction games. Among these, construction games allow players to build their own cities and homes according to their preferences.
[0003] In existing construction games, when laying roads, the process typically involves placing road items in the game scene and then clicking the confirmation button to place the road.
[0004] It can be seen that the existing paving method mainly lays the road sequentially based on the player's placement operation. Therefore, there is a problem of low paving efficiency during the paving process. Summary of the Invention
[0005] The purpose of this application is to address the shortcomings of the prior art by providing a virtual resource deployment method, apparatus, device, and storage medium that can improve deployment efficiency.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, the present invention provides a method for deploying virtual resources, which provides a graphical user interface through a terminal device, the graphical user interface including a game map, the method comprising:
[0008] In response to a trigger operation on the first laying point in the game map, the first laying point is marked;
[0009] In response to a trigger operation on the second laying point in the game map, mark the second laying point;
[0010] In response to the determination operation of the first laying point and the second laying point, the line connecting the first laying point and the second laying point is determined as the target laying line, and the target laying path corresponding to the target laying line is filled with target filling resources.
[0011] Secondly, the present invention provides a virtual resource deployment device that provides a graphical user interface via a terminal device, the graphical user interface including a game map, and the device comprising:
[0012] The first response module is used to respond to a trigger operation on the first laying point in the game map and mark the first laying point;
[0013] The second response module is used to respond to the trigger operation of the second laying point in the game map and mark the second laying point;
[0014] The determination module is used to determine the line connecting the first laying point and the second laying point as the target laying line in response to the determination operation of the first laying point and the second laying point, and to fill the target laying path corresponding to the target laying line with target filling resources.
[0015] Thirdly, the present invention provides an electronic device, comprising: 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 virtual resource deployment method as described in any of the foregoing embodiments.
[0016] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the virtual resource deployment method as described in any of the foregoing embodiments.
[0017] The beneficial effects of this application are:
[0018] This application provides a virtual resource laying method, apparatus, device, and storage medium. The method can provide a graphical user interface through a terminal device, which may include a game map. The method includes: marking a first laying point in response to a trigger operation on a first laying point in the game map; marking a second laying point in response to a trigger operation on a second laying point in the game map; and determining the line connecting the first and second laying points as a target laying line in response to a determination operation on the first and second laying points, and filling the target laying path corresponding to the target laying line with target filling resources. By applying this application, a target laying path can be quickly laid based on the target laying line connecting the first and second laying points. Compared with the prior art, players do not need to lay the path through multiple placement operations, which can effectively improve laying efficiency. Attached Figure Description
[0019] 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.
[0020] Figure 1 A cloud interaction system architecture diagram provided for an embodiment of this application;
[0021] Figure 2 A flowchart illustrating a virtual resource deployment method provided in an embodiment of this application;
[0022] Figure 3 A flowchart illustrating another virtual resource deployment method provided in this application embodiment;
[0023] Figure 4 A flowchart illustrating yet another virtual resource deployment method provided in this application embodiment;
[0024] Figure 5 A flowchart illustrating another virtual resource deployment method provided in this application embodiment;
[0025] Figure 6 This is a schematic diagram of virtual resource deployment provided in an embodiment of this application;
[0026] Figure 7 This is another schematic diagram of virtual resource deployment provided in an embodiment of this application;
[0027] Figure 8 This is another schematic diagram of virtual resource deployment provided in the embodiments of this application;
[0028] Figure 9 This is another schematic diagram of virtual resource deployment provided in an embodiment of this application;
[0029] Figure 10 A schematic diagram illustrating the adjustment of a virtual resource laying path provided in an embodiment of this application;
[0030] Figure 11 A flowchart illustrating yet another virtual resource deployment method provided in this application embodiment;
[0031] Figure 12 This is another schematic diagram of virtual resource deployment provided in the embodiments of this application;
[0032] Figure 13 This is another schematic diagram of virtual resource deployment provided in an embodiment of this application;
[0033] Figure 14This is another schematic diagram of virtual resource deployment provided in the embodiments of this application;
[0034] Figure 15 This is another schematic diagram of virtual resource deployment provided in an embodiment of this application;
[0035] Figure 16 A schematic diagram of the functional modules of a virtual resource deployment device provided in an embodiment of this application;
[0036] Figure 17 This is a schematic diagram of an electronic device structure provided in an embodiment of this application. Detailed Implementation
[0037] 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. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0038] 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.
[0039] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0040] In one embodiment of this application, the virtual resource deployment method can run on a terminal device or a server. The terminal device can be a local terminal device. When the virtual resource deployment method runs on a server, it can be implemented and executed based on a cloud interaction system, which can include a server and client devices.
[0041] Figure 1 A cloud interaction system architecture diagram is provided for embodiments of this application, such as... Figure 1 As shown, the system may include: a client device 10 and a server 20, wherein the client device 10 can be connected to the server 20 via a network 30.
[0042] 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 operation mode, the game program and the game screen presentation are separated. The storage and execution of the game character's transmission method are completed on the cloud gaming server. The client device 10 is used for receiving and sending data and presenting the game screen. For example, the client device 10 can be a display device with data transmission capabilities close to the user, such as a mobile terminal, television, computer, or PDA; however, the terminal device for information processing is the cloud gaming server in the cloud. When playing the game, the player operates the client device 10 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 10 through the network, and finally, the client device 10 decodes and outputs the game screen.
[0043] In an alternative implementation, the terminal device can be a local terminal device. 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, that is, conventionally downloading, installing, and running the game program via an electronic device. The local terminal device can provide the graphical user interface to the player in various ways, such as rendering it on the terminal's display screen, or providing it to the player through holographic projection. For example, the local terminal device can include a display screen for displaying the graphical user interface, which includes game screens, and a processor for running the game, generating the graphical user interface, and controlling the display of the graphical user interface on the display screen.
[0044] Figure 2 This is a flowchart illustrating a virtual resource deployment method provided in an embodiment of this application. The execution subject of this method can be the aforementioned terminal device or a server. When executing this method, a graphical user interface (GUI) can be provided through the terminal device. This GUI may include a game map. This method is applicable to game scenarios requiring player management and construction, i.e., management games, such as the construction of a virtual shop or a virtual house, etc., without limitation. Figure 2 As shown, the method includes:
[0045] S101, In response to the trigger operation on the first laying point in the game map, mark the first laying point.
[0046] In some embodiments, a laying control can be provided in the graphical user interface. Users can interact with the laying control through touch methods such as clicking, long-pressing, swiping, and dragging to enable the function of laying virtual resources in the game map. Optionally, after enabling the virtual resource laying function, players can interact with any location within the layable area of the game map as a first laying point through touch methods such as clicking, long-pressing, and dragging to generate a trigger operation for the first laying point. In response to the trigger operation, the first laying point can be marked on the game map.
[0047] Optionally, when marking, the first laying point can be marked with a preset identifier (such as an arrow, a positioning identifier, etc.), or the laying position corresponding to the first laying point can be filled with target filling resources, which is not limited here.
[0048] S102, Respond to the trigger operation on the second laying point in the game map and mark the second laying point.
[0049] The second laying point can be any location in the layable area of the game map other than the first laying point. Of course, this application does not limit the distance between the first laying point and the second laying point. Optionally, the distance between the two can be relatively close or relatively far.
[0050] In some embodiments, the second laying point can be identified using the same or different marking method as the first laying point. Of course, the marking method can also include text, patterns, animations, etc., which are not limited here. For example, the first laying point and the second laying point can be distinguished by a combination of positioning marks and text. The text label corresponding to the first laying point can be "starting point" and the text label corresponding to the second laying point can be "end point". Of course, the specific marking method is not limited to this.
[0051] S103. In response to the operation of determining the first laying point and the second laying point, determine the line connecting the first laying point and the second laying point as the target laying line, and fill the target laying path corresponding to the target laying line with target filling resources.
[0052] Based on the above description, after determining the positions of the first and second laying points respectively, optionally, the laying point determination control provided by the graphical user interface can be applied to the touch screen through touch methods such as clicking, long pressing, sliding, and dragging to generate a determination operation for the first and second laying points. In response to the determination operation, the line connecting the first and second laying points can be determined as the target laying line. Optionally, the target laying line can be a straight line or a curve, which is not limited here.
[0053] Based on the determined target laying route, further, target filling resources can be used to fill the target laying path corresponding to the target laying route. Optionally, during filling, the map area traversed by the target laying route can be filled based on a preset filling size to obtain the target laying path. Applying the embodiments of this application, a target laying path can be quickly laid based on a target laying route connecting a first laying point and a second laying point. Compared with the prior art, this eliminates the need for players to lay the path through multiple placement operations, effectively improving laying efficiency.
[0054] Optionally, the target filling resource can be any type of virtual resource such as virtual lawn, virtual trees, virtual hills, or virtual rivers. There are no restrictions on this, and it can be flexibly selected according to the actual application scenario.
[0055] In summary, this application provides a virtual resource laying method. This method can provide a graphical user interface through a terminal device, which may include a game map. The method may include: marking a first laying point in response to a trigger operation on a first laying point in the game map; marking a second laying point in response to a trigger operation on a second laying point in the game map; and determining the line connecting the first and second laying points as a target laying line in response to a determination operation on the first and second laying points, and filling the target laying path corresponding to the target laying line with target filling resources. By applying this application, a target laying path can be quickly laid based on the target laying line connecting the first and second laying points. Compared with the prior art, players do not need to lay the path through multiple placement operations, which can effectively improve laying efficiency.
[0056] Figure 3 This is a flowchart illustrating another virtual resource deployment method provided in an embodiment of this application. In optional implementations, such as... Figure 3 As shown, the steps described above for filling the target laying path corresponding to the target laying line with target filling resources may include:
[0057] S201. In response to a trigger operation on any intermediate laying point in the target laying line, the connection between the first laying point and the intermediate laying point is determined as the first adjustment auxiliary connection, and the connection between the intermediate laying point and the second laying point is determined as the second adjustment auxiliary connection.
[0058] In some embodiments, the target paving route can also be displayed on the game map. As can be seen from the above description, the target paving route can represent the direction of the target paving path. In some embodiments, considering that the generated target paving route may not meet the user's paving requirements, it is necessary to adjust the target paving route in this scenario so that it meets the user's paving requirements.
[0059] In some embodiments, when making adjustments, touch operations such as single clicks or multiple clicks can be applied to any intermediate laying point in the target laying line via a touch screen to generate a trigger operation for that intermediate auxiliary point. In response to the trigger operation, the adjustment function for the target laying line can be enabled, and the line connecting the first laying point and the intermediate laying point is determined as the first adjustment auxiliary line, and the line connecting the intermediate laying point and the second laying point is determined as the second adjustment auxiliary line. That is, the starting point of the first adjustment auxiliary line is the first laying point, the ending point is the starting point of the second adjustment auxiliary line, and the ending point of the second adjustment auxiliary line is the second laying point.
[0060] Of course, it should be noted that the operation of enabling the adjustment function is not limited to this. For example, a graphical user interface can provide an adjustment control, and the adjustment function can be enabled in response to the triggering operation of the adjustment control.
[0061] Furthermore, this application does not limit the angle between the first adjustment auxiliary line and the second adjustment auxiliary line; the angle can be any angle depending on the selection of the intermediate laying point.
[0062] S202. Use target filling resources to fill the first target laying path corresponding to the first adjustment auxiliary connection and the second target laying path corresponding to the second adjustment auxiliary connection respectively.
[0063] Based on the determined first adjustment auxiliary connection and second adjustment auxiliary connection, the target filling resources can be used to fill the corresponding laying paths. Then, the path composed of the first target laying path and the second target laying path is the final laying path.
[0064] By applying the embodiments of this application, the target laying path can be adjusted according to the user's laying requirements, which can improve the flexibility of the method of this application.
[0065] Figure 4 This is a flowchart illustrating another virtual resource laying method provided in an embodiment of this application. In an optional implementation, the target laying path includes at least one preset laying unit. Optionally, during filling, the preset laying units traversed by the target laying path can be obtained, and these preset laying units can be filled to obtain the target laying path. The preset laying unit can be a minimum virtual resource filling unit pre-set in the game or user-defined. The preset laying unit can be set to include a preset length and a preset width. Optionally, the shape of the preset laying unit can be a regular shape, such as a rectangle, triangle, circle, rhombus, etc., or it can be other irregular shapes, which are not limited here.
[0066] like Figure 4As shown, the steps described above, which determine the line connecting the first laying point and the second laying point as the target laying line and fill the target laying path corresponding to the target laying line with target filling resources, include:
[0067] S301. If it is determined that the target laying line passes through the vertex of at least one preset laying unit, then the vertex laying cell corresponding to each vertex is determined according to the vertex filling algorithm.
[0068] In some embodiments, considering that when laying based on the preset laying units through which the target laying line passes, there may be cases where the target laying line passes through the vertices of the preset laying units, in order to fill based on a unified filling principle, the vertex laying cells corresponding to each vertex can be determined sequentially according to the vertex filling algorithm.
[0069] S302. Based on the target laying line and the laying cells of each vertex, determine the target laying path and fill the target laying path with target filling resources.
[0070] Based on the above description, the target paving path can be determined by the determined vertex paving cells and the preset paving units through which the target paving line passes, and then filled using target fill resources. Applying the embodiments of this application, it is realized that preset paving units can be used as the smallest virtual resource fill units, and the target paving path can be flexibly filled using target fill resources according to the paving direction of the target paving line, making the filled target paving path more realistic and natural.
[0071] Figure 5 This is a flowchart illustrating another virtual resource deployment method provided in an embodiment of this application. In optional implementations, such as... Figure 5 As shown, if the target laying line is determined to pass through at least one vertex of a preset laying unit, then the vertex laying cell corresponding to each vertex is determined according to the vertex filling algorithm, including:
[0072] S401. If it is determined that the target laying line passes through the vertex of at least one preset laying unit, and the laying position information of the first laying point and the second laying point is different in any laying direction, then the first orientation information of the second laying point relative to the first laying point is obtained.
[0073] S402. Based on the first orientation information, determine the first vertex tiling cell corresponding to each vertex.
[0074] In some embodiments, the laying direction can be divided into a first laying direction and a second laying direction based on a preset coordinate system (e.g., a Cartesian coordinate system xOy), wherein the first laying direction can be the positive direction of the x-axis and the second laying direction can be the positive direction of the y-axis.
[0075] Specifically, based on a preset coordinate system, the first orientation information can characterize the direction and position of the second laying point relative to the first laying point, indicating the laying direction of the endpoint preset laying unit of the target laying path relative to the starting preset laying unit. Optionally, based on the preset coordinate system, the first orientation information can characterize the location of the second laying point as being to the upper left, lower left, upper right, or lower right of the first laying point, etc., which may vary depending on the actual application scenario.
[0076] Based on the preset coordinate system, the laying position information of the first laying point and the second laying point in any laying direction can be determined according to their respective coordinate positions in the preset coordinate system. If the coordinate positions of the two points are different in both the first and second laying directions, the first orientation information of the second laying point relative to the first laying point can be obtained. Based on the laying direction of the preset laying unit at the end of the target laying path indicated by the first orientation information relative to the preset laying unit at the starting point, the first vertex laying cell corresponding to each vertex can be determined. Then, based on each first vertex laying cell, the target laying path can be determined and filled in.
[0077] By applying the embodiments of this application, when the laying position information of the first laying point and the second laying point is different in any laying direction, the target laying path can be filled with target filling resources according to the laying direction of the end preset laying unit of the target laying path indicated by the first orientation information relative to the starting preset laying unit, so that the laid target laying path is more natural and in line with the user's laying habits.
[0078] In an optional implementation, if it is determined that the target laying line passes through at least one preset laying unit vertex, then the vertex laying cell corresponding to each vertex is determined according to the vertex filling algorithm, including:
[0079] If the target laying line is determined to pass through the vertex of at least one preset laying unit, and the laying position information of the first laying point and the second laying point is the same in any laying direction, then the second vertex laying cell corresponding to each vertex is determined according to the preset reference direction.
[0080] Optionally, if the target laying line passes through the vertex of at least one preset laying unit, and the laying position information of the first laying point and the second laying point is the same in the first laying direction or the second laying direction, that is, if the coordinate positions of the two are the same in the first laying direction or the second laying direction, then it will be impossible to determine the second vertex laying cell corresponding to each vertex by referring to the above embodiment.
[0081] Based on this, the embodiments of this application introduce a preset reference direction. Optionally, the preset reference direction can be a direction pre-set in the game map, such as any direction among East (E), West (W), South (S), and North (N), without limitation. Based on the preset reference direction, the second orientation information of the second laying point relative to the first laying point can be determined. This second orientation information can characterize the direction and position information of the second laying point relative to the first laying point, and indicate the laying direction of the end preset laying unit of the target laying path relative to the starting preset laying unit. Then, based on the second orientation information, the second vertex laying cell corresponding to each vertex can be determined.
[0082] By applying the embodiments of this application, when the laying position information of the first laying point and the second laying point is the same in any laying direction, the second azimuth information of the second laying point relative to the first laying point can be determined based on a preset reference direction. Then, according to the laying direction of the end preset laying unit of the target laying path indicated by the second azimuth information relative to the starting preset laying unit, the target laying path is filled with target filling resources, so that the laid target laying path is more natural and conforms to the user's laying habits.
[0083] In an optional implementation, determining the first vertex tiling cell corresponding to each vertex based on the first orientation information includes:
[0084] Based on the first orientation information and the preset reference orientation information, determine the first vertex tiling cell corresponding to each vertex.
[0085] The preset reference orientation information is used to indicate the reference orientation information between the second reference vertex and the first reference vertex in the first preset paving unit corresponding to the first paving point. The second reference vertex and the first reference vertex are two adjacent vertices in the first preset paving unit.
[0086] Optionally, the shape of the preset tiling unit can be a rectangle, rhombus, etc., and is not limited here. The first preset tiling unit corresponding to the first tiling point, that is, the preset tiling unit where the first tiling point is located, can have a first reference vertex that can be any vertex in the first preset tiling unit, and a second reference vertex that can be a vertex in the first preset tiling unit that is adjacent to the first reference vertex.
[0087] In some embodiments, the preset reference orientation information can be determined based on a preset coordinate system. Specifically, the first coordinate position of the first reference vertex and the second coordinate position of the second reference vertex can be determined based on the preset coordinate system, and the preset reference orientation information can be calculated based on the first coordinate position and the second coordinate position.
[0088] Optionally, the aforementioned preset coordinate system can be a rectangular coordinate system, or it can be a tile map coordinate system in a 2.5D perspective, which is not limited here.
[0089] In an optional implementation, based on the first orientation information and the preset reference orientation information, the first vertex tiling cell corresponding to each vertex is determined, including:
[0090] If the first orientation information and the preset reference orientation information meet the first preset requirement, then the coordinates of the diagonal vertex of the first vertex tiling cell corresponding to vertex (x, y) are (x+1, y+1); if the first orientation information and the preset reference orientation information meet the second preset requirement, then the coordinates of the diagonal vertex of the first vertex tiling cell corresponding to vertex (x, y) are (x+1, y-1); if the first orientation information and the preset reference orientation information meet the third preset requirement, then the coordinates of the diagonal vertex of the first vertex tiling cell corresponding to vertex (x, y) are (x-1, y+1); if the first orientation information and the preset reference orientation information meet the fourth preset requirement, then the first vertex tiling cell corresponding to vertex (x, y) is located at the coordinates of the vertex (x-1, y-1).
[0091] In some embodiments, the first azimuth information and the preset reference azimuth information can be represented by trigonometric functions, such as sine and cosine functions, which are not limited here. It is worth noting that in this embodiment, a preset laying unit is used as the unit cell. Of course, depending on the actual application scenario, the preset laying unit may include multiple unit cells, which are not limited here.
[0092] Figure 6 This is a schematic diagram of virtual resource deployment provided in an embodiment of this application. Figure 7 This is another schematic diagram of virtual resource deployment provided in an embodiment of this application. Figure 8 This is another schematic diagram of virtual resource deployment provided in an embodiment of this application. Figure 9 This is another schematic diagram of virtual resource tiling provided in an embodiment of this application. Wherein, if the preset coordinate system is a tile map coordinate system in a 2.5D perspective, the first tiling point is A(x1, y1), the second tiling point is B(x2, y2), the first reference vertex is E(x3, y3), and the second reference vertex is F(x4, y4), then sinA, cosA, sinE, or cosE can be calculated based on this.
[0093] refer to Figure 6As shown, the line connecting the first and second laying points passes through at least one vertex of a preset laying unit. Optionally, if |sinA|>|sinE|, where || represents the absolute value sign, and further, if sinA>0 and cosA>0, it indicates that the target laying line S1 (the straight line connecting A and B) runs from the lower left to the upper right, with an upward trend. It is predicted that the player will set the laying path to the right. Therefore, the preset laying unit to the right of vertex M1(x5, y5) is selected as the first vertex laying cell. The coordinates of the diagonal vertex of this first vertex laying cell are Q1(x5+1, y5+1), thus obtaining the continuously laid target laying path (see...). Figure 6 (The area that is filled in).
[0094] refer to Figure 7 As shown, the line connecting the first and second laying points passes through at least one vertex of a preset laying unit. Optionally, if |sinA| < |sinE|, where || represents the absolute value sign, and further, if sinA > 0 and cosA > 0, it indicates that the target laying line S2 (the straight line connecting A and B) runs from the lower left to the upper right, with a tendency towards the upper right. It is predicted that the player will set the laying path to the right. Therefore, the preset laying unit to the right of vertex M2(x6, y6) is selected as the first vertex laying cell. The coordinates of the diagonal vertex of this first vertex laying cell are Q2(x6-1, y6+1), thus obtaining the target laying path for continuous laying (see...). Figure 7 (The area that is filled in).
[0095] refer to Figure 8 As shown, the line connecting the first and second laying points passes through at least one vertex of a preset laying unit. Optionally, if |sinA|>|sinE|, where || represents the absolute value sign, and further, if sinA<0 and cosA<0, it indicates that the target laying line S3 (the straight line connecting A and B) runs from the upper right to the lower left, with a tendency towards the lower left. It is predicted that the player will set the laying path to the left. Therefore, the preset laying unit to the left of vertex M3(x7, y7) is selected as the first vertex laying cell. The coordinates of the diagonal vertex of this first vertex laying cell are Q3(x7-1, y7-1), thus obtaining the continuous laying target laying path (see...). Figure 8 (The area that is filled in).
[0096] refer to Figure 9As shown, the line connecting the first and second laying points passes through at least one vertex of a preset laying unit. Optionally, if sinA|<|sinE|, where || represents the absolute value sign, and further, if sinA<0 and cosA<0, it indicates that the target laying line S4 (the straight line connecting A and B) runs from the upper right to the lower left, with a downward trend. It is predicted that the player will set the laying path lower. Therefore, the preset laying unit to the left of vertex M4(x8, y8) is selected as the first vertex laying cell. The coordinates of the diagonal vertex of this first vertex laying cell are Q4(x8+1, y8-1), thus obtaining the continuous laying target laying path (see...). Figure 9 (The area that is filled in).
[0097] As can be seen from the examples above, when laying virtual resources, this application embodiment can predict the user's behavioral trend based on the first and second laying points determined by the user during the laying process, so that the final target laying path is more likely to meet the player's laying expectations, which can improve the player's gaming experience.
[0098] It should be noted that whether the line connecting the first laying point and the second laying point passes through the vertex of at least one preset laying unit can be determined by whether the line coincides with the vertex of each preset laying unit.
[0099] Figure 10 This is a schematic diagram illustrating the adjustment of a virtual resource laying path according to an embodiment of this application. Based on the above embodiment, it should be noted that if intermediate laying points are introduced during the laying process, the filling method for the first target laying path corresponding to the first adjustment auxiliary connection and the second target laying path corresponding to the second adjustment auxiliary connection can refer to the filling method of the target laying path in the above example, and will not be repeated here. Figure 10As shown in the figure, if the first laying point is A(x1, y1), the second laying point is B(x2, y2), and the intermediate laying point is C(x0, y0), it can be seen from the figure that the intermediate laying point C(x0, y0) is located in the target laying line. In response to the triggering operation of the intermediate laying point C(x0, y0), the first adjustment auxiliary connection T1 and the second adjustment auxiliary connection T2 can be determined respectively. Among them, the first adjustment auxiliary connection T1 does not pass through the vertices of the preset laying units. Therefore, the target filling resources can be used to fill the first target laying path corresponding to the first adjustment auxiliary connection T1, that is, to fill the pre-set laying units passed by the first adjustment auxiliary connection T1. Set up a laying unit; the second adjustment auxiliary line T2 passes through the vertex P1 of a preset laying unit, and the laying position information of the intermediate laying point C (x0, y0) and the second laying point B (x2, y2) is different in any laying direction. Therefore, according to the steps of S402 above, the first vertex laying cell corresponding to vertex P1 can be determined as the cell indicated by R0 in the figure. The target filling resource is used to fill the second target laying path corresponding to the second adjustment auxiliary line T2 and the cell indicated by R0, that is, to fill each preset laying unit and the cell indicated by R0 that the second adjustment auxiliary line T2 passes through, so as to obtain the final laying result.
[0100] Figure 11 This is a flowchart illustrating another virtual resource deployment method provided in an embodiment of this application. In optional implementations, such as... Figure 11 As shown, the above-mentioned method of determining the second vertex tile layout corresponding to each vertex based on a preset reference direction includes:
[0101] S501. Determine the second orientation information of the second laying point relative to the first laying point according to the preset reference direction.
[0102] S502. Based on the second orientation information, determine the second vertex tiling cell corresponding to each vertex.
[0103] When the target laying line passes through the vertices of multiple preset laying units, the laying position information of the second vertex laying cell corresponding to two adjacent vertices is different in any laying direction.
[0104] In some embodiments, the second orientation information may be represented by trigonometric functions, such as sine functions, cosine functions, etc., without limitation.
[0105] Figure 12 This is another schematic diagram of virtual resource deployment provided in the embodiments of this application; Figure 13 This is another schematic diagram of virtual resource deployment provided in an embodiment of this application; Figure 14 This is another schematic diagram of virtual resource deployment provided in the embodiments of this application; Figure 15This is another schematic diagram of virtual resource tiling provided in an embodiment of this application. Wherein, if the preset coordinate system is the tile map coordinate system in a 2.5D view, the first tiling point is A(x1, y1), the second tiling point is B(x2, y2), and the preset reference direction is north (N), then sinA and cosA can be calculated based on this.
[0106] refer to Figure 12 As shown, the line connecting the first and second laying points passes through the vertex of at least one preset laying unit. Optionally, if |sinA| < |sinE|, where || represents the absolute value sign, and further, if sinA = 0 and cosA = 1, it indicates that the line connecting the first and second laying points is horizontal, and the laying direction of the target laying line S5 is from left to right, with a rightward tendency. Furthermore, based on the north (N) direction, it can be known that the direction of the target laying line S5 (the straight line connecting A and B) is southeast (lower right). It is predicted that the player will set the laying path lower, therefore the target laying line S5 is selected from left to right. The preset paving unit below the first vertex passed to the right is used as the second vertex paving unit corresponding to that first vertex (as indicated by R1 in the diagram). For each subsequent vertex passed, the preset paving unit in the opposite direction of the direction selected by the previous vertex is selected as the next second vertex paving unit. The relationship between two adjacent second vertex paving units can be seen in the relationship between R1 and R2 in the diagram. Based on the determined second vertex paving units, target filling resources can be used to fill each second vertex paving unit and the preset paving units traversed by the target paving path S5, thereby obtaining a continuously paved target paving path (see...). Figure 12 (The area that is filled in).
[0107] refer to Figure 13As shown, the line connecting the first and second laying points passes through the vertex of at least one preset laying unit. Optionally, if |sinA| < |sinE|, where || represents the absolute value sign, and further, if sinA = 0 and cosA = -1, it indicates that the line connecting the first and second laying points is horizontal, and the laying direction of the target laying line S6 is from right to left, with a leftward tendency. Furthermore, based on the north (N) direction, it can be known that the direction of the target laying line S6 (the straight line connecting A and B) is northwest (upper left). It is predicted that the player will set the laying path closer to the top, therefore the target laying line S6 is selected from right to left. The preset paving unit above the first vertex passed by the left is used as the second vertex paving unit corresponding to that first vertex (as indicated by R3 in the figure). For each subsequent vertex passed, the preset paving unit in the opposite direction of the direction selected by the previous vertex is selected as the next second vertex paving unit. The relationship between two adjacent second vertex paving units can be seen in the relationship between R3 and R4 in the figure. Based on the determined second vertex paving units, target filling resources can be used to fill each second vertex paving unit and the preset paving units passed by the target paving path S6, thereby obtaining a continuously paved target paving path (see...). Figure 13 (The area that is filled in).
[0108] refer to Figure 14 As shown, the line connecting the first and second laying points passes through the vertex of at least one preset laying unit. Optionally, if |sinA|>|sinE|, where || represents the absolute value sign, and further, if sinA=1 and cosA=0, it indicates that the line connecting the first and second laying points is vertically perpendicular, and the laying direction of the target laying line S7 is from bottom to top, with an upward trend. Furthermore, based on the north (N) direction, it can be known that the direction of the target laying line S7 (the straight line connecting A and B) is northeast (upper right), predicting that the player will set the laying path on the right. Therefore, the target laying line S7 is selected from bottom to top. The preset paving unit to the right of the first vertex traversed is designated as the second vertex paving unit corresponding to that first vertex (as indicated by R5 in the diagram). For each subsequent vertex traversed, the preset paving unit in the opposite direction of the direction selected by the previous vertex is selected as the next second vertex paving unit. The relationship between two adjacent second vertex paving units can be seen in the relationship between R5 and R6 in the diagram. Based on the determined second vertex paving units, target filling resources can be used to fill each second vertex paving unit and the preset paving units traversed by the target paving path S7, thereby obtaining a continuously paved target paving path (see...). Figure 14 (The area that is filled in).
[0109] refer to Figure 15As shown, the line connecting the first and second laying points passes through the vertex of at least one preset laying unit. Optionally, if |sinA|>|sinE|, where || represents the absolute value sign, and further, if sinA=-1 and cosA=0, it indicates that the line connecting the first and second laying points is vertically perpendicular, and the target laying line S8 (the straight line connecting A and B) runs from top to bottom with a downward trend. Furthermore, based on the north (N) direction, it can be known that the target laying line S8 runs southwest (lower left), predicting that the player will set the laying path to the left. Therefore, the target laying line S8 is selected from bottom to top. The preset paving unit to the left of the first vertex traversed is designated as the second vertex paving unit corresponding to that first vertex (as indicated by R7 in the diagram). For each subsequent vertex traversed, the preset paving unit in the opposite direction of the direction selected by the previous vertex is selected as the next second vertex paving unit. The relationship between two adjacent second vertex paving units can be seen in the relationship between R7 and R8 in the diagram. Based on the determined second vertex paving units, target filling resources can be used to fill each second vertex paving unit and the preset paving units traversed by the target paving path S8, thereby obtaining a continuously paved target paving path (see...). Figure 15 (The area that is filled in).
[0110] As can be seen from the examples above, when laying virtual resources, this application embodiment can predict the user's behavioral trend based on the first and second laying points determined by the user during the laying process, so that the final target laying path is more likely to meet the player's laying expectations, which can improve the player's gaming experience.
[0111] In an optional implementation, before marking the first laying point in response to a triggering operation on the game map, the method further includes:
[0112] In response to a selection operation on any of the multiple fill resources, the fill resource corresponding to the selection operation is determined as the target fill resource.
[0113] Optionally, the resource types of the multiple infill resources may include plot-type resources such as lawns, forests, and water surfaces, and are not limited here. The target infill resource can be any type of these multiple infill resources; for example, it could be a lawn, and is not limited here.
[0114] By applying the embodiments of this application, when laying virtual resources, the target filling resources can be flexibly selected, which can improve the flexibility and applicability of the method of this application.
[0115] Figure 16This is a functional module diagram of a virtual resource deployment device provided in an embodiment of this application. The device can provide a graphical user interface through a terminal device. The graphical user interface includes a game map. The basic principle and technical effects of the device are the same as those of the corresponding method embodiments described above. For the sake of brevity, parts not mentioned in this embodiment can be referred to the corresponding content in the method embodiments.
[0116] like Figure 16 As shown, the virtual resource deployment device 100 includes:
[0117] The first response module 110 is used to respond to the trigger operation of the first laying point in the game map and mark the first laying point;
[0118] The second response module 120 is used to respond to the trigger operation of the second laying point in the game map and mark the second laying point;
[0119] The determination module 130 is used to determine the line connecting the first laying point and the second laying point as the target laying line in response to the determination operation of the first laying point and the second laying point, and to fill the target laying path corresponding to the target laying line with target filling resources.
[0120] In an optional implementation, the determining module 130 is specifically used to determine, in response to a triggering operation on any intermediate laying point in the target laying line, the connection between the first laying point and the intermediate laying point as the first adjustment auxiliary connection, and the connection between the intermediate laying point and the second laying point as the second adjustment auxiliary connection.
[0121] The target filling resources are used to fill the first target laying path corresponding to the first adjustment auxiliary connection and the second target laying path corresponding to the second adjustment auxiliary connection, respectively.
[0122] In an optional implementation, the target paving path includes at least one preset paving unit. The determining module 130 is specifically used to determine the vertex paving cell corresponding to each vertex according to the vertex filling algorithm if it is determined that the target paving path passes through the vertex of at least one preset paving unit.
[0123] Based on the target laying path and the laying cells at each vertex, determine the target laying path and fill the target laying path with target filling resources.
[0124] In an optional implementation, the determining module 130 is specifically used to obtain the first orientation information of the second laying point relative to the first laying point if it is determined that the target laying line passes through the vertex of at least one preset laying unit and the laying position information of the first laying point and the second laying point are different in any laying direction.
[0125] Based on the first location information, determine the first vertex tiling cell corresponding to each vertex.
[0126] In an optional implementation, the determining module 130 is specifically used to determine the second vertex laying cell corresponding to each vertex according to the preset reference direction if it is determined that the target laying line passes through the vertex of at least one preset laying unit, and the laying position information of the first laying point and the second laying point is the same in any laying direction.
[0127] In an optional implementation, the determining module 130 is specifically used to determine the first vertex paving cell corresponding to each vertex based on the first orientation information and the preset reference orientation information.
[0128] The preset reference orientation information is used to indicate the reference orientation information between the second reference vertex and the first reference vertex in the first preset paving unit corresponding to the first paving point. The second reference vertex and the first reference vertex are two adjacent vertices in the first preset paving unit.
[0129] In an optional implementation, the determining module 130 is specifically configured to: if the first orientation information and the preset reference orientation information satisfy the first preset requirement, then the coordinates of the diagonal vertex of the first vertex paving cell corresponding to vertex (x, y) are (x+1, y+1); if the first orientation information and the preset reference orientation information satisfy the second preset requirement, then the coordinates of the diagonal vertex of the first vertex paving cell corresponding to vertex (x, y) are (x+1, y-1); if the first orientation information and the preset reference orientation information satisfy the third preset requirement, then the coordinates of the diagonal vertex of the first vertex paving cell corresponding to vertex (x, y) are (x-1, y+1); if the first orientation information and the preset reference orientation information satisfy the fourth preset requirement, then the first vertex paving cell corresponding to vertex (x, y) is located at the coordinates of the vertex (x-1, y-1).
[0130] In an optional implementation, the determining module 130 is specifically used to determine the second orientation information of the second laying point relative to the first laying point according to a preset reference direction.
[0131] Based on the second orientation information, the second vertex paving cell corresponding to each vertex is determined. When the target paving line passes through the vertices of multiple preset paving units, the paving position information of the second vertex paving cells corresponding to two adjacent vertices is different in any paving direction.
[0132] In an optional implementation, the first response module 110 is further configured to, in response to a selection operation of any one of the multiple filling resources, determine the filling resource corresponding to the selection operation as the target filling resource.
[0133] The above-described device is used to execute the method provided in the foregoing embodiments, and its implementation principle and technical effect are similar, so they will not be described again here.
[0134] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more microprocessors, or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).
[0135] Figure 17 This is a schematic diagram of an electronic device structure provided as an embodiment of this application. Figure 17 As shown, the electronic device may include a processor 210, a storage medium 220, and a bus 230. The storage medium 220 stores machine-readable instructions executable by the processor 210. When the electronic device is running, the processor 210 communicates with the storage medium 220 via the bus 230, and the processor 210 executes the machine-readable instructions to perform the steps of the above method embodiment. The specific implementation and technical effects are similar and will not be described in detail here.
[0136] Optionally, this application also provides a computer-readable storage medium storing a computer program, which, when run by a processor, executes the steps of the above-described method embodiments. The specific implementation and technical effects are similar and will not be repeated here.
[0137] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0138] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0139] 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. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0140] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application. 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.
[0141] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0142] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need further definition and explanation in subsequent figures. The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for deploying virtual resources, characterized in that, The method includes providing a graphical user interface (GUI) via a terminal device, the GUI including a game map, and comprising: In response to a trigger operation on a first laying point in the game map, the first laying point is marked; in response to a trigger operation on a second laying point in the game map, the second laying point is marked; in response to a determination operation on the first laying point and the second laying point, the line connecting the first laying point and the second laying point is determined as the target laying line, and the target laying path corresponding to the target laying line is filled with target filling resources. The target paving path includes at least one preset paving unit. The step of determining the line connecting the first paving point and the second paving point as the target paving line, and filling the target paving path corresponding to the target paving line with target filling resources, includes: If it is determined that the target laying line passes through the vertex of at least one preset laying unit, then the vertex laying cell corresponding to each vertex is determined according to the vertex filling algorithm; Based on the target laying line and the laying cells of each vertex, the target laying path is determined, and the target laying path is filled using the target filling resources; If it is determined that the target laying line passes through at least one preset laying unit vertex, then the vertex laying cell corresponding to each vertex is determined according to the vertex filling algorithm, including: If it is determined that the target laying line passes through the vertex of at least one preset laying unit, and the laying position information of the first laying point and the second laying point is different in any laying direction, then the first orientation information of the second laying point relative to the first laying point is obtained; based on the first orientation information, the first vertex laying cell corresponding to each vertex is determined. If it is determined that the target laying line passes through the vertex of at least one preset laying unit, and the laying position information of the first laying point and the second laying point is the same in any laying direction, then the second vertex laying cell corresponding to each vertex is determined according to the preset reference direction.
2. The method according to claim 1, characterized in that, The step of filling the target laying path corresponding to the target laying line with target filling resources includes: In response to a triggering operation on any intermediate laying point in the target laying line, the line connecting the first laying point and the intermediate laying point is determined as a first adjustment auxiliary line, and the line connecting the intermediate laying point and the second laying point is determined as a second adjustment auxiliary line. The target filling resources are used to fill the first target laying path corresponding to the first adjustment auxiliary connection and the second target laying path corresponding to the second adjustment auxiliary connection, respectively.
3. The method according to claim 1, characterized in that, The step of determining the first vertex tiling cell corresponding to each vertex based on the first orientation information includes: Based on the first orientation information and the preset reference orientation information, determine the first vertex paving cell corresponding to each vertex; The preset reference orientation information is used to indicate the reference orientation information between the second reference vertex and the first reference vertex in the first preset paving unit corresponding to the first paving point. The second reference vertex and the first reference vertex are two adjacent vertices in the first preset paving unit.
4. The method according to claim 3, characterized in that, The step of determining the first vertex tiling cell corresponding to each vertex based on the first orientation information and the preset reference orientation information includes: If it is determined that the first orientation information and the preset reference orientation information meet the first preset requirement, then the coordinates of the diagonal vertex of the first vertex paving cell corresponding to the vertex (x, y) are (x+1, y+1). If it is determined that the first orientation information and the preset reference orientation information meet the second preset requirement, then the coordinates of the diagonal vertex of the first vertex paving cell corresponding to the vertex (x, y) are (x+1, y-1). If it is determined that the first orientation information and the preset reference orientation information meet the third preset requirement, then the coordinates of the diagonal vertex of the first vertex paving cell corresponding to the vertex (x, y) are (x-1, y+1). If it is determined that the first orientation information and the preset reference orientation information meet the fourth preset requirement, then the coordinates of the diagonal vertex of the first vertex paving cell corresponding to the vertex (x, y) are (x-1, y-1).
5. The method according to claim 1, characterized in that, The step of determining the second vertex tiling cells corresponding to each vertex according to a preset reference direction includes: Based on a preset reference direction, determine the second orientation information of the second laying point relative to the first laying point; Based on the second orientation information, the second vertex paving cell corresponding to each vertex is determined. When the target paving line passes through the vertices of multiple preset paving units, the paving position information of the second vertex paving cells corresponding to two adjacent vertices is different in any paving direction.
6. The method according to any one of claims 1-4, characterized in that, Before marking the first laying point in response to a trigger operation on the game map, the method further includes: In response to a selection operation on any one of a plurality of filling resources, the filling resource corresponding to the selection operation is determined as the target filling resource.
7. A virtual resource deployment device, characterized in that, The device provides a graphical user interface (GUI) via a terminal device, the GUI including a game map, and the device includes: The first response module is used to respond to a trigger operation on the first laying point in the game map and mark the first laying point; The second response module is used to mark the second laying point in response to a trigger operation on the game map; The determination module is used to determine the line connecting the first laying point and the second laying point as the target laying line in response to the determination operation of the first laying point and the second laying point, and to fill the target laying path corresponding to the target laying line with target filling resources; The target paving path includes at least one preset paving unit. The determining module is specifically used to determine the vertex paving cell corresponding to each vertex according to the vertex filling algorithm if it is determined that the target paving path passes through the vertex of at least one preset paving unit. Based on the target laying line and the laying cells of each vertex, the target laying path is determined, and the target laying path is filled using the target filling resources; If it is determined that the target laying line passes through at least one preset laying unit vertex, then the vertex laying cell corresponding to each vertex is determined according to the vertex filling algorithm, including: If it is determined that the target laying line passes through the vertex of at least one preset laying unit, and the laying position information of the first laying point and the second laying point is different in any laying direction, then the first orientation information of the second laying point relative to the first laying point is obtained; based on the first orientation information, the first vertex laying cell corresponding to each vertex is determined. If it is determined that the target laying line passes through the vertex of at least one preset laying unit, and the laying position information of the first laying point and the second laying point is the same in any laying direction, then the second vertex laying cell corresponding to each vertex is determined according to the preset reference direction.
8. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus. The storage medium stores machine-readable instructions executable by the processor. 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 virtual resource deployment method as described in any one of claims 1-6.
9. 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 virtual resource deployment method as described in any one of claims 1-6.
Citation Information
Patent Citations
Route generation method and device for three-dimensional game scene, and storage medium
CN110772791A
Object moving method, object moving device, object moving equipment and medium
CN111177291A