How a6575/ci6450-ai-videogames-project works
Project type and purpose
• This is a single-player video game prototype built in Python 3.10+ using Pygame 2.6.1.
• It focuses on character movement and AI steering behaviors (kinematic and dynamic) for both the player avatar and NPCs.
• The goal is to demonstrate AI techniques within a game loop context (movement, rendering, input handling).
File structure
• Top level:
• assets/ – holds graphical and audio resources
• src/main.py – game entry point, initializes Pygame and starts the main loop
• src/imports/gui.py – graphical interface and rendering abstractions
• src/imports/player/player.py – Player class, input mapping, state
• src/imports/npc/npc.py – NPC class, state machine or behavior driver
• src/imports/moves/ – various steering-behavior modules, both kinematic and dynamic, plus a switcher
• No external services or databases, a self-contained monolith.
• requirements.txt declares Pygame dependency.
README for additional insights
• The README confirms the above structure.
Main components
a. Game Loop (main.py)
b. Input Handler (keyboard events → Player module)
c. Update Manager
• Player Controller
• NPC Controller
• Steering Behavior Engine (moves/*)
d. GUI / Renderer (gui.py + Pygame Surface)
e. Asset Manager (assets/)
f. External Library: Pygame
Relationships and interactions
• The Game Loop polls Input → forwards to Player Controller
• Game Loop invokes Update Manager:
• Player Controller queries Steering Behavior Engine for next velocity/position
• NPC Controller uses Steering Behavior Engine via “switcher” to choose behaviors dynamically
• Update Manager updates entity states
• Renderer draws current state using GUI module and loaded assets
• Loop repeats at fixed timestep or frame cap
Architectural patterns and design principles
• Component-based separation:
• Input
• Logic (AI & movement)
• Rendering
• Single Responsibility Principle: each module handles one concern
• Strategy pattern for steering behaviors: interchangeable kinematic vs. dynamic
• Centralized main loop coordinating subsystems
Technologies, frameworks, libraries
• Python 3.10+
• Pygame 2.6.1
• Custom modules under src/imports
Detailed checklist
• [ ] Input Handler block
• [ ] Player and NPC blocks under “Entities”
• [ ] Steering Behavior Engine block with sub-modules (list kinematic_/dynamic_)
• [ ] GUI/Renderer block linked to Pygame API and assets
• [ ] Pygame external library