Android Application And Unity3D Game Documentation
1. DEPARTMENT OF COMPUTER SCIENCE
1 By – Raval Sneh
Android Application and Unity3D Game
Masters of Computer Application
Raval Sneh Bharatbhai
11/24/2014
2. DEPARTMENT OF COMPUTER SCIENCE
2 By – Raval Sneh
Index Sr.no Description Page
1
College Profile
3
2
2.1
2.2
Project Profile
4
System Requirement
5
Tools And Technologies
6
3
3.1
Process Model
8
Spiral Model
8
4
4.1
Analysis
9
Feasibility Study of the Exciting System
9
5
5.1
5.2
5.3
5.2
Profile Manager
11
Input Controls
11
Development Workflow
11
Snapshots
13
6
6.1
6.2
6.3
Unity3D Game : Flappy Bird
14
Input Controls
14
Development Workflow
14
Snapshots
15
7
7.1
7.2
7.3
Unity3D Game : Nightmare
17
Input Controls
17
Development Workflow
17
Snapshots
18
8
Web References
21
3. DEPARTMENT OF COMPUTER SCIENCE
3 By – Raval Sneh
1. Department Of Computer Science:
The Department of Computer Science was established in the year 1996 and the approval of AICTE for MCA Program followed by UGC approval lead us to launch by 1997. The Department started M.Sc. (I.T & C.A.) program from year 2000. The Program is aimed at transformation of graduates to skillful IT professional who are expected to leadership and responsibilities in the corporate world.
The department took initiatives not only for the growth of the department but took responsibilities to design curriculum, guidelines, program structures for the course programs launched at affiliated colleges of this university. The department contributed in revising the curriculum in pace with emerging technologies to incorporate and monitor the programs at department as well as at colleges for the growth of students.
Department of Computer Science‟s Mission is to achieve excellence in teaching and research, to empower learners in achieving their professional goals, to strengthen educational-professional interface, to contribute in building the society and the nation, to Improve the quality of life in harmony with our heritage culture and environment ,to relate learning with the highest human values.
4. DEPARTMENT OF COMPUTER SCIENCE
4 By – Raval Sneh
2. Project Profile:
PROJECT TITLE : 1) Android Application: Profile Manager
2) Unnity3D Game: Flappy Bird
3) Unity3D Game: Nightmare
DEVELOPED BY : Raval Sneh Bharatbhai
DEVELOPED FOR : MCA 5th Semester Project
DEVELOPMENT TOOLS : 1) Eclipse ADT and Android SDK
2) Unity3D
DOCUMENT & DESIGNING
TOOLS : Microsoft Office 2010
5. DEPARTMENT OF COMPUTER SCIENCE
5 By – Raval Sneh
2.1 System Requirement:
1. Profile Manager – Android Application:
o Hardware:
512 Mb Ram
1 GHZ Processor
Android Device
o Software:
Android OS
2. Flappy Bird: Unity3D Game
o Hardware:
512 Mb Ram
1 GHZ Processor
Android Device/Windows/Linux/Macintosh Devices
o Software:
Android/Window/Linux/Macintosh OS
3. Nightmare: Unity3D Game
o Hardware:
1GB Ram
1 GHZ Processor
Window/Linux/Macintosh Device
o Software:
Window/Linux/Macintosh OS
6. DEPARTMENT OF COMPUTER SCIENCE
6 By – Raval Sneh
2.2 Tools and Technologies:
1. Android:
Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google. With a user interface based on direct manipulation, Android is designed primarily for touchscreen mobile devices such as smartphones and tablet computers, with specialized user interfaces for televisions (Android TV), cars (Android Auto), and wrist watches (Android Wear). The OS uses touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to manipulate on-screen objects, and a virtual keyboard. Despite being primarily designed for touchscreen input, it also has been used in game consoles, digital cameras, regular PCs (e.g. the HP Slate 21) and other electronics.
Android is popular with technology companies which require a ready-made, low-cost and customizable operating system for high-tech devices. Android's open nature has encouraged a large community of developers and enthusiasts to use the open-source code as a foundation for community-driven projects, which add new features for advanced users or bring Android to devices which were officially, released running other operating systems.
Android, Inc. was founded in Palo Alto, California in October 2003 by Andy Rubin (co-founder of Danger), Rich Miner (co-founder of Wildfire Communications, Inc.), Nick Sears (once VP at T- Mobile), and Chris White (headed design and interface development at WebTV) to develop.
Android SDK: The Android SDK provides the API libraries and developer tools necessary to build, test, and debug apps for Android.
Why Android?
A secure mobile experience: A dedicated work profile, hardware-based encryption and sharing restrictions ensure business data - calendars, contacts, files and apps - are separate and safe from malware while personal information stays private.
Easy to manage: IT has full control of all work related policies, profiles and data - from distributing apps to wiping business information - and the standard Enterprise Mobility Management (EMM) framework delivers a consistent experience across all devices.
All the apps you need: Find and deploy business apps easily with Google Play and create apps quickly with the Android app framework. Seamlessly integrate with existing IT systems like Microsoft Exchange, IBM Notes and Google Apps for Work.
A seamless experience: Switch between work and personal activities intuitively and seamlessly.
Data separation with multiple profiles: Work and personal information is securely separated and managed on a single device, with multiple profiles.
Standard APIs for EMM providers: A full range of management APIs will be available on all Android devices, ensuring a consistent user experience.
Secure app deployment: All business apps are managed and distributed to the work profile through a managed version of Google Play.
Flexibility: Internally developed enterprise apps can be self-hosted on premise or hosted by Google.
7. DEPARTMENT OF COMPUTER SCIENCE
7 By – Raval Sneh
Full app management support: APIs for complete app management via EMM solutions. Whitelist apps and control installs and updates for business users.
Collaborate anyplace: Connect wherever you are with enterprise apps for mail, contacts, calendar and tasks. Full support for Microsoft Exchange, IBM Notes and Google Apps for Work.
Work anytime: Create files and edit in real-time from your smartphone or tablet using Docs, Sheets and Slides designed and optimized for mobile devices.
Browse online with confidence: Use the internet for work safely using the intuitive and secure Chrome browser, built on top of Android's security framework.
2. Eclipse:
Eclipse is an integrated development environment (IDE). It contains a base workspace and an extensible plug-in system for customizing the environment. Written mostly in Java, Eclipse can be used to develop applications. By means of various plug-ins, Eclipse may also be used to develop applications in other programming languages: Ada, ABAP, C, C++, COBOL, Fortran, Haskell, JavaScript, Lasso, Natural, Perl, PHP, Prolog, Python, R, Ruby (including Ruby on Rails framework), Scala, Clojure, Groovy, Scheme, and Erlang. It can also be used to develop packages for the software Mathematica. Development environments include the Eclipse Java development tools (JDT) for Java and Scala, Eclipse CDT for C/C++ and Eclipse PDT for PHP, among others.
3. Unity3D:
Unity is an entire ecosystem of tools and services designed for people who want to build a successful business by creating multiplatform games and interactive content. The Unity ecosystem is available to anyone who downloads the Unity engine. The Unity engine integrates into one unparalleled platform the tools to create 2D and 3D interactive content; collaboration solutions; rapid multiplatform deployment, and retention, advertising and analytics services to grow your business.
Unity is a cross-platform game creation system developed by Unity Technologies, including a game engine and integrated development environment (IDE). It is used to develop video games for web sites, desktop platforms, consoles, and mobile devices. First announced only for Mac OS, at Apple‟s Worldwide Developers Conference in 2005, it has since been extended to target more than fifteen platforms. It is now the default software development kit (SDK) for the Nintendo Wii U.
Unity is notable for its ability to target games to multiple platforms. Within a project, developers have control over delivery to mobile devices, web browsers, desktops, and consoles. Supported platforms include BlackBerry 10, Windows Phone 8, Windows, OS X, Linux (mainly Ubuntu)[citation needed], Android, iOS, Unity Web Player (including Facebook), Adobe Flash, PlayStation 3, PlayStation 4, PlayStation Vita, Xbox 360, Xbox One, Wii U, and Wii. It includes an asset server and Nvidia's PhysX physics engine. Unity Web Player is a browser plugin that is supported in Windows and OS X only. Unity is the default software development kit (SDK) for Nintendo's Wii U video game console platform, with a free copy included by Nintendo with each Wii U developer license. Unity Technologies calls this third party provisioning of a free SDK, an "industry first".
8. DEPARTMENT OF COMPUTER SCIENCE
8 By – Raval Sneh
3. Process Model – Spiral Model:
The spiral model is similar to the incremental model, with more emphasis placed on risk analysis. The spiral model has four phases: Planning, Risk Analysis, Engineering and Evaluation. A software project repeatedly passes through these phases in iterations (called Spirals in this model). The baseline spiral, starting in the planning phase, requirements is gathered and risk is assessed. Each subsequent spiral builds on the baseline spiral.
Planning Phase: Requirements are gathered during the planning phase. Requirements like „BRS‟ that is „Bussiness Requirement Specifications‟ and „SRS‟ that is „System Requirement specifications‟.
Risk Analysis: In the risk analysis phase, a process is undertaken to identify risk and alternate solutions. A prototype is produced at the end of the risk analysis phase. If any risk is found during the risk analysis then alternate solutions are suggested and implemented.
Engineering Phase: In this phase software is developed, along with testing at the end of the phase. Hence in this phase the development and testing is done.
Evaluation phase: This phase allows the customer to evaluate the output of the project to date before the project continues to the next spiral.
Diagram of Spiral model:
9. DEPARTMENT OF COMPUTER SCIENCE
9 By – Raval Sneh
Advantages of Spiral model:
High amount of risk analysis hence, avoidance of Risk is enhanced.
Good for large and mission-critical projects.
Strong approval and documentation control.
Additional Functionality can be added at a later date.
Software is produced early in the software life cycle.
When to use Spiral model:
When costs and risk evaluation is important
For medium to high-risk projects
Long-term project commitment unwise because of potential changes to economic priorities
Users are unsure of their needs
Requirements are complex
New product line
Significant changes are expected (research and exploration)
4. Analysis:
4.1 Feasibility study exciting system:
A Feasibility study is undertaken to determine the possibility or portability of either improving the existing system or developing a completely new system.
Feasibility is the measure of how beneficial or practical the development of information system will be to an organization. The feasibility study involves following criteria.
Whether the identified user needs may be satisfied using current software and hardware technologies.
The study will decide if the proposed system will be cost-effective and if it can be developed given existing budgetary constraints.
The result should inform the decision of whether to go ahead with a more detailed analysis.
There are three methods of feasibility study.
1. Technical feasibility
2. Economic feasibility
3. Behavior feasibility
Technical feasibility:
It is measure of the practicality of specific technical solution and the availability of technical resources and expertise. Technical feasibility is computer oriented. The “Profile Manager”, “Flappy Bird” and “Nightmare” and is technical feasible because of the following reasons.
10. DEPARTMENT OF COMPUTER SCIENCE
10 By – Raval Sneh
In Game hardware and software requirement are easily available.
The games have a good GUI interface.
The games will have user friendly form and screen.
To check whether the module technically feasible or not we have to give the following two question answer.
Q-1 Is the proposed system practical?
Ans. The proposed system is definitely practical as we have all the resources available. Also building up this module requires the minimum amount of hardware & software is easily available. So, the proposed system is extremely efficient and practical.
Q-2 Do we currently possess the necessary technology?
Ans. Looking into the system requirement, we can see that we possess all the hardware and software requirements. Also the technology used is easily available and deployed all around the world.
Economic feasibility:-
It is a measure of the cost-effectiveness of a project or solution. This is often called a cost-benefit analysis. Economic feasibility deals with the cost and benefits of the information system.
In the economic feasibility, the development cost of the system is evaluated weighing it against the ultimate benefit derived from the new system. It is found that the benefit from the new system would be more than the cost and time involved in its development.
The Game is Economical feasible because of the following reasons.
Game requires less time to react for the user.
The cost of the hardware and software are normal.
GUI interface.
The system provides the services for the decision making. As this not begins a conversion of the present module into and rather begins creating a new module from scratch, the cost of the module includes cost of the module development; implementation and it not include the maintenance.
Operational Feasibility:
Operational feasibility covers two aspects. One is the technical performance aspect and other is the acceptance. Operational feasibility determines how the proposed system will fit in the current operations and what, if any job restructuring and retraining may be needed to implement the system.
In the system operational feasibility checks, whether the user who is going to use the system is able to work with the software‟s with which the system is coded and also the mind of the user going to use the system. If the user does not understand or is able to work on the system further development is of waste.
Behavioral feasibility:-
Behavior feasibility determines how much effort will go in the proposed information system and in education and training efficiency on the new system.
11. DEPARTMENT OF COMPUTER SCIENCE
11 By – Raval Sneh
It is a measure of how well the solution will work in the organization. It is also a measure of how people feel about the application. Behavior feasibility is people oriented. Some question arises in the behavior feasibility, we discuss on this question.
Q-1 Is the problem worth solving or will the solution to the problem work?
Ans. Yes, the problem is off course worth solving because the system existing today is more time consuming and full of extra content like advertisement, other application link etc. so, the problem is worth solving.
Q-2 How the end-user feels about the problem?
Ans. This Game provides a best operator specification through its user friendliness. That is any kind of training is not required to play the game. So, the non-technical person can use it.
5. Profile Manager:
Profile Manager provides a way to manager profile of your Android device with future time. Profile Manager automatically set your device profile to silent or vibrate on specific time and back to the ring mode on given time.
The idea of developing this Application is come from the classroom, Many times in lecture students are forgot to silent or vibrate the cellphone and there phone are ringing in the lecture which was disturb the whole class. So I developed Profile Manager in this application you set the starting time, Profile Mode (Silent or Vibrate) and end time. When the start time arises the device switch in selected profile and when End time arise device back to the Ring mode. This all done using the AsyncTaskRunner class.
I. Input Controls:
a) Input Time using Time Picker.
b) Input Profile Mode using Radio Buttons.
c) Start Application using Button.
II. Development Workflow:
i. Design Splash Screen: Create new XML file named Splash.xml and Design Splash Screen like welcome screen of Application and put it on “ ~/res/layout/ ” folder.
ii. Create Splash Java File: Create java file to manage the Splash Screen activity like time limit to display screen, add Sound, and which activity calling next, etc.
iii. Design Main Activity Screen: Main Activity xml is the main view of game where users interacts and manage the application. I put two Textview control for display application name and current status of application, DigitalClock control to display time, TimePicker for receiving Start and End time from user, two RadioButtons for input the Profile mode and place it in RadioButtonGroup, one Button to Start Application.
12. DEPARTMENT OF COMPUTER SCIENCE
12 By – Raval Sneh
iv. Create MainActivity Java File : The Actual logic of application is written in MainActivity.Java file. In this file fist I will receive input of start time when first time button is clicked and counts the difference between system time and start time like
long startmilisecond= (((timepicker2.getCurrentHour()*120)+(timepicker2.getCurrentMinute() * 60)) - ((cal.get(Calendar.HOUR_OF_DAY)*120)+(cal.get(Calendar.MINUTE)*60)+ cal.get (Calendar.SECOND) ))*1000;
Difference converts into milliseconds and call the AsyncTaskRunner class like
AsyncTaskRunner runner = new AsyncTaskRunner();
runner.execute(sleepTime); // Here sleepTime is Differences of time.
After the sleepTime thread runner will awake and called onPostExecute() method of AsyncTaskRunner class in this I will check which radio button is clicked and depend upon it set the profile mode of device using “audiomanager service” .
myAudioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT )// For Silent
And recall calculate the differences between start and end time and recall the AsyncTaskRunner runner thread. After completing End time reset the profile mode on ring and enable all the controls. To manage Start/End time and AsyncTaskRunner used to variables named getTime and getProfile.
v. Setting Manifest File:
In Menifest.xml file is used to give permission for resources like Internet, memory access to application and we can also set hierarchy of activity called like first Splash file called then after main activity.
vi. Create AVD :
For testing and running the application create Android Virtual Device (AVD) from window menu -> Android Virtual Device Manager. From here we can create new device or used pre-defined devices available.
vii. Run Application:
Run the application using Run Button or Ctrl+F11 key and Test the Application.
14. DEPARTMENT OF COMPUTER SCIENCE
14 By – Raval Sneh
6. Flappy Bird:
Flappy Bird is 2D game and Clone of Original Flappy Bird game. I developed the clone of flappy bird game in Unity3D Editor. I added animation, graphics, and sound to the game. The Background is generated in sequence pipes is randomly generated. I also use 2DPhysics and Gravity, Angular Gravity for Motion of Bird. Also developed different graphics like Ideal Bird, Flapping Bird, Dead Bird for giving different animation effects.
In Flappy bird you can give input from tap the screen and bird will flap and alive. When bird passes through the pipes your score will increase. In game when bird touch to the Ground, Sky and Pipes the Collision occurred and bird Died. The speed of bird will increases continuously with flapping.
I. Input Controls:
a) Tapping to Device Screen.
II. Development Workflow:
i. Camera Projection: Set the size of camera which will give the area view of game here is 1.3. Create 2 Empty child objects of main camera named BgLooper used to regenerate background and pipes and Skykill object to give validation that bird not goes outside the camera limit. And assign Box Collider 2D to both game Objects.
ii. Background Generation: Generate peace of background using image of sky and ground and assign script for moving sky in towards camera.
iii. Generate Animation of Bird: Generate Animation of bird and also create trigger for check state of bird. Now assign script for Bird Movement.
iv. Create Pipe and Score box: Create pipe with child object named score box assign Box Collider to it and make clone of these.
v. Create Score UI Text: Place UI Text in scene and give font effect and apply scoreCalculation Script.
vi. Build Game: From file menu build the appropriate game with Custom settings.
17. DEPARTMENT OF COMPUTER SCIENCE
17 By – Raval Sneh
7. Nightmare:
Nightmare is window base 3D game. I developed the Nightmare game in Unity3D Editor using C# script and 3D Physics. It‟s single level action game which give full entertainment. I added animation, graphics, and sound, score management, health management to the game.
In Nightmare. You fight with three different types of enemies are named zombunny, zombear and hellephant and survives yourself. All enemies have are comes from different direction and attacks on you. All enemies have also had its own harming capacity to harm you and have its own health and score points. Whenever you kill any enemies your score will updated. All enemies are generated at specified time slope. In this game also provide Health management to Player.
I. Input Controls:
a) Player Movement: W, A, S, D and Arrow keys
b) Fire : left Ctrl and Left Mouse
c) Sound Management, Pause/Resume , Exit : Esc
II. Development Workflow:
i. Import Assets: Assets are the property of any game it contains characters, animation, sound, etc. Unity3D provides a large amount of assets(free and paid) that you can directly download from assets store using your unity account and use for your game development. Unity assets store have large collections of various graphics that easily available to user for the use.
ii. Attach Background Music: Add Audio source to game for background music which play in to game when user play it.
iii. Create Player: Create player and assign Capsule collider to detect player, Audio Source of player hurt and script for Player Movement and Player health. On GunBarrel End Assign lineRender and light for firing effect and sound for fire.
iv. Create Enemies: Create Zombunny, Zombear and Hellephant and assign capsule collider to detect enemies, sphere collider to follow Player, Audio source and Enemy Movement, attack, and Health Script.
v. Setting Enemies Spawnpoints: Give x and Y coordinator to enemies. It describe from where enemies are enter in game scene.
vi. Enemies Manager: create game child object which manage all enemies and spawn time slot to generate enemies.
18. DEPARTMENT OF COMPUTER SCIENCE
18 By – Raval Sneh
vii. UI Management: Add UI Image of heart shape and UI slider for Health representation of Player. Add second image Damageimage for when enemies hurt player it will flash, add another image and screenFader which will appear front to screen when player dies, add UIText for Game Score and Game over Message apply Shadow effect and animation on it and apply script on Score text.
viii. Build Game: From file menu build the appropriate game with Custom settings.
III. Snapshot: