Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

26
Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le

Transcript of Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Page 1: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Live Action First Person Shooter Game

Patrick Judd

Ian Katsuno

Bao Le

Page 2: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Inspiration

Inspired by the “Real Time Color Replacement” Project (2009)

Wanted to combine their invisibility effect with a Duck Hunt style game

http://en.wikipedia.org/wiki/Duck_Hunt http://www.eecg.toronto.edu/~pc/courses/432/2009/projects/colorreplacement.pdf

Page 3: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

How our game works

Camera captures the game stage and displays it on a monitor

People/objects which enter the stage become targets

User shoots targets on the monitor with a gun controller

When a target is hit, it disappears (invisibility effect)

Page 4: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Revised Project Goal

Two foreseen difficulties1. Custom HW interface for gun controller

2. Tracking multiple targets Revised project goals

1. Use a mouse instead of a gun controller

2. Restrict number of supported targets to one

Page 5: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Initial System Block DiagramCamera

Video Decoder

Mouse

Serial Port Driver

RAM-live image

-reference image

MicroBlaze Processor

Target Locator

RAM-Modified image

Target Drawer

Draw B/W Image*

Video Encoder

Monitor

Light gun

Optional

Target Manager

Hit/Miss Analyzer

Analog

Digital

Video_to_ram

Page 6: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Target Locator

Compares reference image to live image

A difference in color indicated a target

Encodes targets location as:

(x min, y min)

(x max, y max)

Memory

Microblaze

Reference Image Live Image

(x min, y min) (x max, y max)

Target Locator

Page 7: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Reference Image

Page 8: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Live Image

Page 9: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Target Location

Page 10: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

PS/2 Mouse

FPS requires: High Precision Quick Response Time

Replaced Light Gun as input.

No ECE532 project has used it!

Page 11: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Mouse Operation

Xilinx IP: XPS_Ps2 v1.00a Communicates with Microblaze over PLB SW Initialization: predefined sequence of

byte codes Interrupts on action (move or click) Receives info packets in ISR

Page 12: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Software – Target Manger

Tracks movement of target based on coordinates from the target locator Needs to distinguish an old target from a new

target Compares target location to mouse

coordinates to detect “hits” Remembers if a target has be hit

Page 13: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Target Remover Gets coordinates of box to

remove from microblaze(x min, y min) (x max, y max)

If (pixel is in box)read from reference image

Elseread from live image

Memory

Microblaze

Reference Image Live Image

(x min, y min) (x max, y max)

Target Remover

Output Image

Video Encoder

Page 14: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Design Flow - Hardware

Start with simple custom core to read and write to memory

Create verilog testbench and simulate core Compare output waveforms with spec Test core in hardware Incrementally add functionality

Page 15: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Design Flow - Software

Wrote algorithms and data structures in Linux Integrated into microblaze code Debugged microblaze software using xps gdb

Page 16: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Problem - Mouse Initialization

Initialization: Send and receive a sequence of byte-codes

Problem: Mouse wouldn’t follow script!Debug:

Tried to isolate the problem:Tried mouse on other PCRead Registers using XMD

Solution: Get another mouse!

Page 17: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Problem - Mouse Buffer Overflow

Problem: Buffer overflow interrupt occur

Debug: Decrease sample rate Receive more than one packet in ISR?

Solution: Printf too slow, Remove it!

Page 18: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Problem – Custom Logic

Target Locator core worked correctly in simulation

However the core did not function in hardware

Tried a variety of debug methods but could not isolate the cause of the problem LEDs and switches Chipscope XPS hdl simulator

Page 19: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Problem – Custom Logic

Solution: Use mem_to_ip/ip_to_mem core from “Real Time

Color Replacement” Project Used their FSMs to perform memory reads and

writes Added our own target locator logic Also move target remover functionality to software

Page 20: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Problem - Integration

the ps2 core caused erroneous target detection when it was added to the project

possibly due to bus read errors We are currently unable to find a solution

Page 21: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

For the demo

Two demos too show functionality of parts of the design before integration, in lieu of the ps2 – detection issue

Page 22: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

For the demo

1. Target locator reading the video signal and sending target information to microblaze

Video Decoder

RAM- live image

-reference image

MicroBlaze Processor

Target Locator

Video Encoder

Page 23: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

For the demo

2. Mouse to video interface and target remover functionality

Video Decoder

Mouse

Serial Port Driver

RAM

-live image-reference image

MicroBlaze Processor

Video Encoder

Target Manager

Hit or Miss Analyzer

Page 24: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Lessons learned

Don’t try to reinvent the wheel We spend a lot of timing trying to recreate what

other group had already done instead of focusing on the “new” aspects of our project

Page 25: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Lessons learned

Our approach to hardware debugging was less than ideal We had

multiple group members debugging independently used different methods

Should have decided on the best method concentrated our efforts

Page 26: Live Action First Person Shooter Game Patrick Judd Ian Katsuno Bao Le.

Conclusion

Could not produce a fully functioning project However

Learned valuable lessons in project management Were the first group to use a ps2 mouse with their

project Will add this to the ece532 knowledge base