Course Overview

This course is an introductory, hands-on exploration of object-oriented software design with a focus on practical gaming-oriented  applications in Java. The course emphasizes learning by doing. Theoretical concepts are introduced in the context of concrete coding exercises.

The course covers a range of topics essential for software development, including:

Vibe Coding:

Integrating AI Assisted coding practices into software development

Understanding the LLM contexts, composing the prompts and framing the prompts force custom code

Validatin AI generated code

Fundamental OOP Principles:

Localization of code

DRY Principle 

Encapsulated Variables Principle (EVP) 

Single Responsibility Principle (SRP)

Liskov Substitution Principle (LSP)

Is-A and Has-A Relationships

Open-Close Principle

 Interface Segregation Principle

 Dependency Inversion Principle

 Data-Oriented Design: This approach is particularly relevant for graphics and high-performance software commonly found in engineering systems. Students will learn to use a Driver object to manage data flow between components and organize classes into packages for efficient communication and maintainability.

 Java Programming Concepts:

 Scope and lifetimes of variables

 Parameter passing and object assignment in Java (including pass-by-value and the box model of references)

 Distinctions between primitives and objects

Arrays and their behavior as parameters

The null object and its significance

Stack frame, heap, and object creation

Copy vs. clone operations

Deep copy vs. shallow copy

 OpenGL and Graphics Programming:

 Using LWJGL (a Java library for OpenGL)

Creating an OpenGL Context

Working with GLFW for window management

Understanding GPUs as streaming devices

Implementing basic rendering tasks, like drawing triangles and circles

Concepts of NDC coordinates and OpenGL window coordinates

Rendering circles using sine and cosine operations

Texture mapping

Shader programs (vertex and fragment shaders)

Uniform variables in shaders

 Creating a Camera object (an abstraction not directly present in OpenGL)

 Design Patterns:

 Singleton Pattern (and discussions of potential anti-patterns)

 Observer Pattern

Factory Method Builder Pattern

Game Development Concepts:

Through a series of assignments focused on building games, students will gain hands-on experience with practical applications of OOP principles:

  • Implementing game mechanics, player interaction, and strategies for computer play.
  • Drawing and manipulating circles on the screen.
  • Understanding and applying ping-pong arrays for efficient data management in dynamic scenarios.
  • Building a cellular automata simulation using ping-pong arrays and user interface elements. Convolution operations.
  • Developing a complete game with a graphical user interface, handling user input, and managing game logic.

 Development Tools and Practices:

  • Vibe Coding: Using AI Agents for coding - how to frame prompts, acceptance criteria for AI generated code, validating AI generated code.
  • Using Git for version control.
  • IntelliJ IDEA as the development environment.
  • Introduction to Agile methodologies, particularly Kanban, for managing software development tasks.

 Performance Considerations:

  • Students will explore concepts related to software performance, including:
    • Latency vs. Bandwidth
    • Framebuffers and the glfwSwapBuffers() function
    • Threads and Processes
    • Garbage Collection and its impact on performance

The course assignments provide practical experience in applying the concepts to real-world scenarios. Students are encouraged to use external resources like the LWJGL documentation, Stack Overflow, and OpenGL.org to supplement their learning.

 Course breakdown by weeks

The course is heavily driven by assignments. Every lecture begins with a chance for the students to ask for further help with the assignment and that takes varying times. When all the topics scheduled for a week are not covered, some topics are postponed and some topics are dropped – as prioritized by the instructor.

We have a very active Discord group in addition to course Canvas. The Discord server is by invitation. If you are in the course and don’t have access to the server, contact the instructor.

2.1            Week-1

  • Course goals
  • Using IntelliJ, git, Unit Level Tests for assignments
  • Object-oriented principles:
    • Brief intro to MESS, DRY, EVP, SRP
  • Vibe coding basics. Putting the LLM context-mechanism to proper use. Refining prompts for generating custom-fit code.

2.2            Week-2

  • Abstraction based design of software systems
    • Platform abstraction
    • State-Machine Abstraction
    • MESS and how DRY, EVP, SRP help MESS
  • Introduction to rendering using OpenGL: GLFW & LWJGL Libraries
  • Data-Oriented Deisgn and the Driver class: Driver class functions

2.3            Week-3

  • SRP compliant application from the proof of concept, integrated driver program
  • Reading data from file: using vibe code agent to write code.
  • Assignment-1: Out. Due next week.
  • Anatomy of a LWJGL program
  • How GPU Renders polygons – platform abstraction
  • Rendering polygons from triangles: strips & fans

2.4            Week-4

  • Design Patterns
    • Singleton Pattern
    • Need for singleton WindowManager class/object.
  • Assignment-2: Out. Due next week.
  • Rendering as a separate responsibility: the Renderer class
  • Inheritance, Is-A, Has-a Relationships,
  • Base Class - Derived Class: order of creation in memory
  • Liskov Substitution Principle, Polymorphism

2.5            Week-5

  • Using state machines to derive the software architecture.
  • Assignment-3: out Due Week-7
  • OpenGL buffers and Buffer Objects

2.6            Week-6

  • Rendering polygons, OpenGL Coordinate System, Windows Coordinate system, rendering circle segments, pacman transformations
  • SRP: Revisit – separate rendering into Rendering & Geometry Managers, rendering tiles selectively, concept of polygon budget, frame rates, user interaction frequencies, polled inputs and interrput driven inputs
  • Rendering arrays of polygons

2.7            Week-7

  • Assignment-4: out. Due Week-9. Array of squares
  • Game Data Structures, PingPongArray Data Structure – using modular arithmetic for wrap around computations. Concept of nearest neighbors, computing nearest neighbors
  • Parameter passing, assignment in Java. Pass/assign by value, pass/assign by reference in Java, using final
  • EVP and returning Arrays from a method in Java. Using Cloning.

2.8            Week-8

  • GPU/OpenGL and Java: Problem of lack of pointers in Java and How LWJGL solves that problem;
  • NIO Buffers in Java – rendering selected polygons in the array of polygons
  • Cellular Automata and the Game of Life: Implementing Game of Life rules using PingPongArrays
  • Adjusting the array size based on polygon budget: computing polygon budget for balancing frame rates
  • Assignment-6: Game of LIfe Cellular Automata

2.9            Week-9: Vacation Week

2.10        Week-10

  • Keyboard interrupts, user inputs and adding user interactions to Game of Life
  • Reading mouse coordinates
  • Introduction to texture mapping, introduction to shader compilation: role of shaders and textures
  • Designing your classes: Strongly coupled, weakly-coupled and independent classes; packages vs classes, Java rules for access specifiers for classes within a package
  • Assignment-7: Breaking down GoL CA application into components + adding user interface to the application

2.11        Week-11

  • Shaders in the context of platform abstraction: shader compilation; triangle rendering pipeline – OpenGL context – interaction of the OS with GPU/GPUDriver.
  • ShaderManager Class
  • Texture manager class
  • Assignment-8: Mario in motion: textured tiles

2.12        Week-12

  • MouseIOManager class – computing pixel coordinates for mouse click. Concept of callback functions, implementing callbacks via Java Lambda functions
  • Textured tiles – texture atlas, texture coordinates computation from atlas
  • Assignment-9: Minesweeper

2.13        Week-13

  • Designing classes – abstracting implementable details – extracting class variables – UML Diagrams
  • Java Interface: Diamond problem in Object-Oriented Design, Java approach to avoiding the diamond problem: interfaces
  • Interface Segregation Principle
  • Open Close Principle – Complete SOLID principles in context
  • How DRY, EVP, SOLID contribute to MESS software
  • Class factoring: Creating class hierarchy from abstractions
  • Assignment-9: Written assignment: Wolves & Rabbits Game Design Documents
    • Complete Abstraction of Wolves & Rabbits: State machine, UML, Kanban List.

2.14        Week-14

  • ShaderManager Class
  • Texture manager class
  • Adding texture transitions & alpha blending; fake animation via alpha blending
  • Assignment-10: Wolves & Rabbits

2.15        Week-15

  • Scoring for games: assigning points for wins, equilibrium points in gameplay, sustaining player interest
  • Game Levels: making Wolves & Rabbits an addictive play!
  • Catchup

2.16        Week-16

  • Catchup
  • Course Review
  • Finals Review

2.17        Topics List:

  • Virtual Machines
  • Just in Time Compilation, Jitters etc
  • Packages vs classes
  • Driver class in DoD
  • ULTs in IntelliJ
  •  

 

3.               Extended Syllabus

3.1            Week-1

  • Course goals
  • Using IntelliJ, git, Unit Level Tests for assignments
  • Object-oriented principles:
    • Brief intro to MESS, DRY, EVP, SRP
  • Assignment-1: Setup IntelliJ, Use Gradle to update LWJGL and GLFW libraries. Refactor the code to conform to DRy, EVP, SRP

3.2            Week-2

  • Abstraction based design of software systems
    • Platform abstraction
    • State-Machine Abstraction
    • MESS and how DRY, EVP, SRP help MESS
  • Test-Driven Development: Writing ULTs for classes
  • Assignment-2: TicTacToe – state diagram abstraction, reading user input, spline path implementation

3.3            Week-3

  • Anatomy of a LWJGL program.
  • Introduction of Design patterns, Singleton Pattern
  • GLFWWindow Singleton implementation
  • How GPU Renders polygons – platform abstraction
  • Trigonometric transformations, Polar Coordinates, Rendering circle segments, polygons etc

3.4            Week-4

  • Data-Oriented Design: why games & simulations use them – the Driver class
  • Rendering as a separate responsibility: the Renderer class
  • Inheritance, Is-A, Has-a Relationships, Liskov Substitution Principle, Polymorphism
  • Rendering polygons of varying sides, circle segments and circles
  • Assignment-3: Kalos Renderer

3.5            Week-5

  • OpenGL buffers and Buffer Objects
  • Rendering polygons, OpenGL Coordinate System, Windows Coordinate system, rendering circle segments, pacman transformations
  • Assignment-4: Rendering array of static array of tiles (or pacman transformations)

3.6            Week-6

  • SRP: Revisit – separate rendering into Rendering & Geometry Managers, rendering tiles selectively, concept of polygon budget, frame rates, user interaction frequencies, polled inputs and interrput driven inputs
  • TEST-1

3.7            Week-7

  • Game Data Structures, PingPongArray Data Structure – using modular arithmetic for wrap around computations. Concept of nearest neighbors, computing nearest neighbors
  • Parameter passing, assignment in Java. Pass/assign by value, pass/assign by reference in Java, using final
  • EVP and returning Arrays from a method in Java. Using Cloning.
  • Assignment-5: PingPongArrays

3.8            Week-8

  • GPU/OpenGL and Java: Problem of lack of pointers in Java and How LWJGL solves that problem;
  • NIO Buffers in Java – rendering selected polygons in the array of polygons
  • Cellular Automata and the Game of Life: Implementing Game of Life rules using PingPongArrays
  • Adjusting the array size based on polygon budget: computing polygon budget for balancing frame rates
  • Assignment-6: Game of LIfe Cellular Automata

3.9            Week-9: Vacation Week

3.10        Week-10

  • Keyboard interrupts, user inputs and adding user interactions to Game of Life
  • Reading mouse coordinates
  • Introduction to texture mapping, introduction to shader compilation: role of shaders and textures
  • Designing your classes: Strongly coupled, weakly-coupled and independent classes; packages vs classes, Java rules for access specifiers for classes within a package
  • Assignment-7: Breaking down GoL CA application into components + adding user interface to the application

3.11        Week-11

  • Shaders in the context of platform abstraction: shader compilation; triangle rendering pipeline – OpenGL context – interaction of the OS with GPU/GPUDriver.
  • ShaderManager Class
  • Texture manager class
  • Assignment-8: Mario in motion: textured tiles

3.12        Week-12

  • MouseIOManager class – computing pixel coordinates for mouse click. Concept of callback functions, implementing callbacks via Java Lambda functions
  • Textured tiles – texture atlas, texture coordinates computation from atlas
  • Assignment-9: Minesweeper

3.13        Week-13

  • Designing classes – abstracting implementable details – extracting class variables – UML Diagrams
  • Java Interface: Diamond problem in Object-Oriented Design, Java approach to avoiding the diamond problem: interfaces
  • Interface Segregation Principle
  • Open Close Principle – Complete SOLID principles in context
  • How DRY, EVP, SOLID contribute to MESS software
  • Class factoring: Creating class hierarchy from abstractions
  • Assignment-9: Written assignment: Wolves & Rabbits Game Design Documents
    • Complete Abstraction of Wolves & Rabbits: State machine, UML, Kanban List.

3.14        Week-14

  • ShaderManager Class
  • Texture manager class
  • Adding texture transitions & alpha blending; fake animation via alpha blending
  • Assignment-10: Wolves & Rabbits

3.15        Week-15

  • Scoring for games: assigning points for wins, equilibrium points in gameplay, sustaining player interest
  • Game Levels: making Wolves & Rabbits an addictive play!
  • Catchup

3.16        Week-16

  • Catchup
  • Course Review
  • Finals Review