• Aucun résultat trouvé

Naturalized Motion Generator for NPC in 3D Game

N/A
N/A
Protected

Academic year: 2021

Partager "Naturalized Motion Generator for NPC in 3D Game"

Copied!
5
0
0

Texte intégral

(1)

HAL Id: hal-01771239

https://hal.inria.fr/hal-01771239

Submitted on 19 Apr 2018

HAL is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire HAL, est destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Distributed under a Creative Commons Attribution| 4.0 International License

Naturalized Motion Generator for NPC in 3D Game

Jong-Chul Yoon, In Yoon, Jong-Sung Hong

To cite this version:

Jong-Chul Yoon, In Yoon, Jong-Sung Hong. Naturalized Motion Generator for NPC in 3D Game.

16th International Conference on Entertainment Computing (ICEC), Sep 2017, Tsukuba City, Japan.

pp.366-369, �10.1007/978-3-319-66715-7_41�. �hal-01771239�

(2)

Naturalized motion generator for NPC in 3D game

Jong-Chul Yoon 1 In Seob Yoon2 and Jong-Sung Hong 3

Dept. of Broadcasting Technology, Kangwon National University 1,2,3 media19@kangwon.ac.kr 1 isyoon@kangwon.ac.kr2 jshong@kangwon.ac.kr 3

Abstract. In the 3D game, there are many NPCs for various purposes, and the variety of motion of these NPCs increases the immersion feel- ing of the game. In this paper, we propose a noise - based motion edit- ing 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.

Keywords: Character animation, Noise function, Noise fitting

1. 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 spe- cial 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.

(3)

!2

Figure 1. Motion signal fitting by multiple noise function: refining the extracted noise using a hierarchical 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:

! ,

(1)

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 ! (2) 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

N(t) = Noise(frt)

N

i=1(S(t)−N(t))2

J. C Yoon & I. K Lee & J. J Choi. / Gradient Noise Fitting 5

Because the noise function can be expended unlimited di- mension, we can fit the higher dimension of input data more than 2D or 3D.

For N -dimensional noise fitting, we consider J = 2

N

gra- dient vectors g

j

, ( j = 1, ..., J) as a variable of optimization, where F (x) = c

1

g

1

+ ··· + c

J

g

J

. In this case, we must find the each representative frequency of dimension using the N- dimensional DFT.

The above optimization problem minimizes the squared difference between the noise value and the normalized data, within the range constraints of the PRNs. For N-dimensional noise, we must modify the above problem slightly by con- verting the PRNs into N-dimensional vectors. We used the sequential equality constrained quadratic programming method [Spe98] with the active-set technique [Fle87] to solve the optimization problem.

4.4. Lattice shifting

For better results, we can perform lattice shifting on the tar- get function F (x) prior to optimization. The integer lattice of the noise function can be shifted by some amount ∆x to match the lattice points to the zero crossing points of input data as closely as possible (see Figure 5). Because gradi- ent noise function has zero-crossing property, It is unable to fit the non-zero value to integer lattice. So we shift the do- main of lattice using the optimal translation. Let b

k

denote a zero crossing point of the input data. We can compute b

k

s by computing the zero crossings of the piecewise linear interpo- lation of the normalized data points. The optimal ∆x can be computed by solving the following minimization problem:

minimize ∑ (b

k

° u

k

+ ∆x)

2

, (12)

where u

k

is the nearest integer to b

k

. To avoid the over smoothness we eliminate the ambiguous point set which is b

k

° u

k

> 0.3. Applying lattice shifting in this way, the tar- get function F (x) can be adjusted before the optimization as follows:

F (x) = A

max

· Noise(R

f

· x + ∆x). (13)

shifted lattice original lattice nomalized data

Figure 5: Lattice shifting.

5. Hierarchical Extension and Domain Expansion So far, we have only considered noise within a single oc- tave. Real data has a wide range of frequencies, which can- not be represented by noise within a single octave, and so

we will extend our method to a hierarchical form. A fractal sum, which is the summation of hierarchical noise values, is frequently used to express various real phenomena. Using this mechanism, we can construct a hierarchical noise fitting algorithm with a pyramidal form.

Input Data

Data Nomalizing

Frequency estimation

Gradient Fitting

E=Datai-F(x)

Data

Lattice

noise(x)

E

Until the E < epsilon

Figure 6: Hierarchical noise fitting algorithm.

original data

1 octave noise 2 octave noise 3 octave noise 4 octave noise

Figure 7: Refining the extracted noise using a hierarchical noise function.

5.1. Hierarchical Noise Extraction A fractal sum is defined [EMP

§

02]:

F sum (x) = ∑

U

j=1

Noise(b

j

x)

a

j

, (14)

where U denotes the number of component noise functions (sometimes called ‘layers’ or ‘octaves’), a

j

is a weight re- lated 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 frac- tal 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

submitted to COMPUTER GRAPHICSForum(4/2006).

(4)

!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.

3. 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.

Figure 2. Crowd simulation using time domain expansion: (a) is a base motion and (b) 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 non- uniform 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.

Submission id: paper1135 / Noise Fitting 7

octave 1 2 3 4 5

(a)

(b)

octave 1 2 3 4 5 octave 1 2 3 4 5

(c)

Figure 12:Motion equalizer using a noise pyramid: (a) is the base canonical motion and (b) is the target motion for noise extraction. Using the hierarchical noise function, we can generate (c), which demonstrates motion control by means of an equalizer.

(a)

(b)

Expanding octave 2.

Expanding octave 3.

Expanding octave 4.

(c)

Figure 13:Crowd simulation using domain expansion: (a) is a base canonical motion and (b) is the target motion for noise extraction. Using the hierarchical domain expansion, we simulate a 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 14:Motion analogy: using the drunken motion pattern from Figure 13, we create a the drunken dance (the blue figure is performing the original motion and the red figure performs the adapted motion).

submitted to EUROGRAPHICS 2005.

(5)

!4

Figure 3. Motion analogy: using the drunken motion pattern from Figure 2, we create a the drunken dance (the blue figure is performing the original motion and the red figure performs the adapted motion).

4. 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.

Acknowledgements.

This research was supported by Basic Science Research Program through the Nation- al Research Foundation of Korea(NRF) funded by the Ministry of Education, Science and Technology (NRF-2017R1D1A3B03033656).

References

1. Perlin K.: Realtime responsive animation with personality. IEEE Transactions on Visu- alization and Computer Graphics 1(1), 5–15. (1995)

2. Cook R. L., Derose T.: Wavelet noise. ACM Transactions on Graphics 24(3), 803–811, (2005)

3. Goldberg A., Zwicker M., Durand F: Anisotropic noise. ACM Transactions on Graphics 27(3),54:1–54:8, (2008)

4. Dischler J. M., Ghazanfarpour D.: A procedural description of geometric textures by spec- tral and spatial analysis of profiles. In Proceedings of EURO- GRAPHICS ’97, pp. 129–

139, (1997).

5. Spellucci P.: An sqp method for general non- linear programs using only equality con- strained subproblems. Mathematical Programming 82, 413–448, (1998)

6. Fletcher R.: Practical Methods of Optimiza- tion.JohnWileyandSons, (1987)

Submission id: paper1135 / Noise Fitting 7

octave 1 2 3 4 5

(a)

(b)

octave 1 2 3 4 5 octave 1 2 3 4 5

(c)

Figure 12:Motion equalizer using a noise pyramid: (a) is the base canonical motion and (b) is the target motion for noise extraction. Using the hierarchical noise function, we can generate (c), which demonstrates motion control by means of an equalizer.

(a)

(b)

Expanding octave 2.

Expanding octave 3.

Expanding octave 4.

(c)

Figure 13:Crowd simulation using domain expansion: (a) is a base canonical motion and (b) is the target motion for noise extraction. Using the hierarchical domain expansion, we simulate a 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 14:Motion analogy: using the drunken motion pattern from Figure 13, we create a the drunken dance (the blue figure is performing the original motion and the red figure performs the adapted motion).

submitted to EUROGRAPHICS 2005.

Références

Documents relatifs

From the statistical point of view we find this problem interesting because it is in certain sense intermediate between the classical problem of drift estimation in a diffusion,

Mais un amendement récemment pré- senté contre l'avis du gouvernement par le Sénateur Hugues Portelli , dans le cadre du vote de la loi Valter de transposition de la directive

Cassaine- type diterpenoids fall into two groups: cassaine-type ester amine diterpenoids (Figure 1B) and cassaine-type amide diterpenoids (Figure 1C) [25,26] with the

Avec le dispositif de contrˆ ole de cavitation inertielle, des taux de sonoporation similaires sont attendus pour une mˆ eme consigne dans les configurations boucle ferm´ ee (avec

— A microscopic theory for curved antiphase domain wall motion in ordered structures leads to a prediction that velocity is proportional to mean curvature.. Unlike previous models,

In order to account for the reaction time of individuals, we consider that the coefficient β i depends on the mean value of the individual frustration (defined by (16)) in the

For this special case, characterized by an acyclic influence graph based on cones of vision around the desired direction, the decision taken by each individual (adaptation of

Keywords: fractional Brownian motion, Karhunen-Lo`eve, Fourier series, fractional Orstein- Uhlenbeck, functional quantization..