An Exploration into Modular Core Game Systems: Improving

Download Report

Transcript An Exploration into Modular Core Game Systems: Improving

by Stephen Phillips
#0710108



To improve quality of code by engineering
low level communication between common
game modules in an extensible manner.
To create a streamlined and uniform interface
for accessing and using these game modules.
To enable the seamless exchange of different
middleware engines with minimal impact
upon code reusability.
by Stephen Phillips
#0710108


To produce a report on research pertaining to
software metrics designed for complex
object-oriented systems, and to software
engineering patterns that are most applicable
in the proposed solution of this project.
To support the efficacy and relevance of this
research through a programming artefact
which demonstrates the proposed
architecture at a small scale.
by Stephen Phillips
#0710108
What problems do I seek to address
by Stephen Phillips
#0710108
The new game being developed
Game
by Stephen Phillips
#0710108
Introduction of external middleware
GUI
Input
Physics
Game
Audio
by Stephen Phillips
#0710108
Problem #1: Incompatibility at the data level
Vector3
+ float x
+ float y
+ float z
vector3d<Type>
+ Type X
+ Type Y
+ Type Z
btVector3
+ getX() : float
+ getY() : float
+ getZ() : float
- float[4] m_floats
btVector3 pos(5.0f, 10.0f, 15.0f);
Ogre::Vector3 meshPos(pos.getX(), pos.getY(), pos.getZ());
by Stephen Phillips
#0710108
A further example of incompatibility
vector3d<Type>
vec3<Type>
+ Type X
+ Type Y
+ Type Z
+ Type X
+ Type Y
+ Type Z
irr::core::vector3d<f32> pos(5.0f, 10.0f, 15.0f);
irrklang::vec3d<f32> soundPos(pos.X, pos.Y, pos.Z);
by Stephen Phillips
#0710108
Problem #2: Complexity for the developer
GUI
Input
Physics
Game
Audio
by Stephen Phillips
#0710108
Problem #3: Wasting and rewriting code
Input
Rendering
(with GUI)
Physics
Game
Audio
by Stephen Phillips
#0710108



There is no predefined method of transferring
different data types between game modules,
despite the similarities in their structure.
Using multiple external engines results in a
complex set of interfaces for the developer.
Replacing a module with a similar one wastes
any interface code written by the developer,
despite the similarities in their functionality.
by Stephen Phillips
#0710108
What does this project suggest as a solution
by Stephen Phillips
#0710108
Modular abstraction of grouped middleware
• Bullet
Physics
• Havok
• PhysX
• Irrlicht
Game
Rendering
• Ogre
• Horde3D
• FMOD
Audio
• IrrKlang
• PortAudio
by Stephen Phillips
#0710108
Interactions made through Game Core module
• Bullet
Physics
• Havok
• PhysX
• Irrlicht
Game
Rendering
• Ogre
• Horde3D
• FMOD
Audio
• IrrKlang
• PortAudio
by Stephen Phillips
#0710108
The lowest level interactions
Irrlicht
Convert
Havok
vector3d<float>
Vector3
hkVector4
CMatrix4<float>
Matrix4
hkMatrix4
quaternion
Quaternion
hkQuaternion
by Stephen Phillips
#0710108
The lowest level interactions
Irrlicht
Convert
Bullet
vector3d<float>
Vector3
btVector3
CMatrix4<float>
Matrix4
btMatrix4
quaternion
Quaternion
btQuaternion
by Stephen Phillips
#0710108
Swapping out different libraries
//developer code
#include <OgreModule.h>
#include <HavokModule.h>
#include <GameCore.h>
//Ogre module example
#ifndef _OGREMODULE_H
#define _OGREMODULE_H
//Ogre-specific code...
int main(int argc, char *argv[])
{
//external code
return 0;
}
#endif
//Havok module example
#ifndef _HAVOKMODULE_H
#define _HAVOKMODULE_H
//Havok-specific code...
#endif
by Stephen Phillips
#0710108

Game Core Module header layout
//Game Core module
#ifdef _OGREMODULE_H
#include “OgreInterface.h”
#elif _IRRLICHT_H
#include “IrrlichtInterface.h”
#endif
#ifdef _HAVOKMODULE_H
#include “HavokInterface.h”
#elif _BULLET_H
#include “BulletInterface.h”
#endif
//Game Core code...
by Stephen Phillips
#0710108
Is there research to support this project
Ali Mili, Sherif Yacoub, Edward Addy and Hafedh Mili
Toward an Engineering Discipline of Software Reuse
Concern for practice is no excuse for poor theory
Empirical methods are no excuse for dispensing with
analytical methods
Scientific research ultimately affects and enhances practice
by Stephen Phillips
#0710108
What feasibility issues restrict this project



Cannot predict additional requirements; must
code in a way that can be iteratively improved
Scope must be defined; this project is not a
self-contained engine like Unity
Middleware engines have similarities, but are
all unique; developer must have some access
by Stephen Phillips
#0710108
How can this project’s effectiveness be measured
Chandrashekar Rajaraman and Michael R. Lyu
Reliability and Maintainability Related
Software Coupling Metrics in C++ Programs
(1)
(2)
(3)
(4)
Class Inheritance-related Coupling (CIC)
Class Non-Inheritance-related Coupling (CNIC)
Class Coupling (CC)
Average Method Coupling (AMC)
by Stephen Phillips
#0710108
Baker, Albert L., Bieman, James M., Fenton, Norman, Gustafson,
David A., Melton, Austin and Whitty, Robin (1990) 'A
Philosophy for Software Measurement' Iowa State
University, Colorado State University, The City University
(London), Kansas State University and Polytechnic of the
South Bank (London)
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1
.73.4431&rep=rep1&type=pdf [16 February 2011]
Bridger, Paul (2011) 'C++ Multithreading Tutorial'
http://www.paulbridger.com/ [18 February 2011]
Bruegge, Bernd and Dutoit, Allen H. (2003) Object-Oriented
Software Engineering Using UML, Patterns and Java. USA:
Prentice Hall
http://books.google.co.uk/books?id=VYdf2ONuRZIC [7
November 2010]
Grudin, Jonathan (1989) 'The Computer Reaches Out: The
Historical Continuity of Interface Design' Department of
Computer Science, Aarhus University http://www.istpalcom.org/publications/PB/299/PB-299.pdf [2 November
2010]
Hoffman, Douglas (2000) 'The Darker Side of Metrics' Software
Quality Methods, LLC
http://www.softwarequalitymethods.com/Papers/DarkMets
%20Paper.pdf [8 November 2010]
Huston, Vince (2010) 'Design Patterns'
http://www.vincehuston.org/dp/ [7 November 2010]
Kaner, Cem and Bond, Walter P. (2004) 'Software Engineering
Metrics: What Do They Measure and How Do We Know?'
IEEE. http://www.kaner.com/pdfs/metrics2004.pdf [8th
November 2010]
Liskov, Barbara and Zilles, Stephen (2000) 'Programming with
Abstract Data Types‘ Massachusetts Institute of Technology
and IBM Systems Development Division
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1
.136.3043&rep=rep1&type=pdf [5 November 2010]
Martin, Robert C. (2002) Agile Software Development:
Principles, Patterns, and Practices. USA: Prentice Hall [9
November 2010]
Mili, Ali, Yacoub, Sherif, Addy, Edward and Mili, Hafedh (1999)
'Toward an Engineering Discipline of Software Reuse'
Institute for Software Research, NASA Software
Independent Verification and Validation Facility and
University of Quebec
http://www.raminsoftworx.com/elec443/lectures/reuse3.pdf [16 February 2011]
Nesnas, Issa A.D., Wright, Anne, Bajracharya, Max, Simmons,
Reid, Estlin, Tara and Won Soo Kim (2004) 'CLARAty: An
Architecture for Reusable Robotic Software‘ http://trsnew.jpl.nasa.gov/dspace/bitstream/2014/7235/1/030921.pdf [4 November 2010]
Rajaraman, Chandrashekar and Lyu, Michael R. (2007)
'Reliability and Maintainability Related Software Coupling
Metrics in C++ Programs' CS Department, The University of
Iowa and Information Sciences and Technologies Research
Lab, Bellcore
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1
.46.3055&rep=rep1&type=pdf [14 December 2010]
Sallis, Philip, Tate, Graham and MacDonell, Stephen (1995)
Software Engineering. England: Addison-Wesley [9
November 2010]
Sametinger, Johannes (1997) 'Software Engineering with
Reusable Components‘ Johannes Kepler University of Linz
http://www.swe.uni-linz.ac.at/publications/pdf/TR-SE97.04.pdf [7 November 2010]
Shalloway, Alan and Trott, James (2005) Design Patterns
Explained, Second Edition. USA: Pearson Education [16
February 2011]
Shalloway, Alan (2010) 'The Net Objectives Design Patterns
Repository' http://www.netobjectives.com/ [17 February
2011]
Shaw, Mary, DeLine, Robert, Klein, Daniel V., Ross, Theodore L.,
Young, David M. and Zelesnik, Gregory (1995)
'Abstractions for software architecture and tools to support
them‘ Computer Science Department, Carnegie Mellon
University and affiliations
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1
.92.9998&rep=rep1&type=pdf [5 November 2010]
Sommerville, Ian (2007) Software Engineering 8. England:
Addison-Wesley [9 November 2010]
by Stephen Phillips #0710108