Title: Dias nummer 1
1Bumper Cow Racing
2- Præsentation
- Bumpercow racing
- Gruppen
- Proof of concept
3- Spil programmering
- Hvad vs. Hvordan
- Konceptet
- MDA (Rules - System - Fun)
- Systemisk design
4- Arbejdsprocessen
- Hvad har vi gjort?
- Hvad har været godt?
- Hvad har været dårligt?
5- Tim Ryan
- Mark Cerny
- Extreme programming
6- Metaphor
- Onsite Customer
- Continuous Integration
- Simple Design
- Pair Programming
- Collective Code Ownership
7- Gode ting
- Bedre kode?
- Ingen eksperter
- Fremtiden
8- Dårlige ting
- Kode strukturen tog tid
- Ingen eksperter
9- Sprogvalg
- 5 mand, 2 nye sprog, 1 ny game engine
- Ønske om at alle skal kunne bidrage
- Prioritet Fælles forståelse, struktur, features
- og optimering af run-time performance
- Python frem for C
- Ulempe Stort pres på taskmanageren
- Fordel Renere struktur, alle har kunnet bidrage
10(No Transcript)
11- Object factory
- Fleksibilitet i objekt instansiering
- Instansiering af objekter run-time
- Skabe struktur særligt i vores start klasse
- Interface pattern
Track currentTrack globalvars.factory.createInst
ance("track01") Model m currentTrack.getModel
12class Track01(track.Track) Track
properties modelPath "/Build_final/models/tr
ack/bane01group" trackModel ""
trackScale 20 trackName "Track01"
collisionList "/curb1","/road","/ring1","
/ring2","/ring3","/ring4","/ring5","/rin
g6" def setBitMasks(self, nodeList, bit)
sets up bitmasks for collision objects in the
collisionList i 1 for x in
nodeList tmpNode
self.getTrackModel().find(x)
globalvars.collision.setBitmask(tmpNode, bit)
def getTrackModel(self) . def
getModelPath(self) . def
getWayPoints(self) .. . . def
createTrack() return Track01() globalvars.fa
ctory.registerClass("track01",createTrack)
13- OO og globale variable
- Indkapsling af data
- Mulighed for deling
- Inspireret fra eksisterende spil
- OO og singletons
- Python og script
14 This file contains a series of global
variables for easy accessibility in
different parts of the program.
import objectfactory from
collisiondetection import CollisionDetection Set
up a reference to the global ObjectFactory factor
y objectfactory.Instance Set up a reference
to the global CollisionDetection system collision
CollisionDetection() Set up reference to the
current track object currentTrack "" Set up
reference to the current player car player1Car
"" aiCarNumber 0
Default car properties
carMaxForwardSpeed 34 carMaxReverseSpeed
-15 carAcceleration 0.6 carFriction
0.2 carTurnSpeed 1.4
Start class self.car
globalvars.factory.createInstance("playercar") sel
f.car.setCarName("playercar") globalvars.player1Ca
r self.car
Car class Setup car in
the scene self.car.setPos( globalvars.currentTrac
k.startPosX, globalvars.currentTrack.startPosY,
globalvars.currentTrack.startPosZ ) self.car.setHp
r(globalvars.currentTrack.startHPR,0,0)
15- AI
- Pathfinding waypoint
- Finite State Machine
- Neural Network
16- Collision Detection
- PhysicsCollisionHandler vs CollisionHandler
- Broad collision
- Narrow collision
- Bitmask
17- Konklusion / Vejen Frem
- To Mål
- God objekt orienteret kode
- Godt spil design (sjovt at spille)
18- God objekt orienteret kode
- First pass (i spillet)
- Oprydning i koden
- Klasse struktur
19- God objekt orienteret kode
- Second pass (for fremtiden)
- Model-View-Controller
- Revider klasserne
- Adskil den visuelle representation fra input
håndtering og spil/model states - Definer kommunikations linier/data flow
- Eksempel
20-
- God objekt orienteret kode
CarController
GetSpeed() GetDirection() .....
Controller
Look at
CarRepresentation
CarEntity
Look at
DrawCar() PlayEngineSound() .....
GetPosition() CollisionResponce() ApplyForce()
.....
View
Model
21- Store linjer
- Holdsammensætning
- Proof of concept
22Q A