CN111773725B - Space creation method and device - Google Patents

Space creation method and device Download PDF

Info

Publication number
CN111773725B
CN111773725B CN202010803956.0A CN202010803956A CN111773725B CN 111773725 B CN111773725 B CN 111773725B CN 202010803956 A CN202010803956 A CN 202010803956A CN 111773725 B CN111773725 B CN 111773725B
Authority
CN
China
Prior art keywords
vector
point
virtual object
exit
extension
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.)
Active
Application number
CN202010803956.0A
Other languages
Chinese (zh)
Other versions
CN111773725A (en
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 CN202010803956.0A priority Critical patent/CN111773725B/en
Publication of CN111773725A publication Critical patent/CN111773725A/en
Application granted granted Critical
Publication of CN111773725B publication Critical patent/CN111773725B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/57Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game
    • A63F13/577Simulating properties, behaviour or motion of objects in the game world, e.g. computing tyre load in a car race game using determination of contact between game characters or objects, e.g. to avoid collision between virtual racing cars
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The application provides a space creation method and device, comprising the following steps: responding to a space skill release request sent by the terminal equipment, and generating a test vector according to the position and the orientation of a game role in a game scene; determining collision points of the test vectors on the virtual object side to generate entry creation information of an entry space on the virtual object side according to the collision points; generating an extension vector according to the test vector; determining a collision point of the extension vector on the other side of the virtual object to generate exit creation information of the exit space on the other side of the virtual object according to the collision point; the entry creation information and the exit creation information are synchronized to the terminal device such that the terminal device creates an entry space on one side of the virtual object according to the entry creation information and creates an exit space on the other side of the virtual object according to the exit creation information. The embodiment of the application reduces the working intensity of the developer, is applicable to static and dynamic game scenes, and has a very wide application range.

Description

Space creation method and device
Technical Field
The present application relates to the field of internet technologies, and in particular, to a space creation method and apparatus.
Background
There are many physical system-based skills in current game mechanisms, such as spatial skills that disrupt or traverse virtual objects in front of the game character being played by the player. According to the position and the orientation of the game character, a virtual object is taken as a wall example to generate one door on the wall in front of the game character, and the other corresponding door is obtained on the other side of the wall, and the space between the two doors is communicated, so that the game character can move from any door to the other door.
The generation scheme of the two common doors at present is as follows: scheme 1: the method comprises the steps of voxelizing a game scene, cutting the game scene into a plurality of grids, configuring configuration data (width of each grid, through-wall grids corresponding to each grid and the like) corresponding to each grid by a planner, for example, aiming at a static wall, acquiring grids occupied by each wall and corresponding through-wall grids, and calculating boundaries of the wall according to the configuration data corresponding to the grids to obtain positions of two doors and generate the two doors. Scheme 2: the planner and the artist cooperate to cut and configure configuration data for each wall in the game scene, wherein the configuration data includes an identification name, a length, a width, a height, a center point, and the like. And determining the wall through physical rays in the game, and then acquiring corresponding configuration data according to the identification name of the wall, wherein the configuration data are used for obtaining the positions of the two doors and generating the positions.
However, the above scheme 1 obtains the configuration data of the wall occupied grid which is not fine, the cutting fineness of the grid influences the position of the door generation, and the scheme 2 solves the problem that the configuration data of the wall occupied grid is not fine, but a planner is required to configure the configuration data of each wall, meanwhile, the fine arts staff is required to cut each wall into a single model for processing, so that the workload is greatly increased, and the two schemes can only be applied to static walls in a game scene, and are difficult to work on the walls dynamically generated in the game. It can be seen that the release of current spatial skills depends on static game scenarios and configuration data of virtual objects.
Disclosure of Invention
The embodiment of the application provides a space creation method to solve the problem that the release of space skills in the prior art depends on static game scenes and configuration data of virtual objects.
Correspondingly, the embodiment of the application also provides a space creation device which is used for guaranteeing the implementation and application of the method.
In order to solve the above problems, the present application discloses a space creation method, which includes:
responding to a space skill release request sent by the terminal equipment, and generating a test vector according to the position and the orientation of a game role in a game scene;
Determining collision points of the test vectors on the virtual object side in the game scene to generate entry creation information of an entry space on the virtual object side according to the collision points;
generating an extension vector according to the test vector;
determining a collision point of the extension vector on the other side of the virtual object to generate exit creation information of an exit space on the other side of the virtual object according to the collision point;
synchronizing the entry creation information and the exit creation information to the terminal device such that the terminal device creates an entry space on one side of the virtual object according to the entry creation information and creates an exit space on the other side of the virtual object according to the exit creation information.
Optionally, the generating the test vector quantity according to the position and the orientation of the game character in the game scene includes:
acquiring the position and the orientation of a game role in a game scene;
generating a horizontal vector corresponding to the orientation in the horizontal direction in the game scene;
generating a first vector in the direction of the horizontal vector, generating a second vector in the direction of the horizontal vector deviating to the left by a first preset angle, and generating a third vector in the direction of the horizontal vector deviating to the right by the first preset angle, with the position as a starting point.
Optionally, the determining a collision point of the test vector on the virtual object side in the game scene to generate entry creation information of an entry space on the virtual object side according to the collision point includes:
acquiring a first collision point of the first vector on the virtual object side, a second collision point of the second vector on the virtual object side, and a third collision point of the third vector on the virtual object side;
generating an intermediate vector based on the second collision point and the third collision point to determine an entry orientation vector from the intermediate vector;
and organizing the first collision point as an entry position point and the entry orientation vector into entry creation information of an entry space on the virtual object side.
Optionally, the generating an intermediate vector based on the second collision point and the third collision point to determine an entry orientation vector from the intermediate vector includes:
generating a fourth vector in the horizontal direction in the game scene with the third collision point as a starting point and the second collision point as an end point;
Generating a fifth vector in a direction of the fourth vector deviating from the second preset angle to the left, and generating a sixth vector in a direction of the fourth vector deviating from the second preset angle to the right;
performing dot multiplication on the sixth vector and the first vector to obtain an inner product value;
when the inner product value is greater than or equal to zero, the sixth vector is taken as an inlet orientation vector;
and when the inner product value is smaller than zero, taking the fifth vector as an inlet orientation vector.
Optionally, the generating an extension vector according to the test vector includes:
generating an extension vector in the direction of the inlet orientation vector based on a preset length and by taking the inlet position point as a starting point, wherein the end point of the extension vector is an extension point.
Optionally, the determining the collision point of the extension vector on the other side of the virtual object to generate the exit creation information of the exit space on the other side of the virtual object according to the collision point includes:
determining an exit location point on the other side of the virtual object from the extension vector;
generating a vector perpendicular to the other side of the virtual object as an outlet orientation vector; the vector included angle between the outlet orientation vector and the inlet orientation vector is greater than or equal to 90 degrees;
The exit position points and the exit orientation vectors are organized to create information for the exits of the exit space on the other side of the virtual object.
Optionally, the determining an exit position point on the other side of the virtual object according to the extension vector includes:
determining whether the extension vector has a fourth collision point on the virtual object;
when the fourth collision point does not exist, prompting that space creation fails;
generating a new extension vector in the direction of the entry facing vector based on a preset length and with the extension point as a start point when the fourth collision point exists and the fourth collision point is the extension point, the end point of the new extension vector being a new extension point, and returning to perform the step of determining whether the extension vector exists on the virtual object after taking the new extension vector as an extension vector and the new extension point as an extension point;
when the fourth collision point is present and the fourth collision point is not the extension point, the fourth collision point is taken as an exit position point on the other side of the virtual object.
Optionally, the method further comprises: counting the number of times of returning to the step of determining whether the extension vector has a fourth collision point on the virtual object;
And when the times reach the preset times, prompting that the space creation fails.
Optionally, the first preset angle is 10 degrees, and the second preset angle is 90 degrees.
The application also discloses a space creation device, the device includes:
the test vector generation module is used for responding to the space skill release request sent by the terminal equipment and generating a test vector according to the position and the orientation of the game role in the game scene;
an entry creation information generation module for determining a collision point of the test vector on a virtual object side in the game scene to generate entry creation information of an entry space on the virtual object side according to the collision point;
the extension vector generation module is used for generating an extension vector according to the test vector;
an exit creation information generation module for determining a collision point of the extension vector on the other side of the virtual object to generate exit creation information of an exit space on the other side of the virtual object according to the collision point;
and the space creation module is used for synchronizing the entrance creation information and the exit creation information to the terminal equipment so that the terminal equipment creates an entrance space on one side of the virtual object according to the entrance creation information and creates an exit space on the other side of the virtual object according to the exit creation information.
The embodiment of the application also discloses electronic equipment, which comprises:
one or more processors; and
one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the electronic device to perform one or more methods as described above.
One or more machine-readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the method(s) described above are also disclosed.
Compared with the prior art, the application has the following advantages:
in the embodiment of the application, in response to a space skill release request sent by a terminal device, a test vector is generated according to the position and the orientation of a game character in a game scene, a collision point on one side of a virtual object is determined based on the test vector, entry creation information of an entry space on one side of the virtual object is generated according to the collision point, then an extension vector is generated according to the test vector, a collision point on the other side of the virtual object is determined based on the extension vector, exit creation information of an exit space on the other side of the virtual object is generated according to the collision point, and finally the entry creation information and the exit creation information are synchronized to the terminal device, so that the terminal device creates the entry space on the one side of the virtual object according to the entry creation information, and creates the exit space on the other side of the virtual object according to the exit creation information. According to the method and the device for determining the collision points on the two sides of the virtual object through the vector, the creation information of the entrance space and the exit space is determined according to the collision points, so that the configuration data of the virtual object do not need to be configured in advance, the working intensity of developers is reduced, and the method and the device are applicable to static game scenes and dynamic game scenes, and are wide in application range.
Drawings
In order to more clearly illustrate the technical solutions of the present application, the drawings that are needed in the description of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow chart of steps of an embodiment of a space creation method of the present application;
FIG. 2 is a schematic illustration of a test vector of the present application;
FIG. 3 is a schematic illustration of an extension vector of the present application;
FIG. 4 is a schematic diagram of interactions between a server and a client of the present application;
fig. 5 is a block diagram of a space creation apparatus embodiment of the present application.
Detailed Description
In order that the above-recited objects, features and advantages of the present application will become more readily apparent, a more particular description of the invention briefly described above will be rendered by reference to specific embodiments that are illustrated in the appended drawings.
The space creation method in the embodiment of the application can be operated on the terminal equipment or the server. The terminal device may be a local terminal device. When the space creation method is run as a server, it may be a cloud game.
In an alternative embodiment, cloud gaming refers to a game style based on cloud computing. In the running mode of the cloud game, a running main body of the game program and a game picture presentation main body are separated, the storage and running of the space creation method are completed on a cloud game server, and the cloud game client is used for receiving and sending data and presenting the game picture, for example, the cloud game client can be a display device with a data transmission function close to a user side, such as a mobile terminal, a television, a computer, a palm computer and the like; the terminal device for processing game data is a cloud game server in the cloud. When playing a game, a player operates the cloud game client to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, codes and compresses data such as game pictures and the like, returns the data to the cloud game client through a network, and finally decodes the data through the cloud game client and outputs the game pictures.
In an alternative embodiment, the terminal device may be a local terminal device. The local terminal device stores a game program and is used for presenting game pictures. The local terminal device is used for interacting with the player through the graphical user interface, namely, conventionally downloading and installing the game program through the electronic device and running. The manner in which the local terminal device provides the graphical user interface to the player may include a variety of ways, for example, it may be rendered for display on a display screen of the terminal, or provided to the player by holographic projection. For example, the local terminal device may include a display screen for presenting a graphical user interface including game visuals, 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.
Referring to fig. 1, there is shown a step flow diagram of an embodiment of a space creation method of the present application, the method comprising:
and step 101, responding to a space skill release request sent by the terminal equipment, and generating a test vector according to the position and the orientation of the game role in the game scene.
Step 102, determining collision points of the test vectors on the virtual object side in the game scene, so as to generate entrance creation information of an entrance space on the virtual object side according to the collision points.
And step 103, generating an extension vector according to the test vector.
Step 104, determining a collision point of the extension vector on the other side of the virtual object, so as to generate exit creation information of the exit space on the other side of the virtual object according to the collision point.
Step 105, synchronizing the entrance creation information and the exit creation information to the terminal device, so that the terminal device creates an entrance space on one side of the virtual object according to the entrance creation information and creates an exit space on the other side of the virtual object according to the exit creation information.
In the embodiment of the application, in response to a space skill release request sent by a terminal device, a test vector is generated according to the position and the orientation of a game character in a game scene, a collision point on one side of a virtual object is determined based on the test vector, entry creation information of an entry space on one side of the virtual object is generated according to the collision point, then an extension vector is generated according to the test vector, a collision point on the other side of the virtual object is determined based on the extension vector, exit creation information of an exit space on the other side of the virtual object is generated according to the collision point, and finally the entry creation information and the exit creation information are synchronized to the terminal device, so that the terminal device creates the entry space on the one side of the virtual object according to the entry creation information, and creates the exit space on the other side of the virtual object according to the exit creation information.
According to the method and the device for determining the collision points on the two sides of the virtual object through the vector, the creation information of the entrance space and the exit space is determined according to the collision points, so that the configuration data of the virtual object do not need to be configured in advance, the working intensity of developers is reduced, and the method and the device are applicable to static game scenes and dynamic game scenes, and are wide in application range.
Next, a space creation method of the present exemplary embodiment will be further described with reference to fig. 2 to 4.
And step 101, responding to a space skill release request sent by the terminal equipment, and generating a test vector according to the position and the orientation of the game role in the game scene.
In a game scene, at least one game character is usually included, and the game character can be a game virtual character which is controlled by a player through a terminal device, and in addition, a virtual object is also included in the game scene, wherein the virtual object refers to a wall, a mountain, a tree or the like. Wherein, the game character can traverse the virtual object by releasing the spatial skills in the process of moving the game scene, in particular, the game character can traverse from one side of the virtual object to the other side of the virtual object, such as from one side of the wall to the other side of the wall.
Alternatively, traversing the virtual object may be creating a door on one side of the virtual object as an entry space and then another door on the other side of the virtual object as an exit space, although other ways are possible other than by creating a door, such as creating a cavity on one side of the virtual object as an entry space and then creating another cavity on the other side of the virtual object as an exit space, which embodiments of the present application need not be limited in this respect.
Since the virtual object needs to be traversed from one side to the other side of the virtual object, the release of the spatial skills needs to involve the position and orientation of the game character, and in this embodiment of the present application, when a release request of the spatial skills sent by the player through the terminal device is received, the position and orientation of the game character will be obtained, and a test vector is generated according to the position and orientation of the game character.
In an optional embodiment of the present application, step 101, generating the test vector according to the position and orientation of the game character in the game scene includes:
acquiring the position and the orientation of a game role in a game scene;
generating a horizontal vector corresponding to the orientation in the horizontal direction in the game scene;
Generating a first vector in the direction of the horizontal vector, generating a second vector in the direction of the horizontal vector deviating to the left by a first preset angle, and generating a third vector in the direction of the horizontal vector deviating to the right by the first preset angle, with the position as a starting point.
The first preset angle may be 10 degrees. When a release request of space skills is received, reading the position p0 and the orientation yaw of a game character in a game scene, converting the orientation yaw into a horizontal vector which is two-dimensional in the horizontal direction, determining a position point p1 in the horizontal vector direction by taking the position p0 as a starting point and a preset length, determining a position point p2 in the left 10-degree direction of the horizontal vector, determining a position point p3 in the right 10-degree direction of the horizontal vector, and obtaining three vectors, namely a first vector l1, a second vector l2 and a third vector l3 by utilizing the position p0 and three position points p1, p2 and p 3.
Step 102, determining collision points of the test vectors on the virtual object side in the game scene, so as to generate entrance creation information of an entrance space on the virtual object side according to the collision points.
After obtaining the test vectors of the first vector l1, the second vector l2 and the third vector l3, a physical ray interface in the game program may be called, and a collision point on the virtual object side is determined according to the test vectors, so as to determine entry creation information of the entry space on the virtual object side according to the collision point.
If there is no collision point between the test vector and the virtual object, that is, there is no collision point between any one vector of the first vector l1, the second vector l2 and the third vector l3 and the virtual object, which means that the length of the test vector may not reach the virtual object or there is no virtual object in front of the game character, the test vector is regarded as a space skill release failure, and the player is prompted that there is no virtual object in front of the game character.
In an optional embodiment of the present application, step 102, the determining a collision point of the test vector on a virtual object side in the game scene to generate entry creation information of an entry space on the virtual object side according to the collision point includes:
acquiring a first collision point of the first vector on the virtual object side, a second collision point of the second vector on the virtual object side, and a third collision point of the third vector on the virtual object side;
generating an intermediate vector based on the second collision point and the third collision point to determine an entry orientation vector from the intermediate vector;
and organizing the first collision point as an entry position point and the entry orientation vector into entry creation information of an entry space on the virtual object side.
In a specific implementation, if there are collision points between the first vector l1, the second vector l2, and the third vector l3 and the virtual object, three collision points on the virtual object side, that is, the first collision point px0, the second collision point px1, and the third collision point px2, can be obtained; wherein the first collision point px0 is an entry position point of the entry space. In the embodiment of the application, the intermediate vector may be obtained according to the second collision point px1 and the third collision point px2 on the virtual object, and then the inlet orientation vector of the inlet space may be determined by using the intermediate vector.
When the entry position point and the entry orientation vector of the entry space are obtained, entry creation information of the entry space on the virtual object side may be based on the entry position point and the entry orientation vector.
In an optional embodiment of the application, the generating an intermediate vector based on the second collision point and the third collision point to determine an entry orientation vector from the intermediate vector includes:
generating a fourth vector in the horizontal direction in the game scene with the third collision point as a starting point and the second collision point as an end point;
generating a fifth vector in a direction of the fourth vector deviating from the second preset angle to the left, and generating a sixth vector in a direction of the fourth vector deviating from the second preset angle to the right;
Performing dot multiplication on the sixth vector and the first vector to obtain an inner product value;
when the inner product value is greater than or equal to zero, the sixth vector is taken as an inlet orientation vector;
and when the inner product value is smaller than zero, taking the fifth vector as an inlet orientation vector.
The second preset angle may be 90 degrees. Referring to fig. 2, the third collision point px2 is subtracted from the second collision point px1, a three-dimensional vector from the third collision point px2 to the second collision point px1 is obtained, the three-dimensional vector is converted into a two-dimensional vector in the horizontal direction, that is, a fourth vector, and then rotated 90 degrees to the left and right, respectively, to obtain a fifth vector lx1 and a sixth vector lx2, and the inner product value is obtained by multiplying the sixth vector lx2 by the first vector lx1, and is used to determine the vector angle, and if the inner product value is greater than or equal to zero, the description vector angle is an acute angle, that is, the direction of the sixth vector lx2 and the first vector lx1 are approximately the same, the sixth vector lx2 is determined to be the inlet orientation vector of the first door, and if the inner product value is less than zero, the description vector angle is an obtuse angle, that is, the direction of the sixth vector lx2 and the first vector lx1 are substantially opposite, and the fifth vector lx1 is determined to be the inlet orientation vector of the inlet space. The creation information of the entry space, i.e. the entry position point px0 and the entry orientation vector lx3 (lx 1 or lx 2), is thus obtained.
And step 103, generating an extension vector according to the test vector.
After determining the creation information of the entry space, the embodiment of the application starts to calculate the creation information of the exit space, based on the entry position point px0 of the entry space and the entry orientation vector lx3 thereof.
In an optional embodiment of the present application, step 103, generating the extension vector according to the test vector includes:
generating an extension vector in the direction of the inlet orientation vector based on a preset length and by taking the inlet position point as a starting point, wherein the end point of the extension vector is an extension point.
In this embodiment of the present application, an extension point pNew may be determined by a preset length from the entry position point px0 as a starting point in the direction of the entry toward the vector lx3, and the extension vector may be obtained by connecting the entry position point px0 and the extension point pNew.
Step 104, determining a collision point of the extension vector on the other side of the virtual object, so as to generate exit creation information of the exit space on the other side of the virtual object according to the collision point.
In an alternative embodiment of the present application, step 104, determining a collision point of the extension vector on the other side of the virtual object to generate exit creation information of the exit space on the other side of the virtual object according to the collision point includes:
Determining an exit location point on the other side of the virtual object from the extension vector;
generating a vector perpendicular to the other side of the virtual object as an outlet orientation vector;
the exit position points and the exit orientation vectors are organized to create information for the exits of the exit space on the other side of the virtual object.
In this embodiment of the present application, the physical ray interface may be invoked to determine a collision point between the extension vector and the other side of the virtual object, so that an exit position point of the exit space may be determined according to the collision point, and then a vector perpendicular to the other side of the virtual object is generated as an exit orientation vector, where the exit orientation vector is substantially opposite to the direction of the entrance orientation vector, and therefore a vector included angle between the exit orientation vector and the entrance orientation vector is greater than or equal to 90 degrees. Wherein if both one side and the other side of the virtual object are planar rather than beveled, the direction of the exit orientation vector and the entrance orientation vector are exactly opposite, i.e. the exit orientation vector is the reverse vector of the entrance orientation vector.
When the entry position point and the exit orientation vector of the exit space are obtained, the exit creation information of the exit space on the other side of the virtual object may be based on the exit position point and the exit orientation vector.
In an alternative embodiment of the present application, the determining the exit position point on the other side of the virtual object according to the extension vector includes:
determining whether the extension vector has a fourth collision point on the virtual object;
when the fourth collision point does not exist, prompting that space creation fails;
generating a new extension vector in the direction of the entry facing vector based on a preset length and with the extension point as a start point when the fourth collision point exists and the fourth collision point is the extension point, the end point of the new extension vector being a new extension point, and returning to perform the step of determining whether the extension vector exists on the virtual object after taking the new extension vector as an extension vector and the new extension point as an extension point;
when the fourth collision point is present and the fourth collision point is not the extension point, the fourth collision point is taken as an exit position point on the other side of the virtual object.
Referring to fig. 3, after generating an extension vector, the embodiment of the present application may invoke a physical ray interface to determine whether a fourth collision point (hereinafter referred to simply as a collision point) exists between the extension vector and the other side of the virtual object, if there is no collision point, it is regarded as a failure in releasing spatial skills, and the player wall is prompted to be out of condition, if a collision occurs and the collision point coincides with the extension point pNew, which means that the extension point pNew is still inside the virtual object, so that further determination of the length of the extension vector is required, the extension point pNew point is regarded as a starting point, a new extension point pNew1 is acquired based on a preset length at the entrance direction vector lx3, the extension point pNew and the new extension point pNew1 may obtain a new extension vector, then the new extension vector is regarded as an extension vector, the new extension point pNew1 is regarded as an extension point pNew, and the above steps are repeated until the collision point does not coincide with the extension point pNew, which means that the extension point pNew is not inside the virtual object, and the collision point is regarded as an exit position point of the space.
In an alternative embodiment of the present application, the method further comprises:
counting the number of times of returning to the step of determining whether the extension vector has a fourth collision point on the virtual object;
and when the times reach the preset times, prompting that the space creation fails.
In a specific implementation, in order to avoid unlimited release of spatial skills, if the step of determining the collision point between the extension vector and the virtual object is counted and repeated for a preset number of times, for example, for 6 times, the skill release failure may be considered, and the space creation failure may be prompted.
Step 105, synchronizing the entrance creation information and the exit creation information to the terminal device, so that the terminal device creates an entrance space on one side of the virtual object according to the entrance creation information and creates an exit space on the other side of the virtual object according to the exit creation information.
After obtaining the entrance creation information of the entrance space and the exit creation information of the exit space, the terminal device may synchronize to the terminal device, and the terminal device may create the communicated entrance space and exit space on two sides of the virtual object according to the entrance creation information and the exit creation information, respectively.
For example, a first door is created with an entry position point in the entry creation information as a center and according to a preset space size, then a door opening direction of the first door is created based on a direction of an entry orientation vector, and similarly, a second door is created with an exit position point in the exit creation information as a center and according to a preset space size, and then a door opening direction of the second door is created based on a direction of an exit orientation vector.
After receiving the space skill release request of the player, the server side generates vectors to determine collision points between the walls in front of the player according to the current positions and orientations of game characters operated by the player, obtains the positions and orientations of the entrance spaces, determines the collision points between the walls in front of the player by using the extension vectors again, and obtains the positions and orientations of the exit spaces. Taking a virtual object as a wall as an example, referring to fig. 4, a schematic diagram of data synchronization between a server and a client in the present application is shown, including the following steps:
1. A client sends a space skill release request to a server;
2. the method comprises the steps that a server side obtains the position and the orientation of a game role controlled by a player;
3. the server side generates a test vector according to the position and the orientation to determine the wall in front of the test vector;
4. the server determines first creation information of a first door according to collision points between the test vectors and the wall;
5. the service end generates an extension vector based on the test vector, and determines second creation information of a second door according to a collision point between the extension vector and the wall;
6. the server side sends the first creation information and the second creation information to the client side;
7. the client creates a first door and a second door on the wall according to the first creation information and the second creation information.
In addition, since the calculation process of the embodiment of the application only needs basic vectors, no additional art planning and pre-configuration data is needed, repeated labor of project group development is reduced, and the direction and thickness of the virtual space in front of the player are obtained by using vector detection and are not dependent on specific game scenes and art planning and pre-configuration data, the method and the device can be applied to dynamic or static virtual objects in the game scenes, that is, even though the thickness of the virtual objects is changed, the method and the device can still be realized by using the embodiment of the application.
It should be noted that, for simplicity of description, the method embodiments are shown as a series of acts, but it should be understood by those skilled in the art that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently in accordance with the embodiments. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments and that the acts referred to are not necessarily required by the embodiments of the present application.
Referring to fig. 5, there is shown a block diagram of an embodiment of a space creation apparatus of the present application, the apparatus comprising:
the test vector generation module 501 is configured to generate a test vector according to a position and an orientation of a game character in a game scene in response to a spatial skill release request sent by a terminal device;
an entry creation information generating module 502 for determining a collision point of the test vector on a virtual object side in the game scene to generate entry creation information of an entry space on the virtual object side according to the collision point;
an extension vector generation module 503, configured to generate an extension vector according to the test vector;
An exit creation information generation module 504 for determining a collision point of the extension vector on the other side of the virtual object to generate exit creation information of an exit space on the other side of the virtual object according to the collision point;
a space creation module 505, configured to synchronize the entry creation information and the exit creation information to the terminal device, so that the terminal device creates an entry space on one side of the virtual object according to the entry creation information, and creates an exit space on the other side of the virtual object according to the exit creation information.
In an optional embodiment of the present application, the test vector generation module 501 is configured to obtain a position and an orientation of a game character in a game scene; generating a horizontal vector corresponding to the orientation in the horizontal direction in the game scene; generating a first vector in the direction of the horizontal vector, generating a second vector in the direction of the horizontal vector deviating to the left by a first preset angle, and generating a third vector in the direction of the horizontal vector deviating to the right by the first preset angle, with the position as a starting point.
In an alternative embodiment of the present application, the portal creation information generating module 502 is configured to obtain a first collision point of the first vector on the virtual object side, a second collision point of the second vector on the virtual object side, and a third collision point of the third vector on the virtual object side; generating an intermediate vector based on the second collision point and the third collision point to determine an entry orientation vector from the intermediate vector; and organizing the first collision point as an entry position point and the entry orientation vector into entry creation information of an entry space on the virtual object side.
In an optional embodiment of the present application, the entry creation information generating module 502 is configured to generate a fourth vector in a horizontal direction in the game scene with the third collision point as a start point and the second collision point as an end point; generating a fifth vector in a direction of the fourth vector deviating from the second preset angle to the left, and generating a sixth vector in a direction of the fourth vector deviating from the second preset angle to the right; performing dot multiplication on the sixth vector and the first vector to obtain an inner product value; when the inner product value is greater than or equal to zero, the sixth vector is taken as an inlet orientation vector; and when the inner product value is smaller than zero, taking the fifth vector as an inlet orientation vector.
In an optional embodiment of the present application, the extension vector generating module 503 is configured to generate an extension vector in the direction of the entry orientation vector based on a preset length and using the entry location point as a starting point, where an end point of the extension vector is an extension point.
In an alternative embodiment of the present application, the exit creation information generating module 504 is configured to determine an exit position point on the other side of the virtual object according to the extension vector; generating a vector perpendicular to the other side of the virtual object as an outlet orientation vector, wherein a vector included angle between the outlet orientation vector and the inlet orientation vector is greater than or equal to 90 degrees; the exit position points and the exit orientation vectors are organized to create information for the exits of the exit space on the other side of the virtual object.
In an alternative embodiment of the present application, the exit creation information generating module 504 is configured to determine whether the extension vector has a fourth collision point on the virtual object; when the fourth collision point does not exist, prompting that space creation fails; generating a new extension vector in the direction of the entry facing vector based on a preset length and with the extension point as a start point when the fourth collision point exists and the fourth collision point is the extension point, the end point of the new extension vector being a new extension point, and returning to perform the step of determining whether the extension vector exists on the virtual object after taking the new extension vector as an extension vector and the new extension point as an extension point; when the fourth collision point is present and the fourth collision point is not the extension point, the fourth collision point is taken as an exit position point on the other side of the virtual object.
In an alternative embodiment of the present application, the exit creation information generating module 504 is configured to count the number of times the step of returning to the determination of whether the extension vector has the fourth collision point on the virtual object is performed; and when the times reach the preset times, prompting that the space creation fails.
In an alternative embodiment of the present application, the first preset angle is 10 degrees, and the second preset angle is 90 degrees.
For the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points.
The embodiment of the invention discloses an electronic device, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps in the embodiment of the space creation method when being executed by the processor.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program realizes the steps in the embodiment of the space creation method when being executed by a processor.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described by differences from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
It will be apparent to those skilled in the art that embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, the present embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present embodiments have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the present application.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or terminal device comprising the element.
The foregoing has described in detail a space creation method and a space creation device provided in the present application, and specific examples have been applied herein to illustrate the principles and embodiments of the present application, where the foregoing examples are provided only to assist in understanding the method and core ideas of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (9)

1. A method of space creation, the method comprising:
responding to a space skill release request sent by terminal equipment, and acquiring the position and the orientation of a game role in a game scene; generating a horizontal vector corresponding to the orientation in the horizontal direction in the game scene; generating a first vector in the direction of the horizontal vector, generating a second vector in the direction of the horizontal vector deviating left by a first preset angle, and generating a third vector in the direction of the horizontal vector deviating right by the first preset angle, with the position as a starting point;
acquiring a first collision point of the first vector on the virtual object side, a second collision point of the second vector on the virtual object side, and a third collision point of the third vector on the virtual object side; generating an intermediate vector based on the second collision point and the third collision point to determine an entry orientation vector from the intermediate vector; organizing the first collision point as an entry location point and the entry orientation vector as entry creation information of an entry space on the virtual object side;
Generating an extension vector according to the test vector;
determining an exit location point on the other side of the virtual object from the extension vector; generating a vector perpendicular to the other side of the virtual object as an outlet orientation vector; the vector included angle between the outlet orientation vector and the inlet orientation vector is greater than or equal to 90 degrees; organizing the exit location points and the exit orientation vectors into exit creation information for an exit space on the other side of the virtual object;
synchronizing the entry creation information and the exit creation information to the terminal device such that the terminal device creates an entry space on one side of the virtual object according to the entry creation information and creates an exit space on the other side of the virtual object according to the exit creation information.
2. The method of claim 1, wherein the generating an intermediate vector based on the second collision point and the third collision point to determine an entry orientation vector from the intermediate vector comprises:
generating a fourth vector in the horizontal direction in the game scene with the third collision point as a starting point and the second collision point as an end point;
Generating a fifth vector in a direction of the fourth vector deviating from the second preset angle to the left, and generating a sixth vector in a direction of the fourth vector deviating from the second preset angle to the right;
performing dot multiplication on the sixth vector and the first vector to obtain an inner product value;
when the inner product value is greater than or equal to zero, the sixth vector is taken as an inlet orientation vector;
and when the inner product value is smaller than zero, taking the fifth vector as an inlet orientation vector.
3. The method of claim 1, wherein generating an extension vector from the test vector comprises:
generating an extension vector in the direction of the inlet orientation vector based on a preset length and by taking the inlet position point as a starting point, wherein the end point of the extension vector is an extension point.
4. A method according to claim 3, wherein said determining an exit location point on the other side of the virtual object from the extension vector comprises:
determining whether the extension vector has a fourth collision point on the virtual object;
when the fourth collision point does not exist, prompting that space creation fails;
generating a new extension vector in the direction of the entry facing vector based on a preset length and with the extension point as a start point when the fourth collision point exists and the fourth collision point is the extension point, the end point of the new extension vector being a new extension point, and returning to perform the step of determining whether the extension vector exists on the virtual object after taking the new extension vector as an extension vector and the new extension point as an extension point;
When the fourth collision point is present and the fourth collision point is not the extension point, the fourth collision point is taken as an exit position point on the other side of the virtual object.
5. The method as recited in claim 4, further comprising:
counting the number of times of returning to the step of determining whether the extension vector has a fourth collision point on the virtual object;
and when the times reach the preset times, prompting that the space creation fails.
6. The method of claim 2, wherein the first predetermined angle is 10 degrees and the second predetermined angle is 90 degrees.
7. A space creation apparatus, the apparatus comprising:
the test vector generation module is used for responding to the space skill release request sent by the terminal equipment and obtaining the position and the orientation of the game role in the game scene; generating a horizontal vector corresponding to the orientation in the horizontal direction in the game scene; generating a first vector in the direction of the horizontal vector, generating a second vector in the direction of the horizontal vector deviating left by a first preset angle, and generating a third vector in the direction of the horizontal vector deviating right by the first preset angle, with the position as a starting point;
An entry creation information generation module for determining a first collision point of the first vector on a virtual object side, a second collision point of the second vector on the virtual object side, and a third collision point of the third vector on the virtual object side; generating an intermediate vector based on the second collision point and the third collision point to determine an entry orientation vector from the intermediate vector; organizing the first collision point as an entry location point and the entry orientation vector as entry creation information of an entry space on the virtual object side;
the extension vector generation module is used for generating an extension vector according to the test vector;
an exit creation information generation module for determining an exit location point on the other side of the virtual object according to the extension vector; generating a vector perpendicular to the other side of the virtual object as an outlet orientation vector; the vector included angle between the outlet orientation vector and the inlet orientation vector is greater than or equal to 90 degrees; organizing the exit location points and the exit orientation vectors into exit creation information for an exit space on the other side of the virtual object;
And the space creation module is used for synchronizing the entrance creation information and the exit creation information to the terminal equipment so that the terminal equipment creates an entrance space on one side of the virtual object according to the entrance creation information and creates an exit space on the other side of the virtual object according to the exit creation information.
8. An electronic device, comprising:
one or more processors; and
one or more machine readable media having instructions stored thereon, which when executed by the one or more processors, cause the electronic device to perform the method of any of claims 1-6.
9. One or more machine readable media having instructions stored thereon, which when executed by one or more processors, cause the processors to perform the method of any of claims 1-6.
CN202010803956.0A 2020-08-11 2020-08-11 Space creation method and device Active CN111773725B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010803956.0A CN111773725B (en) 2020-08-11 2020-08-11 Space creation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010803956.0A CN111773725B (en) 2020-08-11 2020-08-11 Space creation method and device

Publications (2)

Publication Number Publication Date
CN111773725A CN111773725A (en) 2020-10-16
CN111773725B true CN111773725B (en) 2024-02-23

Family

ID=72761931

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010803956.0A Active CN111773725B (en) 2020-08-11 2020-08-11 Space creation method and device

Country Status (1)

Country Link
CN (1) CN111773725B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1936909A (en) * 2006-10-16 2007-03-28 北京金山数字娱乐科技有限公司 Fight field loading method and apparatus, method for conducting group fight and network game apparatus
WO2017029279A2 (en) * 2015-08-17 2017-02-23 Lego A/S Method of creating a virtual game environment and interactive game system employing the method
CN107670281A (en) * 2017-10-26 2018-02-09 广州市雷军游乐设备有限公司 The method, apparatus and storage medium of prop model crawl are controlled in gaming
CN108136257A (en) * 2015-08-17 2018-06-08 乐高公司 The method for creating virtual game environment and the interaction game system using this method
CN110681158A (en) * 2019-10-14 2020-01-14 北京代码乾坤科技有限公司 Processing method of virtual carrier, storage medium, processor and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1936909A (en) * 2006-10-16 2007-03-28 北京金山数字娱乐科技有限公司 Fight field loading method and apparatus, method for conducting group fight and network game apparatus
WO2017029279A2 (en) * 2015-08-17 2017-02-23 Lego A/S Method of creating a virtual game environment and interactive game system employing the method
CN108136257A (en) * 2015-08-17 2018-06-08 乐高公司 The method for creating virtual game environment and the interaction game system using this method
CN107670281A (en) * 2017-10-26 2018-02-09 广州市雷军游乐设备有限公司 The method, apparatus and storage medium of prop model crawl are controlled in gaming
CN110681158A (en) * 2019-10-14 2020-01-14 北京代码乾坤科技有限公司 Processing method of virtual carrier, storage medium, processor and electronic device

Also Published As

Publication number Publication date
CN111773725A (en) 2020-10-16

Similar Documents

Publication Publication Date Title
WO2017113732A1 (en) Layout method and system for user interface control, and control method and system therefor
US11227437B2 (en) Three-dimensional model constructing method, apparatus, and system
CN110856005B (en) Live stream display method and device, electronic equipment and readable storage medium
CN108958894A (en) A kind of distributed transaction processing method, system, task manager and terminal device
JP2018026815A (en) Video call quality measurement method and system
WO2019090221A1 (en) Technologies for composing a virtual reality setting in a mobile computing environment
CN108765084B (en) Synchronous processing method and device for virtual three-dimensional space
CN116778054A (en) Scene rendering method and device, electronic equipment and storage medium
CN112465971B (en) Method and device for guiding point positions in model, storage medium and electronic equipment
CN114742928A (en) Animation rendering method and device, electronic equipment and medium
CN111773725B (en) Space creation method and device
CN110990106B (en) Data display method and device, computer equipment and storage medium
CN108876925B (en) Virtual reality scene processing method and device
US20220279234A1 (en) Live stream display method and apparatus, electronic device, and readable storage medium
CN115859411A (en) Volume rendering collision detection method, device, equipment and storage medium
CN112651801B (en) Method and device for displaying house source information
CN114327790A (en) Rendering method of Android container based on Linux system
CN113760394B (en) Data processing method and device, electronic equipment and storage medium
CN103295181B (en) A kind of stacking method and device of particle file and video
CN113230661A (en) Data synchronization method and device, computer readable medium and electronic equipment
CN113553173B (en) MPI-based UE4 parallel processing method, device, equipment and medium
CN108882005B (en) Barrage verification method, computer equipment and storage medium
CN115065866B (en) Video generation method, device, equipment and storage medium
CN115129323B (en) Method, device and equipment for processing data resource packet and storage medium
CN112930556A (en) System and method for integrating third party geometry for visualization of large data sets

Legal Events

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