27
1 SuperCY Group Dec 14-04 Dec14-04 http://dec1404.ece.iastate.edu -or- http://seniordesigndec1404.weebly. com

1 SuperCY Group Dec 14-04 Dec14-04 -or-

Embed Size (px)

Citation preview

Page 1: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

1

SuperCYGroup Dec 14-04

Dec14-04

http://dec1404.ece.iastate.edu-or-

http://seniordesigndec1404.weebly.com

Page 2: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

2

Team Members

• Paul Danner – Leader • Taylor Gehling – Communications • Austen Gregor – Key Idea Holder• Trevor McCormack – Webmaster

• Manimaran Govindarasu – Advisor/Client

Dec14-04

Page 3: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

3

Scope of Project

Initial• Create testbed to implement network optimizations

over Android based system• Optional Goal: Integrate with Union Pacific Multimedia

Wall

Modified• Made integration with media wall mandatory• Removed network optimization goal

Iowa State University

Page 4: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

4

Reasons for Project Re-specification

• To attract potential students and show them what current students are capable of creating

• Lay a foundation for future apps looking to utilize the multimedia wall

• Give department something fun and exciting to show on multimedia wall

Iowa State University

Page 5: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

5

Demo

Iowa State University

SuperCy.mp4

Page 6: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

6

App Overview - SuperCY

• Side-scrolling shooter game

• Shoot at hordes of enemies, resulting in boss battle

• Multiplayer – Potential for up to 20 players

• Powerups add competitive element to game

• Interacts with media wall for unique experience

Iowa State University

Page 7: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

7

Screenshot of App

Iowa State University

Page 8: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

8

Unity

• Game Engine for variety of platforms– Android, iOS, PS3, Xbox, Windows/Mac

• Handles much of back end programming

• Focused around GameObjects– Players, background objects, scenery,

etc.– Write scripts (C#, JS) to control the

various GameObjects

Iowa State University

Page 9: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

9

Application Design – Stage I – Singleplayer

• Created GameObjects to represent player/enemies

• Write C# scripts to control behavior of various GameObjects – Health– Movement– Shooting/collisions

• Unity provides means for modularization of GameObjects– i.e. Health script attached to each enemy/player

Iowa State University

Page 10: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

10

Modularization

CY

Player Script

Move Script

Weapon Script

Shot Script

Move Script

Health Script

Photon View Script

Cy Network

Script

Iowa State University

Page 11: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

11

Powerups – Challenges

• Singleplayer– How to get a powerup to spawn on an enemy death– Doesn’t need to spawn on each enemy death – random

• Multiplayer– Disallowing multiple players to obtain single powerup– Disallow multiple spawning of same powerup– Caused by technical network latency of GameObject Destroy

Iowa State University

Page 12: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

12

Powerups – Solution

• Singleplayer– Add XYZ_powerup_module for each powerup

• Sprite renderer – Graphic for powerup to spawn• Powerup_Script – Controls collision and corresponding actions

– On each enemy death, generate random number to determine if powerup needs to spawn

• Multiplayer– Assign boolean within powerup scripts, keep track of collisions– On first collision with player

• Set boolean to false to disallow other players to interact with it

Iowa State University

Page 13: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

13

Application Design – Stage II – Multiplayer

Iowa State University

• Integrated Photon Unity Networking into singleplayer project

• Modify how game runs across multiple devices– Player/Enemy Spawning– Player/Enemy Shots– Player/Enemy Movement

• Modified game settings to accommodate media wall

Page 14: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

14

Character Spawning

• Treat media wall as host of game– Spawn enemies/boss– Synchronize background

• Treat each Android device as client of game– Spawn character– Update movement/shots across network

• Host and client interact across Photon Cloud and RPC messages

Iowa State University

Page 15: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

15

Networking Breakdown

Photon Instantiated Objects• Player movement/shots• Boss movement/shots• Level Synchronization• Player Score/Ammo/Health

RPC• Enemy damage/destruction• Player joining/leaving game• Call a function on networked

object

Iowa State University

Page 16: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

16

Synchronization – Challenge

• Player movements getting relayed to other devices– Very jittery & delayed

• Player/enemy shot collisions & destruction – Because enemies were spawned locally on each device via RPC

call, object collision was not uniform across network

• Boss health/spawning across devices– Delay caused by network transmissions cause player shots to

last longer

Iowa State University

Page 17: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

17

Player Synchronization – Solution

• Linear Interpolation– Method of “curve fitting” using linear polynomials

• Used to smooth out player movement across devices– Player sends updated position periodically– Other devices receive, and take average over a time frame to

smooth out other player movements

Iowa State University

Page 18: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

18

Collision/Destruction – Solution

• Updated enemy spawning to only spawn one character across the network– Pro: Much easier to synchronize states– Con: Enemy position messages increases network traffic

• When one device damages enemy, send RPC to all users – If enemy health is low enough, make host “Network Destroy”

object

• Keeps all device’s levels synchronized within technical delay time

Iowa State University

Page 19: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

19

Boss Synchronization – Solution

• Player bullets would hit multiple vertices before being “network destroyed”– Cause each bullet to cause additional damage to boss

• Caused by technical network delay in message transmissions

• Updated shot mechanics to cause it not to make more than one damage to enemy/boss

Iowa State University

Page 20: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

20

Garbage Collection – Challenge

• GameObjects that were not in use anymore would build up and drastically reduce game performance– Issue with both Single and Multiplayer development

• Examples– Enemies that weren’t destroyed would continue forever– Bullets that missed would continue forever

Iowa State University

Page 21: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

21

Garbage Collection – Solution

• Attach a frame counter to each GameObject – Count the number of frames since instantiation

• After ‘X’ amount of frames, destroy the GameObject

• Example– @ 60 fps– Enemy will cross screen from right left in 4 secondsif (enemy crosses screen without being destroyed)Destroy ( GameObject ) at frame_count = (60 * 4 + buf)

Iowa State University

Page 22: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

22

Testing

• Test early, Test often– After each small addition to game logic, test using controlled

level variables– Able to isolate problems easily by manipulating level– Make use of Debug Logs

• Beta-test – FAN Club– Let 40-50 students test our game on media wall– Received feedback from testers– Observed game from developmental perspective

Iowa State University

Page 23: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

23

Questions?Thank you for your time

Iowa State University

Page 24: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

24

BACKUP SLIDES

Iowa State University

Page 25: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

25

Menu Diagram - Note

• Like functional decomp in 491 project

Iowa State University

Page 26: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

26

HW/SW Technology

Software• Unity Game Engine

– Used to create Android application

– Utilizes C# scripts written by user to complement traditional game mechanic backing

• Photon Unity Networking– Unity backed network support

for multi-player apps– Cross-compatibility between

different devices • i.e. Windows, Android, iOS, etc.

Hardware• Android Devices

– Up to 20 devices concurrently

• Union Pacific Multimedia Wall– Runs Windows 7– 12 touch screen monitors – Located in Coover East Entrance

Iowa State University

Page 27: 1 SuperCY Group Dec 14-04 Dec14-04  -or-

(X1, Y1, t1)

(X2, Y2, t2)