CN116196611A - Somatosensory game method based on waving action - Google Patents

Somatosensory game method based on waving action Download PDF

Info

Publication number
CN116196611A
CN116196611A CN202310207726.1A CN202310207726A CN116196611A CN 116196611 A CN116196611 A CN 116196611A CN 202310207726 A CN202310207726 A CN 202310207726A CN 116196611 A CN116196611 A CN 116196611A
Authority
CN
China
Prior art keywords
motion
game
function
slow
acceleration data
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
CN202310207726.1A
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.)
Shenzhen Shimi Network Technology Co ltd
Original Assignee
Shenzhen Shimi Network Technology 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 Shenzhen Shimi Network Technology Co ltd filed Critical Shenzhen Shimi Network Technology Co ltd
Priority to CN202310207726.1A priority Critical patent/CN116196611A/en
Publication of CN116196611A publication Critical patent/CN116196611A/en
Pending legal-status Critical Current

Links

Images

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/20Input arrangements for video game devices
    • A63F13/21Input arrangements for video game devices characterised by their sensors, purposes or types
    • A63F13/211Input arrangements for video game devices characterised by their sensors, purposes or types using inertial sensors, e.g. accelerometers or gyroscopes
    • 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/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/017Gesture based interaction, e.g. based on a set of recognized hand gestures
    • 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
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T90/00Enabling technologies or technologies with a potential or indirect contribution to GHG emissions mitigation

Abstract

The invention discloses a motion sensing game method, a device, equipment and a computer readable storage medium based on a hand waving motion, wherein the motion sensing game method based on the hand waving motion comprises the following steps: after the motion sensing game is started, acquiring acceleration data in the horizontal direction or the vertical direction from the bound motion sensing equipment; determining a motion path of a game object in the somatosensory game according to the acceleration data; generating a displacement instruction of the game object according to the acceleration data and a preset inching function; and controlling the game object to move in a nonlinear way along the motion path according to the displacement instruction. The somatosensory game method based on the waving action can provide more real, smooth and flexible user experience, and has better playability and gameplay.

Description

Somatosensory game method based on waving action
Technical Field
The present invention relates to the field of motion sensing game technologies, and in particular, to a motion sensing game method, device, apparatus and computer readable storage medium based on a waving motion.
Background
Most motion sensing devices still use conventional linear motion to effect movement of objects in a game. The linear movement mode is simple and easy to realize, but the linear movement mode is hard in game, and lacks of change and interestingness. Meanwhile, the linear movement mode is difficult to completely restore the real human body movement mode, so that the game experience is difficult to reach the optimal state.
Disclosure of Invention
According to the motion sensing game method based on the waving motion, nonlinear movement of a game object is achieved, and game experience of a user is improved.
In order to achieve the above object, an embodiment of the present application provides a somatosensory game method based on a waving motion, including:
after the motion sensing game is started, acquiring acceleration data in the horizontal direction or the vertical direction from the bound motion sensing equipment;
determining a motion path of a game object in the somatosensory game according to the acceleration data;
generating a displacement instruction of the game object according to the acceleration data and a preset inching function;
and controlling the game object to move in a nonlinear way along the motion path according to the displacement instruction.
In one embodiment, determining a motion path of a game object in the motion sensing game according to the acceleration data comprises:
filtering and denoising the acceleration data;
generating an acceleration vector according to the processed acceleration data;
determining a direction of movement of the somatosensory device based on the acceleration vector;
and selecting a matched motion path from a preset motion path track library according to the moving direction as the motion path of the game object.
In an embodiment, generating the displacement instruction of the game object according to the acceleration data and a preset inching function includes:
screening a time interval for finishing an effective waving action from the acceleration data;
calling a preset slow function, and taking the time interval as the input of the slow function;
and generating the displacement instruction according to the output of the slow motion function.
In an embodiment, taking the time interval as an input to the slow motion function comprises:
mapping the starting time of the time interval to the starting value of the slow function input range;
mapping the ending time of the time interval to the ending value of the slow function input range;
and calculating the input value of the slow motion function corresponding to each moment in the time interval according to an interpolation algorithm.
In an embodiment, generating the displacement instruction according to the output of the inching function includes:
calculating coordinate values of the game object on the moving path at the current time according to an output value of a slow motion function, wherein the expression of the slow motion function is as follows:
f(t)=(1-t) 2 ×P 0 +2×(1-t)×t×P 1 +t 2 ×P 2
wherein f (t) is an output coordinate value, P0, P1 and P2 are constants, t is an input value of a slow function, and the value range is [0,1];
Comparing the current coordinate value with the coordinate value of the previous moment, calculating the displacement of the game object on the moving path at the current moment, and generating the displacement instruction.
In an embodiment, generating the displacement command from the displacement amount includes:
setting two time anchor points in an input interval of the slow function so as to divide the input interval into three motion time periods of an acceleration section, a uniform speed section and a deceleration section;
different weight values are set for the slow motion function output of each motion time period according to the motion time period, and the weight values corresponding to the three motion time periods of the acceleration time period, the uniform speed time period and the deceleration time period are respectively a, b and c, wherein 0< a <1; c > b >1;
and generating the displacement instruction according to the displacement and the weight value of the corresponding time period.
In an embodiment, after controlling the game object to perform nonlinear movement along the motion path according to the displacement instruction, the method further includes:
and generating a game result according to the motion path of the game object.
In order to achieve the above object, an embodiment of the present application further provides a motion sensing game device based on a waving motion, including:
The acquisition module is used for acquiring acceleration data in the horizontal direction or the vertical direction from the bound somatosensory equipment after the somatosensory game is started;
the calculation module is used for determining a motion path of a game object in the somatosensory game according to the acceleration data;
the displacement instruction generation module is used for generating a displacement instruction of the game object according to the acceleration data and a preset slow function;
and the control module is used for controlling the game object to move in a nonlinear way along the motion path according to the displacement instruction.
To achieve the above objective, an embodiment of the present application further provides a motion-based motion-sensing game device, including a memory, a processor, and a motion-based motion-sensing game program stored in the memory and executable on the processor, where the motion-based motion-sensing game method according to any one of the above is implemented when the processor executes the motion-based motion-sensing game program.
To achieve the above object, an embodiment of the present application further provides a computer readable storage medium, where a motion sensing game program based on a hand waving action is stored in the computer readable storage medium, and when the motion sensing game program based on the hand waving action is executed by a processor, the motion sensing game method based on the hand waving action is implemented.
Compared with the traditional linear movement game scheme, the motion sensing game method has the following advantages:
the more realistic and natural movement effect: the speed of the game object moving linearly is constant while the game object moves, the moving track is a straight line, and the moving mode lacks sense of reality. The nonlinear movement is realized through the slow-moving function, so that more natural movement effects, such as changes of an acceleration stage, a uniform speed stage and a deceleration stage, can be simulated, and the motion mode is closer to the real world;
smoother user experience: the nonlinear movement is realized through the slow movement function, so that the game object can be smoother and smoother in the movement process. Compared with a linearly moving game object, obvious jitter and jump are generated in the motion process, and the bad experience can be reduced and the game experience of a user is improved by realizing the nonlinear movement through the slow function;
more flexible and various movement modes: the nonlinear movement is realized through the slow-moving function, various different movement modes such as acceleration, deceleration, uniform speed and the like can be realized, and different weight values can be set in different time periods, so that a more complex animation effect is realized. The flexible and various movement modes can adapt to different types of games and playing methods, so that the playability and the interestingness of the games are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to the structures shown in these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block diagram of one embodiment of a motion sensing game device of the present invention based on a waving motion;
FIG. 2 is a flow chart of an embodiment of a motion sensing game method based on a waving motion of the present invention;
FIG. 3 is a block diagram of a motion sensing game device according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In order that the above-described aspects may be better understood, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps other than those listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. And the use of "first," "second," and "third," etc. do not denote any order, and the terms may be construed as names.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a server 1 (also called a motion sensing game device based on a waving motion) of a hardware running environment according to an embodiment of the present invention.
The server provided by the embodiment of the invention is equipment with display function, such as 'Internet of things equipment', intelligent air conditioner with networking function, intelligent electric lamp, intelligent power supply, AR/VR equipment with networking function, intelligent sound box, automatic driving automobile, PC, intelligent mobile phone, tablet personal computer, electronic book reader, portable computer and the like.
As shown in fig. 1, the server 1 includes: memory 11, processor 12 and network interface 13.
The memory 11 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the server 1, such as a hard disk of the server 1. The memory 11 may in other embodiments also be an external storage device of the server 1, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the server 1.
Further, the memory 11 may also include an internal storage unit of the server 1 as well as an external storage device. The memory 11 may be used not only for storing application software installed in the server 1 and various types of data, such as codes of the motion sensing game program 10 based on a waving motion, but also for temporarily storing data that has been output or is to be output.
Processor 12 may in some embodiments be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chip for executing program code or processing data stored in memory 11, such as executing a swing motion based motion sensing game program 10, etc.
The network interface 13 may optionally comprise a standard wired interface, a wireless interface (e.g. WI-FI interface), typically used to establish a communication connection between the server 1 and other electronic devices.
The network may be the internet, a cloud network, a wireless fidelity (Wi-Fi) network, a Personal Area Network (PAN), a Local Area Network (LAN), and/or a Metropolitan Area Network (MAN). Various devices in a network environment may be configured to connect to a communication network according to various wired and wireless communication protocols. Examples of such wired and wireless communication protocols may include, but are not limited to, at least one of the following: transmission control protocol and internet protocol (TCP/IP), user Datagram Protocol (UDP), hypertext transfer protocol (HTTP), file Transfer Protocol (FTP), zigBee, EDGE, IEEE 802.11, light fidelity (Li-Fi), 802.16, IEEE 802.11s, IEEE 802.11g, multi-hop communications, wireless Access Points (APs), device-to-device communications, cellular communication protocol and/or bluetooth (bluetooth) communication protocol, or combinations thereof.
Optionally, the server may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or a display unit, for displaying information processed in the server 1 and for displaying a visual user interface.
Fig. 1 shows only a server 1 having components 11-13 and a motion-based motion-sensing game program 10, it will be understood by those skilled in the art that the structure shown in fig. 1 is not limiting of the server 1 and may include fewer or more components than shown, or may combine certain components, or a different arrangement of components.
In this embodiment, the processor 12 may be configured to call the motion sensing game program based on the waving motion stored in the memory 11, and perform the following operations:
after the motion sensing game is started, acquiring acceleration data in the horizontal direction or the vertical direction from the bound motion sensing equipment;
determining a motion path of a game object in the somatosensory game according to the acceleration data;
generating a displacement instruction of the game object according to the acceleration data and a preset inching function;
and controlling the game object to move in a nonlinear way along the motion path according to the displacement instruction.
In one embodiment, the processor 12 may be configured to invoke the motion-based motion-sensing game program stored in the memory 11 and perform the following operations:
determining a motion path of a game object in the somatosensory game according to the acceleration data, wherein the motion path comprises the following steps:
Filtering and denoising the acceleration data;
generating an acceleration vector according to the processed acceleration data;
determining a direction of movement of the somatosensory device based on the acceleration vector;
and selecting a matched motion path from a preset motion path track library according to the moving direction as the motion path of the game object.
In one embodiment, the processor 12 may be configured to invoke the motion-based motion-sensing game program stored in the memory 11 and perform the following operations:
generating a displacement instruction of the game object according to the acceleration data and a preset inching function, wherein the displacement instruction comprises the following steps:
screening a time interval for finishing an effective waving action from the acceleration data;
calling a preset slow function, and taking the time interval as the input of the slow function;
and generating the displacement instruction according to the output of the slow motion function.
In one embodiment, the processor 12 may be configured to invoke the motion-based motion-sensing game program stored in the memory 11 and perform the following operations:
the input of the time interval as the slow motion function comprises:
mapping the starting time of the time interval to the starting value of the slow function input range;
Mapping the ending time of the time interval to the ending value of the slow function input range;
and calculating the input value of the slow motion function corresponding to each moment in the time interval according to an interpolation algorithm.
In one embodiment, the processor 12 may be configured to invoke the motion-based motion-sensing game program stored in the memory 11 and perform the following operations:
generating the displacement instruction according to the output of the slow function comprises the following steps:
calculating coordinate values of the game object on the moving path at the current time according to an output value of a slow motion function, wherein the expression of the slow motion function is as follows:
f(t)=(1-t) 2 ×P 0 +2×(1-t)×t×P 1 +t 2 ×P 2
wherein f (t) is an output coordinate value, P0, P1 and P2 are constants, t is an input value of a slow function, and the value range is [0,1];
comparing the current coordinate value with the coordinate value of the previous moment, calculating the displacement of the game object on the moving path at the current moment, and generating the displacement instruction.
In one embodiment, the processor 12 may be configured to invoke the motion-based motion-sensing game program stored in the memory 11 and perform the following operations:
generating the displacement command from the displacement amount includes:
Setting two time anchor points in an input interval of the slow function so as to divide the input interval into three motion time periods of an acceleration section, a uniform speed section and a deceleration section;
different weight values are set for the slow motion function output of each motion time period according to the motion time period, and the weight values corresponding to the three motion time periods of the acceleration time period, the uniform speed time period and the deceleration time period are respectively a, b and c, wherein 0< a <1; c > b >1;
and generating the displacement instruction according to the displacement and the weight value of the corresponding time period.
In one embodiment, the processor 12 may be configured to invoke the motion-based motion-sensing game program stored in the memory 11 and perform the following operations:
after controlling the game object to move in a nonlinear manner along the motion path according to the displacement instruction, the method further comprises:
and generating a game result according to the motion path of the game object.
Based on the hardware architecture of the motion sensing game device based on the hand waving motion, the embodiment of the motion sensing game method based on the hand waving motion is provided. The invention discloses a somatosensory game method based on a waving action, which aims to realize nonlinear movement of a game object and promote game experience of a user.
Referring to fig. 2, fig. 2 is a diagram of an embodiment of a motion-based motion-sensing game method according to the present invention, the motion-based motion-sensing game method includes the following steps:
s10, after the motion sensing game is started, acquiring acceleration data in the horizontal direction or the vertical direction from the bound motion sensing equipment.
Wherein the motion sensing game is a motion sensing game associated with a waving motion that requires a player to play the waving motion with a motion sensing device to develop the game. Through the somatosensory game, a player can make a game character swing an object such as a weapon, a racket and the like to perform corresponding actions such as attack, batting and the like. In this way, the player can more realistically feel the fun of swiping the game.
Illustratively, a fruit-cutting game is a classical somatosensory game associated with a waving motion.
The somatosensory game can be a local application program, an applet or a web page application based on HTML5, and the like. Specifically, the somatosensory game is run on a terminal, which may be a desktop computer, a notebook computer, a game host, a portable game host, a smart phone, a tablet computer, a smart watch, a smart television, and the like.
The motion sensing device refers to a device capable of detecting motion sensing data of a player, and generally, the motion sensing device is configured to include a six-axis IMU sensor including a three-axis accelerometer and a three-axis gyroscope, which detects motion sensing data of a player by detecting a change in three-axis acceleration and a change in three-axis angular velocity of the player.
In the technical scheme of the application, acceleration data acquired by the terminal from the somatosensory equipment are triaxial acceleration data directly acquired by an accelerometer (also called a gravity sensor). The three-axis acceleration data are x-axis acceleration data, y-axis acceleration data and z-axis acceleration data, respectively. The x-axis is the acceleration axis in the front-back direction, the z-axis is the acceleration axis in the vertical direction, and the y-axis is the acceleration axis in the left-right direction. Thus, even if the motion sensing device has only the gravity sensor, the input of the waving command can be completed through the motion sensing action.
Optionally, the somatosensory device is configured to be wearable in a form including, but not limited to, the following: a bracelet, a watch, a gamepad, a smart phone, etc.
Further, before the game, the somatosensory device needs to establish a communication connection with the terminal (i.e. bind with the terminal), wherein a wired connection can be established between the somatosensory device and the terminal, and a wireless connection can also be established between the somatosensory device and the terminal. For example, when the somatosensory device establishes a wired connection with the terminal, the somatosensory device may be based on at least one of USB2.0 protocol, USB3.0 protocol, lightning 3 protocol, lightning 4 protocol; and when the somatosensory device establishes wireless connection with the terminal, the wireless connection can be based on at least one of Bluetooth protocol, wiFi protocol, infrared protocol, 2.4G communication protocol and NFC protocol.
S20, determining a motion path of the game object in the motion sensing game according to the acceleration data.
Specifically, the game object refers to a virtual object that is controlled and moved in a motion-sensing game. It may be various forms of objects, such as figures, vehicles, aircraft, etc., or abstract symbols or graphics. Game objects play an important role in games, one of the key factors in game play and experience.
The motion path is a path along which the game object moves along a certain trajectory in the motion-sensing game. In the invention, the motion path is determined according to the acceleration data acquired by the somatosensory equipment and preset algorithms and rules.
Specifically, the movement direction and speed of the game object may be determined according to the magnitude and direction of the acceleration data. For example, if the acceleration data in the horizontal direction is a positive value, the game object moves rightward; if the acceleration data in the vertical direction is a negative value, the game object moves downward. In addition, more complex motion paths can be realized by combining acceleration data in different directions.
In some embodiments, determining a motion path of a game object in the motion sensing game according to the acceleration data comprises the following steps:
S21, filtering and noise reduction processing is carried out on the acceleration data.
Specifically, since acceleration data acquired by the somatosensory device may have some noise or interference signals, filtering and noise reduction processing are required to be performed on the data so as to improve accuracy and stability of the data. The data may be processed by digital filters, smoothing filters, etc. For example, a low-pass filter may be used to remove high-frequency noise, a median filter may be used to remove bursty interference, or the like, or a kalman filter may be used to filter the acceleration data.
S22, generating an acceleration vector according to the processed acceleration data.
Specifically, the acceleration vector is a three-dimensional vector calculated from the acceleration data, which includes acceleration components in the horizontal direction and the vertical direction and components of gravitational acceleration. The moving direction and the moving speed of the motion sensing device can be determined according to the magnitude and the direction of the acceleration vector, and then the moving path of the game object is determined.
For example, the acceleration vector may be generated by:
1. calculating the X-axis component of the acceleration vector: the acceleration data is projected in the X-axis direction into a three-dimensional coordinate system, i.e. x=ax/g, where Ax represents the component of the acceleration data in the X-axis direction, g being the gravitational acceleration.
2. Calculating the Y-axis component of the acceleration vector: the acceleration data is projected in the Y-axis direction into a three-dimensional coordinate system, i.e., y=ay/g, where Ay represents the component of the acceleration data in the Y-axis direction.
3. Calculating a Z-axis component of the acceleration vector: the acceleration data is projected in the Z-axis direction into a three-dimensional coordinate system, i.e. z=az/g-1, where Az represents the component of the acceleration data in the Z-axis direction, and subtracting 1 is to remove the effect of gravitational acceleration.
4. The resulting three components constitute an acceleration vector, i.e., a= (X, Y, Z).
S23, determining the moving direction of the somatosensory equipment based on the acceleration vector.
Specifically, depending on the magnitude and direction of the acceleration vector, the moving direction of the motion sensing device, for example, left, right, forward, backward, etc., may be determined. In the implementation process, the acceleration vector can be normalized and converted into a unit vector so as to better determine the moving direction and speed of the somatosensory device.
For example, the normalization processing of the acceleration vector may be achieved by:
1. calculating the magnitude of the acceleration vector: i.e., the modulus of a, i.e., |a|=sqrt (X2+y 2+z 2).
2. Calculating normalized acceleration vectors: i.e., each component divided by the modular length of the vector, gives a' = (X/|a|, Y/|a|, Z/|a|).
It is worth to say that the normalized acceleration vector can better reflect the moving direction and speed of the motion sensing device, so that the motion path of the game object can be conveniently determined.
S24, selecting a matched motion path from a preset motion path track library according to the moving direction as the motion path of the game object.
Specifically, in a preset motion path trajectory library, motion paths of various types and directions, such as straight lines, arcs, curves, and the like, may be stored. According to the moving direction and speed of the motion sensing device, a matched motion path can be selected as a motion path of the game object. For example, when the motion sensing device moves leftwards, a motion path matching this direction such as a left straight line, a left turn, or the like may be selected. For different somatosensory games, a motion path track library needs to be preset according to actual conditions and design requirements so as to realize more accurate and smooth game experience.
It can be understood that directly selecting the matched motion path from the motion path trajectory library as the motion path of the game object with respect to the motion trajectory of the computing motion sensing device to obtain the motion path has the following advantages:
1. more accurate: when the matched motion paths are selected, matching can be performed according to the pre-stored real motion data, so that the matching is more accurate.
2. More stable: by selecting the matched motion path, the influence of abnormal values or noise in the acceleration data on the motion path can be avoided, so that the stability of the motion path is improved.
3. More efficient: calculating the motion trail of the motion sensing device consumes a great deal of computing resources, and directly selecting the motion trail from the motion trail library can save the computing resources and improve the running efficiency of the game.
4. The method is simpler: the motion trail of the motion sensing device needs to be calculated by complex algorithm and code, and the realization can be simpler and clearer by directly selecting the motion trail from the motion trail library
Of course, the design of the present application is not limited to this, and in other embodiments, the motion path of the game object may be obtained by calculating the motion track of the motion sensing device.
S30, generating a displacement instruction of the game object according to the acceleration data and a preset inching function.
Specifically, the slow Function (tracking Function) is a mathematical Function for describing the motion process of the object, and can adjust the motion speed of the object in time, so as to achieve the effects of acceleration, deceleration and the like of the motion, so that the motion of the object is more natural, comfortable and real.
Common creep functions include: linear slow motion function, sinusoidal slow motion function, exponential slow motion function, elastic slow motion function, rebound slow motion function, etc., each slow motion function has different characteristics and effects.
The displacement instruction refers to an instruction for controlling a change in the position of the game object. In a game, when a developer needs to control a game object to move along a specific path, the game object can be realized by generating a displacement instruction.
In general, the displacement instruction includes positional information of the game object to be moved in the current frame (game frame picture).
According to the technical scheme, the terminal can calculate the distance that the game object needs to move in the current frame according to the current position, the target position and the preset inching function of the game object, and convert the distance into a displacement instruction form.
It can be understood that the slow-moving function is set to generate the displacement instruction of the game object, so that the speed change of the game object in the motion process can be controlled, and the game object can move more truly, naturally and smoothly, and is more in line with the actual motion change.
In some embodiments, generating the displacement instruction of the game object according to the acceleration data and a preset inching function includes the following steps:
S31, screening out a time interval for completing an effective waving action from the acceleration data.
Specifically, a certain threshold and a certain condition can be set, and the time interval of the hand waving action meeting the requirements can be determined by combining actual testing and adjustment.
For example, the time interval for obtaining an effective waving motion can be achieved by the following method:
1. setting triggering conditions of the waving action, for example: the acceleration of the somatosensory device exceeds the set threshold.
2. After receiving the acceleration data, a point in time is found at which the acceleration change exceeds a threshold by processing the data.
3. And searching forwards or backwards for a period of time according to the set duration time of the hand waving action, and taking the period of time as a time interval of the hand waving action meeting the requirement.
Of course, the design of the present application is not limited thereto, and in other embodiments, the time interval may be determined by defining the minimum amplitude and the maximum amplitude, and the minimum speed and the maximum speed of the waving motion, and screening the acceleration data meeting the requirements, according to the game requirements. Or according to the game scene and design, the starting and ending positions of the waving action are defined, so that acceleration data meeting the requirements are screened to determine a time interval. The time interval can also be determined by defining the shortest time length and the longest time length of the hand waving action to screen the acceleration data meeting the requirements.
S32, calling a preset slow function, and taking the time interval as the input of the slow function.
Specifically, the time interval is used as an input of the slow motion function, and specific operations need to be performed according to the definition and implementation mode of the selected slow motion function. Typically, the input to the slow-moving function is a time parameter t, which indicates how much time the animation has been running, typically ranging from 0 to 1. And the time interval may be represented as a start time t1 and an end time t2.
If the input to the slow-moving function is time t, the time interval needs to be converted and mapped into a range of 0 to 1. A simple implementation is to map the start time t1 to 0 and the end time t2 to 1 of a time interval and then map the input parameter t of the slow function proportionally to said time interval, resulting in the actual time value t'. The specific calculation mode is as follows:
t'=(t-t1)/(t2-t1)。
it should be noted that, the design of the present application is not limited to this, and parameters such as displacement, speed, etc. may be selected for the input of the slow motion function, and in this case, the parameters such as corresponding displacement, speed, etc. need to be converted into the input of the slow motion function according to the specific slow motion function definition and implementation.
S33, generating the displacement instruction according to the output of the slow motion function.
Specifically, according to a preset slow motion function and a time interval of the hand waving action, a real value can be obtained, which indicates a distance that the game object needs to move along the motion path. The distance instruction is decomposed into continuous small steps, and the displacement distance of each small step is calculated by a preset inching function. The displacement instructions of each small step can be stored in a queue, and then the displacement instructions are sequentially taken out of the queue according to a certain time interval, so that nonlinear movement of the game object is realized. It should be noted that the size and time interval of the displacement command need to be adjusted according to specific game requirements, so as to achieve the optimal game experience effect.
In some embodiments, the time interval is input as the slow function, comprising the steps of:
s321, mapping the starting time of the time interval to the starting value of the input range of the slow function;
s322, mapping the ending time of the time interval to the ending value of the slow function input range.
In particular, if the input range of the slow function is [0,1] and the start time of the time interval is 2 seconds, then mapping the start time of the time interval to the range of [0,1] may require the use of a linear mapping algorithm, i.e. mapping 2 seconds to 0, i.e. (2-start time)/(end time-start time) × (end value-start value) +start value. The end time may be mapped to the end value of the slow function input range based on substantially the same way as the start time.
S323, calculating the input value of the slow motion function corresponding to each moment in the time interval according to an interpolation algorithm.
For example, if the time interval is [2,4] seconds, the creep function input range is [0,1], and a quadratic creep function is used, then a quadratic interpolation algorithm may be used to calculate a creep function input value corresponding to each time instant within the time interval. These values may be used as part of a displacement instruction to control the non-linear movement of the game object along the motion path. In this way, the game object can be moved more smoothly and naturally.
In some embodiments, generating the displacement instruction from the output of the creep function includes:
s331, calculating a current coordinate value of the game object on the moving path at the current time according to an output value of a slow function, wherein the expression of the slow function is as follows:
f(t)=(1-t) 2 ×P 0 +2×(1-t)×t×P 1 +t 2 ×P 2
wherein f (t) is an output coordinate value, P0, P1 and P2 are constants, t is an input value of the slow function, and the value range is [0,1]. It should be noted that P0, P1 and P2 may be adaptively adjusted according to practical situations.
S332, comparing the current coordinate value with the coordinate value of the previous moment, calculating the displacement of the game object on the moving path at the current moment, and generating the displacement instruction by the displacement.
For example, if the coordinate of the previous time is (2, 3) and the coordinate calculated at the current time is (3, 5), the displacement of the game object on the moving path at the current time is (1, 2), which is taken as the displacement command.
It should be noted that the above-listed slow-moving function is a bezier curve function, and selecting the bezier curve function as the desired slow-moving function has the following advantages:
1. flexibility: the Bezier curve function has flexibility, and the shape of the curve can be adjusted by adjusting the control point, so that different slow-moving effects can be achieved.
2. Smoothness: the Bezier curve function can generate a smooth curve, so that the motion track of the game object in the moving process is more natural.
3. Predictability: the Bezier curve function has predictability, and the position of the game object on the moving path can be predicted according to the input value of the inching function, so that the motion of the game object can be controlled better.
4. Easy realization: the Bezier curve function is simple to calculate and can be realized through basic mathematical operation, so that the complexity of realization and the cost of calculation are reduced.
In some embodiments, generating the displacement instruction from the displacement amount includes:
S3321, two time anchor points are set in the input interval of the slow-motion function so as to divide the input interval into three motion time periods of an acceleration section, a uniform speed section and a deceleration section.
Specifically, the whole displacement process can be divided into three motion time periods of an acceleration period, a uniform speed period and a deceleration period, and the motion time periods are divided by a preset time anchor point and an input interval.
S3322, setting different weight values for the slow motion function output of each motion time period according to the motion time period, wherein the weight values corresponding to the three motion time periods of the acceleration time period, the uniform speed time period and the deceleration time period are respectively a, b and c, and 0< a <1; c > b >1.
Specifically, in order to achieve a smooth transition and realistic sensation of movement of the game object, different weight values may be set for the creep function output for each movement period. In general, the acceleration section and the deceleration section need to move more smoothly than the constant velocity section, and thus the acceleration section and the deceleration section may be respectively set with a higher weight value than the constant velocity section. Meanwhile, since the deceleration section needs to transition from a section of high-speed motion to a stationary state, a higher weight value than the acceleration section is required to achieve a smoother transition.
For example, the acceleration section, the constant velocity section, and the deceleration section may be respectively corresponding to different sections within the input range [0,1] of the slow-motion function, and a corresponding weight value may be set for each section. For example, an acceleration segment may be associated with the input range [0,0.2], a constant velocity segment may be associated with the input range [0.2,0.8], and a deceleration segment may be associated with the input range [0.8,1], with corresponding weight values a, b, c being set, respectively. Where a is a value between 0 and 1, c is a value between 1 and 2, and a is less than 1 and c is greater than b. Thus, according to different input values, the output of the inching function can be weighted according to different weight values, so that smooth transition and realistic sensation are realized.
S3323, generating the displacement instruction according to the displacement and the weight value of the corresponding time period.
Specifically, the displacement amount may be multiplied by a corresponding weight value to obtain a final displacement value, and then a displacement instruction is generated according to the final displacement value.
It can be appreciated that by setting different displacement weight values for each movement time period, a more natural and realistic effect can be achieved in the movement of the game object. By setting different weight values, the motion trail of the game object in the acceleration, uniform speed and deceleration stages can be more in accordance with the motion rule of a real object, for example, when acceleration starts, the object gradually increases acceleration, but the acceleration is not always unchanged but gradually decreases, so that the situation that the game object suddenly changes speed in motion can be avoided, and the game playability and the ornamental value are increased.
And S40, controlling the game object to move in a nonlinear manner along the motion path according to the displacement instruction.
In particular, non-linear movement refers to a movement in which the change in velocity is not linear, i.e. non-uniform, during the movement of the object. In non-uniform motion, the displacement of the object is different in the same time, and the magnitude and direction of the velocity may also change over time.
By adjusting the position of the game object through the output of the inching function, the game object can be controlled to move along the motion path in an inactive mode.
It can be appreciated that the motion sensing game method according to the technical scheme of the present application has the following advantages compared with the conventional linear motion game scheme:
the more realistic and natural movement effect: the speed of the game object moving linearly is constant while the game object moves, the moving track is a straight line, and the moving mode lacks sense of reality. The nonlinear movement is realized through the slow-moving function, so that more natural movement effects, such as changes of an acceleration stage, a uniform speed stage and a deceleration stage, can be simulated, and the motion mode is closer to the real world;
smoother user experience: the nonlinear movement is realized through the slow movement function, so that the game object can be smoother and smoother in the movement process. Compared with a linearly moving game object, obvious jitter and jump are generated in the motion process, and the bad experience can be reduced and the game experience of a user is improved by realizing the nonlinear movement through the slow function;
More flexible and various movement modes: the nonlinear movement is realized through the slow-moving function, various different movement modes such as acceleration, deceleration, uniform speed and the like can be realized, and different weight values can be set in different time periods, so that a more complex animation effect is realized. The flexible and various movement modes can adapt to different types of games and playing methods, so that the playability and the interestingness of the games are improved.
In summary, compared with the traditional linearly moving game scheme, the technical scheme of the method and the device can provide more real, smooth and flexible user experience, and has better playability and game performance.
In some embodiments, after controlling the game object to perform nonlinear movement along the motion path according to the displacement instruction, the somatosensory game method of the present application further includes:
and generating a game result according to the motion path of the game object.
Specifically, the game result refers to a score or prize obtained by the player after the player completes the game in the somatosensory game. Game outcome is typically assessed based on game rules and player performance, which may be game time, points, ratings, rewards, unlocking new game levels, and the like.
For example, game results may be generated by:
1. and acquiring a motion path of the game object, namely acquiring a motion track of the game object in the game process.
2. The motion path of the game object is analyzed, and a score is calculated according to the game rule.
3. And generating a game result according to the scoring condition and displaying the game result to the user.
Specifically, in the motion-sensing game, there are various ways of generating a game result according to a motion path of a game object, for example:
if the game is a fruit cutting game, indexes such as fruit cutting, continuous impact number and the like can be calculated according to the motion path of the game object, and the result of the ancient city game is scored according to the indexes;
if the game is a running game, calculating indexes such as jump height, air time, obstacle avoidance and the like according to the motion path of the game object, scoring according to the indexes and generating a game result;
if the game is a hit game, indexes such as the accuracy, the number of continuous hits and the like of a hit target can be calculated according to the motion path of a game object, and a game result is generated according to the index score;
if the game is a flight game, the game result may be generated by calculating the index such as the flight altitude, the speed, or the passing obstacle from the movement path of the game object, and scoring the game result from the index.
By generating the game result according to the motion path of the game object, the game is more challenging and interesting, and the user can intuitively know the game performance.
In addition, referring to fig. 3, an embodiment of the present invention further provides a motion sensing game device based on a waving motion, where the motion sensing game device based on the waving motion includes:
the acquiring module 110 is configured to acquire acceleration data in a horizontal direction or a vertical direction from the bound somatosensory device after the somatosensory game is started;
a calculation module 120, configured to determine a motion path of a game object in the somatosensory game according to the acceleration data;
a displacement instruction generating module 130, configured to generate a displacement instruction of the game object according to the acceleration data and a preset inching function;
and the control module 140 is used for controlling the game object to move in a nonlinear way along the motion path according to the displacement instruction.
The steps implemented by each functional module of the motion sensing game device based on the waving motion may refer to each embodiment of the motion sensing game method based on the waving motion of the present invention, and will not be described herein.
In addition, the embodiment of the invention also provides a computer readable storage medium, which can be any one or any combination of a plurality of hard disk, a multimedia card, an SD card, a flash memory card, an SMC, a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a portable compact disc read-only memory (CD-ROM), a USB memory and the like. The computer readable storage medium includes the motion sensing game program 10, and the embodiment of the computer readable storage medium of the present invention is substantially the same as the motion sensing game method based on the motion sensing motion and the embodiment of the server 1, and will not be described herein.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. 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 apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, 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 invention 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 invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (10)

1. A somatosensory game method based on waving action, comprising:
after the motion sensing game is started, acquiring acceleration data in the horizontal direction or the vertical direction from the bound motion sensing equipment;
determining a motion path of a game object in the somatosensory game according to the acceleration data;
generating a displacement instruction of the game object according to the acceleration data and a preset inching function;
and controlling the game object to move in a nonlinear way along the motion path according to the displacement instruction.
2. The motion sensing game method based on the hand waving action according to claim 1, wherein determining a motion path of a game object in the motion sensing game according to the acceleration data comprises:
filtering and denoising the acceleration data;
generating an acceleration vector according to the processed acceleration data;
Determining a direction of movement of the somatosensory device based on the acceleration vector;
and selecting a matched motion path from a preset motion path track library according to the moving direction as the motion path of the game object.
3. The motion sensing game method based on the hand waving motion according to claim 1, wherein generating the displacement instruction of the game object according to the acceleration data and a preset inching function comprises:
screening a time interval for finishing an effective waving action from the acceleration data;
calling a preset slow function, and taking the time interval as the input of the slow function;
and generating the displacement instruction according to the output of the slow motion function.
4. A motion sensing game method based on waving motions as defined in claim 3, wherein the inputting of the time interval as the slow motion function comprises:
mapping the starting time of the time interval to the starting value of the slow function input range;
mapping the ending time of the time interval to the ending value of the slow function input range;
and calculating the input value of the slow motion function corresponding to each moment in the time interval according to an interpolation algorithm.
5. The motion sensing game method based on a waving motion according to claim 3, wherein generating the displacement command according to the output of the slow motion function comprises:
calculating coordinate values of the game object on the moving path at the current time according to an output value of a slow motion function, wherein the expression of the slow motion function is as follows:
f(t)=(1-t) 2 ×P 0 +2×(1-t)×t×P 1 +t 2 ×P 2
wherein f (t) is an output coordinate value, P0, P1 and P2 are constants, t is an input value of a slow function, and the value range is [0,1];
comparing the current coordinate value with the coordinate value of the previous moment, calculating the displacement of the game object on the moving path at the current moment, and generating the displacement instruction.
6. The motion sensing game method based on the waving motion of claim 5, wherein generating the displacement command from the displacement amount comprises:
setting two time anchor points in an input interval of the slow function so as to divide the input interval into three motion time periods of an acceleration section, a uniform speed section and a deceleration section;
different weight values are set for the slow motion function output of each motion time period according to the motion time period, and the weight values corresponding to the three motion time periods of the acceleration time period, the uniform speed time period and the deceleration time period are respectively a, b and c, wherein 0< a <1; c > b >1;
And generating the displacement instruction according to the displacement and the weight value of the corresponding time period.
7. The motion sensing game method based on the hand waving motion according to claim 1, wherein after controlling the game object to perform the nonlinear movement along the motion path according to the displacement instruction, the method further comprises:
and generating a game result according to the motion path of the game object.
8. A motion sensing game device based on a waving motion, comprising:
the acquisition module is used for acquiring acceleration data in the horizontal direction or the vertical direction from the bound somatosensory equipment after the somatosensory game is started;
the calculation module is used for determining a motion path of a game object in the somatosensory game according to the acceleration data;
the displacement instruction generation module is used for generating a displacement instruction of the game object according to the acceleration data and a preset slow function;
and the control module is used for controlling the game object to move in a nonlinear way along the motion path according to the displacement instruction.
9. A motion-based motion-sensing game device comprising a memory, a processor, and a motion-based motion-sensing game program stored on the memory and executable on the processor, wherein the motion-based motion-sensing game program when executed by the processor implements the motion-based motion-sensing game method of any of claims 1-7.
10. A computer readable storage medium, wherein a motion based motion sensing game program is stored on the computer readable storage medium, and when the motion sensing game program is executed by a processor, the motion sensing game method based on the motion of the hand is realized according to any one of claims 1-7.
CN202310207726.1A 2023-02-27 2023-02-27 Somatosensory game method based on waving action Pending CN116196611A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310207726.1A CN116196611A (en) 2023-02-27 2023-02-27 Somatosensory game method based on waving action

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310207726.1A CN116196611A (en) 2023-02-27 2023-02-27 Somatosensory game method based on waving action

Publications (1)

Publication Number Publication Date
CN116196611A true CN116196611A (en) 2023-06-02

Family

ID=86507533

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310207726.1A Pending CN116196611A (en) 2023-02-27 2023-02-27 Somatosensory game method based on waving action

Country Status (1)

Country Link
CN (1) CN116196611A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501175A (en) * 2023-06-25 2023-07-28 江西格如灵科技股份有限公司 Virtual character moving method, device, computer equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501175A (en) * 2023-06-25 2023-07-28 江西格如灵科技股份有限公司 Virtual character moving method, device, computer equipment and medium
CN116501175B (en) * 2023-06-25 2023-09-22 江西格如灵科技股份有限公司 Virtual character moving method, device, computer equipment and medium

Similar Documents

Publication Publication Date Title
US11318390B2 (en) Systems and methods for hardware-based matchmaking
WO2017077783A1 (en) Game system, etc. for conducting route search for non-player character on basis of player movement history
US11235241B2 (en) Route navigation system within a game application environment
CN111260762A (en) Animation implementation method and device, electronic equipment and storage medium
EP3807846A1 (en) Method and system for real-time animation generation using machine learning
US7999812B2 (en) Locality based morphing between less and more deformed models in a computer graphics system
WO2022142626A1 (en) Adaptive display method and apparatus for virtual scene, and electronic device, storage medium and computer program product
JP2005319175A (en) Game machine, program, and information storage medium
US11816772B2 (en) System for customizing in-game character animations by players
CN116196611A (en) Somatosensory game method based on waving action
CN115581922A (en) Game character control method, device, storage medium and electronic equipment
CN115222847A (en) Animation data generation method and device based on neural network and related products
JP2005322144A (en) Image generation program, information storage medium, and image generation system
JP6576544B2 (en) Information processing apparatus, information processing method, and computer-readable storage medium
JP2009251887A (en) Image generation system, program, and information storage medium
CN116271785A (en) Somatosensory game method based on slapping action
KR20190127308A (en) Apparatus and method for predicting game user control
CN116196626A (en) Somatosensory game method based on pushing action
CN116251343A (en) Somatosensory game method based on throwing action
CN116474355A (en) Motion sensing game method based on hammering action
Cai et al. Cognitive gaming
JP2013202259A (en) Program, information storage medium, game device, and server system
CN117018594A (en) Somatosensory game method based on apple watch
CN116271783A (en) Somatosensory tug-of-war game method, device, equipment and computer readable storage medium
CN115445201A (en) Skating motion sensing game method and device and computer readable storage medium

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