Game program, game system, game processing method, and game device
The game system dynamically updates voxel data to manage material changes in a virtual space using light source conditions and shadow buffers, addressing the challenge of controlling object materials in voxel-based games and improving processing efficiency.
Patent Information
- Application Number
- JP2024177784
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2026-01-15
- Estimated Expiration
- 2044-10-10
AI Technical Summary
Existing game technologies struggle to effectively manage and control material changes of objects in a virtual space using voxel data, necessitating a solution that allows for dynamic material adjustments based on in-game judgments.
A game system that updates voxel data to determine vertex coordinates and materials of meshes based on game processing, utilizing conditions such as light sources and object positions to change materials dynamically, with support from shadow buffers and ray checks for accurate and efficient processing.
Enables games to implement dynamic material changes of voxels in a virtual space, enhancing gameplay realism and reducing processing load through optimized material determination methods.
Smart Images

Figure 0007799781000001 
Figure 0007799781000002 
Figure 0007799781000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to a game program, a game system, a game processing method, and a game device that generate objects in a virtual space using voxel data. [Background technology]
[0002] Conventionally, objects are managed using voxel data, and meshes of the objects are generated in a virtual space based on the voxel data (see, for example, Non-Patent Document 1). [Prior art documents] [Non-patent literature]
[0003] [Non-Patent Document 1] “Marching cubes: A high resolution 3D surface construction algorithm”, Computer Graphics, Volume 21, Number 4, WE Lorensen, HE Cline, 1987 Summary of the Invention [Problem to be solved by the invention]
[0004] In games that use meshes that are generated based on voxel updates, it may be necessary to control not only the meshes but also the materials.
[0005] Therefore, an object of the present invention is to provide a game program, a game system, a game processing method, and a game device that can realize a game using material changes of voxels in a specified voxel space based on judgments made during the game. [Means for solving the problem]
[0006] In order to achieve the above object, the present invention may employ the following configurations (1) to (11), for example.
[0007] (1) One configuration example of the game program of the present invention is to cause a computer of an information processing device to update, based on game processing, a plurality of voxel data defined for each of a plurality of voxel spaces in a virtual space, the voxel data having at least a density indicating the degree to which the space defined by the voxel is virtually occupied by contents and a material indicating the type of the contents for each of a plurality of voxels included in the voxel space, the voxel data being updated, based on game processing, determine vertex coordinates of a first mesh corresponding to the voxel data based on at least the density included in the voxel data, and determine the material of the first mesh based on at least the material included in the voxel data. The method generates or updates the first mesh based on a first determination of whether or not a first determination shape set in the virtual space for at least any one of the voxel spaces is located within a range that satisfies a first condition based on the game processing, and updates the first material to a second material among the materials included in the voxel data of the voxel space that is determined to satisfy the first condition, based on a first determination of whether or not a first determination shape set in the virtual space for at least any one of the voxel spaces is located within a range that satisfies the first condition based on the game processing.
[0008] According to the above configuration (1), when the first judgment shape set for the voxel space satisfies the first condition, the material contained in the voxel data of the voxel space is changed, thereby realizing a game that uses material changes of voxels in a specified voxel space based on judgments during the game.
[0009] (2) In the above configuration (1), the first condition may be that the object is not in the shadow of the first light source.
[0010] According to the above configuration (2), since the first determination shape is not in the shadow of the first light source, it is possible to change the material included in the voxel data in the voxel space.
[0011] (3) In the configuration (1) or (2) above, the computer may perform the first determination based on a shadow buffer that is based on a first light source.
[0012] According to the above configuration (3), the use of a shadow buffer can reduce the processing load required for the first determination.
[0013] (4) In any one of the above configurations (1) to (3), the computer may perform the first determination based on contact between a plurality of rays based on a first light source and a first determination shape.
[0014] According to the above configuration (4), the first determination can be made more accurately by using the ray check.
[0015] (5) In any one of the above configurations (2) to (4), the first light source may be ambient light.
[0016] According to the above configuration (5), the material included in the voxel data in the voxel space can be changed depending on whether the object is located in a range illuminated by ambient light or in a shadow.
[0017] (6) In the above configuration (1), the first condition may be that the object is in contact with or included in a second determination shape defined in the virtual space.
[0018] According to the above configuration (6), when the first judgment shape is in contact with or contained within the second judgment shape defined in the virtual space, the material contained in the voxel data in the voxel space can be changed.
[0019] (7) In the above configuration (6), the second determination shape may be set at a position corresponding to the position of a second light source arranged based on the game processing.
[0020] According to the above configuration (7), it is possible to change the material included in the voxel data in the voxel space based on the second determination shape set at a position corresponding to the position of the second light source.
[0021] (8) In the configuration (6) or (7) above, the second determination shape may be at least one spherical shape centered on the position of the second light source.
[0022] According to the above configuration (8), the material included in the voxel data in the voxel space can be changed based on the spherical shape based on the position of the second light source.
[0023] (9) In any one of the configurations (1) to (8) above, the computer may further update a second material to a first material among materials included in voxel data of a voxel space in which a first judgment shape is set and which is judged not to satisfy a first condition.
[0024] According to the configuration (9) above, when the first judgment shape set for the voxel space goes from satisfying the first condition to no longer satisfying the first condition, it is possible to change the material contained in the voxel data of the voxel space back to its original state.
[0025] (10) In any one of the configurations (1) to (9) above, the computer may be configured to make a first judgment based on whether or not a predetermined number or more of the feature points set in the first judgment shape satisfy a first condition.
[0026] According to the above configuration (10), the first determination can be easily performed by using a plurality of feature points.
[0027] (11) In the configuration (10) above, the first judgment shape may be a rectangular parallelepiped shape, and in this case, the feature points may include at least eight corner points of the rectangular parallelepiped.
[0028] According to the above configuration (11), the first determination can be performed efficiently by using the eight feature points at the corners.
[0029] The present invention may also be embodied in the form of a game system, a game processing method, and a game device. [Effects of the Invention]
[0030] According to the present invention, it is possible to realize a game that uses material changes of voxels in a predetermined voxel space based on decisions made during the game. [Brief explanation of the drawings]
[0031] [Figure 1] A diagram showing an example of the left and right controllers attached to the main unit. [Figure 2] A diagram showing an example of the state when the left controller and right controller are detached from the main unit. [Figure 3] Six-sided views showing an example of the main unit [Figure 4] Six-sided diagram showing an example of the left controller [Figure 5] Six-sided diagram showing an example of the right controller [Figure 6] A block diagram showing an example of the internal configuration of a main unit. [Figure 7] A block diagram showing an example of the internal configuration of the main unit, left controller, and right controller. [Figure 8] FIG. 1 is a diagram showing an example of a terrain object that is a voxel object. [Figure 9]9A and 9B are diagrams showing an example of the state before and after a part of the terrain object shown in FIG. 8 is deleted. [Figure 10] 9A and 9B are diagrams showing an example of the state before and after a part of the terrain object shown in FIG. 8 is deleted. [Figure 11] A diagram showing an example of voxel data [Figure 12] A diagram showing an example of material data [Figure 13] A diagram showing an example of the game space when an update event occurs. [Figure 14] A diagram showing an example of an update range [Figure 15] A diagram showing an example of how to set vertices [Figure 16] A diagram showing one example of how vertex materials are determined [Figure 17] A diagram showing an example of vertex simplification [Figure 18] An example of material conditions [Figure 19] FIG. 10 is a diagram showing an example of a mesh generated based on each vertex. [Figure 20] An example of how a mesh quadrilateral is divided into two triangles. [Figure 21] A diagram showing an example of how to determine the material of polygons that make up the display mesh [Figure 22] An example of materials set at each vertex of two adjacent polygons [Figure 23] An example of applying a texture to a polygon [Figure 24] A diagram showing an example of a method for determining the material of polygons that make up the judgment mesh [Figure 25] FIG. 10 is a diagram showing an example of a game image showing a player character 201 attacking an enemy object 251a located within a shadow area in the game space. [Figure 26] FIG. 2 is a diagram showing an example of a game image showing an enemy object 251 after being changed by being positioned in a lighted area 281 in the game space. [Figure 27]FIG. 10 is a diagram showing an example of a game image showing a state in which the player character 201 is attacking an enemy object 251b located in a lighted range 281 in the game space. [Figure 28] FIG. 10 is a diagram showing an example of a determination shape; [Figure 29] FIG. 10 is a diagram showing an example of determining whether a feature point FP is located within a range illuminated by light by ray checking. [Figure 30] FIG. 10 is a diagram showing an example of a game image depicting a player character 201 holding a light object 202 and an enemy object 251a in the game space. [Figure 31] FIG. 2 shows an example of a game image showing the state after an enemy object 251 has been changed by being positioned within a range 282 of light from the light object 202. [Figure 32] FIG. 10 is a diagram showing an example of a game image showing a player character 201 standing on a voxel block located within the shadow of an obstacle in the game space. [Figure 33] FIG. 10 is a diagram showing an example of a game image showing a state in which the position of the shadow of an obstacle in the game space has changed; [Figure 34] FIG. 1 is a diagram showing an example of the positional relationship between a light source, an obstacle, and a surface on which a shadow of the obstacle is cast. [Figure 35] FIG. 10 is a diagram showing an example of a range in the game space where light and shadow determination is performed using a shadow buffer and a range where light and shadow determination is performed by ray checking. [Figure 36] FIG. 10 is a diagram showing an example of various data used in information processing in a game system. [Figure 37] A flowchart showing an example of the flow of game processing executed by the game system. [Figure 38] A subroutine showing an example of the material change process in step S7 in FIG. 37. DETAILED DESCRIPTION OF THE INVENTION
[0032] [1. Game system configuration] A game system according to an example of this embodiment will be described below. An example of the game system 1 according to this embodiment includes a main unit (information processing device; in this embodiment, it functions as a game device main unit) 2, a left controller 3, and a right controller 4. The left controller 3 and the right controller 4 are each detachable from the main unit 2. In other words, the game system 1 can be used as an integrated device by attaching the left controller 3 and the right controller 4 to the main unit 2. The game system 1 can also be used by separating the main unit 2 from the left controller 3 and the right controller 4 (see FIG. 2). Below, the hardware configuration of the game system 1 according to this embodiment will be described, followed by a description of the control of the game system 1 according to this embodiment.
[0033] FIG. 1 is a diagram showing an example of a state in which a left controller 3 and a right controller 4 are attached to a main unit 2. As shown in FIG. 1, the left controller 3 and the right controller 4 are each attached to and integrated with the main unit 2. The main unit 2 is a device that executes various processes (e.g., game processes) in the game system 1. The main unit 2 is equipped with a display 12. The left controller 3 and the right controller 4 are devices that have operation units that allow the user to perform inputs.
[0034] Fig. 2 is a diagram showing an example of the state in which the left controller 3 and the right controller 4 are detached from the main unit 2. As shown in Figs. 1 and 2, the left controller 3 and the right controller 4 are detachable from the main unit 2. Note that, below, the left controller 3 and the right controller 4 may be collectively referred to as "controllers."
[0035] Fig. 3 is a six-sided view showing an example of the main unit 2. As shown in Fig. 3, the main unit 2 includes a substantially plate-shaped housing 11. In this embodiment, the main surface of the housing 11 (in other words, the front surface, i.e., the surface on which the display 12 is provided) is generally rectangular.
[0036] The shape and size of the housing 11 are arbitrary. As an example, the housing 11 may be of a portable size. Furthermore, the main unit 2 alone or an integrated device in which the left controller 3 and right controller 4 are attached to the main unit 2 may be a portable device. Furthermore, the main unit 2 or the integrated device may be a handheld device. Furthermore, the main unit 2 or the integrated device may be a portable device.
[0037] 3, the main unit 2 includes a display 12 provided on the main surface of the housing 11. The display 12 displays images generated by the main unit 2. In this embodiment, the display 12 is a liquid crystal display (LCD). However, the display 12 may be any type of display device.
[0038] The main device 2 also includes a touch panel 13 on the screen of the display 12. In this embodiment, the touch panel 13 is of a type that allows multi-touch input (for example, a capacitance type). However, the touch panel 13 may be of any type, and may be of a type that allows single-touch input (for example, a resistive type).
[0039] The main unit 2 is provided with a speaker (i.e., speaker 88 shown in FIG. 6) inside the housing 11. As shown in FIG. 3, speaker holes 11a and 11b are formed on the main surface of the housing 11. The output sound of the speaker 88 is output from these speaker holes 11a and 11b, respectively.
[0040] The main unit 2 also has a left terminal 17, which is a terminal for the main unit 2 to communicate with the left controller 3 via a wired connection, and a right terminal 21, which is a terminal for the main unit 2 to communicate with the right controller 4 via a wired connection.
[0041] As shown in FIG. 3, the main unit 2 includes a slot 23. The slot 23 is provided on the upper side of the housing 11. The slot 23 has a shape that allows a predetermined type of storage medium to be inserted therein. The predetermined type of storage medium is, for example, a storage medium (e.g., a dedicated memory card) dedicated to the game system 1 and the same type of information processing device. The predetermined type of storage medium is used, for example, to store data used by the main unit 2 (e.g., application save data, etc.) and / or programs executed by the main unit 2 (e.g., application programs, etc.). The main unit 2 also includes a power button 28.
[0042] The main unit 2 has a lower terminal 27. The lower terminal 27 is a terminal through which the main unit 2 communicates with the cradle. In this embodiment, the lower terminal 27 is a USB connector (more specifically, a female connector). When the all-in-one device or the main unit 2 alone is placed on the cradle, the game system 1 can display images generated and output by the main unit 2 on a stationary monitor. In this embodiment, the cradle also has the function of charging the all-in-one device or the main unit 2 alone that is placed on it. The cradle also has the function of a hub device (specifically, a USB hub).
[0043] FIG. 4 is a six-sided view showing an example of the left controller 3. As shown in FIG. 4, the left controller 3 includes a housing 31. In this embodiment, the housing 31 has a vertically long shape, that is, a shape that is long in the up-down direction (i.e., the y-axis direction shown in FIGS. 1 and 4). The left controller 3 can also be held in a vertically long orientation when detached from the main unit 2. The housing 31 has a shape and size that allows it to be held in one hand, particularly the left hand, when held in a vertically long orientation. The left controller 3 can also be held in a horizontally long orientation. When the left controller 3 is held in a horizontally long orientation, it may be held with both hands.
[0044] The left controller 3 includes an analog stick 32. As shown in FIG. 4, the analog stick 32 is provided on the main surface of the housing 31. The analog stick 32 can be used as a direction input unit that can input directions. By tilting the analog stick 32, the user can input a direction corresponding to the tilt direction (and input a magnitude corresponding to the tilt angle). Note that instead of an analog stick, the left controller 3 may be equipped with a cross key or a slide stick that can perform slide inputs as a direction input unit. In this embodiment, input can be made by pressing the analog stick 32.
[0045] The left controller 3 is equipped with various operation buttons. The left controller 3 is equipped with four operation buttons 33 to 36 (specifically, a right button 33, a down button 34, an up button 35, and a left button 36) on the main surface of the housing 31. The left controller 3 also is equipped with a record button 37 and a - (minus) button 47. The left controller 3 is equipped with a first L button 38 and a ZL button 39 on the upper left of the side of the housing 31. The left controller 3 is also equipped with a second L button 43 and a second R button 44 on the side of the housing 31 that is attached to the main unit 2. These operation buttons are used to issue instructions according to various programs (for example, OS programs and application programs) executed on the main unit 2.
[0046] The left controller 3 also includes a terminal 42 for wired communication between the left controller 3 and the main unit 2.
[0047] FIG. 5 is a six-sided view showing an example of the right controller 4. As shown in FIG. 5, the right controller 4 includes a housing 51. In this embodiment, the housing 51 has a vertically long shape, that is, a shape that is long in the up-down direction. The right controller 4 can also be held in a vertically long orientation when detached from the main unit 2. The housing 51 has a shape and size that allows it to be held in one hand, particularly the right hand, when held in a vertically long orientation. The right controller 4 can also be held in a horizontally long orientation. When the right controller 4 is held in a horizontally long orientation, it may be held with both hands.
[0048] Like the left controller 3, the right controller 4 is equipped with an analog stick 52 as a directional input unit. In this embodiment, the analog stick 52 has the same configuration as the analog stick 32 of the left controller 3. The right controller 4 may also be equipped with a cross key or a slide stick that allows slide input, instead of an analog stick. Like the left controller 3, the right controller 4 is equipped with four operation buttons 53 to 56 (specifically, an A button 53, a B button 54, an X button 55, and a Y button 56) on the main surface of the housing 51. The right controller 4 is also equipped with a + (plus) button 57 and a home button 58. The right controller 4 is also equipped with a first R button 60 and a ZR button 61 on the upper right side of the housing 51. Like the left controller 3, the right controller 4 is also equipped with a second L button 65 and a second R button 66.
[0049] The right controller 4 also includes a terminal 64 for wired communication between the right controller 4 and the main unit 2.
[0050] Fig. 6 is a block diagram showing an example of the internal configuration of main unit 2. In addition to the configuration shown in Fig. 3, main unit 2 includes components 81-91, 97, and 98 shown in Fig. 6. Some of these components 81-91, 97, and 98 may be mounted on an electronic circuit board as electronic components and housed in housing 11.
[0051] The main unit 2 includes a processor 81. The processor 81 is an information processing unit that executes various types of information processing executed in the main unit 2, and may be composed of, for example, only a CPU (Central Processing Unit), or may be composed of an SoC (System-on-a-chip) that includes multiple functions such as a CPU function and a GPU (Graphics Processing Unit) function. The processor 81 executes various types of information processing by executing an information processing program (for example, a game program) stored in a storage unit (specifically, an internal storage medium such as flash memory 84, or an external storage medium inserted into slot 23, etc.).
[0052] The main device 2 includes a flash memory 84 and a DRAM (Dynamic Random Access Memory) 85 as examples of internal storage media built into the main device 2. The flash memory 84 and the DRAM 85 are connected to the processor 81. The flash memory 84 is a memory used primarily to store various types of data (which may be programs) saved in the main device 2. The DRAM 85 is a memory used to temporarily store various types of data used in information processing.
[0053] The main device 2 includes a slot interface (hereinafter abbreviated as "I / F") 91. The slot I / F 91 is connected to the processor 81. The slot I / F 91 is connected to the slot 23, and reads and writes data from and to a predetermined type of storage medium (e.g., a dedicated memory card) inserted into the slot 23 in accordance with instructions from the processor 81.
[0054] The processor 81 reads and writes data from and to the flash memory 84, DRAM 85, and the above-mentioned storage media as appropriate, to execute the above-mentioned information processing.
[0055] The main unit 2 includes a network communication unit 82. The network communication unit 82 is connected to the processor 81. The network communication unit 82 communicates with external devices via a network (specifically, wireless communication). In this embodiment, the network communication unit 82 connects to a wireless LAN and communicates with external devices using a method conforming to the Wi-Fi (registered trademark) standard as a first communication mode. The network communication unit 82 also performs wireless communication with other main units 2 of the same type using a predetermined communication method (e.g., communication using a proprietary protocol or infrared communication) as a second communication mode. Note that the wireless communication using the second communication mode enables wireless communication with other main units 2 located within a closed local network area, and realizes a function that enables so-called "local communication," in which data is transmitted and received by direct communication between multiple main units 2.
[0056] The main unit 2 is equipped with a controller communication unit 83. The controller communication unit 83 is connected to the processor 81. The controller communication unit 83 performs wireless communication with the left controller 3 and / or right controller 4. Any communication method may be used between the main unit 2 and the left controller 3 and right controller 4, but in this embodiment, the controller communication unit 83 performs communication with the left controller 3 and right controller 4 in accordance with the Bluetooth (registered trademark) standard.
[0057] The processor 81 is connected to the left terminal 17, right terminal 21, and lower terminal 27. When performing wired communication with the left controller 3, the processor 81 transmits data to the left controller 3 via the left terminal 17 and receives operation data from the left controller 3 via the left terminal 17. When performing wired communication with the right controller 4, the processor 81 transmits data to the right controller 4 via the right terminal 21 and receives operation data from the right controller 4 via the right terminal 21. When performing wired communication with the right controller 4, the processor 81 transmits data to the cradle via the lower terminal 27. As described above, in this embodiment, the main unit 2 can perform both wired and wireless communication with the left controller 3 and the right controller 4. When an integrated device in which the left controller 3 and the right controller 4 are attached to the main unit 2 or the main unit 2 alone is attached to the cradle, the main unit 2 can output data (e.g., image data and audio data) to a stationary monitor or the like via the cradle.
[0058] Here, the main unit 2 can communicate simultaneously (in other words, in parallel) with multiple left controllers 3. The main unit 2 can also communicate simultaneously (in other words, in parallel) with multiple right controllers 4. Therefore, multiple users can simultaneously input to the main unit 2 using their own sets of left controllers 3 and right controllers 4. For example, a first user can input to the main unit 2 using a first set of left controllers 3 and right controllers 4, while a second user can simultaneously input to the main unit 2 using a second set of left controllers 3 and right controllers 4.
[0059] The display 12 is also connected to the processor 81. The processor 81 displays on the display 12 an image generated (for example, by executing the above-described information processing) and / or an image acquired from the outside.
[0060] The main unit 2 includes a codec circuit 87 and speakers (specifically, a left speaker and a right speaker) 88. The codec circuit 87 is connected to the speakers 88 and the audio input / output terminal 25, and is also connected to the processor 81. The codec circuit 87 is a circuit that controls the input and output of audio data to and from the speakers 88 and the audio input / output terminal 25.
[0061] The main device 2 includes a power control unit 97 and a battery 98. The power control unit 97 is connected to the battery 98 and the processor 81. Although not shown, the power control unit 97 is also connected to each part of the main device 2 (specifically, each part that receives power from the battery 98, the left terminal 17, and the right terminal 21). The power control unit 97 controls the power supply from the battery 98 to each of the above parts based on instructions from the processor 81.
[0062] Furthermore, battery 98 is connected to lower terminal 27. When an external charging device (e.g., a cradle) is connected to lower terminal 27 and power is supplied to main device 2 via lower terminal 27, battery 98 is charged with the supplied power.
[0063] Figure 7 is a block diagram showing an example of the internal configuration of the main unit 2, left controller 3, and right controller 4. Note that details of the internal configuration of the main unit 2 are omitted in Figure 7 because they are shown in Figure 6.
[0064] The left controller 3 is equipped with a communication control unit 101 that communicates with the main unit 2. As shown in FIG. 7 , the communication control unit 101 is connected to each component, including the terminal 42. In this embodiment, the communication control unit 101 can communicate with the main unit 2 both via wired communication via the terminal 42 and via wireless communication without using the terminal 42. The communication control unit 101 controls the method of communication between the left controller 3 and the main unit 2. That is, when the left controller 3 is attached to the main unit 2, the communication control unit 101 communicates with the main unit 2 via the terminal 42. When the left controller 3 is detached from the main unit 2, the communication control unit 101 communicates wirelessly with the main unit 2 (specifically, with the controller communication unit 83). Wireless communication between the controller communication unit 83 and the communication control unit 101 is performed in accordance with, for example, the Bluetooth (registered trademark) standard.
[0065] The left controller 3 also includes a memory 102, such as a flash memory. The communication control unit 101 is configured, for example, by a microcomputer (also called a microprocessor), and executes firmware stored in the memory 102 to perform various processes.
[0066] The left controller 3 includes buttons 103 (specifically, buttons 33 to 39, 43, 44, and 47). The left controller 3 also includes an analog stick (referred to as "stick" in FIG. 7) 32. Each button 103 and analog stick 32 repeatedly outputs information related to operations performed on the button 103 and analog stick 32 to the communication control unit 101 at appropriate timing.
[0067] The communication control unit 101 acquires information related to the input (specifically, information related to the operation or the detection results from the sensor) from each input unit (specifically, each button 103 and analog stick 32). The communication control unit 101 transmits operation data including the acquired information (or information obtained by performing a predetermined process on the acquired information) to the main unit 2. The operation data is repeatedly transmitted once every predetermined time. The interval at which the information related to the input is transmitted to the main unit 2 may or may not be the same for each input unit.
[0068] By transmitting the above operation data to the main unit 2, the main unit 2 can obtain the input made to the left controller 3. In other words, the main unit 2 can determine the operation of each button 103 and analog stick 32 based on the operation data.
[0069] The left controller 3 is equipped with a power supply unit 108. In this embodiment, the power supply unit 108 has a battery and a power control circuit. Although not shown, the power control circuit is connected to the battery and to each part of the left controller 3 (specifically, each part that receives power from the battery).
[0070] As shown in FIG. 7, the right controller 4 is equipped with a communication control unit 111 that communicates with the main unit 2. The right controller 4 also has a memory 112 that is connected to the communication control unit 111. The communication control unit 111 is connected to each component, including the terminal 64. The communication control unit 111 and memory 112 have the same functions as the communication control unit 101 and memory 102 of the left controller 3. Therefore, the communication control unit 111 can communicate with the main unit 2 both via wired communication via the terminal 64 and via wireless communication that does not use the terminal 64 (specifically, communication in accordance with the Bluetooth (registered trademark) standard), and controls the method of communication between the right controller 4 and the main unit 2.
[0071] The right controller 4 has input units similar to those of the left controller 3. Specifically, it has buttons 113 and an analog stick 52. These input units have the same functions as those of the left controller 3 and operate in the same manner.
[0072] The right controller 4 is equipped with a power supply unit 118. The power supply unit 118 has the same functions as the power supply unit 108 of the left controller 3 and operates in the same manner.
[0073] [2. Overview of processing in the game system] Next, an overview of the processing executed in the game system 1 will be described with reference to Figs. 8 to 24. In this embodiment, the game system 1 generates a game image in which terrain objects and characters (for example, a player character controlled by a user) are arranged in a game space, which is a three-dimensional virtual space, and displays the game image on a display device. Note that in this embodiment, the display device on which the game image is displayed may be the above-mentioned display 12 or a stationary monitor.
[0074] [2-1. Voxel] In this embodiment, the shapes of some objects in the game space are defined by voxel data. Here, a voxel is a rectangular parallelepiped (more specifically, cubic) region arranged in a grid pattern in the game space, and voxel data is data that indicates information about each voxel. Hereinafter, an object whose shape is defined by voxel data will be referred to as a "voxel object." In this embodiment, the game system 1 stores voxel data for a plurality of voxels set in the game space as data for generating voxel objects in the game space.
[0075] Fig. 8 is a diagram showing an example of a terrain object that is a voxel object. As shown in Fig. 8, in this embodiment, the shape of a terrain object that represents terrain such as the ground is defined by voxel data (i.e., it is a voxel object). Each cube shown in Fig. 8 represents a terrain object. Note that in Fig. 8, the edges of the terrain object are shown with thick lines, but these thick lines are added to make the drawing easier to read, and in reality, the edges of the terrain object do not need to be displayed thick.
[0076] The terrain object shown in FIG. 8 is generated according to a rule that, for example, "if a parameter included in the voxel data set for a voxel is greater than a predetermined value, a cube is placed at the position of the voxel, and if the parameter is equal to or less than the predetermined value, nothing is placed at the position of the voxel." The terrain object shown in FIG. 8 is shown for the purpose of clearly illustrating the relationship between voxels and voxel objects. In this embodiment, a voxel object is actually generated (based on voxel data) according to a rule that results in a complex shape, such as the terrain object shown in FIG. 13 (described later). Note that the rule for determining the shape of the voxel object based on the voxel data is arbitrary. In other embodiments, the game system 1 may generate a voxel object as shown in FIG. 8 or a voxel object as shown in FIG. 13 based on object data.
[0077] The shape of a voxel object can be changed by changing the voxel data of each voxel. FIGS. 9 and 10 are diagrams showing an example of the state before and after a portion of the terrain object shown in FIG. 8 is deleted. That is, when the hatched portion of the terrain object shown in FIG. 9 is destroyed, the terrain object changes to a shape as shown in FIG. 10. At this time, the game system 1 can easily erase the terrain object by rewriting the voxel data (described later) for the voxels in the hatched portion so that they indicate that the terrain object does not exist. Note that when adding a terrain object, the game system 1 can easily change the shape of the terrain object by changing the voxel data of each voxel, just as when erasing a terrain object.
[0078] In this way, the game system 1 can freely change the shape of a voxel object by rewriting the voxel data. For example, when a terrain object is destroyed in a game for some reason (for example, when a player character hits the terrain object), resulting in a change in the shape of the terrain object, the game system 1 can freely change the shape of the terrain object by changing the voxel data used to generate the terrain object, rather than directly changing the data indicating the outer shape of the terrain object (i.e., a mesh, which will be described later).
[0079] In this embodiment, voxels are defined throughout the entire game space (i.e., the voxel space in which voxels are set corresponds to the entire game space). However, the voxel space does not have to be set throughout the entire game space, and may be set in a partial area of the game space. When a voxel space is set in a partial area of the game space, the shape of a voxel object is defined by voxel data related to the voxels in the voxel space, and the position of the voxel object in the game space is defined by the position of the voxel space in the game space. Furthermore, multiple voxel spaces may be set in the game space, and a main voxel space may be set throughout the entire game space and a sub-voxel space may be set in a partial area of the game space. In this case, the game system 1 stores voxel data for each voxel space.
[0080] 11 is a diagram showing an example of voxel data. The voxel data includes density data, a first material ID, a second material ID, material mixing ratio data, and state data for each voxel defined in the game space. In the voxel data of this embodiment, these data are set for each voxel.
[0081] The density data indicates density, which is an index used to define the shape of a voxel object based on the voxel (specifically, the shape defined by a mesh, which will be described later). As will be described in detail later, the position and shape of the surface of the voxel object (i.e., the mesh, which will be described later) are determined based on the density.
[0082] In this embodiment, density can take an integer value ranging from a lower limit (e.g., 0) to an upper limit (e.g., 255). In this embodiment, the game system 1 determines the surface shape of a voxel object based on density such that a high density value set for a voxel tends to increase the volume ratio of the area inside the voxel object within that voxel, and a low density value tends to decrease that ratio. In this way, density is an index that affects the volume ratio of the area inside the voxel object within that voxel. Density can also be considered an index that indicates the degree to which the space of that voxel is occupied by virtual contents (i.e., the virtual contents of the voxel object). For example, a density of 0 means that the voxel is empty; a density of 255 means that the entire voxel is occupied by the contents of the voxel object; and a density value between 0 and 255 means that the contents of the voxel object occupy the voxel at a ratio according to the value. Then, the shape of the mesh, i.e., the surface shape of the voxel object, can be determined based on the density. The mesh can be described as the surface of the portion of the voxel where content exists, or as the boundary between the portion of the voxel where content exists and the portion of the voxel where content does not exist. Note that the volume occupied by the region within the voxel object generated based on the density does not need to be a volume that strictly matches the proportion indicated by the density. For example, the volume of the voxel object generated by a method such as that shown in Figure 8 and a method such as that shown in Figure 13 may differ even if they are based on the same density.
[0083] In other embodiments, the density may indicate either the entire area of the voxel being occupied by the volume of the area in the voxel object, or the area in the voxel not including the volume of the area in the voxel object. For example, the density data may be data that can only take on the values 0 or 1.
[0084] The first material ID and the second material ID are information indicating the material (in other words, the substance) of the voxel. In this embodiment, a material such as sand, rock, or soil is set to the voxel. Note that the game system 1 provides a plurality of types of materials that can be set to the voxel (see the material data shown in FIG. 12). In this embodiment, up to two materials from the plurality of types of materials provided can be set to one voxel. The first material ID is an ID indicating the first material set to the voxel, and the second material ID is an ID indicating the second material set to the voxel. As will be described in detail later, the material of a voxel object (i.e., the material set to the polygons of the voxel object) is determined based on the material set to the voxel.
[0085] As described above, in this embodiment, the voxel data includes an ID indicating the material, but in other embodiments, the voxel data may have a data structure that includes data that directly indicates the content of the material (i.e., the name, properties, and drawing setting information described below).
[0086] The material mixing ratio data is an example of data indicating the ratio of each material in a voxel. In this embodiment, since up to two material IDs can be set for one voxel, the material mixing ratio data indicating the ratio of one of the materials indicated by the first material ID and the second material ID can also indicate the ratio of the other material. In this embodiment, the material mixing ratio is a value between 0 and 1 indicating the ratio of the second material to the entire first and second materials. For example, if the material mixing ratio set for a certain voxel is 0.4, this indicates that the first material and the second material are composed in a ratio of 0.6:0.4 in that voxel. As will be described in detail later, the appearance and properties of a voxel object are determined based on the materials. The material mixing ratio is used to determine the appearance and properties of a voxel object. In other embodiments, the material mixing ratio may be a value indicating the ratio of the first material. Furthermore, the ratio of materials in a voxel may be represented by individual values indicating the ratio of each material. In particular, in other embodiments, when three or more types of materials can be set instead of two, the ratio of the materials within the voxel is expressed as a plurality of values indicating the proportion of each material.
[0087] In this embodiment, two types of materials do not necessarily have to be set for a voxel, and one type of material may be set. For example, if one type of material is set for a certain voxel, the first material ID indicates that material, and the material mixing ratio is set to 0.
[0088] The state data indicates the state set for the voxel. The specific content and number of types of state data are arbitrary. In this embodiment, the state data includes data indicating the amount of damage set for the voxel. Note that in other embodiments, the state data may include, for example, data indicating whether or not the voxel is wet (and to what extent).
[0089] As described above, in this embodiment, the voxel data includes a material ID, and the game system 1 stores material data that defines the content of the material indicated by the material ID. Fig. 12 is a diagram showing an example of material data. As shown in Fig. 12, in the material data in this embodiment, the material ID is associated with the name, properties, and rendering setting information set for each material.
[0090] The name included in the material data is the name set for the material (for example, earth, sand, grass, etc.). Note that the name of the material of a voxel object may be displayed during the game. To achieve this display, the material data includes information on the name of the material.
[0091] The properties included in the material data are properties that are set for the material. The material properties are properties that the voxel object to which the material is set has in the game. The specific content and number of types of material properties are arbitrary. For example, at least one of the following information may be set as the material properties: Hardness Weight Slipperiness - Damage settings when the player character comes into contact ·temperature Whether other objects can be glued to the voxel object The amount of health recovered by the player character when the player character destroys or acquires a voxel object The amount of in-game currency the player character will acquire when they destroy or acquire a voxel object. In other embodiments, information other than the above may be set as information indicating the properties of the material.
[0092] In this embodiment, the material data includes an ID indicating the property as information specifying the property of the material (see FIG. 12). Although not shown, the game system 1 stores property information for each prepared property in which the content of the property (for example, values indicating the weight and slipperiness described above) is associated with the property ID. The game system 1 can specify the specific content of the property set for the material by referring to the property information.
[0093] The rendering settings included in the material data are information indicating settings related to rendering, such as textures used to render the voxel object to which the material is set. In this embodiment, the material data includes, as information on the rendering settings, the IDs of the textures used to render the voxel object to which the material is set (see FIG. 12). Although not shown, the game system 1 stores texture information that associates a texture ID with the texture indicated by the texture ID for each texture provided. By referring to the texture information, the game system 1 can identify the specific content of the texture set for the material. Note that in other embodiments, in addition to texture information, any information related to shading settings may be set as information on the rendering settings. For example, information related to reflectance, normals, etc. may be set.
[0094] Furthermore, the material data may include data other than the data shown in Fig. 12. For example, the material data may include data related to sound settings. For example, the data related to sound settings may be data that defines footsteps to be output when a player character walks on a voxel object based on the voxel.
[0095] The material data may be data in any format that can identify the properties and / or rendering settings of a material. For example, in another embodiment, the material data may have a data structure that includes data that directly indicates the properties and / or rendering settings of a material, instead of a data structure that includes a material ID or a texture ID.
[0096] [2-2. Updating Voxel Data] During the game, the voxel data is updated, thereby deforming the voxel object. In this embodiment, when a game event for updating the voxel object (hereinafter referred to as an "update event") occurs, the game system 1 updates the voxel data. The specific content of the update event is arbitrary. The update event may be, for example, an action by a character appearing in the game that deforms the voxel object (e.g., a player character punching a voxel object), or the occurrence of an event that deforms the voxel object (e.g., an object thrown by a character coming into contact with a voxel object, or a bomb exploding).
[0097] Fig. 13 is a diagram showing an example of a game space when an update event has occurred. The situation shown in Fig. 13 is a situation in which a player character 201 has performed a punch action on a terrain object 202, which is a voxel object. Details will be described later, but in the example shown in Fig. 13, the voxel data is updated so that the terrain object 202 around the position where the punch action by the player character 201 has landed is erased. This expresses the situation in which the terrain object 202 is destroyed by the punch action by the player character 201.
[0098] In this embodiment, when an update event occurs, the game system 1 sets an update range in the game space (an update range 203 in the example shown in FIG. 13 ) in which the voxel object is updated. The position, shape, and size of the update range are arbitrary. The position of the update range may be determined based on, for example, the position of contact between an object related to the update event that has occurred (e.g., the player character that delivered the punch) and the voxel object. In the example shown in FIG. 13 , the position of the update range 203 may be determined based on the position where a punch from the player character 201 has landed. For example, the center position of the update range 203 may be the position of the hit or a position a predetermined distance forward from the position of the hit. The shape and size of the update range may be determined in advance to be a shape according to the type of update event. For example, when an update event occurs due to a punch from the player character 201, the shape and size of the update range may be determined as a sphere of a predetermined size as shown in FIG. 13 . The size of the update range may also be determined according to a value indicating the degree of influence of the update event that has occurred (e.g., the strength of the punch or the size of the explosion).
[0099] The game system 1 changes the density of voxels corresponding to the set update range. Note that voxels corresponding to the update range are, for example, voxels within the update range or voxels that overlap with the update range. As a result of changing the density, the mesh of the voxel object is changed by processing described below, thereby changing the shape of the voxel object (the visible shape and the shape used for collision detection). Note that in other embodiments, in addition to changing the density of voxels included in the update range, the game system 1 may change the materials (i.e., the first material, the second material, and the material mixing ratio) of the voxels, or may change the state of the voxels.
[0100] In this embodiment, the game system 1 determines whether a voxel is included in the update range using an SDF (Signed Distance Field). The game system 1 sets an SDF indicating the update range set in the game space and performs the above determination based on the value of the SDF. The SDF represents the distance from a specified shape to an arbitrary position using a signed value. FIG. 14 is a diagram illustrating an example of the update range. In the example shown in FIG. 14, a spherical update range is set in the game space. For example, in the example shown in FIG. 14, the SDF is set so that, among positions in the game space, positions inside the shape represented by the SDF have negative SDF values and positions outside the shape represented by the SDF have positive SDF values. In this example, whether a voxel is included in the update range can be determined based on whether the SDF value is positive or negative. Furthermore, by using the signed distance value, not only simple inside / outside determination but also processes such as correction and interpolation can be performed.
[0101] In the above, an example was described in which a change was made to a voxel object such that the voxel objects within the update range were transformed as if they had been deleted, but the change made to a voxel object using the update range is not limited to this. For example, a change may be made to a voxel object such that a new voxel object is added within the update range (i.e., the volume occupied by the area within the voxel object increases by the amount of the update range). Also, a change may be made to a voxel object such that only the material of the voxels within the update range changes, without changing the density of the voxels. Also, a change in voxel density and a change in material may be made in combination.
[0102] [2-3. Calculating the vertices] When the voxel density is updated as described above, the game system 1 sets vertices based on the updated voxel data. These vertices can become vertices of the mesh of the voxel object. As will be described in detail later, in this embodiment, the vertices are simplified, and the simplified vertices become vertices of the mesh of the voxel object.
[0103] FIG. 15 is a diagram showing an example of a method for setting vertices. In the following descriptions of FIGS. 15 to 24, voxels, vertices, meshes, etc. are depicted in two dimensions for the purpose of making the drawings easier to see and the explanation easier to understand. However, in reality, vertices and meshes are set in three-dimensional space based on voxels in the three-dimensional space. In this embodiment, the game system 1 uses a method for setting vertices at coordinates based on the positions and densities of multiple surrounding voxels in an area where voxels having a density set to indicate their presence (i.e., a density equal to or greater than a reference value, described later) are adjacent to voxels having a density set to indicate their absence (i.e., a density less than a reference value, described later). Details of this method are described below.
[0104] As described above, in this embodiment, the density set for a voxel is set in the range of 0 to 255. A voxel with a density of 0 represents a completely empty state, and a voxel with a density of 255 represents a completely filled state. Densities between 0 and 255 are treated as interpolation and used to determine vertices. In this embodiment, voxels with a density equal to or greater than a reference value are virtually considered to be inside the object, and voxels with a density less than the reference value are virtually considered to be outside the object. It is also possible to virtually consider voxels with a density equal to or greater than a reference value as voxels indicating presence, and voxels with a density less than the reference value as voxels indicating absence. It is not necessary to define only voxels with a density of 0 as outside the object (i.e., the reference value = 1); the reference value may be, for example, 128. In the example shown in FIG. 15, the density of voxel 211 and the other outer voxels is set to 0, the density of voxel 212 is set to 100, which is less than the reference value, and the densities of voxels 213 and 214 are set to 150 and 210, which are greater than or equal to the reference value. In this embodiment, the game system 1 generates vertices between voxels whose densities are greater than or equal to the reference value and voxels whose densities are less than the reference value. Specifically, for each region (region surrounded by dotted lines in the drawing) spanning eight adjacent voxels (four in the drawing), a determination is made as to whether or not to generate a vertex. In other words, a vertex is generated in a region spanning both voxels whose densities are greater than or equal to the reference value and voxels whose densities are less than the reference value. The coordinates of the vertex are determined by comparing the densities of adjacent voxels along each of the X, Y, and Z axes and interpolating based on the difference in density. Note that by setting normal information that defines the position and orientation of the line connecting the vertices, the coordinates of the vertices can be further calculated based on the normal information. Normal information may be stored in advance for at least some voxels, or if not stored, normal information may be calculated based on the densities of adjacent voxels. In Fig. 15, the density of voxel 212 is less than the reference value, so voxel 212 is treated as outside the object in determining whether or not a vertex exists, but the density value of voxel 212 itself is used to calculate the coordinates of the vertices to be generated.If the reference value were set to a value lower than the density of the voxel 212, the result would be that the number of vertices would increase further to the upper right and upper left of the voxel 212 in FIG.
[0105] By setting vertices as described above, when generating a mesh connecting the set vertices (or the vertices after performing the simplification process described below on the set vertices), it is possible to generate a shape having a volume that reflects the density of each voxel to some extent. However, depending on the relationship with adjacent voxels, it is possible that a voxel with a density of 0 may include a part of an area inside the object, or that a voxel with a density of 255 may include a part of an area outside the object. Furthermore, in this embodiment, voxels with a density less than the reference value are processed as outside the object, so that the number of vertices is reduced compared to when voxels are processed as inside the object, and therefore the volume is also reduced accordingly. In this way, it is not necessary to calculate a polygon mesh so that the volume strictly corresponds to the density value.
[0106] [2-4. Determining the vertex material] The game system 1 determines a material for each vertex set as described above. The material of a vertex is determined based on the materials of the voxels surrounding the vertex. The voxels surrounding the vertex are, for example, the voxels used to determine whether or not to generate the vertex (i.e., the voxels that overlap with the "voxel-spanning area" described above). Note that in other embodiments, the voxels used to determine the material of a vertex and the voxels used to determine whether or not to generate the vertex do not need to be the same, and may be different.
[0107] FIG. 16 is a diagram showing an example of a method for determining the material of a vertex. In the example shown in FIG. 16, a vertex 219 is set for four voxels 215 to 218, and these four voxels 215 to 218 are the "voxels surrounding the vertex" described above. In an actual three-dimensional space, the number of voxels surrounding a vertex is eight. In the example shown in FIG. 16, the density of voxel 215 is set to 255, the first material is set to "sand," and the material mixture ratio is set to 0 (i.e., first material:second material = 1:0, or the second material may not be set). The density of voxel 216 is set to 0 (the first and second materials may not be set). For voxel 217, the density is set to 204, the first material is "sand," the second material is "grass," and the material mixing ratio is set to 0.3 (i.e., first material:second material = 0.7:0.3). For voxel 218, the density is set to 153, the first material is "earth," the second material is "grass," and the material mixing ratio is set to 0.4 (i.e., first material:second material = 0.6:0.4). Furthermore, the coordinates indicating the position of vertex 219 are set to (X,Y) = (0.8,0.6). Note that in this coordinate system, the left-right direction in FIG. 16 is the X coordinate, the up-down direction is the Y coordinate, and the center position of voxel 217, the bottom-left one of voxels 215 to 218 (the positions of the white circles in FIG. 13), is set to (0,0).
[0108] When determining the material of a vertex, the game system 1 calculates an evaluation value for each material in surrounding voxels based on the density of the material and a weight value based on the distance from the voxel to the vertex. First, a weight value is calculated for each voxel, and the closer the distance from the center position of the voxel to the vertex, the larger the weight value is calculated. In this embodiment, when the center position of the voxel is (x1, y1) and the coordinates of the vertex are (x2, y2), the weight value for a certain voxel is calculated according to the following formula (1): (weight value) = |(1-x1)-x2|·|(1-y1)-y2|…(1) In the example shown in FIG. 16, the weight values of the voxels 215 to 218 calculated according to the above formula (1) are as follows: (Weight value of voxel 215) = |(1-0)-0.8|·|(1-1)-0.6| = 0.12 (Weight value of voxel 216) = |(1-1)-0.8|·|(1-1)-0.6| = 0.48 (Weight value of voxel 217) = |(1 - 0) - 0.8| · |(1 - 0) - 0.6| = 0.08 (Weight value of voxel 218) = |(1-1)-0.8|·|(1-0)-0.6| = 0.32
[0109] The game system 1 also calculates the density of the material for each voxel. Here, the density of a material is a value obtained by multiplying the proportion of the material in the materials set for that voxel by the density of that voxel. In this embodiment, the density of the voxel is calculated by normalizing the values from 0 to 255 to values from 0 to 1. In the example shown in FIG. 16, the only material set for voxel 215 is sand, so the proportion of the sand material is 1 and the density of that voxel is 1, so the density of the sand material is 1. For voxel 216, the density is 0 and no material is set, so the density of the material is not calculated. Alternatively, if some material is set, the density of that material is 0. For voxel 217, the ratios of the sand and grass materials are 0.7 and 0.3, respectively, and the density of the voxel is 204 / 255 = 0.8, so the density of the sand material is 0.7 · 0.8 = 0.56, and the density of the grass material is 0.3 · 0.8 = 0.24. For voxel 218, the ratios of the dirt and grass materials are 0.6 and 0.4, respectively, and the density of the voxel is 153 / 255 = 0.6, so the density of the dirt material is 0.6 · 0.6 = 0.36, and the density of the dirt material is 0.4 · 0.6 = 0.24.
[0110] The game system 1 then calculates the evaluation value for each material based on the weight value and the material density. In this embodiment, the evaluation value for a material is the sum of the material densities calculated for each voxel, weighted according to the weight value for each voxel, for each surrounding voxel. In the example shown in FIG. 16 , the evaluation value for the sand material is 1·0.12+0.56·0.08=0.1648 because the material density for voxel 215 is 1 and the weight value is 0.12, and the material density for voxel 217 is 0.56 and the weight value is 0.08. The evaluation value for the grass material is 0.24·0.08+0.24·0.32=0.096 because the material density for voxel 217 is 0.24 and the weight value is 0.08, and the material density for voxel 218 is 0.24 and the weight value is 0.32. Furthermore, the evaluation value of the soil material for voxel 218 is 0.36·0.32=0.1152 because the material density is 0.36 and the weighting value is 0.32.
[0111] The game system 1 determines the material of the vertex based on the evaluation value of each material. Specifically, a predetermined number of materials are determined as the materials of the vertex in descending order of evaluation value. In this embodiment, the two materials with the highest evaluation values are determined as the materials of the vertex. In the example shown in FIG. 16, the evaluation values of the sand, grass, and soil materials are 0.1648, 0.096, and 0.1152, respectively. Therefore, the sand material and the soil material are determined as the materials of the vertex. The game system 1 also calculates the ratio of the two determined materials based on the evaluation values. In this embodiment, the ratio of the two materials may be expressed as a second material ratio, which is the proportion of the second material to the whole, similar to the material mixture ratio. In the example shown in FIG. 16, for example, if the first material is soil and the second material is sand, the second material ratio is expressed as 0.1648 / (0.1648+0.1152)≒0.59. In other embodiments, the value representing the ratio of the two materials may be a value representing the proportion of the first material, or a value representing the proportion of each material may be used.
[0112] In this embodiment, the game system 1 generates and stores vertex data indicating the position of a vertex, the material IDs of the first and second materials set at the vertex, and the ratio of the materials. However, any method may be used to manage the materials set at the vertices. In other embodiments, the vertex data may have a data structure that includes data that directly indicates the contents of the first and second materials.
[0113] As described above, in this embodiment, for each vertex, the game system 1 calculates a priority parameter (e.g., an evaluation value) for each material ID included in the voxel data of multiple surrounding voxels based on the voxel data. Then, based on the priority parameters, up to a predetermined number (here, two) of material IDs with high priorities are selected and determined as the material ID for the vertex. Note that the specific parameter used as the priority parameter is not limited to the evaluation value. For example, in other embodiments, an evaluation value calculated using the density of the material without using the weight value may be used as the priority parameter.
[0114] In this embodiment, the evaluation value, which is an example of a priority parameter, is calculated based on the density of multiple voxels surrounding the vertex so that the material set in a voxel with a higher density has a higher priority (i.e., the evaluation value of the material is larger, making it more likely to be selected). This allows the material of the vertex to be determined by reflecting the magnitude of the density set in the voxels.
[0115] In this embodiment, an evaluation value, which is an example of a priority parameter, is calculated based on the distance from the reference position (specifically, the center position) of multiple voxels surrounding the vertex to the vertex so that the priority of a material set to a voxel close to the vertex is higher. This allows the material of the vertex to be determined by reflecting the distance between the voxel and the vertex.
[0116] In addition, in this embodiment, the evaluation value, which is an example of a priority parameter, can be said to be calculated based on the material mixture ratios of multiple voxels surrounding the vertex, so that a material with a higher material mixture ratio has a higher priority. This makes it possible to determine the material of the vertex by reflecting the ratio of each material when multiple materials are set for one voxel.
[0117] [2-5. Simplifying vertices] In this embodiment, the game system 1 simplifies each of the vertices calculated as described above. That is, the game system 1 reduces the number of vertices by replacing some of the vertices calculated as described above with a single vertex. Note that, as will be described in detail later, the coordinates (i.e., position) and material of the replaced vertex are set based on the multiple vertices before replacement. This simplification can reduce the number of vertices and polygons that make up the mesh of a voxel object, thereby reducing the amount of memory used for processing and the processing load.
[0118] In this embodiment, the game system 1 performs simplification by representing each vertex using SVO (Sparse Voxel Octree). FIG. 17 is a diagram showing an example of vertex simplification. In FIG. 17, one square indicated by a solid line in FIG. 17(a) represents one vertex segment. Here, a vertex segment is a square region with the center position of a voxel as its vertex (in an actual three-dimensional space, a vertex segment is a cube or rectangular parallelepiped), and is a region with the dotted lines in FIG. 15 and FIG. 16 as its edges. In FIG. 17, a vertex segment with the letter "v" inside it indicates a vertex segment in which a vertex is set.
[0119] In this embodiment, the game system 1 determines whether simplification is possible for vertices in a predetermined number of adjacent vertex division regions (four in FIG. 17, eight in actual three-dimensional space). If it is determined that simplification is possible, simplification is performed for the vertices in the predetermined number of vertex division regions.
[0120] (a) in Figure 17 shows the state before simplification is performed. In the example shown in Figure 17, it is assumed that the vertex division areas within the range surrounded by the dotted line are determined to be simplifiable. At this time, the game system 1 performs simplification so that the vertices in the predetermined number of vertex division areas determined to be simplifiable are replaced with a single vertex (see (b) in Figure 17). As a result, the vertices in the predetermined number of vertex division areas are simplified to a single vertex.
[0121] In this embodiment, the game system 1 performs simplification in multiple stages. The number of stages is arbitrary, but FIG. 17 illustrates and explains up to the second stage. FIG. 17(b) shows a state after the first stage of simplification has been performed, and FIG. 17(c) shows a state after the second stage of simplification has been performed. In the second stage of simplification, a determination is made as to whether simplification is possible for the vertices resulting from the first stage of simplification. In the example shown in FIG. 17, it is determined that simplification is possible for the vertex segment area within the range surrounded by the dotted line in FIG. 17(b). As a result, the vertices of the vertex segment area are simplified, resulting in the state shown in FIG. 17(c). Note that the conditions for determining whether the first stage of simplification is possible and the conditions for determining whether the second stage of simplification is possible may be the same or different.
[0122] The specific method for determining whether simplification is possible is arbitrary. In this embodiment, the conditions used for the determination are a condition related to the shape of the voxel object and a condition related to the material. In this embodiment, if both the condition related to the shape of the voxel object and the condition related to the material are satisfied, it is determined that simplification is possible, and if at least one of the condition related to the shape of the voxel object and the condition related to the material is not satisfied, it is determined that simplification is not possible.
[0123] The shape condition may be, for example, that the shape of each vertex before simplification does not change significantly from the shape of each vertex after simplification. For example, whether the shape of each vertex does not change significantly before and after simplification can be determined by calculating an index indicating the error between the mesh before simplification and the mesh after simplification and determining whether the index is equal to or less than a predetermined tolerance. For example, if the shape of each vertex before simplification is hollow, but the shape of each vertex after simplification becomes solid (i.e., the hollow information is lost due to simplification), it is determined that the shape condition is not satisfied. Whether or not the above case occurs can be determined based on, for example, the density of each voxel corresponding to the vertex segment area being determined. For example, if the shape of each vertex before simplification can be expressed only by two or more vertices, but cannot be expressed by a single vertex, it is determined that the shape condition is not satisfied. The shape condition of a voxel object may be the same as that of a conventional method using SVO.
[0124] In this embodiment, the material condition is a condition regarding the number of material types set for each vertex within the predetermined number of vertex segment regions to be simplified. FIG. 18 illustrates an example of the material condition. (a) in FIG. 18 illustrates a case where the materials of vertices 221 to 224 are (grass), (grass), (grass and earth), and (grass and earth), respectively. (b) in FIG. 18 illustrates a case where the materials of vertices 221 to 224 are (grass and sand), (grass), (grass and earth), and (grass and earth), respectively. In this embodiment, the material condition is that the total number of material types set for each vertex to be simplified is equal to or less than a predetermined number. For example, the material condition is that the total number of material types set for each vertex to be simplified is equal to or less than the number of materials that can be set for one vertex. In this embodiment, the predetermined number is 2. For example, in the case of (a) in FIG. 18, the total number of material types set for vertices 221 to 224 to be simplified is two, grass and earth, so the material condition is satisfied. At this time, each of the vertices 221 to 224 is determined to be simplifiable, provided that the above-mentioned conditions regarding the shape of the object are satisfied. On the other hand, in the case of (b) shown in Figure 18, the total number of material types set for each of the vertices 221 to 224 to be simplified is three: grass, earth, and sand, so the conditions regarding the materials are not satisfied. At this time, each of the vertices 221 to 224 is determined to be unsimplifiable, regardless of whether the above-mentioned conditions regarding the shape of the object are satisfied.
[0125] Note that in the game system 1, multiple types of materials may be prepared that have the same set properties but different appearances, even if they are strictly classified as different types. Some of these multiple types of materials may be considered to be the same type when determining whether or not a material satisfies a condition related to the material. For example, with regard to soil materials, multiple types of soil materials may be prepared that have the same properties but similar appearances (e.g., texture color or pattern). In such a case, the game system 1 may consider these multiple types of soil materials to be the same type when determining whether or not a material satisfies a condition related to the material.
[0126] In this embodiment, up to two types of material can be set for a vertex, just as with voxels. In contrast, in this embodiment, if the total number of material types set for each vertex to be simplified is three or more, simplification is not performed. In other words, if the total number of material types exceeds the number of materials that can be set for one vertex, simplification is not performed. Therefore, even if the number of vertices is reduced by simplification, the information about the materials set for the vertices is not lost as a result of the simplification, and the material information can be maintained.
[0127] In this embodiment, the material of a vertex after simplification is determined based on the material of each vertex before simplification. Specifically, the game system 1 sets one or two types of material set at the vertex before simplification as the first material and the second material at the vertex after simplification. This allows the material information to be maintained. The ratio of the material after simplification is determined based on the ratio of the material at each vertex before simplification. In this embodiment, the ratio of the material after simplification is calculated in the same manner as the method for calculating the ratio of the material at each vertex using the evaluation value described above. That is, the game system 1 calculates a weight value based on the distance between the vertex after simplification and the vertex before simplification, and calculates an evaluation value for each material based on the weight value and the density of the material at the vertex before simplification (note that the evaluation value of the material described above in [2-4. Determining the Material at a Vertex] can be used as the material density here). Then, the ratio of the material is calculated based on the calculated evaluation value of each material.
[0128] [2-6. Mesh Generation] In this embodiment, a mesh of a voxel object is generated based on the vertices simplified as described above. FIG. 19 is a diagram showing an example of a mesh generated based on the vertices. Note that the squares shown in FIG. 19 represent the vertex division regions described above, or vertex division regions formed by combining multiple vertex division regions into one vertex division region through simplification. As shown in FIG. 19, the game system 1 generates a mesh composed of polygons whose sides are straight lines connecting adjacent vertices of the vertex division regions. Each polygon that makes up the mesh is a triangle or a quadrangle.
[0129] In this embodiment, the game system 1 generates two types of meshes: a display mesh and a determination mesh. The display mesh is a mesh used for displaying voxel objects. The determination mesh is a mesh used for collision determination of voxel objects. As will be described in detail later, by using the above two types of meshes, the game system 1 can perform processing using meshes that are suitable for displaying voxel objects and for collision determination.
[0130] In this embodiment, the game system 1 generates the display mesh and the determination mesh based on the above-mentioned SVO data (i.e., based on the simplified vertices). This allows the vertex data used to generate the two types of meshes to be shared, thereby improving processing efficiency. Note that in other embodiments, the game system 1 may not simplify the vertices, and may generate the display mesh and / or the determination mesh based on the unsimplified vertices.
[0131] In this embodiment, the game system 1 generates a determination mesh with a simpler shape than the display mesh. Specifically, the game system 1 sets the number of vertices of the determination mesh to be fewer than the number of vertices of the display mesh. In this embodiment, the SVO data is data that stores data on vertices before simplification and data on simplified vertices in an octree structure, but also includes data used to determine whether simplification is possible. This data includes, for example, data on vertices (referred to as provisional vertices) calculated as candidates for vertices after simplification, and data on the aforementioned indicators indicating the errors between the pre-simplification vertices and the provisional vertices. For example, the game system 1 may use, among the provisional vertices, vertices whose indicators are equal to or smaller than a predetermined threshold (this threshold is assumed to be greater than the aforementioned allowable value) to generate the determination mesh. This allows the number of vertices of the determination mesh to be fewer than the number of vertices of the display mesh. By setting the number of vertices of the determination mesh to be fewer than the number of vertices of the display mesh, the processing load due to collision determination can be reduced. Furthermore, since the number of vertices in the display mesh is not excessively reduced, the appearance of the voxel object can be expressed in detail.
[0132] In other embodiments, the display mesh and the judgment mesh may be generated based on the same data or different data. The display mesh and the judgment mesh may have the same shape (although even in this case, the materials set for the two may be different). The number of vertices in the judgment mesh may be the same as the number of vertices in the display mesh or may be greater than the number of vertices in the display mesh.
[0133] [2-6-1.Determining the material of the display mesh] Next, an example of a method for determining the material and appearance of a display mesh will be described. In this embodiment, the game system 1 determines a material for each polygon that constitutes the display mesh. As will be described in detail later, in this embodiment, the polygons corresponding to the polygons are drawn using up to two types of textures corresponding to up to two types of materials. Therefore, the game system 1 ensures that no more than two types of material are ultimately set for each polygon that constitutes the mesh. In other embodiments, three or more types of material may be set. For example, in an embodiment in which there are three or more types of voxel materials and three or more types of vertex materials, the same number of materials may be set for the polygons.
[0134] In this embodiment, a quadrangle may be formed as a polygon that constitutes a display mesh (see FIG. 19). When determining the material of the display mesh, the game system 1 first divides the quadrangle that constitutes the display mesh into two triangles under certain conditions. The process of dividing a quadrangle into two triangles will be described below with reference to FIG. 20.
[0135] Fig. 20 is a diagram showing an example in which a quadrangle constituting a mesh is divided into two triangles. Fig. 20(a) shows the quadrangle formed by vertices 231 to 234, which are part of the vertices of the mesh, before division, and Fig. 20(b) shows the two triangles into which the quadrangle is divided. In the example shown in Fig. 20, the materials set for each of vertices 231 to 234 are grass, dirt, sand and grass, and grass, respectively.
[0136] In this embodiment, the game system 1 determines whether a division condition is satisfied when a total of three or more types of materials are set at the vertices of a quadrangle. In this embodiment, the division condition is that by dividing the quadrangle into two triangles, a total of two or fewer types of materials can be set at the vertices of the triangles. If the division condition is satisfied, the game system 1 divides the quadrangle into two triangles such that a total of two or fewer types of materials are set at the vertices. In the example shown in FIG. 20, the materials set at the vertices 231 to 234 forming the quadrangle are three types: grass, earth, and sand. Furthermore, if the quadrangle is divided into a triangle formed by vertices 231, 232, and 234 and a triangle formed by vertices 231, 233, and 234, the materials set at the vertices of the former triangle are two types: sand and grass, and the materials set at the vertices of the latter triangle are two types: grass and earth (see (b) in FIG. 20). Therefore, the division condition is satisfied for the quadrangle, and the game system 1 divides the quadrangle into two triangles.
[0137] Since there are two ways to divide a quadrangle into two triangles, if the division condition is satisfied for a triangle divided by at least one of the two methods, the game system 1 performs the division by the method that satisfies the division condition. On the other hand, if the division condition is not satisfied for a triangle divided by either of the two methods, the game system 1 performs the division by one of the two methods.
[0138] By dividing the polygon as described above, the game system 1 can generate two triangles in which two or fewer types of material are set at each vertex of the quadrangle, minimizing loss of information about three or more types of material that are set at each vertex. As described above, each polygon that makes up a mesh is rendered using up to two types of texture. Therefore, by dividing the polygon as described above, the game system 1 can render the polygon using two types of texture, minimizing loss of information about the material that is set at each vertex.
[0139] In this embodiment, the game system 1 sets polygons corresponding to the polygons after the above division. That is, the vertices of the polygons after the above division become the vertices of the polygons of the display mesh.
[0140] In this embodiment, when a total of three or more types of materials are set for each vertex of a polygon constituting a display mesh, the game system 1 determines the material of the polygon by selecting two types of materials. FIG. 21 is a diagram illustrating an example of a method for determining the material of a polygon constituting a display mesh. In the example shown in FIG. 21, for vertex 241 of a triangular polygon constituting the display mesh, the first material is set to "grass," the second material is set to "earth," and the material ratio of the first material to the second material is set to 0.8:0.2. For vertex 242 of the polygon, the first material is set to "grass," the second material is set to "sand," and the material ratio of the first material to the second material is set to 0.5:0.5. For vertex 243 of the polygon, the first material is set to "sand," the second material is set to "earth," and the material ratio of the first material to the second material is set to 0.7:0.3.
[0141] When a total of three or more types of materials are set for each vertex of a polygon, the game system 1 calculates a judgment value for each material. The judgment value is calculated as the sum of the ratios of the materials set for each vertex. The game system 1 then selects the two materials with the largest judgment value as the material for the polygon. In the example shown in FIG. 21, the judgment value for the grass material is 0.8+0.5=1.3, the judgment value for the sand material is 0.5+0.7=1.2, and the judgment value for the earth material is 0.2+0.3=0.5. Therefore, the grass and sand materials are selected as the materials for the polygon shown in FIG. 21 (see (a) in FIG. 21).
[0142] Note that the specific method for selecting the material of a polygon of a display mesh is arbitrary. In other embodiments, the material of a polygon of a display mesh may be selected by any method based on information set at the vertices of the polygon. For example, the material of a polygon of a display mesh may be selected for each vertex by identifying the material with the largest proportion at that vertex, and the material identified most frequently for each vertex may be selected as the material of that polygon.
[0143] In this embodiment, the material of the polygon selected as described above is indicated by the material set at each vertex of the polygon. That is, when a material for a polygon is selected, the game system 1 changes the material set at each vertex of the polygon (i.e., the material ID included in the vertex data) to the selected material. In the example shown in FIG. 21, before the selection of the polygon material, grass and earth and sand and earth materials were set for vertices 241 and 243, respectively (see FIG. 21(a)). When grass and sand materials are selected as the polygon material as described above, the materials set at vertices 241 and 243 are changed to grass and sand (see FIG. 21(b)). Note that the material set at vertex 242 before selection is the same as the material of the selected polygon, so the material is not changed. As described above, when two types of materials are selected as the polygon material, the information on the third and subsequent materials set at each vertex of the polygon is erased.
[0144] Furthermore, the game system 1 changes the ratio of materials set for a vertex in accordance with a change in the material set for that vertex. For example, for vertex 241, the first material is grass and the second material is earth, and the first material is grass and the second material is sand. Here, the proportion of sand material is 0, so the material ratio is set to first material:second material = 1:0. In this way, the above change formally changes the material of each vertex in order to represent the material of the polygon by the material of each vertex of the polygon.
[0145] According to the above, the material set for each vertex of one polygon is only the material corresponding to the texture used for rendering, which will be described later, making it easier to execute rendering processing using texture.
[0146] Note that the above change may result in all materials being changed for a certain vertex (i.e., none of the materials before and after the change match). Such a case may occur, for example, when the material set for the vertex before the change is earth and the materials selected for the polygon are grass and sand. In such a case, the material ratio for the vertex may be set based on the material ratio for the other vertices of the polygon. For example, in the above example, if the first material set for one of the other vertices of the triangular polygon is grass and has a material ratio of grass:sand = 1:0, and the material set for the other vertex is sand and has a material ratio of sand:grass = 1:0, the material ratio for the vertex may be set to grass:sand = 0.5:0.5. The game system 1 may also determine the material ratio for the vertex taking into account the distance between the vertex and the other vertices (e.g., based on a weight value that increases as the distance decreases).
[0147] As described above, in this embodiment, for each polygon, the game system 1 selects up to a predetermined number (here, two) of material IDs from among the material IDs set to the vertices included in the polygon (i.e., material IDs set to the vertices of the polygon corresponding to the polygon), and determines them as the material ID for the polygon. This allows the game system 1 to perform rendering processing while reducing the number of textures used, while reflecting the materials set to the vertices in the appearance of the polygon.
[0148] In this embodiment, if the number of materials for all vertices constituting a polygon is equal to or less than the predetermined number, the game system 1 determines the material as the polygon's material, and if the number of materials exceeds the predetermined number, it selects a predetermined number of materials with high priority based on the priority parameters of each vertex (specifically, based on the judgment value calculated based on the evaluation value) and determines them as the polygon's material. This allows the polygon to be made up of a predetermined number of materials or less, taking priority into consideration, even if the total number of materials set for each vertex exceeds the predetermined number.
[0149] As described above, in this embodiment, the first and second materials set for each vertex of a polygon are changed to two types of materials set for that polygon. When such a change is made, there is a possibility that a discrepancy will occur between the first and second materials set for a vertex shared by two adjacent polygons.
[0150] FIG. 22 is a diagram showing an example of materials set at the vertices of two adjacent polygons. FIG. 22 shows a state (shown in (b) in FIG. 20) in which two polygons are formed by the vertices 231 to 234 shown in FIG. 20. In the example shown in FIG. 22, the materials of the first polygon formed by the vertices 231, 233, and 234 are determined to be grass and sand, and therefore the first and second materials of these vertices should be set to grass and sand, respectively. On the other hand, the materials of the second polygon formed by the vertices 231, 232, and 234 are determined to be grass and earth, and therefore the first and second materials of these vertices should be set to grass and earth, respectively. Therefore, in the example shown in FIG. 22, a discrepancy occurs in the materials to be set for the vertices 231 and 234 shared by the two polygons.
[0151] Therefore, in this embodiment, if a discrepancy occurs in the materials to be set for a vertex shared by two polygons, the game system 1 adds another vertex at the same position as the vertex. FIG. 22(b) shows an example of a state in which a vertex 231' is added for the vertex 231 and a vertex 234' is added for the vertex 234. In the example of FIG. 22, the game system 1 sets the first and second materials for the vertices 231 and 234 to grass and sand in accordance with the material of the first polygon. Also, the game system 1 sets the first and second materials for the vertices 231' and 234' to grass and earth in accordance with the material of the second polygon. In this way, by formally setting two vertices as vertices shared by two polygons (i.e., generating two vertex data sets having the same position but different materials), it is possible to prevent discrepancies in the materials set for the vertices.
[0152] The game system 1 generates a display mesh made up of polygons whose vertices and materials have been determined as described above. The game system 1 also draws the voxel object by drawing the polygons based on the material information (i.e., the first material and the second material) set for each vertex.
[0153] Fig. 23 is a diagram showing an example of applying a texture to a polygon. Fig. 23 shows a triangular polygon formed by the vertices 241 to 243 shown in Fig. 21. The material set for each of the vertices 241 to 243 is the one shown in Fig. 21(b).
[0154] The vertices of a polygon are drawn by mapping that blends the texture of the first material and the texture of the second material set for that vertex at the ratio of the materials set for that vertex (i.e., that ratio is used as the blend ratio). The textures of the first and second materials used for drawing are the textures indicated by the drawing setting information associated with each material ID associated with the vertex data in the material data (see FIG. 12) described above. In the example shown in FIG. 23, the material ratio for the vertex 241 is grass:sand = 1:0, so drawing is performed using only the grass texture. The first material for the vertex 243 is sand, so the material ratio for the sand:grass is 1:0, so drawing is performed using only the sand texture. The first material for the vertex 242 is grass, the second material for the vertex 242 is sand, so the material ratio for the grass:sand is 0.5:0.5, so drawing is performed by blending the grass texture and the sand texture at a blend ratio of 0.5:0.5.
[0155] Furthermore, for positions other than the vertices of a polygon, the game system 1 determines the blend ratio by interpolating the blend ratio at each vertex. Then, rendering is performed by mapping, blending the textures of the two materials set at each vertex based on the interpolated blend ratio. Note that any specific interpolation method may be used. One example is linear interpolation of the blend ratio between vertices. In FIG. 23, positions where a high proportion of grass material texture is applied are indicated in white, and positions where a high proportion of sand material texture is applied are indicated in black. In the example shown in FIG. 23, a grass texture is applied to vertex 241, and the blend ratio of the sand texture increases toward vertex 243. At vertex 242, the grass-to-sand blend ratio is 1:1, and at vertex 243, only the sand texture is applied. In this way, by blending and rendering the two textures set at the polygon (i.e., set at each vertex of the polygon) at a blend ratio according to the material ratio, the boundary between different materials in the display mesh can appear natural. This allows the display mesh to have a plurality of types of materials set thereto to appear natural.
[0156] [2-6-2.Determining the material of the judgment mesh] Next, an example of a method for determining the material of a determination mesh will be described. Details will be given later, but in this embodiment, a collision determination for a voxel object is performed using the determination mesh, and processing may be performed according to the material of the voxel object for which a collision has been determined. Therefore, in this embodiment, the material is also determined for the determination mesh.
[0157] In this embodiment, the game system 1 sets one type of material for each polygon that constitutes the determination mesh. Specifically, the game system 1 determines the material to be set for a polygon of the determination mesh based on information about the material set at the vertices of the polygon (i.e., information about the first and second materials and the ratio of the materials).
[0158] Fig. 24 is a diagram showing an example of a method for determining the material of polygons that make up a determination mesh. Fig. 24 shows an example of determining the material for a triangular polygon formed by each of the vertices 241 to 243 shown in Fig. 21. The material set for each of the vertices 241 to 243 is the one shown in Fig. 21(a).
[0159] When determining the material of a polygon, the game system 1 calculates a judgment value for each material set at each vertex of the polygon. In this embodiment, the method for calculating the judgment value is the same as the method for calculating the judgment value used to select the material set at the polygon of the display mesh. Note that the specific method for calculating the judgment value is arbitrary. In other embodiments, the judgment value may be calculated by any method based on the information set at the vertices of the polygon of the judgment mesh.
[0160] In the example shown in Fig. 24, the judgment values for each material are the same as in the case shown in Fig. 21, with the grass material judgment value being 1.3, the sand material judgment value being 1.2, and the earth material judgment value being 0.5. Therefore, the grass material is selected as the material for the polygon shown in Fig. 24.
[0161] As described above, in this embodiment, for each polygon, the game system 1 selects up to a predetermined number (here, one) of material IDs from among the material IDs set at the vertices of the polygon (i.e., material IDs set at the vertices of the polygon corresponding to the polygon) and determines the material ID for the polygon. This allows the game system 1 to keep the number of materials set in the determination mesh below a predetermined number. This prevents the processing according to the type of material, which is performed according to the results of collision determination using the determination mesh, from becoming complicated. Note that the method for determining the material of the polygon of the determination mesh is arbitrary and is not limited to the above. In other embodiments, the material of the polygon of the determination mesh may be determined by any method based on the information set at the vertices of the polygon.
[0162] Furthermore, in this embodiment, up to two types of material are set for the polygons of the display mesh, while one type of material is set for the polygons of the determination mesh. This allows the polygons of the display mesh to have a natural appearance using two types of texture, and prevents the processing of the determination mesh performed based on the results of collision determination using the determination mesh from becoming complicated. Note that, in other embodiments, any type of material can be set for the polygons of the display mesh and the determination mesh. The number of materials that can be set for the polygons of the display mesh and the determination mesh may both be multiple, may be the same, or may be different.
[0163] In this embodiment, up to two types of materials can be set for one voxel, and up to two types of materials can be set for one polygon in a display mesh. This makes it possible to reduce the amount of voxel data while reflecting material information set in the voxel data on the materials of the display mesh. Furthermore, in this embodiment, up to two types of materials can also be set for vertices set based on the voxel data (see FIG. 16). This allows two types of materials to be set for vertices generated during the process of obtaining a display mesh from voxel data, so that the material information set in the voxel data is not lost during the process, and the material information set in the voxel data can be reflected on the display mesh.
[0164] In another embodiment, the game system 1 may set different materials for vertices used to generate a display mesh and for vertices used to generate a determination mesh, with respect to vertices set based on voxel data. For example, the game system 1 may set up to two types of materials for vertices used to generate a display mesh, as described above, and set one type of material for vertices used to generate a determination mesh. Similarly, two types of materials may be set for polygons of the display mesh, and one type of material may be set for polygons of the determination mesh based on one type of material set for each vertex of the polygon. When one type of material is set for vertices used to generate a determination mesh, the material with the largest judgment value calculated for each material may be set as the material for that vertex. As in the present embodiment, this allows up to two types of materials to be set for each polygon in the display mesh, and only one type of material to be set for each polygon in the determination mesh. Therefore, the information about the material set in the voxel data can be reflected in the display mesh, and the processing performed according to the results of collision judgment using the judgment mesh can be prevented from becoming complicated.
[0165] As described above, in this embodiment, a display mesh and a judgment mesh may be set for one voxel object. However, depending on the game situation, it is not necessary to simultaneously set both a display mesh and a judgment mesh for one voxel object (for example, it is not necessary to set both in processing for one frame). For example, a judgment mesh may be generated in a range within the game space where collision determination is performed, but not in a range where collision determination is not performed. As an example, the game system 1 may generate judgment meshes for voxel objects within a predetermined range centered on the player character, and may generate only display meshes for voxel objects outside the predetermined range without generating judgment meshes.
[0166] Furthermore, for display meshes, the game system 1 may store data relating to the generated meshes in memory, and in frames after the meshes are generated, use the data without re-executing the mesh generation process except for the updated range. This reduces the processing load for generating display meshes. For determination meshes, data relating to the generated meshes may not be stored in memory, and meshes may be generated sequentially as needed (for example, whenever collision determination is required). This saves memory space used for mesh generation.
[0167] The above describes a method for generating meshes (i.e., display meshes and determination meshes) based on the changed voxel data when voxel data is changed from its initial state. The above method can also be used when generating meshes based on voxel data in the initial state, for example, at the start of a game. However, meshes based on voxel data in the initial state do not need to be generated based on voxel data in the initial state at the start of the game, and may be prepared in advance before the start of the game.
[0168] [2-7. Processing to change materials] Next, with reference to Figs. 25 to 35, an example of processing for changing the material of a voxel object will be described. In this embodiment, the material of a voxel object in a voxel space is changed by changing the material ID of voxel data set in the voxel space. The material change processing will be described below using first to third examples. In the following, it is assumed that terrain objects such as the ground and walls, and virtual objects that appear in the game space (for example, enemy objects), etc. are voxel objects, and an example will be described in which a player character takes an action, and an action in the game occurs as a result of collision determination.
[0169] The "in-game effect" is any change that occurs in the game, such as a change that occurs due to "processing that reflects the results of collision between objects." The "in-game effect" may be based on a collision determination between a determination mesh and a determination shape corresponding to a determination target based on game processing (for example, a determination area set for an object such as a player character), and the effect may occur on an object corresponding to the determination mesh, or on an object corresponding to the determination target. The content of the "in-game effect" may be associated with a material set for a polygon that is determined to have collided in the collision determination that causes the effect to occur (i.e., the content of the effect may be determined by the material).
[0170] (Example 1) As a first example, an example will be described in which the material constituting the enemy object 251 is changed when the enemy object 251 is located in an area illuminated by light such as a directional light in the game space. Fig. 25 is a diagram showing an example of a game image depicting a player character 201 attacking an enemy object 251a located in a shadow area in the game space.
[0171] The enemy object 251 is a voxel object, and a unique voxel space independent of the voxel space of voxels corresponding to terrain objects and the like is defined for the enemy object 251. In the unique voxel space, unique voxel data corresponding to the enemy object 251 is defined, and a unique display mesh and a unique determination mesh based on the unique voxel data are set. The unique voxel space can be moved / rotated within the game space together with the defined enemy object 251, and the position, direction (posture), and the like of the unique voxel space within the game space are controlled. Note that the voxels defined in the unique voxel space may be a different size from the voxels that make up the terrain object, or the size of the voxels may be relatively small.
[0172] The first material ID of the material of the polygon in the enemy object 251 is set to "material A." The material mixing ratio is also set to 0 (i.e., the only material set for the voxel is "material A"). In the first example, the enemy object 251 made of material A is referred to as enemy object 251a. The property information included in the above-mentioned material data is set to have a property of strong attack resistance strength for material A. Then, using the above-mentioned method for determining the materials of the display mesh and judgment mesh, the materials of the unique display mesh and unique judgment mesh of the enemy object 251a based on the material of the voxel are determined.
[0173] In the example shown in FIG. 25, the game system 1 performs a collision determination between the enemy object 251 and the player character 201 using a determination mesh. That is, the game system 1 performs a collision determination as to whether or not the determination mesh of the enemy object 251 comes into contact with a determination area set for the player character (for example, an area of a predetermined shape set based on the position of the player character). When a collision between a polygon whose material is material A and the player character 201 is determined, the game system 1 performs a process of attacking the enemy object 251 to destroy it, or a process of counterattacking the enemy object 251 to reduce the strength of the player character 201, as a process of causing an action in the game. In addition, in the above cases, the game system 1 performs a process of causing the player character 201 to perform a predetermined reaction. For example, in the example shown in FIG. 25, the user performs an operation input to cause the player character 201 to perform the punch action, whereby the player character 201 performs an action of punching forward, and a collision determination is performed. When a collision between the player character 201 performing a punch action and the enemy object 251a is determined, it is determined whether the attack by the punch action has effectively affected the enemy object 251a. Here, since the enemy object 251a is made of material A, which has a property set to have strong attack resistance strength, the enemy object 251a is not destroyed by the attack by the punch action, and a process is performed in which the player character 201 reacts as if the attack had been bounced back. At this time, the game system 1 may generate an in-game effect (for example, a decrease in the player character's strength due to the attack being bounced back) based on property information corresponding to the material set for the polygon in the determination mesh for which a collision has been determined by the collision determination.
[0174] In the first example, in response to determining that the enemy object 251a is located in the light-irradiated range 281 in the game space, the game system 1 modifies the enemy object 251a, which is a voxel object, as an in-game action. Note that in the first example, a ray check is used to determine whether the enemy object 251a is located in the light-irradiated range 281, and this determination method will be described later. Fig. 26 is a diagram showing an example of a game image representing the state after a modification has been made to the enemy object 251 as a result of the enemy object 251a being located in the light-irradiated range 281 in the game space.
[0175] In the example shown in FIG. 26 , the material of the entire enemy object 251 (i.e., all voxels in the unique voxel space defined for the enemy object 251) is changed as if the material had changed due to exposure to light in the game space. For example, enemy object 251a, which was made of material A, is changed to enemy object 251b made of material B by moving from a shadow into range 281 where light hits in the game space. It is assumed that the property information included in the above-mentioned material data indicates that material B has a property of weak attack resistance strength. In this embodiment, among the material IDs included in the voxel data in the unique voxel space defined for the enemy object 251, the material ID corresponding to material A is updated to the material ID corresponding to material B. Then, using the method for determining the materials of the display mesh and the determination mesh described above, the materials of the unique display mesh and unique determination mesh of enemy object 251b are determined based on the materials of the updated voxels. Specifically, for voxels in the specific voxel space defined for the enemy object 251, if only a material ID corresponding to material A is set, the first material ID "material A" is changed to "material B," and the material mixing ratio remains set to 0 (i.e., the voxel is set to only one material, "material B"). Also, if a voxel in the specific voxel space defined for the enemy object 251 has material A and another material set, the material ID corresponding to "material A" is changed to the material ID corresponding to "material B," while the material IDs corresponding to the other materials continue to maintain the other materials, and the material mixing ratio remains the same. Also, if a voxel in the specific voxel space defined for the enemy object 251 does not have a material ID corresponding to "material A," the material ID and material mixing ratio values remain unchanged.According to this, the part of the enemy object 251a that was made of "material A" will appear to have been changed to "material B", so by shining light on the "material A" material of the enemy object 251a, it becomes easier for the user to get the impression that it has changed to "material B".
[0176] The enemy objects 251a and 251b may have the same shape or different shapes. In the latter case, the shape of the enemy object 251 may be changed by increasing or decreasing the density of one of the voxels in the voxel space defined for the enemy objects 251a and 251b in accordance with the change in material described above.
[0177] Furthermore, the enemy object 251 may be generated by combining a voxel object with a part of a non-voxel object. For example, detailed features (eyebrows, eyes, teeth, etc.) attached to the surface of the enemy object 251 may be generated using a non-voxel object. Here, the non-voxel object is an object not based on the voxel data described above, and is displayed in the game space by rendering a set polygon mesh. The same material ID as that of the voxel object is set in the polygon mesh of the non-voxel object, and the non-voxel object is displayed by rendering the polygon mesh. In this case, when the material ID of a part of the voxel object is updated, the material ID of the part of the non-voxel object may also be updated in the same way.
[0178] In the example shown in FIG. 27 , a user performs an operation input to cause the player character 201 to perform the punch action, resulting in a punch action toward an enemy object 251b in front of the player character 201, and a collision determination is performed. If a collision between the player character 201 performing the punch action and the enemy object 251a is determined, it is determined whether the attack by the punch action effectively affected the enemy object 251a. Here, the enemy object 251b is made of material B, which has a property set to have weak attack resistance strength, and is therefore destroyed by the attack by the punch action. Specifically, if a collision between the player character 201 performing the punch action and the enemy object 251b is determined, it is determined that the attack by the punch action effectively affected the enemy object 251b, and the above-described update range is generated based on the position and orientation of the player character 201. The game system 1 then deforms (destroys) the enemy object 251b by reducing the density of voxels of the enemy object 251b in the update range.
[0179] The update range indicates the destruction range of the enemy object 251b that is destroyed by the punch action of the player character 201. The update range is generated based on the position, strength, and ability of the player character 201 when attacking the enemy object 251b, the strength of the enemy object 251b (for example, the properties of material B), and the like. For example, the update range is generated in a shape corresponding to the action in a predetermined direction (for example, forward) based on the player character 201. For example, the update range is formed in a bell shape with a hemispherical innermost part, centered on the collision position determined when the player character 201 performs a punch action. Note that the shape of the update range may be other shapes, such as a sphere, an oval sphere, a cube, a cylinder, a wedge, a shape generated by 3D software, or a shape with a portion missing from any of these shapes. Furthermore, the position of the update range may be set around the position in the game space where the punch action by the player character 201 occurs (for example, the position where the punching fist of the player character 201 reaches), or may be set around the position a predetermined distance ahead of that position as seen from the player character 201.
[0180] The game system 1 reduces the density of voxels corresponding to the update range. As a result, the enemy object 251b is deformed so that the portion corresponding to the update range is erased. For example, in this embodiment, the erasure of each voxel is controlled by rewriting the density of each voxel based on the SDF of each voxel in the enemy object 251b. Note that instead of unconditionally deforming the voxel object corresponding to the update range, the game system 1 may increase the amount of damage set in the voxels corresponding to the update range in accordance with a punch action, and reduce the density of the voxels when the amount of damage exceeds a predetermined value.
[0181] Alternatively, fragment objects corresponding to the erased portions of the enemy object 251b may be generated, and an effect may be produced in which the fragment objects scatter as the enemy object 251b deforms. In this case, the fragment objects may be generated so as to have a shape corresponding to the erased portions of the enemy object 251b, or may have a predetermined shape. The fragment objects may or may not be voxel objects.
[0182] In this way, in the first example, as the enemy object 251 changes from being in the shadow of a light source in the game space to being out of the shadow of that light source, the material that makes up the enemy object 251 changes from material A to material B, making it possible to realize a game that uses material changes based on in-game judgments in the voxels of the voxel space defined for the enemy object 251.
[0183] In the first example, the light source that generates the light hit range 281 is a directional light or the like set in the game space, such as ambient light having information only about the direction of the light (for example, a parallel light source that emits sunlight). As another example, it may be configured with a point light source. In determining whether or not the enemy object 251 is located in such light hit range 281, the determination shapes set for the enemy objects 251a and 251b are used.
[0184] As shown in FIG. 28, the determination shape is a shape that contains each of the enemy objects 251a and 251b within the game space. For example, a rectangular parallelepiped bounding box for each of the enemy objects 251a and 251b is used as the determination shape. The bounding box may be an axis-aligned bounding box (AABB) that is parallel to the coordinate axes of the game space, or may be an oriented bounding box for each of the enemy objects 251a and 251b. If a change in shape occurs between the enemy object 251a and the enemy object 251b, the size of the bounding box may be changed based on the change in shape. The determination shape may be any shape that contains at least a portion of each of the enemy objects 251a and 251b. As an example, the determination shape may be a rectangular parallelepiped of the intrinsic voxel space defined for each of the enemy objects 251a and 251b. As another example, the determination shape may be any shape that encloses at least a portion of each of the enemy objects 251a and 251b, and may be, for example, a sphere, an oval sphere, or another polyhedron.
[0185] As shown in FIG. 28, a plurality of feature points FP are set in the determination shape. The feature points FP include at least eight points at the corners of the bounding boxes set for each of the enemy objects 251a and 251b. The feature points FP may be nine points, including one point set at the center of the bounding box or at a predetermined part of each of the enemy objects 251a and 251b. In another embodiment, the feature point FP may be only one point set at the center of the bounding box or at a predetermined part of each of the enemy objects 251a and 251b. When there is one feature point FP, the determination shape does not have to be a shape that includes at least a portion of each of the enemy objects 251a and 251b, and the determination shape may be a point (i.e., one feature point FP).
[0186] As shown in Fig. 29, in the first example, a ray check is used to determine whether an enemy object 251 is located within the range illuminated by light. Note that in Fig. 29, bounding boxes, feature points, obstacles, etc. are represented in two dimensions for the purpose of making the drawing easier to see and the explanation easier to understand, but in reality, three-dimensional bounding boxes and obstacles are set in a three-dimensional space, and eight feature points FP (four points in the drawing) are set. Also, in Fig. 29, a point light source is used for the purpose of making the direction of the light source easier to see, but as described above, a parallel light source may also be used.
[0187] In the first example, whether or not the enemy object 251 is located within the range illuminated by the light is determined based on contact between a plurality of rays based on the light source and the bounding box. For example, a ray check is performed from each feature point FP in the direction of the light source, and if no object (obstacle) is hit between the feature point FP and the light source, it is determined that the feature point FP is not located in the shadow of the light source (i.e., located within the range illuminated by the light source) (for example, the state of feature point FP1 in FIG. 29). On the other hand, if any object (obstacle) is hit between the feature point FP and the light source during a ray check from the feature point FP in the direction of the light source, it is determined that the feature point FP is located in the shadow of the light source (for example, the states of feature points FP2 to FP4 in FIG. 29).
[0188] Then, when it is determined that a predetermined number or more of the feature points FP set in the bounding box are not located in the shadow of the light source, it is determined that the enemy object 251 for which the bounding box is set is not located in the shadow of the light source (i.e., is located in an area illuminated by the light source). The predetermined number used as a threshold for the above determination is arbitrary. As a first example, when it is determined that at least one feature point FP of the multiple feature points FP is not located in the shadow of the light source, it is determined that the enemy object 251 is not located in the shadow of the light source. In this case, it is determined that the enemy object 251 is not located in the shadow of the light source because a part of the enemy object 251 is located in an area illuminated by the light source, and it is determined that the enemy object 251 is located in the shadow of the light source because the entire enemy object 251 is located in the shadow of the light source, and the material of the enemy object 251 is changed based on the determination result. As a second example, when it is determined that all of the multiple feature points FP are not located in the shadow of the light source, it is determined that the enemy object 251 is not located in the shadow of the light source. In this case, since the entire enemy object 251 is located in an area where light from the light source hits it, it is determined that it is not located in the shadow of the light source, and since part of the enemy object 251 is located in the shadow of the light source, it is determined that it is located in the shadow of the light source, and the material of the enemy object 251 is changed based on the determination result.
[0189] (Example 2) As a second example, an example will be described in which the material constituting the enemy object 251 is changed when the enemy object 251 is located within a range illuminated by a placement light in the game space. Fig. 30 is a diagram showing an example of a game image representing the player character 201 holding the light object 202 and the enemy object 251a in the game space.
[0190] In FIG. 30 , a light object 202 is an example of a positioned light placed in the game space, and is a point light that is placed in the game space and emits light radially from its surface. The light object 202 has a range 282 that light from the light object 202 reaches, and a determination shape is set based on the range 282. In the example shown in FIG. 30 , a spherical range with a size based on the shape of the range 282, centered on the position of the light object 202 in the game space, is set as the determination shape. Note that the determination shape is a shape used to determine the range onto which light from the positioned light hits, and may be set to any shape, such as a sphere, an ellipsoid, a cone, or a cylinder, based on the type and properties of the light source. Furthermore, the determination shape may be the same size and shape as the range into which light from the light source actually reaches, or may be a size and shape that is at least partially smaller than the range into which light reaches, or may be a size and shape that is partially outside the range into which light reaches.
[0191] The light object 202 may be an item object possessed by the player character 201, may be placed in advance in the game space, or may be obtained from a terrain object based on the player character 201's action of plucking a part of the terrain object. When the light object 202 is obtained by the above action, the light object 202 may be generated to have a shape corresponding to the part of the terrain object that has been erased by the action, or may have a predetermined shape. The light object 202 may or may not be a voxel object. When the light object 202 is a voxel object, a voxel space different from the voxel space of voxels corresponding to the terrain object, enemy object 251, etc. may be defined for the light object 202.
[0192] The enemy object 251a placed in the game space in the second example is the same voxel object as the enemy object 251a used in the first example. That is, the enemy object 251a used in the second example is located in the shadow in the game space, and is therefore made of material A.
[0193] Also in the second example, the game system 1 changes the material of the enemy object 251a, which is a voxel object, as an in-game action in response to determining that the enemy object 251a is located within the range 282 reached by the light from the light object 202. Fig. 31 is a diagram showing an example of a game image representing the state after a change has been made to the enemy object 251a as a result of the enemy object 251a being located within the range 282 reached by the light from the light object 202.
[0194] 31, when the enemy object 251 and / or the light object 202 move in the game space, and at least a part of the enemy object 251 enters the range 282 reached by light from the light object 202, the material of the entire enemy object 251 (i.e., all voxels in the unique voxel space defined for the enemy object 251) is changed. For example, enemy object 251a made of material A moves from a range where light from the light object 202 does not reach to a range 282 where light does reach, and is changed to enemy object 251b made of material B. In the second example, the material is changed by updating the material ID corresponding to material A to the material ID corresponding to material B among the material IDs included in the voxel data of the unique voxel space defined for the enemy object 251; however, as this is the same as the first example described above, a detailed description thereof will be omitted here.
[0195] In the second example, a collision-based determination is made as to whether or not the enemy object 251a is located within the range 282 reached by the light from the light object 202. For example, in the second example, if the enemy object 251 comes into contact with the determination shape set based on the range 282 reached by the light from the light object 202 or is included in the determination shape, it is determined that the enemy object 251 is located within the range 282 reached by the light. Specifically, based on a collision determination between the determination mesh of the voxel object that is the enemy object 251 and the determination shape, it is determined whether or not the enemy object 251 is located within the range 282 reached by the light from the light object 202. Note that, as an example, if the determination mesh of the enemy object 251 comes into contact with the determination shape, it may be determined that the enemy object 251 is located within the range 282. In this case, since a part of the enemy object 251 is located within the range 282 reached by the light from the light object 202, it is determined that the enemy object 251 is not located in the shadow cast by the light from the light object 202, and since the entire enemy object 251 is located in a range not hit by the light, it is determined that the enemy object 251 is located in the shadow cast by the light, and the material of the enemy object 251 is changed based on the determination result. As another example, when the determination mesh of the enemy object 251 is included inside the above-mentioned determination shape, it may be determined that the enemy object 251 is located in the range 282. In this case, since the entire enemy object 251 is located within the range 282 reached by the light from the light object 202, it is determined that the enemy object 251 is not located in the shadow cast by the light from the light object 202, and since a part of the enemy object 251 is located in a range not hit by the light, it is determined that the enemy object 251 is located in the shadow cast by the light, and the material of the enemy object 251 is changed based on the determination result.
[0196] In the above description, an example was used in which an enemy object is determined to be located within the range reached by light when the enemy object comes into contact with the determination shape or is included in the determination shape, but determination may be made based on other determination conditions. For example, an enemy object may be determined to be located within the range reached by light when other conditions are met, such as when the enemy object overlaps the determination shape by a predetermined percentage or more, or when a predetermined part or position of the enemy object is included in the determination shape.
[0197] In the above first and second examples, a material change is performed when the enemy object 251 is located within a range illuminated by light from a shadow. However, in this embodiment, a material change opposite to the above may be performed when the enemy object 251 moves from a range illuminated by light into a shadow. For example, an enemy object 251b made of material B may be changed to an enemy object 251a made of material A by moving from a lighted range 281 or a light-reaching range 282 in the game space into the shadow of the light. Specifically, when the enemy object 251 moves from a lighted range into a shadow, the material ID corresponding to material B among the material IDs included in the voxel data of the unique voxel space defined for the enemy object 251 may be updated to the material ID corresponding to material A.
[0198] (Example 3) As a third example, an example will be described in which the material constituting the voxel object is changed when the voxel block is located in an area that is cast in shadow by light such as a directional light (for example, sunlight) in the game space. Fig. 32 is a diagram showing an example of a game image that shows a player character 201 standing on a voxel block that is located in an area cast in shadow by an obstacle in the game space. Note that the dashed line in Fig. 32 indicates the direction of the light.
[0199] In the third example, the terrain, such as the ground of the game space, is formed by a plurality of voxel blocks arranged in a grid pattern. The voxel block is a voxel object, and a single voxel block is formed by combining a plurality of voxels into a rectangular parallelepiped (more specifically, a cube). Each cube shown in FIG. 32 represents a voxel block that constitutes the ground in the game space. A unique voxel space is defined for each voxel block. That is, unique voxel data corresponding to one voxel block is defined in the unique voxel space, and a unique display mesh and a unique judgment mesh based on the unique voxel data are set. The unique voxel space can then be assigned a material for each defined voxel block. Note that the voxels that constitute the voxel block defined in the unique voxel space may be a different size from the voxels that constitute the terrain object, or the size of the voxels may be relatively small.
[0200] The first material ID of the material of a polygon in a voxel block that is not in a shadow caused by light in the game space is set to "Material C." The material mixing ratio is also set to 0 (i.e., the only material set for the voxel is "Material C"). Then, it is assumed that the property information included in the above-mentioned material data is set to a property of soft fluidity (for example, a non-solid substance). Then, using the above-mentioned method for determining the materials of the display mesh and the determination mesh, the materials (for example, a material representing floating objects such as clouds) of the unique display mesh and unique determination mesh of the voxel block based on the material of the voxel are determined.
[0201] On the other hand, the first material ID of the material of the polygon in the voxel block that is in the shadow caused by the light in the game space is set to "Material D." The material mixing ratio is also set to 0 (i.e., the voxel is set to only one material, "Material D"). The property information included in the material data described above is set to material D as having a property of strong strength (for example, a solid substance). Then, using the method for determining the materials of the display mesh and the determination mesh described above, the materials of the voxel block's unique display mesh and unique determination mesh (for example, a material indicating a structure such as metal or stone) are determined based on the voxel's material. In the third example, whether the voxel block is in the shadow is determined using a shadow buffer; this determination method will be described later.
[0202] As shown in FIG. 32, because material D has a property of being strong and rigid, when a collision between the player character 201 and a determination mesh of a voxel block made of material D is determined, the player character 201 is controlled so as not to enter the interior of the polygon block. Therefore, the player character 201 can stand on or walk on a polygon block made of material D. On the other hand, because material C has a property of being soft and fluid, when a collision between the player character 201 and a determination mesh of a voxel block made of material C is determined, the player character 201 is controlled so as to enter the interior of the polygon block. Therefore, the player character 201 cannot stand on or walk on a polygon block made of material C.
[0203] If the position of a shadow in the game space changes, the material of the polygon block also changes based on the movement of the shadow. For example, if the direction of a light ray changes from the direction shown in FIG. 32 to the direction shown in FIG. 33, the direction of a shadow cast by an obstacle also changes. When the direction of the shadow changes in this way, the material of the entire voxel block that has changed from being in the shadow to being out of the shadow (i.e., all voxels in the specific voxel space defined for the voxel block) is changed from material D to material C, and the material of the entire voxel block that has changed from being out of the shadow to being in the shadow is changed from material C to material D. Specifically, among the material IDs included in the voxel data in the specific voxel space defined for the voxel block that is now positioned in the range illuminated by the shadow due to the change in the direction of the shadow, the material ID corresponding to material D is updated to the material ID corresponding to material C. Furthermore, among the material IDs included in the voxel data in the specific voxel space defined for the voxel block that has moved from the illuminated range into the shadow due to the change in the direction of the shadow, the material ID corresponding to material C is updated to the material ID corresponding to material D. Then, using the method for determining the materials of the display mesh and the judgment mesh described above, the materials of the unique display mesh and unique judgment mesh of the voxel block are determined based on the material of the updated voxel.
[0204] As shown in FIG. 33, as the direction of the shadow changes, the voxel block on which the player character 201 is standing is changed from material D to material C. This material change causes the material of the voxel block on which the player character 201 is standing to change from material D, which has a strong, rigid property, to material C, which has a weak, fluid property. As a result, based on the collision between the player character 201 and the determination mesh of the voxel block made of material C, the player character 201 sinks inside the polygon block, making it difficult for the player character 201 to move forward, backward, left, or right within the game space. In this way, in order for the player character 201 to continue moving within the game space, it is necessary for him to stand on a voxel block that is in a shadow cast by light, and the position of the shadow is important in the progression of the game.
[0205] In the third example, light such as a directional light, which is an ambient light that has only information about the direction of the light (for example, a parallel light source that emits sunlight), is set in the game space. As another example, other light sources such as point light sources may be set. A shadow buffer is used to determine whether each voxel block is in a shadow caused by the light. For example, the calculation results of the shadow map are copied to texture memory (linear texture) and stored as a shadow buffer, and whether or not it is in the shadow is determined by depth comparison.
[0206] The shadow map indicates the depth (in other words, the depth) of each position when viewed from the light ray direction. The depth is calculated as the distance in the light ray direction from a predetermined reference position (i.e., the position of the light source) to the position. Note that the reference position may be any position.
[0207] For a position in the shadow map where an obstacle such as an object exists when viewed from the light ray direction, the depth is calculated as the distance in the light ray direction from a predetermined reference position to the position of the obstacle, and for a position in the shadow map where no obstacle exists when viewed from the light ray direction, the depth is set to a maximum value.
[0208] Figure 34 is a diagram showing an example of the positional relationship between a light source, an obstacle, and the surface on which the shadow of the obstacle is cast (for example, the ground in the game space, or the top surface of the display mesh in the voxel blocks arranged in the grid pattern described above).
[0209] In FIG. 34, the length t is the depth at a position corresponding to the pixel (for example, position A shown in FIG. 34), and is the depth when the light source is used as a reference (i.e., the depth from the position of the light source to the position corresponding to the pixel). The length t is obtained by converting the depth d when the virtual camera is used as a reference into the depth when the light source is used as a reference. Note that the depth d when the virtual camera is used as a reference is stored in a depth buffer. The depth value stored in the depth buffer may be calculated using a conventional method.
[0210] The length x is the depth at the position corresponding to the pixel, which is stored in the shadow buffer. That is, the length x is the depth when the light source is used as a reference, and if an obstacle exists between the position of the light source and the position corresponding to the pixel (for example, position A shown in FIG. 34), the length x is the distance from the position of the light source to the position of the obstacle (for example, position B shown in FIG. 34). Note that the shadow buffer may store a value obtained by applying a predetermined smoothing filter to the depth x, an average depth value for pixels within a predetermined range including the pixel, or the like.
[0211] Here, if an obstacle exists on the line from the light source to the pixel in question, the length t will be greater than the length x. In this case, the pixel in question will be a pixel where the shadow of the obstacle is drawn. On the other hand, if there is no obstacle on the line from the light source to the pixel in question, the length t will be the same as the length x (or less than the length x). In this case, the pixel in question will be a pixel where the shadow of the obstacle is not drawn.
[0212] The game system 1 generates a game image with shadows by performing lighting processing on the game image drawn in the frame buffer using a shadow map of the entire drawing range.
[0213] In the third example, the depth stored in the shadow buffer is applied to each feature point of the bounding box of each voxel block to determine whether each voxel block is in shadow. For example, if the depth of the position (e.g., length t shown in FIG. 34) obtained by converting the coordinates of each feature point FP into coordinates in the shadow buffer with reference to the shadow buffer is greater than the depth stored in the shadow buffer (e.g., length x shown in FIG. 34), the feature point FP is determined to be in shadow (i.e., located in a range not illuminated by the light source). On the other hand, if the depth of the position (e.g., located in a range illuminated by the light source with reference to the shadow buffer with reference to the coordinates of each feature point FP) is smaller than the depth stored in the shadow buffer, the feature point FP is determined to be not in shadow (i.e., located in a range illuminated by the light source).
[0214] Then, if it is determined that a predetermined number or more of the feature points FP set in the bounding box of each voxel block are not in the shadow, the voxel block to which the bounding box is set is determined to be not in the shadow (i.e., located in an area illuminated by light). The predetermined number used as a threshold for the above determination is arbitrary. As a first example, if it is determined that at least one feature point FP of the multiple feature points FP is not in the shadow, the voxel block to which the bounding box is set is determined to be in the shadow. In this case, the voxel block is determined to be not in the shadow because a portion of the voxel block is located in an area illuminated by light, and the voxel block is determined to be in the shadow because the entire top surface of the voxel block exposed above the ground is in the shadow. The material of the voxel block is changed based on the determination result. As a second example, if it is determined that all (e.g., four) of the multiple feature points FP exposed above the ground in the game space are not in the shadow, the voxel block to which the bounding box is set is determined to be not in the shadow. In this case, the entire top surface of the voxel block exposed above the ground is located in an area where light hits it, so the voxel block is determined to be not in shadow, and part of the top surface of the voxel block exposed above the ground is in shadow, so the voxel block is determined to be in shadow, and the material of the voxel block is changed based on the determination result.
[0215] In this way, by also using the shadow buffer generated for drawing shadows to determine whether a voxel object is in a shadow, an increase in processing load can be suppressed. In particular, in the third example, a large number of voxel blocks are placed over the entire surface of the ground of the game space, so light and shadow determination using a shadow buffer is suitable in cases where performing light and shadow determination by ray checking on all of these voxel blocks would increase the processing load. On the other hand, in the first example above, only the enemy object 251 is subject to light and shadow determination, so the processing load when performing this light and shadow determination is relatively light, and therefore using ray checking allows for more accurate light and shadow determination.
[0216] However, because light and shadow determination using the shadow buffer targets only the drawing range, it is not possible to perform light and shadow determination or the light and shadow determination will be inaccurate for voxel objects in the game space that are at least partially outside the drawing range. Therefore, when the drawing range moves, it is possible that the light and shadow determination for voxel objects that newly enter the drawing range will be delayed from the timing of displaying the voxel objects.
[0217] In this embodiment, in order to prevent delays in the light and shadow determination, the light and shadow determination using the shadow buffer described above may be combined with the light and shadow determination by ray checking described above to perform light and shadow determination for the entire game space. Figure 35 is a diagram showing an example of the range in the game space where light and shadow determination is performed using the shadow buffer and the range where light and shadow determination is performed by ray checking.
[0218] Fig. 35 shows the game space in which the game image exemplified in Fig. 33 has been generated. The game space is divided into an area within the drawing range displayed on the display 12 and an area outside the drawing range.
[0219] As described above, the voxel blocks BCa and BCb located in the game space within the rendering range are subjected to light / shadow determination based on the shadow buffer. Voxel block BCa is determined to be in shadow based on the light / shadow determination based on the shadow buffer, and is composed of material D. Voxel block BCb is determined not to be in shadow based on the light / shadow determination based on the shadow buffer, and is composed of material C.
[0220] On the other hand, voxel blocks BCc and BCd, which are located in the game space outside the drawing range, are determined to be in the shadow by the ray check. Voxel block BCc is determined to be in the shadow by the ray check light and shadow determination, and is composed of material D. Voxel block BCd is determined to be in an area where light hits by the ray check light and shadow determination, and is composed of material C.
[0221] For voxel blocks located between the inside and outside of the drawing range, as one example, all feature points FP may be subjected to light and shadow determination by ray check. As another example, for the voxel blocks, feature points FP within the drawing range may be determined by light and shadow determination based on a shadow buffer, and feature points FP outside the drawing range may be determined by light and shadow determination by ray check, and these determination results may be combined to perform light and shadow determination for the voxel block.
[0222] In the above example, a method for determining light and shadow is used depending on whether the area is within the drawing range or outside the drawing range, but light and shadow determination by ray check may also be performed even within the drawing range. For example, for voxel blocks or feature points that are located in an area that is not visible to the virtual camera because a virtual object or the like in the game space is an obstacle, light and shadow determination by ray check may be performed even within the drawing range.
[0223] Furthermore, for voxel blocks located in the game space outside the drawing range, the range for determining light and shadow by ray checking may target voxel blocks within a predetermined number or a predetermined distance from the drawing range. As an example, the range may target, among the voxel blocks outside the drawing range, voxel blocks located between inside and outside the drawing range, and voxel blocks adjacent to those voxel blocks.
[0224] Furthermore, in the first to third examples described above, when a voxel object is positioned in an area illuminated by light, the material constituting the voxel object is changed from material A, which has a high attack resistance property, or material D, which has a strong strength property, to material B, which has a weak attack resistance property, or material C, which has a soft and fluid property. In the first to third examples described above, when a voxel object is positioned in an area illuminated by light, the material is weakened compared to when the voxel object is in shadow. However, in other embodiments, the voxel object may be weakened when it is in shadow. That is, when a voxel object is in shadow, the material constituting the voxel object may be changed from material A or material D to material B or material C. In this way, when a voxel object is positioned in an area illuminated by light, the material to be changed is arbitrary, and the source material and the destination material may each have arbitrary properties.
[0225] [3. Specific examples of processing in game systems] Next, a specific example of information processing in the game system 1 will be described with reference to FIGS.
[0226] FIG. 36 is a diagram showing an example of various data used for information processing in the game system 1. Each piece of data shown in FIG. 36 is stored in a memory accessible by the main unit 2 (for example, the flash memory 84, the DRAM 85, and / or a memory card inserted in the slot 23, etc.). As shown in FIG. 36, the game system 1 stores a game program. The game program is for executing the game processing in this embodiment (for example, the game processing shown in FIGS. 37 and 38). The game program includes the above-mentioned material data (see FIG. 12). The memory also stores the above-mentioned voxel data (see FIG. 11), update range data, mesh data, object data, determination shape data, ray check processing data, rendering processing data, etc. (see FIG. 36).
[0227] The update range data is data that indicates the update range described above. In this embodiment, the update range is represented by the SDF described above.
[0228] The mesh data includes various data related to the mesh of the voxel object. As shown in FIG. 32 , in this embodiment, the mesh data includes SVO data, display mesh data, and judgment mesh data. The SVO data is data that holds each vertex calculated from the voxel data in the above-mentioned SVO structure. In this embodiment, the SVO data includes data indicating the position of each vertex, as well as data indicating the material set for each vertex (e.g., data indicating the material ID). The display mesh data includes various data related to the display mesh. Specifically, the display mesh data includes data indicating each vertex of the display mesh and data indicating the material set for each vertex (e.g., data indicating the material ID). The judgment mesh data includes various data related to the judgment mesh. Specifically, the judgment mesh data includes data indicating each vertex of the judgment mesh and data indicating the material set for each vertex (e.g., data indicating the material ID).
[0229] The object data includes various data related to objects other than voxel objects (e.g., player characters, virtual objects, etc.). The object data is stored for each object that appears in the game space. The object data includes, for example, data indicating the position, speed, status, etc. of the object.
[0230] The judgment shape data includes various data related to the judgment shape set for the voxel object (for example, the bounding box and its feature points) and various data related to the judgment shape based on the range of the light of the placement light.
[0231] The ray check processing data includes various data related to the light and shadow determination by ray check described in [2-7. Processing for changing materials] (for example, data indicating whether an object hits between each feature point and the light source).
[0232] The rendering processing data includes various data related to the light and shadow determination based on the shadow buffer described in [2-7. Processing for changing materials] (for example, the frame buffer, depth buffer, shadow buffer, and light and shadow determination results for each feature point).
[0233] Fig. 37 is a flowchart showing an example of the flow of game processing executed by the game system 1. Fig. 38 is a subroutine showing an example of the material change processing of step S7 in Fig. 37. Execution of the game processing is started, for example, when the game is started in response to a user instruction during execution of the game program. Note that a processing loop consisting of a series of processes from steps S1 to S15 is executed once per frame.
[0234] In the present embodiment, the processor 81 of the main unit 2 executes the game program stored in the game system 1 to perform the processing of each step shown in FIGS. 37 and 38. However, in other embodiments, some of the processing of each step may be performed by a processor (e.g., a dedicated circuit) other than the processor 81. Furthermore, if the game system 1 is capable of communicating with another information processing device (e.g., a server), some of the processing of each step shown in FIGS. 37 and 38 may be performed in the other information processing device. Furthermore, the processing of each step shown in FIGS. 37 and 38 is merely an example, and the order of the processing of each step may be reversed, or another process may be performed in addition to (or instead of) the processing of each step, as long as similar results are obtained.
[0235] 37 and 38, the processor 81 executes the processing of each step shown in Fig. 37 and 38 using a memory (for example, the DRAM 85). That is, the processor 81 stores information (in other words, data) obtained by each processing step in the memory, and when using the information in a subsequent processing step, reads the information from the memory and uses it.
[0236] 37, processor 81 acquires operation data indicating an operation input by a user (step S1) and proceeds to the next step. For example, processor 81 acquires operation data output from each controller via controller communication unit 83 and / or each terminal 17 and 21, or operation data output from main unit 2 (e.g., touch panel 13).
[0237] Next, processor 81 designates, as a processing target, any object (including a voxel object defined in the unique voxel space) for which processing has not been completed among the objects in the game space that require processing. For the designated object, processor 81 executes a process for calculating the velocity and a process for reflecting the results of collision between objects in the previous frame (step S2), and then proceeds to the next step. The velocity of the object is used to calculate the position of the object in the current frame in the process of step S13, which will be described later. For example, if the designated object is a player character, the velocity of the player character is calculated based on the operation data acquired in step S1. Furthermore, if the designated object is an object not controlled by the user (e.g., an enemy object), the velocity of the object is calculated based on rules predetermined in the game program. For example, the velocity of the enemy object is set to 0 if the enemy object is placed on a terrain object and not moving; if the enemy object is being held by the player character, the velocity is set to the same as the velocity of the player character; and if the enemy object is thrown by a throwing action by the player character, the velocity is set to a velocity that moves in a direction based on the direction of the player character with a magnitude determined by the above rules. Specifically, the speed of an object is calculated based on virtual physics calculations that include interactions between objects, such as repulsion due to collisions between objects, interactions such as friction due to contact, falling due to virtual gravity, and deceleration due to virtual air resistance.
[0238] Furthermore, the process of reflecting the result of the collision between objects in the previous frame includes a process of influencing the objects due to the collision when it is determined that the objects have collided in the collision determination (step S12 described later) in the previous frame. The above process is, for example, the following process. -Processing to reduce the player character's stamina if it is determined that the player character has come into contact with a lava terrain object in the previous frame A process of generating a fragment object (for example, a light object 202; see FIG. 30) when it is determined that the player character has come into contact with a terrain object due to a pulling action or punching action in the previous frame. If the player character stood on a voxel block made of a strong material in the previous frame, the process of keeping the player character standing on that voxel block (see Figure 32) If the player character stepped on a voxel block made of a soft, fluid material in the previous frame, the player character will sink into the voxel block (see Figure 33). If the state of the object is changed in the process of step S2 above, processor 81 updates the object data stored in memory for that object so that it indicates the changed content.
[0239] Next, processor 81 determines whether or not an update event that updates the voxel object has occurred due to the object specified in step S2 (step S3). For example, the determination in step S3 is made based on the result of collision determination in the previous frame (step S12, described later). As an example, if it is determined that the player character has come into contact with the terrain object by a punch action or the like in the previous frame, it is determined that an update event that erases a part of the terrain object has occurred. If an update event has occurred, processor 81 proceeds to step S4. On the other hand, if an update event has not occurred, processor 81 proceeds to step S6.
[0240] In step S4, processor 81 sets an update range in the game space for updating the voxel object, and proceeds to the next step. For example, the specific contents of the update range (e.g., position, shape, and size) are associated with each type of update event in the game program. The update range set in step S4 is set to have contents associated with the type of update event determined to occur in step S3. In step S4, processor 81 stores data indicating the set update range in memory as update range data.
[0241] Next, processor 81 makes changes to the voxels corresponding to the update range set in step S4 in accordance with the update event (step S5), and proceeds to step S6. For example, when processor 81 deforms a voxel object in the update range so as to erase or reduce it, or deforms a voxel object in the update range so as to add it, processor 81 updates the voxel data stored in memory so as to change the density of the voxels corresponding to the update range (see [2-2. Updating Voxel Data] above).
[0242] In step S6, processor 81 determines whether or not the processing of steps S2 to S5 has been completed for all objects requiring processing (including voxel objects defined by the unique voxel space). If the processing of all objects has been completed, processor 81 proceeds to step S7. On the other hand, if the processing of any object has not been completed, processor 81 returns to step S2 and repeats the processing.
[0243] Processor 81 then performs a material change process (step S7), and proceeds to step S8. The material change process in step S7 will now be described with reference to FIG.
[0244] 38, processor 81 determines whether or not the processing of steps S23 to S32, which will be described later, has been completed for all voxel spaces (including the characteristic voxel space) that require processing (step S21). If the processing of all voxel spaces has been completed, processor 81 ends the processing of this subroutine. On the other hand, if the processing of any game space has not been completed, processor 81 proceeds to step S22.
[0245] In step S22, the processor 81 selects, as a processing target, any voxel space for which processing has not been completed among the voxel spaces that require processing, and proceeds to the next step.
[0246] Next, processor 81 determines whether or not the voxel object defined by the voxel space selected in step S22 is a target for which the material is to be changed by light and shadow determination (step S23). If the voxel object is a target for which the material is to be changed by light and shadow determination, processor 81 proceeds to step S24. On the other hand, if the voxel object is not a target for which the material is to be changed by light and shadow determination, processor 81 returns to step S21 and repeats the process.
[0247] In step S24, processor 81 determines whether a change has occurred in the voxel object defined by the voxel space selected in step S22, causing the voxel object to enter a range illuminated by the light of the placement light or to exit a range illuminated by the light of the placement light. As an example, processor 81 makes an affirmative determination in step S24 when, based on the collision determination result of the previous frame in step S12 described later, the determination mesh of the voxel object changes from a non-contact state to a contact state with the determination shape set based on the range illuminated by the light of the placement light, or when the determination mesh changes from a contact state with the determination shape to a non-contact state (for example, when enemy object 251a shown in FIG. 30 comes into contact with range 282, or when enemy object 251b as a whole exits range 282 shown in FIG. 31; see the second example in [2-7. Processing for Changing Material] above). As another example, the processor 81 makes a positive determination in step S24 if, based on the collision determination result of the previous frame in step S12 (described later), a state in which a portion of the determination mesh of the voxel object is outside the determination shape changes to a state in which the entire determination mesh is contained within the determination shape, or if a state in which the entire determination mesh is contained within the determination shape changes to a state in which a portion of the determination mesh is outside the determination shape. If the state change has occurred in the voxel object, the processor 81 proceeds to step S31. On the other hand, if the change has not occurred in the voxel object, the processor 81 proceeds to step S25. The processor 81 may perform the process of step S24 only if the voxel object defined by the voxel space selected in step S22 is a target whose material changes depending on the light from the placement light. In other words, if the voxel object is not a target whose material changes depending on the light from the placement light, the processor 81 may cancel the process of step S24 and proceed directly to step S25.
[0248] In step S25, processor 81 determines whether or not the processing of steps S26 to S30 (described later) has been completed for all feature points (see FIGS. 28 and 29) that are set in the voxel object defined by the voxel space selected in step S22 and that require processing. If processor 81 determines that processing of any feature point has not been completed, processor 81 proceeds to step S26. On the other hand, if processing of all feature points has been completed, processor 81 proceeds to step S31.
[0249] In step S26, the processor 81 selects, as a processing target, any of the feature points that require processing and for which processing has not been completed, and proceeds to the next step.
[0250] Next, processor 81 determines whether or not to perform light / shadow determination on the feature point selected in step S26 above based on the shadow buffer (step S27). For example, if rendering processing using the shadow buffer has been performed in the game image generation processing (drawing processing) for the previous frame in step S14 described below, and if the feature point is located within the drawing range in the game space, processor 81 makes a positive determination in step S27 above. If processor 81 determines to perform light / shadow determination on the feature point based on the shadow buffer, processor 81 proceeds to step S28. On the other hand, if processor 81 does not determine light / shadow determination on the feature point based on the shadow buffer, processor 81 proceeds to step S30.
[0251] In step S28, processor 81 performs a light / shadow determination on the feature point currently being processed based on the shadow buffer, and proceeds to step S29. For example, processor 81 uses the shadow buffer used in the game image generation process (drawing process) of the previous frame in step S14, which will be described later, to determine whether the feature point being processed is in shadow or located in an area where light hits it, in accordance with the determination method based on the shadow buffer described in the third example in [2-7. Process for changing material] above, and updates the drawing process data stored in memory based on the determination result.
[0252] In step S29, processor 81 determines whether or not to perform light and shadow determination on the feature point selected in step S26 above using ray check. For example, processor 81 makes a positive determination in step S29 above if rendering processing using a shadow buffer has not been performed in the game image generation processing (drawing processing) of the previous frame in step S14 described below, if the feature point is located outside the drawing range in the game space, if a negative determination has been made in step S27 above, or if processor 81 wishes to perform both light and shadow determination using a shadow buffer and light and shadow determination using ray check. If processor 81 determines to perform light and shadow determination on the feature point using ray check, processor 81 proceeds to step S30. On the other hand, if processor 81 does not determine light and shadow determination on the feature point using ray check, processor 81 returns to step S25 above and repeats the process.
[0253] In step S30, the processor 81 performs a light / shadow determination by ray check on the feature point currently being processed, and then returns to step S25 to repeat the process. For example, the processor 81 determines whether the feature point being processed is in shadow or in an area where light hits it, according to the method of determination by ray check described in the first and third examples in [2-7. Processing for changing material] above, and updates the ray check processing data stored in memory based on the determination result.
[0254] Meanwhile, in step S31, the processor 81 determines whether or not to change the material of the voxel in the voxel space selected in step S22. As a first example, if step S31 is executed as a result of a positive determination in step S24, the determination in step S31 is made based on the light and shadow determination method described in the second example of [2-7. Processing for Changing Materials] above. As a second example, if step S25 is made based on a positive determination and all feature points have been determined to be light and shadow by ray check, the determination in step S31 is made by referring to the ray check processing data stored in memory according to the light and shadow determination method described in the first example of [2-7. Processing for Changing Materials] above. As a third example, if step S25 is made based on a positive determination and at least some feature points have been determined to be light and shadow based on the shadow buffer, the determination in step S31 is made by referring to the rendering processing data (and ray check processing data, if necessary) stored in memory according to the light and shadow determination method described in the third example of [2-7. Processing for Changing Materials] above. If the material is to be changed, processor 81 proceeds to step S32. On the other hand, if the material is not to be changed, processor 81 returns to step S21 and repeats the process.
[0255] In step S32, the processor 81 changes the material of the voxel in the voxel space selected in step S22, and then returns to step S21 to repeat the process. As a first example, if step S32 is executed as a result of a positive determination in step S24, the material of all voxels in the voxel space being processed is changed according to the material change method described in the second example of [2-7. Material Change Processing] above, and the voxel data stored in memory is updated. As a second example, if the determination in step S25 is positive, the material of all voxels in the voxel space being processed is changed according to the material change method described in the first or third example of [2-7. Material Change Processing] above, and the voxel data stored in memory is updated.
[0256] Returning to FIG. 37, after the material change process in step S7 above, processor 81 updates the vertices of the voxel object in the game space (step S8) and proceeds to the next step. For example, if the voxel data is updated in the process of step S5 above, processor 81 calculates new vertices based on the updated voxel data. The positions of the new vertices are calculated according to the method described above in [2-3. Vertex Calculation]. The materials of the new vertices are calculated according to the method described above in [2-4. Determining the Vertex Material].
[0257] Next, processor 81 simplifies the vertices (step S9) and proceeds to the next step. For example, processor 81 simplifies each vertex after updating by the processing of step S8 above, according to the method described above in [2-5. Vertex Simplification]. Then, processor 81 updates the SVO data stored in memory to indicate each vertex obtained by the processing of steps S8 and S9 above. Note that the processing of steps S8 and S9 above does not need to recalculate the vertices for all of the voxel data, and may be performed only for the part whose voxel content has been changed in the processing of step S5 above.
[0258] Next, the processor 81 updates the display mesh of the voxel object based on the SVO data stored in memory (step S10) and proceeds to the next step. The positions of each vertex of the display mesh and the material of each polygon of the display mesh (e.g., the material set for each vertex of a polygon) are calculated according to the methods described in [2-6. Mesh Generation] and [2-6-1. Determining the Material of the Display Mesh] above. In step S10, the processor 81 updates the display mesh data stored in memory to indicate the updated positions and materials of each vertex of the display mesh. The processor 81 may start processing from step S11 (described later) onward without waiting for the completion of step S10, and execute these processing in parallel. In this case, step S10 must be completed before the start of step S14 (described later).
[0259] Next, processor 81 updates the determination mesh of the voxel object based on the SVO data stored in memory (step S11), and proceeds to the next step. The positions of each vertex of the determination mesh and the material of each polygon of the determination mesh (e.g., the material set for each vertex of a polygon) are calculated according to the methods described above in [2-6. Mesh Generation] and [2-6-2. Determining the Material of the Determination Mesh]. In step S11, processor 81 updates the determination mesh data stored in memory to indicate the positions and materials of each vertex of the determination mesh after the update.
[0260] In the example shown in FIG. 37, the determination mesh generation process in step S11 is executed for each frame, but the determination mesh generation process does not have to be executed for each frame. For example, if the collision determination process in step S12, which will be described later, is executed only in frames that satisfy a predetermined condition, processor 81 may execute the determination mesh generation process in the frame in which the collision determination is performed. Processor 81 may also execute the determination mesh generation process for voxels within an area of the game space in which the collision determination in step S12 is performed. For example, in a situation in which no objects other than voxel objects that are the subject of collision determination exist around the player character in the game space (that is, a situation in which it is sufficient to perform collision determination only between the player character and its surrounding voxel objects), processor 81 may execute the determination mesh generation process for voxels within a predetermined range based on the player character.
[0261] Next, processor 81 performs collision determination for each object in the game space based on the determination mesh data and object data stored in memory (step S12), and proceeds to the next step. For example, processor 81 performs collision determination using a determination mesh for a voxel object, and using a determination area of a predetermined shape set for the object for an object that is not a voxel object. Note that in this embodiment, the collision determination in step S12 is performed taking into account the speed calculated in step S2 above. In other words, processor 81 performs collision determination using the position of each object when it moves at the above speed.
[0262] In this embodiment, the collision determination in step S12 determines, for example, whether or not there will be a next contact. - Collision between the player character performing actions such as movement or punching and terrain objects or enemy objects Contact between a character who lifts a light object and the light object Contact between an object that is the target of light and shadow determination (for example, enemy object 251 shown in FIGS. 30 and 31) and a determination shape based on the range of the light of the placement light (for example, range 282 shown in FIGS. 30 and 31). If it is determined in the collision determination in step S12 above that the objects have come into contact with each other, then in the processing of step S2 in the next frame, a process is executed to reflect the result of the objects coming into contact with each other, in the processing of step S3 in the next frame, it is determined that an update event has occurred, and in the processing of steps S26 and S32 in the same frame described below, a light / shadow determination is executed.
[0263] Next, processor 81 controls the actions of each object in the game space (step S13) and proceeds to the next step. For example, processor 81 controls the player character to move and perform various actions based on the operation data acquired in step S1. When a predetermined action is performed, processor 81 generates an area for collision determination in the game space according to the action. Note that in one execution of step S13, processor 81 controls each object so that, for an action performed over multiple frames (e.g., an action by the player character), the action progresses for one frame. As a result, by repeatedly executing the process of step S13 over multiple frames, each object performs a series of actions related to movement and various actions. Furthermore, the position of an object is basically determined to be the position after moving at the speed calculated in step S2. However, if it is determined by the collision determination in step S12 that an object will come into contact with another object and the movement is obstructed by the contacting object, the position of the object may be determined not to change. Then, in step S13, processor 81 updates the object data stored in memory so that the content indicates the object after the control in step S13.
[0264] Next, processor 81 generates a game image (step S14) and proceeds to the next step. For example, processor 81 generates a game image by drawing each polygon of a display mesh of a voxel object and each polygon of an object other than the voxel object based on a virtual camera. Note that each polygon of the display mesh is drawn using drawing settings such as texture corresponding to the material set for the polygon, according to the method described above in [2-6-1. Determining the Material of the Display Mesh]. Furthermore, processor 81 sets a light source such as a directional light or a positional light in the game space, performs lighting processing based on the light source, and executes rendering processing including processing for casting shadows on the game space. For example, when a light object (see FIGS. 30 and 31) is placed in the game space, processor 81 sets a point light that emits light radially from the surface of the light object as the positional light, and sets a range within which the light of the positional light can reach (for example, range 282 shown in FIGS. 30 and 31). The game image generated in step S14 above is output to the display device once per frame and displayed.
[0265] In step S14, when a game image with a shadow added is generated using a shadow buffer, processor 81 performs processing to update the shadow buffer and executes rendering processing including processing to generate a shadow based on a shadow map stored in the shadow buffer and write the shadow to the frame buffer. For example, processor 81 updates the shadow buffer according to the method of generating a shadow map and storing it in the shadow buffer described above in [2-7. Processing to Change Material], performs drawing processing using the shadow buffer, and updates the drawing processing data stored in memory based on the drawing processing.
[0266] Returning to FIG. 37, in step S15, processor 81 determines whether or not to end the game. For example, if the user has performed a predetermined operation input for ending the game or if a condition for ending the game is satisfied, processor 81 makes an affirmative determination in step S15. If processor 81 determines to end the game, it ends the processing according to the flowchart. On the other hand, if processor 81 does not want to end the game, it returns to step S1 and repeats the processing. Thereafter, the series of processing steps S1 to S15 are repeatedly executed until it is determined in step S15 that the game is to end.
[0267] In this way, in this embodiment, the material of all voxels in the voxel space in which the voxel object is defined is changed depending on whether the voxel object is in shadow or in an area where light hits it. This makes it possible to realize a game that uses material changes of voxels in a specified voxel space based on in-game judgments.
[0268] Note that the combination of the voxel object to be determined and the determination method for determining whether the determination object is located within the range illuminated by light does not need to be a fixed combination and may be varied. For example, the combination of the determination object and the determination method may be replaced with any other combination. As an example, for the enemy object 251, which is the determination object used in the second example of [2-7. Processing for Changing Material] above, a bounding box containing the enemy object 251 may be used as the determination shape to determine whether the enemy object 251 is located within the range illuminated by light. In this case, as a first example, whether the enemy object 251 is located within the range illuminated by light may be determined based on the number of feature points (see FIG. 28) set based on the bounding box and arranged within the determination shape set based on the range 282 illuminated by light. As a second example, it may be determined whether or not the enemy object 251 is located within the lighted range 282 by using the light object 202 as a light source and performing light and shadow determination using a ray check for each feature point set based on the bounding box, or by performing light and shadow determination using a shadow buffer. In this case, in the subroutine illustrated in Fig. 38, the enemy object 251, which is the determination target used in the second example, may be subjected to light and shadow determination by the processing in steps S25 to S30, and the processing in step S24 may be skipped.
[0269] In the above description, a processing procedure was used in which both light and shadow determination using a shadow buffer and light and shadow determination by ray checking may be performed for one of the feature points, but a processing procedure in which only one of the light and shadow determinations is performed may also be used. In this case, in the subroutine illustrated in Fig. 38, after the processing of step S28 is performed, the processing may return to step S25 and be repeated without performing the processing of step S29.
[0270] In the above explanation, an example was used in which a voxel object is defined by generating a three-dimensional mesh based on voxel data set in voxels in three-dimensional space, but a voxel object may also be defined based on voxel data set in two-dimensional voxels.
[0271] Furthermore, the game system 1 may be any device, such as a portable game device or any portable electronic device (PDA (Personal Digital Assistant), mobile phone, smartphone, personal computer, camera, tablet, etc.). In this case, the input device for performing user operations to move the player character, etc. does not have to be the left controller 3, the right controller 4, or the touch panel 13, etc., but may be another controller, a mouse, a touchpad, a touch panel, a trackball, a keyboard, a cross key, a slide pad, etc.
[0272] Furthermore, although the above description uses an example in which information processing is performed by the game system 1, at least some of the above processing steps may be performed by another device. For example, if the game system 1 is configured to be able to communicate with yet another device (e.g., another server, another information processing device, another game device, another mobile terminal, etc.), the above processing steps may be executed by cooperation with the other device. In this way, by performing at least some of the above processing steps in another device, processing similar to the above-described processing becomes possible. Furthermore, the above-described information processing may be executed by one processor or cooperation between multiple processors included in an information processing system composed of at least one information processing device. Furthermore, in the above embodiment, information processing can be performed by the processor 81 of the game system 1 executing a predetermined program, but some or all of the above processing may be performed by a dedicated circuit provided in the game system 1.
[0273] According to the above-described modified example, the present invention can also be realized in a so-called cloud computing system configuration, or in a distributed wide area network or local network system configuration. For example, in a distributed local network system configuration, the above processing can be performed cooperatively between a stationary information processing device (stationary game device) and a portable information processing device (portable game device). Note that in these system configurations, there is no particular limitation on which device performs the above processing, and it goes without saying that the present invention can be realized regardless of the processing division.
[0274] Furthermore, the processing order, setting values, conditions used for judgment, etc. used in the information processing described above are merely examples, and it goes without saying that this embodiment can be realized even with other orders, values, and conditions.
[0275] The program may be supplied to the game system 1 not only through an external storage medium such as an external memory, but also through a wired or wireless communication line. The program may be pre-recorded in a nonvolatile storage device within the device. The information storage medium for storing the program may be a nonvolatile memory, a CD-ROM, a DVD, or similar optical disk-shaped storage media, a flexible disk, a hard disk, a magneto-optical disk, or a magnetic tape. The information storage medium for storing the program may also be a volatile memory for storing the program. Such a storage medium may be a recording medium readable by a computer or the like. For example, the various functions described above can be provided by having a computer or the like read and execute the program from such a recording medium.
[0276] Although the present invention has been described in detail above, the above description is merely illustrative of the present invention in all respects and is not intended to limit its scope. It goes without saying that various improvements and modifications can be made without departing from the scope of the present invention. Furthermore, those skilled in the art will understand that, from the description of specific embodiments of the present invention, they will be able to implement equivalents based on the description of the present invention and common technical knowledge. Furthermore, unless otherwise specified, it should be understood that the terms used in this specification are used in the same sense as commonly used in the art. Therefore, unless otherwise defined, all technical and technical terms used in this specification have the same meaning as commonly understood by those skilled in the art to which this invention belongs. In the event of any conflict, the present specification (including definitions) will prevail. [Industrial Applicability]
[0277] As described above, the present invention can be used as a game program, game system, game device, game processing method, etc. that can realize a game using material changes of voxels in a specified voxel space based on judgments made during the game. [Explanation of symbols]
[0278] 1. Information processing system 2...Main unit 3...Left controller 4...Right controller 11. Housing 12...Display 13...Touch panel 32, 52...Analog stick 42, 64...Terminals 81...Processor 82...Network Communication Department 83...Controller communication section 85...DRAM
Claims
1. The computer of the information processing device updating, based on game processing, a plurality of voxel data defined for each of a plurality of voxel spaces in the virtual space, the voxel data having at least a density indicating the degree to which the space defined by the voxel is virtually occupied by content and a material indicating the type of content set for each of a plurality of voxels included in the voxel space; generating or updating a first mesh corresponding to the voxel data by determining vertex coordinates of the mesh based at least on the density included in the voxel data and determining a material of the first mesh based at least on the material included in the voxel data; drawing the first mesh based on material data including at least rendering setting information including at least texture information set for the material for each type of material, and based on the rendering setting information of the material of the first mesh; A game program that updates a first material included in the voxel data of at least one of the voxel spaces that is determined to satisfy a first condition to a second material based on a first determination of whether a first determination shape set in the virtual space for at least one of the voxel spaces is located within a range that satisfies the first condition based on the game processing.
2. 2. The game program according to claim 1, wherein the first condition is that the character is not in the shadow of a first light source.
3. 3. The game program according to claim 2, wherein the computer is caused to make the first determination based on a shadow buffer that is based on the first light source.
4. 3. The game program according to claim 2, wherein the computer is caused to make the first determination based on contact between a plurality of rays based on the first light source and the first determination shape.
5. 5. The game program according to claim 2, wherein the first light source is ambient light.
6. 2. The game program according to claim 1, wherein the first condition is that the object is in contact with or is included in a second determination shape defined in the virtual space.
7. 7. The game program according to claim 6, wherein the second determination shape is set at a position corresponding to a position of a second light source arranged based on the game processing.
8. The game program according to claim 7 , wherein the second determination shape is at least one spherical shape centered on the position of the second light source.
9. 9. A game program according to claim 1, further comprising causing the computer to update the second material to the first material among materials contained in the voxel data of the voxel space in which the first judgment shape is set and which is determined not to satisfy the first condition.
10. A game program as described in claims 1 to 4 and 6 to 8, which causes the computer to make the first judgment based on whether a predetermined number or more of the plurality of feature points set in the first judgment shape satisfy the first condition.
11. the first determination shape is a rectangular parallelepiped shape, The game program according to claim 10 , wherein the feature points include at least eight corners of the rectangular parallelepiped.
12. updating, based on game processing, a plurality of voxel data defined for each of a plurality of voxel spaces in the virtual space, the voxel data having at least a density indicating the degree to which the space defined by the voxel is virtually occupied by content and a material indicating the type of content set for each of a plurality of voxels included in the voxel space; generating or updating a first mesh corresponding to the voxel data by determining vertex coordinates of the mesh based on at least the density included in the voxel data and determining a material of the first mesh based on at least the material included in the voxel data; drawing the first mesh based on material data including at least rendering setting information including at least texture information set for the material for each type of material, and based on the rendering setting information of the material of the first mesh; A game system that updates a first material included in the voxel data of at least one of the voxel spaces that is determined to satisfy a first condition to a second material based on a first determination of whether a first determination shape set in the virtual space for at least one of the voxel spaces is located within a range that satisfies the first condition based on the game processing.
13. 13. The game system of claim 12, wherein the first condition is that the object is not in the shadow of a first light source.
14. The game system according to claim 13 , wherein the first determination is made based on a shadow buffer based on the first light source.
15. The game system according to claim 13 , wherein the first determination is made based on contact between a plurality of rays based on the first light source and the first determination shape.
16. 16. The game system according to claim 13, wherein the first light source is ambient light.
17. The game system according to claim 12 , wherein the first condition is that the object is in contact with or is included in a second determination shape defined in the virtual space.
18. 18. The game system according to claim 17, wherein the second determination shape is set at a position corresponding to a position of a second light source arranged based on the game processing.
19. The game system according to claim 18 , wherein the second determination shape is at least one spherical shape centered on the position of the second light source.
20. 20. A game system according to any one of claims 12 to 15 and 17 to 19, further comprising: updating the second material to the first material among materials included in the voxel data of the voxel space in which the first judgment shape is set and which is judged not to satisfy the first condition.
21. A game system according to claims 12 to 15 and 17 to 19, wherein the first judgment is made based on whether or not a predetermined number or more of the feature points set in the first judgment shape satisfy the first condition.
22. the first determination shape is a rectangular parallelepiped shape, 22. The game system according to claim 21, wherein the feature points include at least eight corner points of the rectangular parallelepiped.
23. Information processing systems, updating, based on game processing, a plurality of voxel data defined for each of a plurality of voxel spaces in the virtual space, the voxel data having at least a density indicating the degree to which the space defined by the voxel is virtually occupied by content and a material indicating the type of content set for each of a plurality of voxels included in the voxel space; generating or updating a first mesh corresponding to the voxel data by determining vertex coordinates of the mesh based at least on the density included in the voxel data and determining a material of the first mesh based at least on the material included in the voxel data; drawing the first mesh based on material data including at least rendering setting information including at least texture information set for the material for each type of material, and based on the rendering setting information of the material of the first mesh; A game processing method, comprising: updating a first material, among materials included in the voxel data of at least one of the voxel spaces that is determined to satisfy a first condition based on the game processing, to a second material based on a first determination of whether or not a first determination shape set in the virtual space for at least one of the voxel spaces is located within a range that satisfies the first condition based on the game processing.
24. 24. A game processing method according to claim 23, wherein the first condition is that the character is not in the shadow of a first light source.
25. 25. The game processing method according to claim 24, wherein the information processing system makes the first determination based on a shadow buffer that is based on the first light source.
26. 25. The game processing method according to claim 24, wherein the information processing system makes the first determination based on contact between a plurality of rays based on the first light source and the first determination shape.
27. 27. A game processing method according to claim 24, wherein the first light source is ambient light.
28. 24. A game processing method according to claim 23, wherein the first condition is that the object is in contact with or is included in a second determination shape defined in the virtual space.
29. 29. A game processing method according to claim 28, wherein the second determination shape is set at a position corresponding to a position of a second light source arranged based on the game processing.
30. 30. A game processing method according to claim 29, wherein the second determination shape is at least one spherical shape centered on the position of the second light source.
31. 31. A game processing method according to any one of claims 23 to 26 and 28 to 30, further comprising causing the information processing system to update the second material to the first material among materials included in the voxel data of the voxel space determined not to satisfy the first condition in the voxel space in which the first judgment shape is set.
32. A game processing method according to claims 23 to 26 and 28 to 30, wherein the information processing system makes the first determination based on whether or not a predetermined number or more of a plurality of feature points set in the first determination shape satisfy the first condition.
33. the first determination shape is a rectangular parallelepiped shape, 33. A game processing method according to claim 32, wherein the feature points include at least eight corner points of the rectangular parallelepiped.
34. A gaming device including a processor, The processor: updating, based on game processing, a plurality of voxel data defined for each of a plurality of voxel spaces in the virtual space, the voxel data having at least a density indicating the degree to which the space defined by the voxel is virtually occupied by content and a material indicating the type of content set for each of a plurality of voxels included in the voxel space; generating or updating a first mesh corresponding to the voxel data by determining vertex coordinates of the mesh based on at least the density included in the voxel data and determining a material of the first mesh based on at least the material included in the voxel data; drawing the first mesh based on material data including at least rendering setting information including at least texture information set for the material for each type of material, and based on the rendering setting information of the material of the first mesh; a game device that updates a first material, among materials included in the voxel data of at least one of the voxel spaces that is determined to satisfy a first condition based on the game processing, to a second material, based on a first determination of whether a first determination shape set in the virtual space for at least one of the voxel spaces is located within a range that satisfies the first condition based on the game processing.
Citation Information
Patent Citations
Program and image generation system
JP2017099744A
Simulation system, simulation method, and simulation program
JP2022187433A
Method and system for generating polygon meshes approximating surfaces using root-finding and iteration for mesh vertex positions
JP2023178274A
Generating surface meshes from voxel models of 3D environments.
JP2024521128A