Naturalized Motion Generator for NPC in 3D Game

. In the 3D game, there are many NPCs for various purposes, and the variety of motion of these NPCs increases the immersion feeling of the game. In this paper, we propose a noise - based motion editing technique that can add diversity and naturalness to the motion of NPCs. In the area of computer graphics, noise function has been used as a classical method of applying the naturalness of the animation. We extract these noise functions from existing motion signals and control them to make many similar motions naturally.


Introduction
The NPC in the game is widely used as a hint to help the game progress or as an element to increase the fun factor. Most of these NPCs take only simplified motions because of the limitation of production, and these limited motions act as an obstacle to the immersion feeling of the game. To solve this simplicity, we propose a technique for applying styles to npc movements. In order to generate stable motion without special attention of the game maker, we propose a technique to change the motion richly using the noise function which is a classical computer graphics element.
Since Perlin [1] introduced the noise function, it has been used in various computer graphics applications for adding random patterns to naive animations or to produce procedural textures. Using noise function, we extract motion pattern from existing motions as non-uniform hierarchical functions, which we can then apply to synthesize new motions with similar characteristics. Users can control the randomness at specified frequencies by varying the parameters of the noise function, while preserving the features of the motion pattern. The advantage of Perlin's classical noise function compared to the various noise functions for the recently introduced anti-aliasing enhanced rendering [2,3] is that Perlin noise is generated for a given random table. Since the motion of a each joint forms of a one-dimensional signal. it can be extracted as a sum of noise function and it is possible to generate a new motion with similar but diversity when the transformation is applied to the random table. Our system proposes a method to easily generate multiple similar motions using this noise function.

2.
Motion analysis based on the noise function.
To construct a noise function that represents the motion signal, we need to find the representative frequency of motion signal. We use the discrete Fourier transform (DFT) to derive the representative frequency. Because general motion signal has a various frequencies, we use method of statistical stability to extract representative frequency which was introduced by Dischler and Ghazanfarpour [4]. Let fr be a representative frequency of given motion signal, then we can design the Perlin noise function as follows: where, t represent time parameter. Since our purpose is to represent the motion signal as a noise function, we need to fit a normalized motion signal is S(t) to a noise function. We design the objective function which changes the random number table of the noise function newly and it to be as similar as possible to the given motion signal as follows: minimize !
The above optimization problem minimizes the squared difference between the noise value and the motion signal. We used the sequential equality constrained quadratic programming method [5] with the active-set technique [6] to solve the optimization problem.
As mentioned above, since the motion signal contains various frequencies, it is difficult to fit the entire motion signal with a noise function of a single frequency. So we have designed an iterative noise extraction algorithm which generates a function of pyramidal form. If we extract noise of a single frequency from motion signal that possibly includes frequencies outside that range, then fitting that single frequency noise may not match real motion signal particularly well. Nevertheless, a noise function obtained in this way will still approximate the input date to some extent, so quadratic programming t technique [Fle87] to ttice shifting on the tartion. The integer lattice by some amount ∆x to crossing points of input ure 5). Because gradiproperty, It is unable to ice. So we shift the doslation. Let b k denote a We can compute b k s by iecewise linear interpo-. The optimal ∆x can be inimization problem: b k . To avoid the over uous point set which is ting in this way, the tarfore the optimization as shifted lattice original lattice hifting.

main Expansion
ise within a single ocfrequencies, which cana single octave, and so Until the E < epsilon

Hierarchical Noise Extraction
A fractal sum is defined [EMP § 02]: where U denotes the number of component noise functions (sometimes called 'layers' or 'octaves'), a j is a weight related to the amplitude, and b j is a weight for controlling the frequency of each component noise function Noise(b j x). The coefficients usually have the properties: a j < a j+1 , and b j < b j+1 , for j = 1, ...,U, so that the resulting fractal sum is determined by the lower-frequency noise terms, with higher amplitudes, added to the higher-frequency noise terms, which have lower amplitudes.
Exploiting this property, we have designed an iterative pattern extraction algorithm which generates a function of pyramidal form. If we extract noise of a single octave from 6). ! 3 the resulting error value have lower amplitude than the original motion signal. Therefore we find representative frequency of error signal and than fit the noise interactively until the error is smaller than a given threshold; the result is in the form of a fractal sum. Using this mechanism, which we call the noise pyramid, we can extract motion signal for various frequencies (see Figure 1). The more octaves we use, the better the approximation that can be achieved.

Similar motion generation for NPC
To test our noise-based system, we selected a simple walking motion and a drunken motion and extracted the difference between the two motion as a noise pyramid. Since the noise function can generate random signals at infinite time, we can generate various similar motions with different time parameters. In an extended tome domain, the noise function repeatedly computes the similar patterns. This is because we preserve the statistical characteristics of the extracted pattern by retaining the distribution of random number table of noise function. Using this property, we simulate a crowd NPC motion by varying different frequencies. As shown Figure 2, each of the resulting images shows the four different variations of a single motion simultaneously that from a crowd. is the target motion for noise extraction. Using the hierarchical time domain expansion, we simulate a NPC crowd by controlling desired frequency terms (c).
Each of these three images shows a crowd made by four different variations on the motion of a single character. Figure 3 shows another application called motion analogy; in which a motion is adapted to a specific style. The analogy factor, drunken style, is extracted as a nonuniform hierarchical noise function as the difference between a pair of inputs (normal walking, drunken walking) and then the style is applied to a 'dancing' motion. The result is a 'drunken dance' and it is possible to apply this style to various types of NPC motion generation. Expanding octave 2.

Conclusions
We have introduced a system that extracts signal pattern from given motion signal and uses it to create various similar motion pattern using noise function. Our method allows the user to control the randomness of particular frequencies within the pattern, while preserving its appearance, and this cab generate the various but similar motion for NPC. Because noise function does not require complex calculation, our method has advantages of lower complexity and it can be used real-time application like 3D game. The limitation of this paper is that it is difficult for the user to control motion detail because the noise depends on the randomness. We will develop a user-friendly interface to compensate for this.