CN118179031A - Control method and device for troops in game and electronic equipment - Google Patents

Control method and device for troops in game and electronic equipment Download PDF

Info

Publication number
CN118179031A
CN118179031A CN202410160166.3A CN202410160166A CN118179031A CN 118179031 A CN118179031 A CN 118179031A CN 202410160166 A CN202410160166 A CN 202410160166A CN 118179031 A CN118179031 A CN 118179031A
Authority
CN
China
Prior art keywords
team
spline
component
sub
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410160166.3A
Other languages
Chinese (zh)
Inventor
肖威威
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202410160166.3A priority Critical patent/CN118179031A/en
Publication of CN118179031A publication Critical patent/CN118179031A/en
Pending legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention provides a control method, a device and electronic equipment for a marching team in a game, wherein the method comprises the following steps: creating a blueprint base class of a target team, and adding at least one sub-team component in the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the sub-teams form a target team according to a preset arrangement sequence; acquiring first component parameters of the sub-team component, and generating a target team based on the first component parameters; wherein the first component parameters include: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team; adding spline components in the blueprint base class, and obtaining second component parameters of the spline components; wherein the second component parameter is for indicating: a movement path of the target team; and controlling the target team to move according to the moving path through the spline line component. The method reduces the labor cost spent by the editing troops and improves the editing efficiency.

Description

Control method and device for troops in game and electronic equipment
Technical Field
The present invention relates to the field of game technologies, and in particular, to a method and an apparatus for controlling a marching team in a game, and an electronic device.
Background
In the related art, when editing the scene of the marching of the team, a plurality of character models needed by the team need to be created, then the number and the row position of each character model in the team are set one by one, the moving start point and the moving end point of the character model are obtained, the position of the character model in each animation frame between the moving start point and the moving end point is calculated, and each character model in the marching team is driven to move, so that the movement of the whole marching team is controlled. The system for editing the troops has high labor cost and low editing efficiency.
Disclosure of Invention
Accordingly, the present invention is directed to a method, an apparatus, and an electronic device for controlling a game play team, so as to edit the game play team conveniently and rapidly, reduce labor cost, and improve editing efficiency.
In a first aspect, an embodiment of the present invention provides a method for controlling a troop in a game, creating a blueprint base class of a target troop, and adding at least one sub-troop component into the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the sub-teams form a target team according to a preset arrangement sequence; acquiring first component parameters of the sub-team component, and generating a target team based on the first component parameters; wherein the first component parameter comprises one or more of: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team; adding spline components in the blueprint base class, and obtaining second component parameters of the spline components; wherein the second component parameter is for indicating: a movement path of the target team; and controlling the target team to move according to the moving path through the spline line component.
In a second aspect, an embodiment of the present invention provides a control apparatus for a troop in a game, the apparatus comprising: the first creation module is used for creating a blueprint base class of the target team and adding at least one sub-team component into the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the sub-teams form a target team according to a preset arrangement sequence; the first generation module is used for acquiring first component parameters of the sub-team component and generating a target team based on the first component parameters; wherein the first component parameter comprises one or more of: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team; the first acquisition module is used for adding spline components into the blueprint base class and acquiring second component parameters of the spline components; wherein the second component parameter is for indicating: a movement path of the target team; the first control module is used for controlling the target team to move according to the moving path through the spline assembly.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory stores machine executable instructions executable by the processor, and the processor executes the machine executable instructions to implement a method for controlling a marching team in a game.
In a fourth aspect, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement a method of controlling a marching team in a game as described above.
The embodiment of the invention has the following beneficial effects:
The control method, the control device and the electronic equipment of the troop in the game are used for creating a blueprint base class of a target troop and adding at least one sub-troop component into the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the sub-teams form a target team according to a preset arrangement sequence; acquiring first component parameters of the sub-team component, and generating a target team based on the first component parameters; wherein the first component parameter comprises one or more of: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team; adding spline components in the blueprint base class, and obtaining second component parameters of the spline components; wherein the second component parameter is for indicating: a movement path of the target team; and controlling the target team to move according to the moving path through the spline line component. In the method, at least one sub-team component and a spline component are added in a blueprint base class of a target team, the sub-team component corresponds to the sub-team in the target team, and the target team is generated according to component parameters such as the position of the sub-team corresponding to the sub-team component in the blueprint base class of the target team, the type of the sub-team, the object arrangement parameters in the sub-team and the like; and indicating the moving path of the target team according to the component parameters of the spline component, and controlling the target team to move according to the moving path through the spline component. According to the method, the target teams with the arrangement sequence can be generated by adding the sub teams components in the blueprint base class of the target teams and acquiring the component parameters of the sub teams components, and the target teams can be controlled to move according to the moving path through the spline line components, so that the labor cost for editing the marching teams is reduced, and the editing efficiency is improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the above objects, features and advantages of the present invention more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are some embodiments of the invention and that other drawings may be obtained from these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for controlling a troop in a game according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a target team according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of second component parameters of a spline component according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of moving an object animation model on a scene model surface of a virtual scene according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a control device for a game play team according to an embodiment of the present invention;
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Based on the above, the method, the device and the electronic equipment for controlling the troops in the game provided by the embodiment of the invention can be particularly applied to three-dimensional creation platforms such as the illusion engine UE4 (Unreal Engine), the Maya and the like for making dynamic scenes.
First, terms involved in the specification are explained:
1. Blueprints: the programming language built in the UE4 can logically package and secondarily process art assets such as models, maps, animations and the like so as to realize a certain specific function; the embodiment is realized on the basis of blueprints;
2. and (3) assembly: the officially encapsulated base class within the UE4 has a certain functionality. Such as a sound component, a video component, a camera component, an animation component, a spline component, etc.
3. Spline line: a manually editable curve, which can manually manipulate points on a spline to change its curve shape; in this embodiment, the army line is generated to allow the army to walk along the curve.
In one embodiment of the invention, the method for controlling a troop in a game may be executed on a local terminal or a server. For the understanding of the present embodiment, first, a method for controlling a troop team in a game disclosed in the present embodiment will be described in detail, as shown in fig. 1, and the method includes the following steps:
Step S102, creating a blueprint base class of a target team, and adding at least one sub-team component into the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the sub-teams form a target team according to a preset arrangement sequence;
The blueprint base class of the target team can realize the logical packaging and secondary processing of various object animation models, maps, animations and other art assets required by the target team, wherein the object animation models are character models capable of executing dynamic gestures, such as a soldier animation model for in-situ riding attack and an infantry animation model for in-situ running. The above-mentioned sub-team components correspond to the sub-teams in the target teams, and one sub-team component corresponds to the sub-teams, which may be a column, a row or a plurality of object animation models with a specified arrangement order, for example: a row of infantry animation models, or two rows of cavalier animation models. The target team may include one or more sub-teams, and the sub-teams are formed into the target team according to a preset arrangement sequence.
In the three-dimensional creation platform, different tools are needed to construct virtual scene elements, various object animation models, maps, animations and other art assets required by a target team can be prefabricated, then a blueprint base class of the target team is created, and a user can call the art assets through the blueprint base class and logically package and secondary process the art assets; further, adding an sub-team component into the blue-image base class, setting component parameters of the sub-team component, establishing a sub-team corresponding to the sub-team component, and controlling the performance state of the corresponding sub-team in the virtual scene by controlling the sub-team component.
In the step, a blueprint base class of the target team is created, and one or more sub-team components are added into the blueprint base class according to the construction requirement of the target team so as to realize the construction of the target team in the blueprint base class of the target team.
Step S104, acquiring first component parameters of the sub-team component, and generating a target team based on the first component parameters; wherein the first component parameter comprises one or more of: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team;
It may be understood that, in order to construct the sub-team, it is necessary to set an object arrangement parameter in the sub-team corresponding to the sub-team component, where the object arrangement parameter indicates an arrangement order of the object animation models and the number of the object animation models in the sub-team, and for example, the arrangement parameter may be set such that 5 character models are arranged in a row or a column at the same interval, and as follows: the arrangement parameters may be set such that character models are arranged in 1 row and 2 column at the same interval.
Considering that there may be a plurality of types of arms in the target team, such as hero arms, horseback arms, infantry arms, etc., further, the team type of the sub-team corresponding to the sub-team component may be set, and the team type of the sub-team in the sub-team component may be set as the type of arms required in the target team, for example: when the hero, the riding and the infantry are needed to exist in the target teams, the team types of the teams corresponding to the plurality of teams can be respectively set as the hero team type, the riding team type and the infantry type, and after the setting is completed, an object animation model matched with the team type is automatically obtained from the blueprint base class according to the team type of the teams to be used as a role model in the teams corresponding to the teams.
Further, since the target team composed of a plurality of sub-teams has a predetermined arrangement position between the sub-teams, the target team may be composed of a plurality of sub-teams having an arrangement order, by setting the position of the sub-teams corresponding to the sub-teams in the target team.
The first component parameters include one or more of a position of the sub-team corresponding to the sub-team component in the target team, a team type of the sub-team, and an object arrangement parameter in the sub-team, and the user may set the first component parameters of the sub-team component, and the first component parameters in different sub-team components may be the same or different, and according to the obtained first component parameters of the sub-team component, the target team is quickly generated through a blueprint base class of the target team and displayed in the virtual scene.
In the step, after one or more sub-team components are added in the blueprint base class of the target team, the object animation model can be called through the blueprint base class of the target team only according to the first component parameters by acquiring the first component parameters of the sub-team components, so that the target team with an arrangement sequence can be quickly generated in the virtual scene, and the editing efficiency of the target team is improved.
Step S106, adding spline components into the blueprint base class, and obtaining second component parameters of the spline components; wherein the second component parameter is for indicating: a movement path of the target team;
In the three-dimensional creation platform, spline lines are used as a tool for virtual scene elements, so that richer scene models can be drawn. And adding a spline assembly in the blueprint base class, wherein after the spline assembly is added, a spline appears in the virtual scene, the spline is a three-dimensional curve obtained by giving a group of position points, the three-dimensional curve can be positioned on the horizontal plane of the virtual scene, can be extended in a plurality of space directions, and parameters such as the length, the shape, the tangential direction of the position points and the like of the spline can be edited according to the positions of the position points required to update, so that the edited spline is obtained.
Here, the target team is controlled to move along the edited spline, and parameters such as the length, shape, tangential direction of the position point in the edited spline are used as second component parameters of the spline component to indicate the length and shape of the moving path of the target team and the team direction when the target team moves to the designated position, respectively.
And S108, controlling the target team to move according to the moving path through the spline line assembly.
The target team can be equally divided to two sides of the spline in the virtual scene, and the sub-team component is controlled to move according to the moving path indicated by the spline, so that the object animation model in the sub-team corresponding to the sub-team component moves according to the moving path.
Here, the target team moves in the virtual scene in the following manners:
In one mode, a moving path indicated by a spline can be controlled to be displayed on a horizontal plane with a designated height in a virtual scene, the sub-team component is controlled to move along the spline in the spline component, at the moment, an object animation model in the sub-team corresponding to the sub-team component always keeps moving on the horizontal line, and the moving display mode can be applied to a flight scene of a target team.
In one mode, when the target team is army, in order that the movement process presented by the team is more real, the object animation model needs to be controlled to move on the scene model surface of the virtual scene, so that a movement path is arranged on the horizontal plane of the virtual scene, the target team is controlled to move according to the movement path on the horizontal plane of the virtual scene, the vertical distance between the object animation model and the scene model surface can be obtained by calling a related function in the vertical direction perpendicular to the horizontal plane, the object animation model is controlled to shift in position on the movement path according to the vertical distance, and the object animation model is controlled to move on the scene model surface of the virtual scene.
The control method of the troops in the game comprises the steps of creating a blueprint base class of a target team, and adding at least one sub-team component into the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the sub-teams form a target team according to a preset arrangement sequence; acquiring first component parameters of the sub-team component, and generating a target team based on the first component parameters; wherein the first component parameter comprises one or more of: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team; adding spline components in the blueprint base class, and obtaining second component parameters of the spline components; wherein the second component parameter is for indicating: a movement path of the target team; and controlling the target team to move according to the moving path through the spline line component. In the method, at least one sub-team component and a spline component are added in a blueprint base class of a target team, the sub-team component corresponds to the sub-team in the target team, and the target team is generated according to component parameters such as the position of the sub-team corresponding to the sub-team component in the blueprint base class of the target team, the type of the sub-team, the object arrangement parameters in the sub-team and the like; and indicating the moving path of the target team according to the component parameters of the spline component, and controlling the target team to move according to the moving path through the spline component. According to the method, the target teams with the arrangement sequence can be generated by adding the sub teams components in the blueprint base class of the target teams and acquiring the component parameters of the sub teams components, and the target teams can be controlled to move according to the moving path through the spline line components, so that the labor cost for editing the marching teams is reduced, and the editing efficiency is improved.
The following embodiments provide specific implementations for generating a target team.
Determining a team type of the sub-team, and acquiring an object animation model matched with the team type; and adding the object animation model into the corresponding sub-team component of the sub-team, and displaying the object animation model based on the first component parameters to obtain the target team.
The object animation model refers to a character model capable of performing a dynamic gesture, such as a horseback riding animation model for in-situ horseback riding attack, and an infantry animation model for in-situ running.
According to the team type of the sub-team, acquiring an object animation model matched with the team type, for example, when the team type of the sub-team is a horseman, acquiring a horseman animation model of in-situ horseman attack from a blueprint base class of the target team; when the team type of the sub-team is infantry, acquiring an infantry animation model of running in situ from the blueprint base class of the target team. Here, the team type of the sub-team component in the blue-base class is sequentially determined, and an object animation model matched with the team type is acquired.
Further, the object animation model is added to the corresponding sub-team components of the sub-teams in sequence, and the object animation model is displayed in the virtual scene according to the component parameters and the like according to the position of the sub-teams corresponding to the sub-teams in the target teams, the team types of the sub-teams, the object arrangement parameters in the sub-teams and the like, so that the target teams are obtained.
Illustratively, an auxiliary team component added with an hero team type auxiliary team is set, and each auxiliary team corresponding to the auxiliary team component is a character animation model of 1 walking in situ; setting a sub-team component added with a riding team type sub-team, wherein each sub-team corresponding to the sub-team component is a row of 4 riding animation models of in-situ riding attack arranged according to the first object arrangement parameters; setting three sub-team components added with sub-teams of an infantry type, wherein the sub-teams corresponding to each sub-team component are an infantry animation model of 3 running in situ at the same interval, and further setting the sub-teams corresponding to the sub-teams of an hero type at the forefront of the target teams; setting the corresponding sub-teams of the team riding type at the back of the character animation model, setting the corresponding sub-teams of the team infantry type at the back of the target teams, and further rapidly obtaining the target teams shown in fig. 2 in the virtual scene.
The target team uses the object animation model, so that the target team can move and simultaneously add the motion gesture of the skeleton model of character or animal, and the motion process presented by the model is more real.
The following embodiments provide specific implementations for obtaining second component parameters for spline components.
Determining a spline starting point and a spline ending point corresponding to the spline component, and generating an initial spline between the spline starting point and the spline ending point; wherein the initial spline has an initial shape; determining a target point in the initial spline, and updating the position of the target point; updating the shape of the initial spline based on the position of the target point to obtain a first spline; the starting point of the first spline is a spline starting point, the end point of the first spline is a spline end point, and the first spline is a target point after being subjected to position updating; based on the first spline, second component parameters of the spline component are generated.
Adding a spline component in a blueprint base class, after setting spline starting points and spline ending points corresponding to the spline component by a user, generating an initial spline with an initial shape between the spline starting points and the spline ending points in a virtual scene, wherein the initial spline is provided with a plurality of position points, taking any position point as a target point, editing parameters such as the length, the shape, the tangential direction of the position points and the like of the spline by updating the position of the target point to obtain an edited spline, taking the edited spline as a first spline, taking the starting point of the first spline as a spline starting point, taking the end point of the first spline as a spline ending point, and saving the first spline to the spline component as the spline in the spline component after the position of the first spline is updated; a second component parameter of the spline component is generated from the first spline.
Here, the second component parameters include one or more of the following:
Spline length of the first spline; a first designated position in the first spline and a spline starting point, a distance length along the first spline; the first spline is in the tangential direction of the second appointed position; wherein, tangential direction is used for: and indicating a team orientation when the target team moves to the second designated location.
The first designated position and the second designated position may be positions corresponding to any position point on the first identical line, and the first designated position and the second designated position may be the same position.
Illustratively, the first spline is shown in fig. 3, and it can be understood that, after the first spline is edited, the length of the entire first spline can be obtained, where the length of the first spline is the length of the moving path; by triggering any position point on the first spline, such as a point Q1, the distance length between the point Q1 and the spline starting point Q0 along the first spline can be obtained, such as L1 in FIG. 3, so that a user can obtain the journey information in the moving process of the target team; the tangential direction of the first spline at the Q1 position can also be obtained by the second trigger operation, which is used to calculate the orientation of the target team when the target army walks along the spline to that point.
The following embodiments provide implementations in which a target team moves according to a movement path.
Controlling the sub-team component to move along the spline in the spline component so that the object animation model in the sub-team moves along the spline; wherein the spline indicates the movement path.
The spline in the spline assembly is the first spline.
When the sub-team component is a line of object animation model in actual implementation, each line of object animation model corresponding to each sub-team component can be equally divided to two sides of a spline line, the sub-team component starts from a movement starting point position corresponding to the sub-team component on the spline line by taking one sub-team component as a unit, the sub-team component moves for a certain distance from frame to frame along a time sequence, after the distance is moved, a corresponding coordinate position on the spline line is read, and a position under a world coordinate system to which the sub-team component needs to move is set according to the coordinate position, wherein the position under the world coordinate system is simply called the world position; the control sub-team component moves to the corresponding world position, so that the control sub-team component moves along the spline in the spline component from the movement starting point position. Further, after the world position of the sub-team component is obtained, the world position of each object animation model in the sub-team component under each world position can be obtained according to the object arrangement parameters in the sub-team corresponding to the sub-team component, and each object animation model corresponding to the sub-team component is controlled to move to the corresponding world position, so that the object animation models in the sub-team are controlled to move along the spline line.
In one manner, the manner in which the movement of the sub-team component is controlled may be determined with reference to the following:
obtaining a spline starting point in a spline assembly, and setting an initial value of a distance parameter; increasing the distance parameter according to the time sequence; and determining the component position of the sub-team component in the spline line based on the increased distance parameter and the spline starting point, and controlling the sub-team component to move to the component position.
After obtaining the spline starting point in the spline assembly, setting an initial value of a distance parameter, such as zero, determining an increment of the distance parameter of each frame according to the spline length of the first spline, starting from the initial value of the distance parameter, increasing the distance parameter frame by frame according to a time sequence to obtain an increased distance parameter corresponding to each frame, and then obtaining a coordinate position of the sub-team assembly on the spline according to the spline starting point coordinate and the increased distance parameter in each frame, wherein the coordinate in a world coordinate system corresponding to the coordinate position is the assembly position of the sub-team assembly in each frame, controlling the sub-team assembly to move to the assembly position, calculating the assembly position of the sub-team assembly frame by frame, and moving the sub-team assembly to the assembly position, so that the sub-assembly can move along the spline.
In the mode, the sub-team component is used as a unit, the sub-team component is controlled to move along the spline in the spline component, and then the object animation model in the sub-team can be driven to move along the spline, so that the moving path of each object animation model is not required to be set, and the editing efficiency of the marching team is improved.
In addition, when the spline line in the spline line assembly is used for driving the sub-team assembly, the double-precision floating point number is used, and the distance of the real moving path is continuously overlapped by taking the length of the spline line, namely the moving path as a parameter, so that each object animation model in the sub-team assembly can be driven along the spline line more accurately.
It should be noted that, because there may be a plurality of sub-teams in the target teams, and a preset arrangement sequence is provided between the plurality of sub-teams, so that the target teams have a certain length, the movement start points of the sub-teams corresponding to each sub-teams are different, and the deviation value between each sub-teams and the spline start point needs to be stored in an array, so as to ensure that each sub-teams has a certain front-back distance during movement.
Specifically, determining a component starting point position of the sub-team component based on the spline starting point and the position of the sub-team corresponding to the sub-team component in the target team; based on the increased distance parameter and the component start position, a component position of the sub-team component is determined in the spline.
The component starting point position is the movement starting point of the sub-team component, and the movement starting point is the world position of the position point on the spline line.
That is, the component start position of the sub-team component is determined according to the spline start point and the position of the sub-team component in the corresponding sub-team in the target team, and for example, the component start position of the sub-team component corresponding to the last sub-team in the target team may be determined as the world position of the spline start point, and the component start position of each sub-team component in the target team is determined according to the position of the sub-team component corresponding to the sub-team in the target team in the first component parameter of the sub-team component.
Further, the distance parameters and the component starting point positions after the distance parameters and the component starting point positions are increased, the component positions of each sub-team component are determined in a spline line, each sub-team component is controlled to move to the corresponding component position, so that the object animation models in all the sub-teams start to move simultaneously, the front and back distances are kept consistent, and the whole target teams move along the spline line.
It should be noted that, the spline line may be set at a specified height in the virtual scene, and in the process of moving the object animation model along the spline line, the bottom of the object animation model is always leveled with the spline line, and considering that scene models such as hillsides and canyons may exist in the virtual scene, so that the terrain is rugged and has a certain gradient or concave degree.
Specifically, the moving path is located on the horizontal plane of the virtual scene, and the control target team moves according to the moving path on the horizontal plane of the virtual scene; in the vertical direction perpendicular to the horizontal plane, acquiring the vertical distance between the object animation model in the target team and the scene model surface of the virtual scene; and controlling the object animation model to shift in the vertical direction according to the vertical distance by taking the horizontal plane as a reference so as to control the object animation model to move on the scene model surface of the virtual scene.
The vertical distance between the object animation model and the scene model surface of the virtual scene may be obtained by a ray-based detection, where the ray detection is provided by the UE4 platform engine with a functional interface, and the vertical distance is determined by invoking a ray detection function. Specifically, taking a single object animation model as an example, calling LinearTraceByChannel functions from the position of the object animation model to emit a ray to the scene model, wherein the ray length is 1000 meters, generating collision coordinates after the ray collides with the scene model surface of the virtual scene, calculating the distance between the object animation model and the collision coordinates, and obtaining the vertical distance between the object animation model and the scene model surface of the virtual scene.
Here, the movement path indicated by the spline line is located on the horizontal plane of the virtual scene, and the control target team moves according to the movement path on the horizontal plane of the virtual scene; in the vertical direction perpendicular to the horizontal plane, acquiring the vertical distance between the object animation model in the target team and the scene model surface of the virtual scene by calling a ray detection function; then, the position of the object animation model is adjusted by using SetWorldPosition functions, and the object animation model is controlled to shift in the vertical direction according to the vertical distance based on the horizontal plane, so that the object animation model moves on the scene model surface of the virtual scene, as shown in fig. 4.
Through the mode, the effect of walking of the target teams on the ground can be achieved, and the moving process presented by the teams is more real.
In another mode, when the target team is an air force army, the moving path indicated by the spline can be controlled to be displayed on the horizontal plane with the designated height in the virtual scene, the sub-team components in the target team are controlled to move along the spline in the spline components, and at the moment, the object animation model in the sub-team corresponding to the sub-team components always keeps moving on the horizontal line, and the moving display mode can be applied to the flight scene of the target team.
In another embodiment, a state switching position point may be provided on the moving path, and when the target team reaches the state switching position point, the display state of the target team may be switched. The method can be used for a river crossing scene of a team, for example, when a river appears on a moving route, a target team needs a water way, and when the target team walks to a ferry position, the target team can be hidden and switched into a model of a river crossing tool to be displayed after crossing the river.
Specifically, the second component parameters of the spline component further include: the positions of the first state switching position point and the second state switching position point on the moving path; determining that the target team moves to a first state switching position point, hiding and displaying the target team, and displaying a first animation model corresponding to the first state switching position point; controlling the first animation model to move along the moving path from the first state switching position point; and determining that the first animation model moves to the second state switching position point, hiding and displaying the first animation model, and displaying the target team.
The first state switching position point is a position point for hiding and displaying a target team, and can be a ferry starting position in a team river crossing scene; the second state switching position point is a position point for displaying a target team, and may be a ferry ending position in a team river crossing scene; the first animation model is a tool model driven by a target team, and can be a ship model in a team river-crossing scene.
Taking a team river crossing scene as an example, adding a first state switching position point and a second state switching position point on a spline line, manually adjusting the positions of the two state switching position points, taking the position of the first state switching position point as the starting position of a ferry, and taking the position of the first state switching position point as the ending position of the ferry. The method comprises the steps of calculating the component position of a component of a front-most sub-team of a target team in real time, determining that the target team moves to a first state switching position point when the component position is the same as the world position of the first state switching position point, hiding the target team, switching the first state switching position point to a ship model, controlling the ship model to move along a moving path indicated by a spline line from the first state switching position point, and when the ship model position reaches a second state switching position point, driving out a river from a ship in a virtual scene to reach a ferry ending position at the moment, displaying object animation models in the target team one by one, displaying the target team, and simulating the login effect of the target team.
In one mode, on the basis of the control method of the troops in the game, one-key switching UI (Uesr Interface, user interface) logic can be developed, so that the work efficiency of artistic personnel in the game development is greatly improved.
Here, in the three-dimensional authoring platform such as the illusion engine UE4 and Maya, a blueprint base class corresponding to a plurality of target teams may be created, each target team has a corresponding sub-team component and a moving route, and a scene in which the plurality of target teams move along the moving route is displayed in the virtual scene. Here, the one-key switching UI logic may be developed, a UI control is displayed in a graphical user interface where a virtual scene screen is located on the terminal device, a user may quickly select a target team name or a moving route through the UI control, a scene that a target team corresponding to the team name moves along the moving route corresponding to the target team is displayed in the virtual scene, and the scene is consistent with an in-game effect, so that a development flow is greatly reduced.
Specifically, a user creates a plurality of target teams and moving routes of the target teams, wherein the moving routes of the plurality of target teams can be the same or different, a build up the Army team blueprint is created in an illusion engine, when the user selects a team name through a UI control, the user selected team name can be received in the army blueprint, then unnecessary teams are hidden through a Visibility function, only a scene that the target teams selected by the user move along the corresponding moving routes is displayed in a virtual scene, and a scene picture where the target teams are located is displayed on a terminal device.
In a further mode, a camera component is created in the illusion engine, a army camera component is added in the blue picture base class of each target team, the army camera always moves along with the team, when the target team is not switched, a user can randomly adjust the visual angle of the camera and display content corresponding to the visual angle of the camera on the terminal device, after the user selects the corresponding target team through the UI control, the army camera component in the blue picture base class of the target team is read according to the team name of the target team, then the user switches to the army camera through the SetViewTargetWithBlend function, the visual angle of the camera jumps to the visual angle of the army camera, and the content corresponding to the army camera is displayed on the user interface, so that the visual angle following is realized.
The editing mode reduces the labor cost spent by editing the troops, improves the editing efficiency, can help the artistic staff to check the troops's effect in the game under the multi-camera visual angle by rapidly switching the functions of the target troops, the visual angle and the like through the UI, so as to verify the ideas, and greatly reduces the development flow.
In accordance with an embodiment of the above method, and referring to fig. 5, there is shown a schematic diagram of a control apparatus for a game play team, the apparatus comprising:
A first creating module 502, configured to create a blueprint base class of a target team, and add at least one sub-team component in the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the team members form the target team members according to a preset arrangement sequence;
A first generating module 504, configured to obtain a first component parameter of the sub-team component, and generate a target team based on the first component parameter; wherein the first component parameter comprises one or more of: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team;
a first obtaining module 506, configured to add spline components to the blueprint base class, and obtain second component parameters of the spline components; wherein the second component parameter is for indicating: a movement path of the target team;
a first control module 508 for controlling the movement of the target team according to the movement path through the spline assembly.
In the method, at least one sub-team component and a spline component are added in a blueprint base class of a target team, the sub-team component corresponds to the sub-team in the target team, and the target team is generated according to component parameters such as the position of the sub-team corresponding to the sub-team component in the blueprint base class of the target team, the type of the sub-team, the object arrangement parameters in the sub-team and the like; and indicating the moving path of the target team according to the component parameters of the spline component, and controlling the target team to move according to the moving path through the spline component. According to the method, the target teams with the arrangement sequence can be generated by adding the sub teams components in the blueprint base class of the target teams and acquiring the component parameters of the sub teams components, and the target teams can be controlled to move according to the moving path through the spline line components, so that the labor cost for editing the marching teams is reduced, and the editing efficiency is improved.
The first generation module is further used for determining a team type of the sub-team and acquiring an object animation model matched with the team type; and adding the object animation model into the corresponding sub-team component of the sub-team, and displaying the object animation model based on the first component parameters to obtain the target team.
The first obtaining module is further configured to determine a spline starting point and a spline ending point corresponding to the spline assembly, and generate an initial spline between the spline starting point and the spline ending point; wherein the initial spline has an initial shape; determining a target point in the initial spline, and updating the position of the target point; updating the shape of the initial spline based on the position of the target point to obtain a first spline; the starting point of the first spline is a spline starting point, the end point of the first spline is a spline end point, and the first spline is a target point after being subjected to position updating; based on the first spline, second component parameters of the spline component are generated.
The second component parameters include one or more of the following: spline length of the first spline; a first designated position in the first spline and a spline starting point, a distance length along the first spline; the first spline is in the tangential direction of the second appointed position; wherein, tangential direction is used for: and indicating a team orientation when the target team moves to the second designated location.
The first control module is further configured to control the sub-team component to move along a spline in the spline component, so that the object animation model in the sub-team moves along the spline; wherein spline lines indicate the movement paths.
The device further comprises a second control module, a first control module and a second control module, wherein the second control module is used for acquiring spline starting points in the spline assembly and setting initial values of distance parameters; increasing the distance parameter according to the time sequence; and determining the component position of the sub-team component in the spline line based on the increased distance parameter and the spline starting point, and controlling the sub-team component to move to the component position.
The device further comprises a first determining module, a second determining module and a third determining module, wherein the first determining module is used for determining the component starting point position of the sub-team component based on the spline starting point and the position of the sub-team component in the corresponding sub-team in the target team; based on the increased distance parameter and the component start position, a component position of the sub-team component is determined in the spline.
The moving path is positioned on the horizontal plane of the virtual scene; the first control module is also used for controlling the target team to move according to the moving path on the horizontal plane of the virtual scene; in the vertical direction perpendicular to the horizontal plane, acquiring the vertical distance between the object animation model in the target team and the scene model surface of the virtual scene; and controlling the object animation model to shift in the vertical direction according to the vertical distance by taking the horizontal plane as a reference so as to control the object animation model to move on the scene model surface of the virtual scene.
The second component parameters include: the positions of the first state switching position point and the second state switching position point on the moving path; the device also comprises a first display module, a second display module and a first animation model, wherein the first display module is used for determining that the target team moves to a first state switching position point, hiding and displaying the target team, and displaying the first animation model corresponding to the first state switching position point; controlling the first animation model to move along the moving path from the first state switching position point; and determining that the first animation model moves to the second state switching position point, hiding and displaying the first animation model, and displaying the target team.
The embodiment also provides an electronic device including a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the method for controlling a marching team in a game. The electronic device may be a server or a terminal device.
Referring to fig. 6, the electronic device includes a processor 100 and a memory 101, the memory 101 storing machine executable instructions executable by the processor 100, the processor 100 executing the machine executable instructions to implement the above-described method of controlling a marching team in a game.
Further, the electronic device shown in fig. 6 further includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103, and the memory 101 are connected through the bus 102. The memory 101 may include a high-speed random access memory (RAM, random Access Memory), and may further include a non-volatile memory (non-volatile memory), such as at least one disk memory. The communication connection between the system network element and at least one other network element is implemented via at least one communication interface 103 (which may be wired or wireless), and may use the internet, a wide area network, a local network, a metropolitan area network, etc. Bus 102 may be an ISA bus, a PCI bus, an EISA bus, or the like. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 6, but not only one bus or type of bus. The processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 100 or by instructions in the form of software. The processor 100 may be a general-purpose processor, including a central processing unit (Central Processing Unit, abbreviated as CPU), a network processor (Network Processor, abbreviated as NP), etc.; but may also be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application Specific Integrated Circuit (ASIC), field-Programmable gate array (FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and, in combination with its hardware, performs the steps of the method of the previous embodiment.
The processor in the electronic device may implement the following operations of the method for controlling a march in a game by executing machine executable instructions: creating a blueprint base class of a target team, and adding at least one sub-team component in the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the team members form the target team members according to a preset arrangement sequence; acquiring first component parameters of the sub-team component, and generating a target team based on the first component parameters; wherein the first component parameter comprises one or more of: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team; adding spline components in the blueprint base class, and obtaining second component parameters of the spline components; wherein the second component parameter is for indicating: a movement path of the target team; for controlling the target team to move according to the movement path through the spline assembly.
In the method, at least one sub-team component and a spline component are added in a blueprint base class of a target team, the sub-team component corresponds to the sub-team in the target team, and the target team is generated according to component parameters such as the position of the sub-team corresponding to the sub-team component in the blueprint base class of the target team, the type of the sub-team, the object arrangement parameters in the sub-team and the like; and indicating the moving path of the target team according to the component parameters of the spline component, and controlling the target team to move according to the moving path through the spline component. According to the method, the target teams with the arrangement sequence can be generated by adding the sub teams components in the blueprint base class of the target teams and acquiring the component parameters of the sub teams components, and the target teams can be controlled to move according to the moving path through the spline line components, so that the labor cost for editing the marching teams is reduced, and the editing efficiency is improved.
The processor in the electronic device may implement the following operations of the method for controlling a march in a game by executing machine executable instructions: determining a team type of the sub-team, and acquiring an object animation model matched with the team type; and adding the object animation model into the corresponding sub-team component of the sub-team, and displaying the object animation model based on the first component parameters to obtain the target team.
The processor in the electronic device may implement the following operations of the method for controlling a march in a game by executing machine executable instructions: determining a spline starting point and a spline ending point corresponding to the spline component, and generating an initial spline between the spline starting point and the spline ending point; wherein the initial spline has an initial shape; determining a target point in the initial spline, and updating the position of the target point; updating the shape of the initial spline based on the position of the target point to obtain a first spline; the starting point of the first spline is a spline starting point, the end point of the first spline is a spline end point, and the first spline is a target point after being subjected to position updating; based on the first spline, second component parameters of the spline component are generated.
The second component parameters include one or more of the following: spline length of the first spline; a first designated position in the first spline and a spline starting point, a distance length along the first spline; the first spline is in the tangential direction of the second appointed position; wherein, tangential direction is used for: and indicating a team orientation when the target team moves to the second designated location.
The processor in the electronic device may implement the following operations of the method for controlling a march in a game by executing machine executable instructions: controlling the sub-team component to move along the spline in the spline component so that the object animation model in the sub-team moves along the spline; wherein spline lines indicate the movement paths.
The processor in the electronic device may implement the following operations of the method for controlling a march in a game by executing machine executable instructions: obtaining a spline starting point in a spline assembly, and setting an initial value of a distance parameter; increasing the distance parameter according to the time sequence; and determining the component position of the sub-team component in the spline line based on the increased distance parameter and the spline starting point, and controlling the sub-team component to move to the component position.
The processor in the electronic device may implement the following operations of the method for controlling a march in a game by executing machine executable instructions: determining a component start position of the sub-team component based on the spline start point and the position of the sub-team component in the corresponding sub-team in the target team; based on the increased distance parameter and the component start position, a component position of the sub-team component is determined in the spline.
The moving path is positioned on the horizontal plane of the virtual scene; the processor in the electronic device may implement the following operations of the method for controlling a march in a game by executing machine executable instructions: on the horizontal plane of the virtual scene, the target team is controlled to move according to the moving path; in the vertical direction perpendicular to the horizontal plane, acquiring the vertical distance between the object animation model in the target team and the scene model surface of the virtual scene; and controlling the object animation model to shift in the vertical direction according to the vertical distance by taking the horizontal plane as a reference so as to control the object animation model to move on the scene model surface of the virtual scene.
The second component parameters include: the positions of the first state switching position point and the second state switching position point on the moving path; the processor in the electronic device may implement the following operations of the method for controlling a march in a game by executing machine executable instructions: determining that the target team moves to a first state switching position point, hiding and displaying the target team, and displaying a first animation model corresponding to the first state switching position point; controlling the first animation model to move along the moving path from the first state switching position point; and determining that the first animation model moves to the second state switching position point, hiding and displaying the first animation model, and displaying the target team.
The present embodiment also provides a machine-readable storage medium storing machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method of controlling a marching team in a game described above.
The machine-executable instructions stored on the machine-readable storage medium may be executed to implement the following operations in the method for controlling a troop in a game: creating a blueprint base class of a target team, and adding at least one sub-team component in the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the team members form the target team members according to a preset arrangement sequence; acquiring first component parameters of the sub-team component, and generating a target team based on the first component parameters; wherein the first component parameter comprises one or more of: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team; adding spline components in the blueprint base class, and obtaining second component parameters of the spline components; wherein the second component parameter is for indicating: a movement path of the target team; for controlling the target team to move according to the movement path through the spline assembly.
In the method, at least one sub-team component and a spline component are added in a blueprint base class of a target team, the sub-team component corresponds to the sub-team in the target team, and the target team is generated according to component parameters such as the position of the sub-team corresponding to the sub-team component in the blueprint base class of the target team, the type of the sub-team, the object arrangement parameters in the sub-team and the like; and indicating the moving path of the target team according to the component parameters of the spline component, and controlling the target team to move according to the moving path through the spline component. According to the method, the target teams with the arrangement sequence can be generated by adding the sub teams components in the blueprint base class of the target teams and acquiring the component parameters of the sub teams components, and the target teams can be controlled to move according to the moving path through the spline line components, so that the labor cost for editing the marching teams is reduced, and the editing efficiency is improved.
The machine-executable instructions stored on the machine-readable storage medium may be executed to implement the following operations in the method for controlling a troop in a game: determining a team type of the sub-team, and acquiring an object animation model matched with the team type; and adding the object animation model into the corresponding sub-team component of the sub-team, and displaying the object animation model based on the first component parameters to obtain the target team.
The machine-executable instructions stored on the machine-readable storage medium may be executed to implement the following operations in the method for controlling a troop in a game: determining a spline starting point and a spline ending point corresponding to the spline component, and generating an initial spline between the spline starting point and the spline ending point; wherein the initial spline has an initial shape; determining a target point in the initial spline, and updating the position of the target point; updating the shape of the initial spline based on the position of the target point to obtain a first spline; the starting point of the first spline is a spline starting point, the end point of the first spline is a spline end point, and the first spline is a target point after being subjected to position updating; based on the first spline, second component parameters of the spline component are generated.
The second component parameters include one or more of the following: spline length of the first spline; a first designated position in the first spline and a spline starting point, a distance length along the first spline; the first spline is in the tangential direction of the second appointed position; wherein, tangential direction is used for: and indicating a team orientation when the target team moves to the second designated location.
The machine-executable instructions stored on the machine-readable storage medium may be executed to implement the following operations in the method for controlling a troop in a game: controlling the sub-team component to move along the spline in the spline component so that the object animation model in the sub-team moves along the spline; wherein spline lines indicate the movement paths.
The machine-executable instructions stored on the machine-readable storage medium may be executed to implement the following operations in the method for controlling a troop in a game: obtaining a spline starting point in a spline assembly, and setting an initial value of a distance parameter; increasing the distance parameter according to the time sequence; and determining the component position of the sub-team component in the spline line based on the increased distance parameter and the spline starting point, and controlling the sub-team component to move to the component position.
The machine-executable instructions stored on the machine-readable storage medium may be executed to implement the following operations in the method for controlling a troop in a game: determining a component start position of the sub-team component based on the spline start point and the position of the sub-team component in the corresponding sub-team in the target team; based on the increased distance parameter and the component start position, a component position of the sub-team component is determined in the spline.
The moving path is positioned on the horizontal plane of the virtual scene; the machine-executable instructions stored on the machine-readable storage medium may be executed to implement the following operations in the method for controlling a troop in a game: on the horizontal plane of the virtual scene, the target team is controlled to move according to the moving path; in the vertical direction perpendicular to the horizontal plane, acquiring the vertical distance between the object animation model in the target team and the scene model surface of the virtual scene; and controlling the object animation model to shift in the vertical direction according to the vertical distance by taking the horizontal plane as a reference so as to control the object animation model to move on the scene model surface of the virtual scene.
The second component parameters include: the positions of the first state switching position point and the second state switching position point on the moving path; the machine-executable instructions stored on the machine-readable storage medium may be executed to implement the following operations in the method for controlling a troop in a game: determining that the target team moves to a first state switching position point, hiding and displaying the target team, and displaying a first animation model corresponding to the first state switching position point; controlling the first animation model to move along the moving path from the first state switching position point; and determining that the first animation model moves to the second state switching position point, hiding and displaying the first animation model, and displaying the target team.
The computer program product of the control method, the control device and the electronic device for a troop in a game provided by the embodiment of the invention comprises a computer readable storage medium storing program codes, wherein the instructions included in the program codes can be used for executing the method described in the method embodiment, and specific implementation can be referred to the method embodiment and will not be repeated here.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again.
In addition, in the description of embodiments of the present invention, unless explicitly stated and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention will be understood by those skilled in the art in specific cases.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention for illustrating the technical solution of the present invention, but not for limiting the scope of the present invention, and although the present invention has been described in detail with reference to the foregoing examples, it will be understood by those skilled in the art that the present invention is not limited thereto: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (12)

1. A method of controlling a troop in a game, the method comprising:
Creating a blueprint base class of a target team, and adding at least one sub-team component into the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the sub-teams form the target teams according to a preset arrangement sequence;
Acquiring first component parameters of the sub-team component, and generating the target team based on the first component parameters; wherein the first component parameter comprises one or more of the following: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team;
adding a spline component into the blue graph base class, and obtaining a second component parameter of the spline component; wherein the second component parameter is for indicating: a movement path of the target team;
And controlling the target team to move according to the moving path through the spline line component.
2. The method of claim 1, wherein generating the target team based on the first component parameter comprises:
Determining a team type of the sub-team, and acquiring an object animation model matched with the team type;
And adding the object animation model into a corresponding sub-team component of the sub-team, and displaying the object animation model based on the first component parameter to obtain the target team.
3. The method of claim 1, wherein the step of obtaining second component parameters of the spline component comprises:
determining a spline starting point and a spline ending point corresponding to the spline component, and generating an initial spline between the spline starting point and the spline ending point; wherein the initial spline has an initial shape;
determining a target point in the initial spline, and updating the position of the target point; updating the shape of the initial spline based on the position of the target point to obtain a first spline; the starting point of the first spline is the starting point of the spline, the end point of the first spline is the end point of the spline, and the first spline passes through the target point after the position is updated;
Generating second component parameters of the spline component based on the first spline.
4. A method according to claim 3, wherein the second component parameters comprise one or more of the following:
spline length of the first spline;
a first designated position in the first spline line and the spline line starting point, along the distance length of the first spline line;
the first spline is in the tangential direction of the second appointed position; wherein the tangential direction is for: and indicating a team orientation when the target team moves to the second designated location.
5. The method of claim 1, wherein the step of controlling the target team to move according to the travel path via the spline assembly comprises:
controlling the sub-team component to move along a spline in the spline component so as to enable an object animation model in the sub-team to move along the spline; wherein the spline indicates the movement path.
6. The method of claim 5, wherein the step of controlling the sub-team component to move along a spline in the spline component comprises:
acquiring a spline starting point in the spline assembly, and setting an initial value of a distance parameter;
Increasing the distance parameter according to time sequence; and determining the component position of the sub-team component in the spline line based on the increased distance parameter and the spline starting point, and controlling the sub-team component to move to the component position.
7. The method of claim 6, wherein determining the component position of the sub-team component in the spline based on the incremented distance parameter and the spline starting point comprises:
Determining a component start position of the sub-team component based on the spline start and the position of the sub-team component in the corresponding sub-team in the target team;
and determining the component position of the sub-team component in the spline line based on the increased distance parameter and the component starting point position.
8. The method of claim 1, wherein the movement path is located at a level of a virtual scene; the step of controlling the target team to move according to the movement path includes:
Controlling the target team to move according to the moving path on the horizontal plane of the virtual scene;
In a vertical direction perpendicular to the horizontal plane, acquiring a vertical distance between an object animation model in the target team and a scene model surface of the virtual scene;
And taking the horizontal plane as a reference, controlling the object animation model to shift in the vertical direction according to the vertical distance so as to control the object animation model to move on the scene model surface of the virtual scene.
9. The method according to claim 1, wherein the second component parameters include: the positions of the first state switching position point and the second state switching position point on the moving path; the method further comprises the steps of:
Determining that the target team moves to the first state switching position point, hiding and displaying the target team, and displaying a first animation model corresponding to the first state switching position point;
controlling the first animation model to move along the moving path from the first state switching position point;
and determining that the first animation model moves to the second state switching position point, hiding and displaying the first animation model, and displaying the target team.
10. A control device for a troop in a game, the device comprising:
The first creation module is used for creating a blueprint base class of a target team and adding at least one sub-team component into the blueprint base class; wherein the sub-team component corresponds to a sub-team in the target team; the sub-teams form the target teams according to a preset arrangement sequence;
The first generation module is used for acquiring first component parameters of the sub-team component and generating the target team based on the first component parameters; wherein the first component parameter comprises one or more of the following: the position of the corresponding sub-team in the target team, the type of the sub-team and the object arrangement parameters in the sub-team;
the first acquisition module is used for adding a spline component into the blue-image base class and acquiring a second component parameter of the spline component; wherein the second component parameter is for indicating: a movement path of the target team;
And the first control module is used for controlling the target team to move according to the moving path through the spline assembly.
11. An electronic device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement the method of controlling a marching team in a game of any of claims 1-9.
12. A machine-readable storage medium storing machine-executable instructions which, when invoked and executed by a processor, cause the processor to implement the method of controlling a marching team in a game of any of claims 1-9.
CN202410160166.3A 2024-02-03 2024-02-03 Control method and device for troops in game and electronic equipment Pending CN118179031A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410160166.3A CN118179031A (en) 2024-02-03 2024-02-03 Control method and device for troops in game and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410160166.3A CN118179031A (en) 2024-02-03 2024-02-03 Control method and device for troops in game and electronic equipment

Publications (1)

Publication Number Publication Date
CN118179031A true CN118179031A (en) 2024-06-14

Family

ID=91391962

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410160166.3A Pending CN118179031A (en) 2024-02-03 2024-02-03 Control method and device for troops in game and electronic equipment

Country Status (1)

Country Link
CN (1) CN118179031A (en)

Similar Documents

Publication Publication Date Title
JP5887458B1 (en) A game system for searching for a route of a non-player character based on a player's movement history
CN112862935B (en) Game role movement processing method and device, storage medium and computer equipment
US6961055B2 (en) Methods and apparatus for constructing virtual environments
US20050266921A1 (en) Image processing program, game processing program and game information processing apparatus
CN112717404B (en) Virtual object movement processing method and device, electronic equipment and storage medium
CN110141862B (en) Method and device for mobile control in game, electronic equipment and storage medium
JP2010068872A (en) Program, information storage medium and game device
CN112090078B (en) Game character movement control method, device, equipment and medium
CN113244603A (en) Information processing method and device and terminal equipment
CN112121417B (en) Event processing method, device, equipment and storage medium in virtual scene
CN111729311A (en) Climbing jump method and device, computer equipment and computer readable storage medium
CN113244619B (en) Data processing method, device, equipment and storage medium
US20050159216A1 (en) Simulation game system and method thereof integrating geographical information
CN113082719A (en) Three-dimensional virtual scene path finding method and device and electronic equipment
CN118179031A (en) Control method and device for troops in game and electronic equipment
JP2012247953A (en) Program, information storage medium, information processing system and information processing method
Adegun et al. Design and implementation of an intelligent gaming agent using A* algorithm and finite state machines
JP2005245525A (en) Image display program and information processing device
Davar et al. Virtual generation of lidar data for autonomous vehicles
JP5784985B2 (en) Program, information storage medium, information processing system, and information processing method
CN116385273B (en) Method, system and storage medium for moving points in stepping panoramic roaming
CN110314377B (en) Method and device for randomly generating object moving path in three-dimensional space
JP5396432B2 (en) Program, information storage medium, information processing system, and information processing method
CN116251349A (en) Method and device for prompting target position in game and electronic equipment
CN115512052A (en) Road scene generation method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination