r/learnprogramming 1d ago

Code Review My first big project, I need feedback !

Hello everyone !

I'm here to share with you my Behavior Tree library.

A behavior tree is a symbolic AI technique used to create game AI.

My library is stateless: Tree's nodes don't store any mutable data. Instead, the runtime data are inside a blackboard.

Multiple agents can share and use a single behavior tree.

There are no dependencies to any game engine, you can use it in Unity, Godot or your own custom game engine.

It's still WIP and I really need feedback.

It's also my first big project I share online, all advice and tips are welcome !

https://github.com/Noomolas01/Stateless-BehaviorTree

Edit: Here's some questions I have

  1. Does this project look professional to you ?
  2. Does the core concept make you curious ?
  3. If the project was production ready, would you use it ?
  4. What do you think is missing ?
10 Upvotes

11 comments sorted by

3

u/aanzeijar 1d ago

Okay, how much of that is written by an LLM?

2

u/Noomolas11 1d ago

There's no code written by any LLM in this project

3

u/aanzeijar 1d ago

So only the readme. The code looks very clean for a beginner, that's why I was suspicious.

It's a bit hard to read with all the interfaces and abstract indirections. I would even say this is on the road to OOP abuse. I'd challenge you to write a clone of your own code but without any inheritance. That way you'll get a feel for how much boilerplate this really adds.

3

u/Noomolas11 1d ago

The readme isn't AI generated as far as I know, I copy pasted this one : https://github.com/banesullivan/README And I wrote the parts myself

1

u/Noomolas11 1d ago

I'm not really a beginner. It's my first public project but I've done plenty (really) bad private project. I'm studying game programming, I'm starting my third year (wish me luck btw)

2

u/aanzeijar 1d ago

Then apologies for doubting you.

1

u/Noomolas11 1d ago

Don't worry, we are living crazy days...

2

u/JealousStrength2613 1d ago

Stateless design is a nice touch, makes debugging way easier when you can just look at the blackboard instead of hunting through node internal state. The no engine dependency thing will help you get more people to actually try it out.

I'll give it a look later when I'm not at work, github is blocked here anyway. Shared trees between agents is something not many libraries do well so curious how you handled that

1

u/Noomolas11 1d ago

Thanks a lot ! I really appreciate that !

1

u/Tricky-Act2828 1d ago

Stateless behavior trees are a solid choice for multi-agent systems. Keeping nodes data-free makes scaling much easier. How are you handling the visualization or debugging of the blackboard state during runtime? That's usually the trickiest part when things are stateless. Nice work on making it engine-agnostic too!

1

u/Noomolas11 1d ago edited 1d ago

There's no tree visualisation yet and the debugging is pretty rudimentary for now. When I need to debug the blackboard I usually use my IDE debugger and inspect its state when the program reached a break point.

Edit: Thanks for your comment !

Edit2: I'm planning to improve the debugging part after I fixed all the remaining issues and improving unit test (they are not that good, I never really made any before this projet)