Skip to content

Nocturne Engine

A modern C++20 game engine implementing QBert with advanced architecture

Project Overview

Nocturne is a modern C++20 game engine that recreates the classic QBert gameplay with contemporary architecture. It features a component-based design, sophisticated AI, and advanced game programming patterns.

Component Architecture

GameObjects with modular components for rendering, physics, and gameplay logic

State Machines

Advanced enemy AI with state transitions for Coily (Spawning, Egg, Snake states)

Modern C++20

Utilizes ranges, concepts, lambdas, and other modern C++ features

Game Features

🎮

QBert Mechanics

Classic pyramid tile navigation with color-changing mechanics

👾

Enemy AI System

Coily, Slick, Sam, Ugg, and Wrongway with distinct behaviors

🏆

High Score System

Persistent storage of top 10 scores with player name entry

🎵

Audio Integration

Sound effects for jumps, hits, and level completion

Engine Architecture

Core Systems
Scene Manager
Input Manager
Resource Manager
Sound Service
Game Objects
GameObject
Component System
Transform
Renderer
Game Logic
QBert Player
Enemy AI
Level System
Score System

Design Philosophy

Nocturne Engine follows a strict component-based architecture with minimal coupling between systems. The design prioritizes extensibility, allowing new features to be added with minimal impact on existing code.

Event-Driven Programming

Components communicate through events (OnTileColored, OnHealthChanged) to reduce dependencies

Data-Driven Design

Level configurations loaded from external files for easy modification

Minimal Getters/Setters

Code designed to avoid trivial accessors, focusing on behavior instead

Programming Patterns

Component Pattern

GameObjects composed of reusable components (LevelComponent, PlayerDataComponent)

Command Pattern

Input handling via Command classes (MoveCommand, NameEntryUpCommand)

State Pattern

QBert states (Idle, Dead) and Coily states (Egg, Snake, Dying)

Observer Pattern

Event subscriptions for UI updates (ScoreDisplayObserver)

Factory Pattern

Enemy creation via factory methods (CreateCoily, CreateSlick)

Service Locator

SoundServiceLocator for decoupled audio access

C++20 Features

Ranges Library

Clean data processing with std::ranges::filter in Level::CheckForCompletion

Concepts

Implicit template constraints for type safety in generic code

Lambda Expressions

Concise event subscriptions and menu callbacks

Structured Bindings

Clean tuple unpacking in range-based loops

constexpr

Compile-time evaluation for constants and arrays

std::unique_ptr

Automatic memory management for game objects

Technical Highlights

Key Systems

Design Choices

Designed and built by Ivans Minajevs.