Introduction to Game Programming & Design III Lecture III.

Slides:



Advertisements
Similar presentations
Everything you ever wanted to know about collision detection
Advertisements

Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
30 min Scratch July min intro to Scratch A Quick-and-Dirty approach Leaving lots of exploration for the future. (5 hour lesson plan available)
Introduction Games have always been a fundamental part of human life. Space storm “ عاصفة الفضاء” is a 3D SCI-FI game that consists of two stages presented.
Intersection Testing Chapter 13 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
Collision Detection and Resolution Zhi Yuan Course: Introduction to Game Development 11/28/
2.1. C OLLISION D ETECTION Overview. Collision detection is used within many types of application, e.g. from robotics, through engineering simulations,
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
Computational Geometry & Collision detection
Week 14 - Monday.  What did we talk about last time?  Bounding volume/bounding volume intersections.
GameSalad Fundamentals. Introduction to Game-Authoring System  Objectives  Define game-authoring system.  Understand the components of logic and assets.
Move With Me S.W Graduation Project An Najah National University Engineering Faculty Computer Engineering Department Supervisor : Dr. Raed Al-Qadi Ghada.
How do games work? Game Workshop July 4, Parts Sprites/pictures Map/background Music/sounds Player character Enemies Objects.
Chapter 4.2 Collision Detection and Resolution. 2 Collision Detection Complicated for two reasons 1. Geometry is typically very complex, potentially requiring.
1 Geometry A line in 3D space is represented by  S is a point on the line, and V is the direction along which the line runs  Any point P on the line.
Game Mathematics & Game State The Complexity of Games Expectations of Players Efficiency Game Mathematics o Collision Detection & Response o Object Overlap.
Mechanics, Dynamics & Aesthetics The Complexity of Games Expectations of Players Efficiency Game Mathematics o Collision Detection & Response o Object.
Collision Detection Michael Fuller. Overlap testing Most Common Technique Most Error Prone Test if two bodies overlap.
(An Introduction for Programmers)
INTRODUCTION TO SCRATCH. About Me Resources Scratch Website Learn Scratch Washington-Lee Computer.
CS 4730 Collision Detection CS 4730 – Computer Game Design.
Comparing Python and Visual Basic
Modeling and representation 1 – comparative review and polygon mesh models 2.1 Introduction 2.2 Polygonal representation of three-dimensional objects 2.3.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
1 Perception and VR MONT 104S, Spring 2008 Lecture 22 Other Graphics Considerations Review.
Creative Commons Attribution 3.0 creativecommons.org/licenses/by/3.0 Key Abstractions in Game Maker Foundations of Interactive Game Design Prof. Jim Whitehead.
CATCH SCRATCH! Programming from Scratch. Remember Scratch?
COMPUTER AIDED DESIGN -(CAD)-3
VIDEO GAME PROGRAMMING Video Game Programming Junior – DigiPutt INSTRUCTOR TEACHER’S ASSISTANT.
A Spring 2005 CS 426 Senior Project By Group 15 John Studebaker, Justin Gerthoffer, David Colborne CSE Dept., University of Nevada, Reno Advisors (CSE.
CSE 381 – Advanced Game Programming Quickhull and GJK.
Week 13 - Friday.  What did we talk about last time?  Ray/sphere intersection  Ray/box intersection  Slabs method  Line segment/box overlap test.
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
Computer Graphics 2 In the name of God. Outline Introduction Animation The most important senior groups Animation techniques Summary Walking, running,…examples.
Emerging Technologies for Games Alpha Sorting and “Soft” Particles CO3303 Week 15.
Institute for Personal Robots in Education (IPRE)‏ CSC 170 Computing: Science and Creativity.
Monte Carlo Methods Versatile methods for analyzing the behavior of some activity, plan or process that involves uncertainty.
CO1301: Games Concepts Dr Nick Mitchell (Room CM 226) Material originally prepared by Gareth Bellaby.
Collaborative Visual Computing Lab Department of Computer Science University of Cape Town Graphics Topics in VR By Shaun Nirenstein.
Sample Video Game & Sound. The Plan 1.Game Theme 2.Game Structure 3.Sprites 4.Trackers 5.Collisions 6.Score 7.Levels 8.Splash Screens 9.Design 10.Implementation.
CIS 350 – I Game Programming Instructor: Rolf Lakaemper.
Microsoft® Small Basic Collision Detection Estimated time to complete this lesson: 1 hour.
Geometry. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions are.
CSCE 552 Fall 2012 Math, Physics and Collision Detection By Jijun Tang.
Collision Detection And Response Jae Chun KyungSoo Im Chau Vo Hoang Vu.
Computer Game Design and Development
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
CompSci 44.1 Game Package Introduction to Jam’s Video Game Package.
SCRATCH ScratchScratch is a programming language that makes it easy to create your own interactive stories, animations, games, music, and art -- and share.
Game Programming 13 Physics in Games (cont.) 2010 년 2 학기 디지털콘텐츠전공.
ICT/COMPUTING RULES Only use software allowed by the teacher
CSCE 552 Fall 2012 Math, Physics and Collision Detection By Jijun Tang.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Introduction to Graphics Modeling
2.1. Collision Detection Overview.
Chapter 4.2 Collision Detection and Resolution
Learn… Create… Program
Learn… Create… Program
Mechanics, Dynamics & Aesthetics
Computer Animation Algorithms and Techniques
Collision Detection.
CO Games Concepts Week 12 Collision Detection
Learn… Create… Program
Learn… Create… Program
GPAT – Chapter 7 Physics.
Presentation transcript:

Introduction to Game Programming & Design III Lecture III

Content Player Expectations Efficiency Game Mathematics Game State

Player Expectations In general, games are held to a higher standard than other types programs. People expect "office applications" to fail, and don't expect 100% up-time from business websites. What we are willing to tolerate when "working" is wildly different then what we are willing to tolerate when "playing".

Efficiency Complexity and computability are concepts that are not normally taught on an undergraduate level. BUT game programmers need to consider "efficiency" in everything that they do. Studies have shown that if a player has to wait more than 30 seconds for levels to load in a game, their "review" of that will be greatly reduced.

Game Mathematics "Game Mathematics" refers both to areas of general mathematics (geometry, trigonometry, calculus) as well as specialized areas of mathematics (vectors, matrices). Graphic libraries, game libraries, 2D and 3D libraries exist for programming languages to help simplify the mathematical problems that you will face. But they can't be relied on to do everything.

Collision Detection Figuring out if two objects are touching incredibly common problem in a game: ◦ Ball games (pong) ◦ Shooting games. Two basic techniques: ◦ Overlap testing  Detects whether a collision has already occurred ◦ Intersection testing  Predicts whether a collision will occur in the future

Overlap Testing Facts: ◦ Most common technique used in games ◦ Exhibits more error than intersection testing Concept ◦ For every simulation step, 1.Move (update) all objects. 2.Test objects to see if they overlap. 3.If objects overlap, make adjustments or corrections. ◦ Easy for simple volumes like dots, boxes and spheres, but harder for polygonal models.

Simple Overlap Testing Easiest example is of a particle interacting with a square. This will still require 4 logical tests in a 2D game. Depending on the type of game that played, the order of those 4 tests can have a profound effect on efficiency.

Complex Shape OOT How many tests would be required now?

Bounding Boxes Bounding Boxes can be used to reduce the complexity of shapes to simplify overlap testing. Note that secondary testing may need to be done if the bounding box is found to overlap. How many test now?

Minkowski Sum Simple technique for reducing number of tests necessary. By taking the Minkowski Sum of two complex volumes and creating a new volume, overlap can be found by testing if a single point is within the new volume. Variations on the Minkowski Sum include calculating the x, y and z distances between the two objects that are being tested.

Minkowski Sum

OT - Collision Time Collision time calculated by moving object back in time until right before collision. ◦ Bisection is one effective technique. Θ(log n) ◦ Minkowski values are another.

Collision Response Having captured the exact moment and position of collision, geometry, and trigonometry can be applied to calculate new trajectories.

Limits of OT OT is easy, but limited. ◦ Fails with objects that move too fast ◦ Unlikely to catch time slice during overlap Possible solutions ◦ Design constraint on speed of objects ◦ Reduce simulation step size ◦ Use Vectors

Vectors You are already know of "vector images", images represented by a mathematical formula. We can represent entire objects (and their movement) with formula's as well. Vector (an matrice) mathematics can then be applied to reveal information about where objects will be and whether or not the will collide (at any time, past or future). P1[ x1, y1, x2, y2]; // A particle vector.

Game Mathematics In SCRATCH SCRATCH simplifies game mathematics for you, with a couple of hand blocks. ◦ Object collision detection in SCRATCH can be done with a simple "is touching block". ◦ Objects can be kept on screen with a simple "if on edge bounce" block.

Game State All games consist of a sequence of states. Each state is characterized by a combination of visual, audio and/or animation effects, as well as a set of rules that are being applied.

Object State Objects in the game proceed through their own states as well. These states are defined by the behavior and functionality applied at that time.

Game State in Scratch At typical game in Scratch might use the following state transition diagram.

Object State in Scratch In a typical game in Scratch, all of your normal sprites (not stage or any control sprites like buttons) will work very well with only 4 scripts. These scripts (and any associated variables) will control the objects state.

The End