Closed stryker313 closed 2 years ago
Thanks for the kind words! It’s always extremely motivating to hear something like this 😊 As for your question: the algorithm is designed to work “concurrently”, meaning all genomes of a generation compete at the same time. I put concurrency in quotes, because really it is just a for loop – check out the important code here
If you want to evaluate each genome sequentially - which might be reasonable if you have a really complex environment - you'd have to start with that function. If you were to rewrite it such that only one agent is evaluated, you could write an outer loop calling that function until a stopping criterion is met. This is what I mean by outer loop. Of course before you call evaluate_generation()
and next_generation()
, you'd have to make sure that all genomes were evaluated.
But honestly, its a complex solution that would require rewriting a bunch of files in the /neat
folder. Not to mention that it would make the evolution process reeaallly slow because of the sequential simulation.
I guess it really depends on what you're trying to do. As you said, if you place the agents in different arenas, it should work. And place_bodies()
would be the right place to start. If it's an asteroids game, perhaps you could mess with collision layers to achieve simultaneous simulation where the agents can't interfere with each other.
Sure we can chat on discord, send me your handle via email: p.straberger@gmail.com. Unfortunately, I don't have a lot of time at the moment, but if you have specific questions, I'll try my best to help you out.
Best wishes, Paul
Alright, since we're on discord now I can close this
Hi!
First off, outstanding work! I can't believe something like this exists for Godot! I am sorry you don't have more recognition for this!
Second. I have gone through the demos, and briskly the documentation, and had a question regarding certain types of environments
Lets say you have a game like tic tac toe, or asteroids, or something like (https://www.youtube.com/watch?v=AW-37sD8O1A).
All these agents cannot participate on the same track/level, and thus must be trained in independent arenas.
How do you go about setting up the training environment?
My though is that you would have to simply create many instances of the training environment in a larger scene, and simply wait for all agents to die/win, then tie all the stuff together as opposed to using 1 environment/level/track, and placing all agents.
Possibly by modifying the place_bodies function to add each body to a different arena?
Maybe I missed something in the documentation, but as far as I am aware of the demos, there is no such example.
Thirdly, is there a place I can contact you regarding this plugin? I noticed you had the reddit post about a year ago, and there is this place, but wanted to know if there is a place your prefer to chat. I potentially have a bunch more questions.