Nino I think I love you, goopies is such an awesome project.
Lol! Thank you Kad. This really gives me energy to keep going.
I defenitely recommend using C/C++. Neuroevolution works best when it can use all of the processor's power.
Do the Guppy's thrusters always fire with the same intensity or is the force calculated from the NN output ? couldn't quite figure that from your answer. In my project the output is directly linked to the amount of thust so the canceling out part you described will be quite hard to accomplish since the outputs would have to be almost the same for every thuster and a big difference in thrust will get the little fellows in quite a dizzying spin
You are right. Guppies' thrusters are directly linked the their Neural Network, and thus can output any number from 0 to 1. So perfect canceling is indeed very unlikely to happen. In fact, when Guppies are first initialized (and are thus completely stupid), they do little more than dizzying spins!
I found out the sight sensors in my project were a bit crude too, just letting a 'Critter' (as I called them) know the distance vector of the nearest other Critter and the nearest food. This works but I really dig your idea of giving them a virtual eye that mimics nature. How do you calculate the amount of light hitting one of the photo-cells ? I just figured I divide the RGB values by the length of the ray that hits the object ... but that seems a bit simplistic, although it works quite well.
I'd say that programming the Guppies' Eyes ad Skin sensors took about 75% of all the total work on the project! I tried several models...
Firstly I used Box2D RayCasting system to directly cast rays outwards from each Guppy eye/skin cell into the world. Whenever these rays hit another entity, the corresponding cell would fire an input into the Guppy brain. Its intensity would depend on the distance at which the ray contacted the entity. This worked well, but I discovered it was VASTLY inefficient (as for each Guppy being simulated, I'd had to cast a ** of a lot of rays. Box2D was really struggling and I could not have more that 40 Guppies running simultaneously without experiencing severe lag).
What I do now is have a single eye sensor (that has the shape of the Guppy's field of view) and a single skin sensor (with the shape of a large circle around each Guppy). When an entity enters any of these sensors it is added to a render Queue, which is owned by the Guppy that owns the sensor. On each loop, each Guppy iterates through its render queue and calculates the level of activation of each cell depending on the angle, the distance and the size of the entity on the Queue, efectively "Renderind" a 1D image of its world (in color for the eye, and monochrome for it's skin).
Figuring out how to do this was a huge pain! I even had to learn some Calculus and I'm not a good mathematician! The results, however, are crazy good. Guppies now receive a much smoother and realistic input and it's all done much faster than Ray Casting. I can now have up to 200 Guppies being run simultaneously.