^ Week 02, Thursday
▶ review system architecture
game prototype
- log game state changes to some console
- trace logging, e.g.
C.out, trace()
- in game HUD, e.g.
com.pixeldroid.tools.osd.Console
- implement pixeldroid arcade rom interface for access to controls and high scores
- rom:
com.pixeldroid.r_c4d3.interfaces.IGameRom
- controlsProxy will be set to an implementation of
com.pixeldroid.r_c4d3.interfaces.IGameControlProxy
- scoresProxy will be set to an implementation of
com.pixeldroid.r_c4d3.interfaces.IGameScoreProxy
- stub out every major state (screen)
- see examples in svn:
testing strategies
- unit test: determine correctness of functional units before integrating with rest of system
- update and build with latest code frequently to identify problems early
profiling techniques
- timing
- fps
- function timing
- execution counting
- identifying bottlenecks with window size
- processing – smaller window has no effect on frame rate
- rendering – smaller window improves frame rate
optimization strategies
less is more!
- test early; test often; optimize last
- do as few things simultaneously as possible
- reduce screen redraw
- share object instances rather than create new ones
- cache memory references, especially long dereferencing chains
- precalculate known values
- defer unnecessary calculations
- use fewer local scripts
- ignore inactive areas