I’m an undergraduate CS student working on a final project due in about a month, and I’m trying to design and implement a C++-based AI Neural Network Simulator integrated into a small game environment. I’d really appreciate guidance on architecture, design decisions, and best practices—especially how to combine the AI and OOP/game requirements cleanly.

I’ve started implementing basic building blocks like Neuron and a custom Matrix class:

class Neuron {
private:
    double bias;
    double value;
    double delta;

public:
    Neuron(double b = 0.0) : bias(b), value(0.0), delta(0.0) {}

    double getValue() const { return value; }
    void setValue(double v) { value = v; }
};

I also created a simple templated matrix class:

template <typename T>
class Matrix {
private:
    std::vector<std::vector<T>> data;

public:
    Matrix(int r, int c) : data(r, std::vector<T>(c, 0)) {}

    T& operator()(int i, int j) {
        return data[i][j];
    }
};

However, I’m unsure whether continuing with a custom matrix implementation is a good idea, or if I should fully switch to Eigen as required.

I am required to implement the following components:

  • Classes:

    • Neuron

    • Layer

    • Network

    • TrainingData

  • Data Structures:

    • Graph-like structure for neuron/layer connections

    • Matrix representation for weights (using Eigen)

  • Algorithms:

    • Activation functions (Sigmoid/ReLU)

    • Backpropagation

    • Gradient descent

  • OOP Requirement:

    • Use templates for flexible network architectures (e.g., different layer sizes or activation types)
  • Libraries:

    • Eigen for matrix operations

    • SFML for visualization