VR SFML Game Specification
• Create a Player class which holds the current transformation position of player head.
• Create a NPC class which holds the current transformation position of the cube(s).
• Initialise the VBO • Create buffer • Bind buffer• Fill buffer with vertex data
• Create views (like mini map) which split screen in two halves.
• During update loop alter the transformations for the character cubes / (view & projections).
• SFML Sensor API (https://www.sfml-dev.org/documentation/2.4.2/classsf_1_1Sensor.php )
• Building for Android (https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android-on-Windows )
Vertex Buffer Object
• Store vertex data (vertex, normal vector, color etc.)
• Stored on graphics hardware for non-immediate rendering
• Substantial performance gains over immediate mode rendering
Generating Vertex Buffer Objects
Steps to generating VBOhttps://www.opengl.org/archives/about/arb/
1. Generate a new buffer object with glGenBuffers###()
2. Bind the buffer object with glBindBuffer###()
3. Copy vertex data to the buffer object with glBufferData###()
Vertex Data
vertex[0].coordinate[0] = -0.5f;
vertex[0].coordinate[1] = -0.5f;
vertex[0].coordinate[2] = 0.0f;
vertex[0].color[0] = 0.1f;
vertex[0].color[1] = 1.0f;
vertex[0].color[2] = 0.0f;
initialize()
/* Create a new VBO using VBO id */
glGenBuffers(1, vbo);
/* Bind the VBO */
glBindBuffer(GL_ARRAY_BUFFER, vbo[0]);
/* Upload vertex data to GPU */
glBufferData(GL_ARRAY_BUFFER, sizeof(Vertex) * 6, vertex, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glGenBuffers(1, &index);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(GLubyte) * 6, triangles, GL_STATIC_DRAW);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
render()
void Game::render(){
cout << "Drawing" << endl;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glBindBuffer(GL_ARRAY_BUFFER, vbo[0]);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(3, GL_FLOAT, sizeof(Vertex), (char*)NULL + 12);
/* Draw Triangle from VBO */
glVertexPointer(3, GL_FLOAT, sizeof(Vertex), (char*)NULL + 0);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_BYTE, (char*)NULL + 0);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
window.display();
}
Sample of Project Results
James https://github.com/JamesCondon22/Project-2
Peter https://github.com/peterdaly97/Project_Two
Liam https://github.com/C00204864/GameplayVR
Keenan https://github.com/keenanMcentee/GPProject2-AndroidVr
Bartosz https://github.com/CastBart/PseudoVR/tree/master/VR_Project
Projects
https://bitbucket.org/Nerakai/ma-text-advecture-game/src/5ea87a8cef46f6ead51a8c86a42e13be1b7e97b7/Project.X68?at=master&fileviewer=file-view-default
History Lesson
1968 – 1973 1st Gen
Brown Box
1968
PONG
1972
ODESSEY
1972
1978 – 1981 2nd Gen
SPACE INVADERS
1978
Asteroids
1979
PAC-MAN
1980
DONKEY KONG
1981
Frogger
1981
1983 – 1985 3rd Gen
SUPER MARIO
1983
TETRIS
1985
1991 – 1992 4th Gen
Sonic the Hedgehog
1991
MORTAL COMBAT
1992
1994 – 1995 5th Gen
PS1
1994
SEGA Saturn
1995
1998– 2005
6th Gen
SEGA Dreamcast
1998
SEGA Net (MOL)
2000
PS2
2000
GAMEBOY Advanced
2001
Nintendo GameCube
2001
Xbox
2001
2005 – 2009
7th Gen
Xbox 360
2005
Nintendo Wii
2006
PS3
2006
2013 – 20168th Gen
Xbox ONE
2013
PS3
2013
photo courtesy National Aeronautics and Space Administration
Input / Output devices
Keyboard Mouse
Monitor Screen
Speaker /Headphone
Phone / Tablet
Touchpad
Camera
Virtual Reality
Buses
A bus is simply a circuit that connects one part of the motherboard to another. The more data a bus can handle at one time, the faster it allows information to travel.
ATmega644
• Low-power CMOS 8-bit microcontroller
• Based on the AVR enhanced RISC architecture
• Throughputs approaching 1 MIPS per MHz
• Optimize power consumption versus processing speed.
Digital Game Design Challenge Continuum
“our primary problem is that we have little theory on which to base our efforts. We don’t really know what a game is, or why people play games, or what makes a great game…..we need to establish our
principals of aesthetics, a framework for criticism, and a model for development…We computer game designers must put our shoulders
together so that our successors may stand on top of them”
- Crawford, Chris; 1982 The Art of Computer Game Design
Magic Circle Genres
• Single player – entered via choosing to play
• Multiplayer Game – agreed convention
PES / FIFA vs Real World
The Magic Circle
Scoring a Goal
The Real World
Kicking a ballinto the NET
Maslow's hierarchy of needs
By User:Factoryjoe (Mazlow's Hierarchy of Needs.svg) [CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0)], via Wikimedia Commons
Life Cycle Game Loop
Awake – Initialization (Shared)
Update() – Every Frame
Start() Called Once
FixedUpdate() – Consistent (Physics)
Update
Fixed Update
Awake
Start
Technology Research
Hardware (PC, Xbox, PlayStation)
Drivers
Operating System
3rd Party SDK’s
Platform Independence Layer
Resources
Human Interface DesignRendering Profiling Debugging Collision & Physics
Scene Graph/Culling
OptimisationsSkeletal Animation Visual Effects Online Multiplayer
Front End Gameplay
Game Specific Sub-systems
Audio
Core Systems
ATmega644
Pinouts
StarterKit.h
extern void gameloop(void);
extern void setLedOn(void);
extern void setLedOff(void);
extern void delay(void);
extern void sample(void);
extern void startgame(void);
extern int getHealth(int, int);
extern int getScore(int, int);
StarterKitEngine.s
;****************************
; Turns on onboard LED PD4
;****************************
.global setLedOn
.section .text.setLedOn
setLedOn:
SBI _SFR_IO_ADDR(PORTD),PD4
RET
StarterKit.c
void drawRectangle(int x, int y, int width, int height, char c) {if (x < SCREEN_TILES_H && y < SCREEN_TILES_V) {
for (int i = 0; i < width; i++) {if (x + i < SCREEN_TILES_H && y < SCREEN_TILES_V) {
PrintChar(x + i, y, c);}if (y + height - 1 < SCREEN_TILES_V) {
PrintChar(x + i, y + height - 1, c);}
}for (int i = 1; i < height; i++) {
PrintChar(x, y + i, c);PrintChar(x + width - 1, y + i, c);
}}
}
StarterKitEngine.s
;****************************
; Update the Score
;****************************
.global getScore
.section .text.getScore
getScore:
ADD R24,R22
CLRR25
RET