Exam
Format
Section titled “Format”Individual oral exam, 20 minutes including grading, without preparation. See the syllabus for the formal description.
- You draw a number from 1–10.
- The exam starts with question 0 (your project), followed by the question you drew.
- That gives about 7–8 minutes per question.
The sub-questions are there to guide the conversation. You aren’t expected to get through all of them.
If you can’t answer part of the question you drew using your own game project, you are welcome to refer to the games from the course. You may use their source code at the exam: all of them are in gar-games, one folder per game.
Questions
Section titled “Questions”0. Present Your Game Project
Section titled “0. Present Your Game Project”- Present your game project.
- Briefly describe the gameplay and systems in the game.
- What is the overall architecture?
- Which design patterns does the project use? Choose one and describe its implementation in detail. It must be a different pattern from the one in the question (1–10) you drew.
1. Game Loop & Update Method
Section titled “1. Game Loop & Update Method”Covered in: 01 Pong, 03 Snake, 11 Geometry Wars
- Explain the structure of a traditional game loop. What are the responsibilities of the
UpdateandDrawphases, and why are they usually kept separate? - What problems arise with a fixed-step versus a variable-step game loop, and what role
does delta time play in
Update? - How is the game loop implemented in MonoGame, and where does your project hook into it?
- Show a place in your project where the Update Method pattern is applied to a collection
of game objects. What are the trade-offs of each entity implementing an
Update(dt)method?
2. State Pattern & State Stack
Section titled “2. State Pattern & State Stack”Covered in: 02 Flappy Bird, 05 Pac-Man, 06 Super Mario Bros, 10 Pokemon
- Explain the State pattern. What problem does it solve compared to using
if/switchstatements on an enum or boolean flags? - Draw (or describe) a state diagram for an entity or scene in your project, and explain how transitions are triggered.
- How are
Enter()andExit()methods useful, and what kinds of bugs occur if you forget to call them? - What is a state stack, and how does it differ from a simple finite state machine? Give an example where pushing/popping states is more appropriate than replacing them.
- State and Strategy have the same structure. What is the difference between them? Give an example of each.
3. Singleton & Service Locator
Section titled “3. Singleton & Service Locator”Covered in: 02 Flappy Bird, 10 Pokemon, 11 Geometry Wars
- Explain the Singleton pattern. Why is it both widespread and controversial in game development?
- Which concrete problems does the Service Locator pattern solve, and how does it differ from a Singleton in terms of coupling and testability?
- Show how a locator (like
Locatorin Pokemon) is used in your project. Which services have you registered, and why? - Discuss the trade-offs: when would you prefer dependency injection (passing references in through constructors) over a Service Locator?
4. Command Pattern & Input Handling
Section titled “4. Command Pattern & Input Handling”Covered in: 01 Pong, 02 Flappy Bird, 03 Snake, 04 Sokoban, 06 Super Mario Bros
- Explain the Command pattern. What is the core idea, and what are its main benefits in a game context? How can commands support undo and redo, and what must a command remember to be undone?
- Explain how input is handled at the lowest level in MonoGame (polling
Keyboard.GetState()/Mouse.GetState()). What problems arise if you poll directly inside gameplay code? - How would you (or how did you) build an input abstraction layer on top of polling, and where does the Command pattern fit in?
- Demonstrate or sketch a refactoring in your project where input handling could be improved using commands.
5. Observer Pattern, Events & UI
Section titled “5. Observer Pattern, Events & UI”Covered in: 07 The Legend of Zelda, 08 Angry Birds, 10 Pokemon
- Explain the Observer pattern. How is it implemented in C# with
eventanddelegate(orAction<T>)? - Why is Observer particularly well suited to UI code?
- Show a place in your project where you use events. Who is the publisher, who are the subscribers, and what would the alternative (polling / direct calls) look like?
- What are common pitfalls when using events in games?
6. Sprites, Texture Atlases, Animation & Rendering
Section titled “6. Sprites, Texture Atlases, Animation & Rendering”Covered in: 01 Pong, 02 Flappy Bird, 03 Snake
- Explain how 2D rendering works in MonoGame: what is a
SpriteBatch, and what happens betweenBegin()andEnd()? - What is a texture atlas (sprite sheet), and why is it preferable to loading many individual texture files?
- How is a frame-based animation system typically structured? Sketch (or describe) a
class diagram for an
AnimatedSprite, and explain how it switches between frames over time. - How does your project organize sprite assets, and what would need to change to support, for example, a new animated enemy?
7. Tilemaps, Collision Detection & Procedural Generation
Section titled “7. Tilemaps, Collision Detection & Procedural Generation”Covered in: 01 Pong, 02 Flappy Bird, 03 Snake, 04 Sokoban, 06 Super Mario Bros, 07 The Legend of Zelda, 08 Angry Birds, 12 Vampire Survivors
- Explain how a tile-based level is represented in memory, and how rendering a tilemap differs from rendering individual sprites.
- Describe at least two approaches to 2D collision detection (e.g. AABB, circle-circle, tile-grid lookup). What are the trade-offs between performance and precision?
- How can collision detection be made efficient when there are many entities?
- Explain a procedural generation technique you have used or studied (e.g. infinite scrolling with obstacles).
- How would you bring a physics library into a game without the rest of the code depending on it? Explain the Adapter and Facade patterns, and what problems they solve.
8. Data-Driven Design & Serialization
Section titled “8. Data-Driven Design & Serialization”Covered in: 03 Snake, 04 Sokoban, 07 The Legend of Zelda, 08 Angry Birds, 09 Plants vs. Zombies, 10 Pokemon
- What does it mean for a game to be data-driven? Compare hardcoded gameplay values with externalized data (JSON, configuration files).
- What are the benefits of data-driven design for designers, testers and programmers? What are the costs?
- How is serialization used in your project (save/load, level files, entity configurations)? Walk through how an object is turned into bytes and back again.
- Identify a part of your project that is currently hardcoded but would benefit from being data-driven. What would the data file look like, and what code would need to change?
- Explain the Type Object and Prototype patterns. How does each make new objects from data, and what must you watch out for when copying objects?
9. Components & Systems
Section titled “9. Components & Systems”Covered in: 07 The Legend of Zelda, 09 Plants vs. Zombies, 11 Geometry Wars
- Explain the Component pattern. What problems with deep inheritance hierarchies does it solve, and what does it cost?
- How do components of the same entity work together, and how do they find out about other entities?
- When should behaviour live in a system, and when in a component? Give an example of each.
- Show a class in your project that does several unrelated things. How could it be split into components, and what would you gain?
10. Memory & Performance
Section titled “10. Memory & Performance”Covered in: 11 Geometry Wars, 12 Vampire Survivors
- Explain the difference between an Array of Structs and a Struct of Arrays. Why can the memory layout of game data affect performance?
- Explain spatial partitioning. What problem does a uniform grid solve, and when would checking every pair still be the better choice?
- Explain the Object Pool and Flyweight patterns. What problem does each solve, and how do they differ?
- Show a place in your project that would become a bottleneck with many more entities (e.g. allocations, collision checks). How would you measure it, and how would you fix it?
