• No results found

Gaming in Virtual Reality using A* algorithm

N/A
N/A
Protected

Academic year: 2020

Share "Gaming in Virtual Reality using A* algorithm"

Copied!
5
0
0

Loading.... (view fulltext now)

Full text

(1)

Gaming in Virtual Reality using A* algorithm.

Mukund R. Magdum1, Veena B. Kamble2, Siddhesh R. Chavan3, Shwetali M. Pawar4 ,Ashwini V. Khodke5

Mangesh J. Shinde6

1,2,3,4,5

Students, Department of Computer Science and Engineering,

D. Y. Patil College of Engineering and Technology, Kasaba Bawada, Kolhapur, Maharashtra, India.

6Assistant Professor, Department of Computer Science and Engineering,

D. Y. Patil College of Engineering and Technology, Kasaba Bawada, Kolhapur, Maharashtra, India.

Abstract -

They say we live in a stimulation, we

actually don't know the truth but we can, using Virtual Reality which can be referred as immersive multimedia or computer generated simulation of life, replicates an environment that can be simulation of physical places in the virtual world or imagined worlds and lets the user interact in that world. Virtual reality artificially creates sensory experiences, which can include sight, hearing, touch, smell, and taste. Virtual reality gaming is where a person can experiences being in three dimensional environment and interact with that environment during a game. Based on Virtual Reality (VR) technology, we provide a more interesting and convenient way for people to play virtual reality game on Google Cardboard. In this project, we propose a Virtual Reality in Gaming for on Android platform through Google Card board (Wearable Device). The game is rendered when player aims using his/her eye sight at the specific marker. The players can view the virtual scenario through the lenses of Google Cardboard. Player moves the device to control the game. The experiment results show that the proposed game system can work effectively and provide winner result to the player.

Keywords: Virtual Reality, 3-D game, Google Cardboard, Android Device.

1.

Introduction

Mobile is probably the only thing we carry along everywhere and because of the recent research and development we now have access to the new world of virtual reality. Virtual Reality is the name for any immersive simulated experience. VR simulates a user’s presence in different environments, usually through the use of a visual headset but also can include virtual taste, smell, sound, and touch.

There are already millions of games on the stores (Google’s play stores, iOS’s App stores) right now, but the numbers of VR games are very less. The games which includes Indian Mythologies are even less.

The project will implement Artificial Intelligence (AI) character. AI is simply the theory and development of computer systems able to perform task normally requiring human intelligence such as visual perception, speech recognition, decision making and translation between languages. The aim of this project is to develop a game for mobile platform using both VR and AI. The project will use unity game engine which is free and widely used for game development. In order to promote Indian culture we are developing a game on Indian protagonist character ARJUNA from famous Indian epic Mahabharata.

2.

Related work

The following is the paper that was referenced for the project:

[1]. Jie Hu; Wang gen Wan; Xiaoqing Yu, "A pathfinding algorithm in realtime strategy game based on Unity3D, 2012 International Conference on Audio, Language and Image Processing (ICALIP)," pp.1159,1162, 16-18 July 2012

This paper aims to discuss the application of the A* Algorithm in partially explored environments with the aim of making pathfinding for NPCs in a 3D games engine.The proposed pathfinding system is aimed to simulate more realistic planning and decision making processes based on the information known about the environment. This will result in the proposed system making assumptions about the best path and then having to recalculate the path as it learns more about the environment. The A* algorithm is widely used in game development as a way of controlling NPC movement. The A* algorithm is similar to that of Dijkstra’s algorithm however it uses a heuristic to determine the optimal search area. The most common implementation of the A algorithm uses the Manhattan approach where the heuristic is calculated by the number of nodes from the current position to the target. The use of an appropriate heuristic allows the algorithm to find the shortest path to the target and has a distinct advantage over the Dijkstra algorithm. [1]

(2)

International Conference on Audio, Language and Image Processing (ICALIP)”pp.1159,1162, 16-18 July 2012 IEEE

This paper aims to discuss pathfinding in the context of video games concerns the way in which a moving entity finds a path around obstacles; the most frequent context is real-time strategy games (in which the player directs units around a play area containing obstacles), but forms of this are found in most modern video games. It is probably the most popular but frustrating game artificial intelligence (AI) problem in game industry. This article introduces A-Star algorithm first, then describes the details of Star algorithm. Finally, a real example of how the A-Star pathfinding technique is used in a famous 3D game engine: Unity3D. [2]

[3]. Khantanapoka, K.; Chinnasarn, K.,” Pathfinding of 2D & 3D game realtime strategy with depth direction A_ algorithm for multi-layer”, SNLP 2009.” Eighth

International Symposium on Natural Language Processing, pp.184,188, 20-22 Oct. 2009.

This paper aims to discuss the pathfinding analysis has importance for various working such as logistics, transportation, operation management, system analysis and design, project management, network and production line. Especially, game programming technology has effect to economic and dominates culture, increasingly. The shortest path analysis is artificial intelligent which developed capability about think cause and effect, learning and thinking like human. Heuristic technique is method for solving a problem which gets result or not. It may return unexpected value which depends on each problem. 3D game realtime strategy uses shortest path analysis control path for movement of character, wheeled vehicle, animals, and fantasy buildings. It uses path for movement ever time, both in sea, terra and sky (three layers). The position of 3D object use refers 2D coordinate. Generally, the most of 3D game strategy both on LAN and online will play on terrain more than inside building or the room. This research proposes two essences. It proposes comparison rapidity, intelligence and efficiency about seven path finding algorithms which is principle algorithm are familiar. These algorithms used in game computer extensively as follows [a] Depth First Search [b] Iterative Deepening [c] Breadth First Search [d] Dijkstra's Algorithm [e] Best First Search [f] A-Star Algorithm (A∗) [g] Iterative Deepening A∗. Besides, this research proposes Depth Direction A∗ algorithm method which new method which use linear graph theory cooperate with A∗ Algorithm calculate increase efficiency of avoid barrier object on maps and search for shortest path of multi-layer. It movement are natural characteristic more other method [3]

[4]. S.Saini, P.W.H. Chung and C.W.Dawson “Mimicking Human Strategies in Fighting Games using a Data Driven Finite State Machine “, 2011, IEEE

This paper aims to discuss single player fighting videogames have become an increasingly popular over the last few years, especially with the introduction of online play, making for a more competitive experience. Multiplayer fighting games give players the opportunity to utilize particular strategies and tactics to win, allowing them to use their own signature style. As a player can only play against a particular opponent who is actively participating in the game themselves, they cannot practice combating the opponent's style if the opponent is not participating in the game. This paper presents a novel approach for an avatar to learn and mimic the style of a player. It does this by recording and analyzing the data before splitting it up into two tiers; tactical data and strategic data. [4]

3.

Implementation Details

3.1

System overview

Fig 1. System architecture

In above fig. user will use an input controller to control the character. As we start the game the user interface and assets gets loaded in level management. In level Management game world, AI and player controller gets loaded on platform. User control's the player controller through input device. As the user completes the levels, score is generated at each level. The user generated score is stored in database through API. API also helps upload score on social networking sites.

3.1.1Game engine

(3)

3.1.2 API and services

Application programming interface (API) is a set of routines, protocols and tools for building software application. API's will be integrated with game engine.API provides services like input method services, web accessibility services, hosting services for the game.

3.2 Modules

The proposed system is divided into following five modules:

3.2.1 UI Design

:

We will be implementing three different types of UI design:

i. Main Menu:

This will be 360 degree UI and initially loaded consisting of different options such as starting the level, exit, help, score display and shop.

ii. Level UI:

The level UI design will consist of option such as start, pause and exit.

iii. Shop UI:

User can purchase coins, character stuff and special powers.

3.2.2 Game Mode

This module will be implementing two game modes:

i. Normal mode:

User can play normal game like any other.

ii. VR mode:

User can play the game in 360 view.

3.2.3 Levels:

The module will be implemented with 5 different level based on life of Arjuna. Each level will consist of different AI. The degree of difficulty of each level will go on increasing.

3.2.4

Shop System

:

User can purchase coins, characters stuff and social stuff. User can enhance his own character through shop system.

3.3.1. A* algorithm

A* algorithm responsible for finding to find the player. We can implement A* algorithm in our project. A* algorithm is allowed to be AI based characters to move in environment using detection and movement cost.[3]

Pseudo code

1. OPEN //set of nodes to evaluate. 2. Close //set of nodes already evaluated. 3. Add the start node to OPEN.

4. Loop

5. Current = Nodes in OPEN with lowest f_cost. 6. Remove current from OPEN.

7. Add current to CLOSED.

8. If current is the target node //path is found. 9. Return

10. Foreach neighbor of the current node.

11. if the neighbors is not traversable OR neighbors is in CLOSED.

12. Step to the next neighbors.

13. if new path to neighbor is shorter or neighbors is not in OPEN.

14. Set f_cost of neighbors.

15. Set parent of neighbors to current . 16. if neighbors is not in OPEN. 17. Add neighbor to OPEN. [1][2][3]

3.3.2. K-Nearest neighbor algorithm

1. Determine parameter K=number of neighbors.

2. Calculate the distance between the query-instance and all training samples.

3. Sort the distance and determine nearest neighbors based on the K-th minimum distance.

4. Gather the category of the nearest neighbors.

5. Use simple majority of the category of nearest neighbors as the prediction value of the query instance.

3.3.3 Flocking Algorithm

Flocking behavior are controlled by three simple rules: 1.Separation-avoid crowding neighbors(short range repulsion)

2. Alignment-steer towards average heading of neighbors. 3.Cohesion-steer towards average position of neighbors(long range attraction). [4]

3.4 Experimental Setup

(4)

3.4.1 Hardware Requirements:

i. Intel i3 processor. ii. 4 GB Ram or higher

iii. Minimum 80 GB of HDD space. iv. Google cardboard or VR box.

v. Android device.

3.4.2 Software Requirements:

i. Windows 7 or higher.

ii. Front end: Android studio, Unity Game Engine.

iii. Back end: Firebase database.

4

Result set

The following are the figure for Gaming in VR :

Fig 2. User Interface System

The user interface system provides options such as play, shop, help and exit.

Fig 3. Training phase of Arjuna

This is training phase of Arjuna where the Aacharya Dronacharya give guidance to Arjuna.

Fig 4.Swayamvar

This is the Swayamwar phase where the Arjuna performs the task.

Fig 5.Swayamvar Mechanism

(5)

Fig 6. Finding the enemy and approaching him .

This is the Devbhumi phase were the enemy finds Arjuna by using A* algorithm.

5

Conclusion & Future work

In this game, we combine the advantages of both wearable device supported game and traditional Smartphone games. We implement the game system through an application on Android platform. To illustrate the effectiveness of the system, we adopt Unity Game Engine. The experimental results show that our developed system can work effectively on android devices with wearable Device (Google Cardboard). Friendly user interface is very important for an application. Most of people decide whether to use an application only by its user interface. Thus, the 3D virtual Environment looked more real. Moreover, although the game system can show fantastic virtual game scenario, the improvement of accuracy and sensitivity of the system is still needed.

7 References

[1]. John Stamford, Arjab Singh Khuman, Jenny Carter & Samad Ahmadi “Pathfinding in partially explored games environments, the application of the A_ Algorithm with Occupancy Grids in Unity3D” Oct 2014 IEEE.

[2]. Jie Hu; Wang gen Wan; Xiaoqing Yu, “A pathfinding algorithm in realtime strategy game based on Unity3D, 2012 International Conference on Audio, Language and Image Processing (ICALIP)” pp.1159,1162, 16-18 July 2012 IEEE.

[3]. Khantanapoka, K.; Chinnasarn, K.,” Pathfinding of 2D & 3D game realtime strategy with depth direction A_ algorithm for multi-layer”, SNLP 2009. Eighth International Symposium on Natural Language Processing, pp.184,188, 20-22 Oct. 2009.

Figure

Fig 2. User Interface System

References

Related documents