schrum2 / MM-NEAT

Modular Multiobjective (Hyper) Neuro-Evolution of Augmenting Topologies + MAP-Elites: Java code for evolving intelligent agents in Ms. Pac-Man, Tetris, and more, as well as code for Procedural Content Generation in Mario, Zelda, Minecraft, and more!
http://people.southwestern.edu/~schrum2/re/mm-neat.php
Other
50 stars 20 forks source link

Evolve Missles! #865

Closed schrum2 closed 1 year ago

schrum2 commented 1 year ago

Just saw this video: https://youtu.be/pHx_4jKChbU

This will use the new Explosive Block Set #864 but we need to figure out exactly what the goal is and the fitness function. I suppose this evaluation scheme could involve the placing of a structure near where the shape is evolving, and then after a certain amount of time, we could read the blocks in that space and see how many are left, with the assumption that missing blocks were blown up. This only fully works if the blocks are a type that can't simply be pushed by the pistons, so I guess it needs to be a 6 x 6 x 6 block?

We would also need to spawn each shape farther away from each other than before, since collateral explosions from TNT could cause some problems in how neighboring shapes are evaluated. Might also need to only allow shapes to exist high up in the air, since the ground affects the explosions.

There is a lot to work on here.

Also, this seems related ... something to think about for later: https://youtu.be/lwNeBXieHlw

schrum2 commented 1 year ago

Don't start on this until @JoannaBlatt finishes #870 , though it might be useful for the two of you to work together pair-programming on issue #870 a bit so that you will be able to build on the code she creates.

TjRaffert commented 1 year ago

I am running the first Missile test over the weekend. The target has a slight offset from where it is supposed to go. Despite this it is still good enough to run.

TjRaffert commented 1 year ago

It seemed to have good results on the first run but don't have a good way of evaluating it after the fact. One possible future test would be to split up the area below the target into sections and reward it for blowing up in a good direction and penalizing it in a bad direction.

schrum2 commented 1 year ago

Two issues with evolving missiles. One is that long evolutionary runs crash #883

However, we are also not succeeding in the way we want when it comes to blowing up targets. With the directed missile test, the target is too close. The shape just blows up in a way that flings some TNT at the shape, which then blows up after making contact in order to eliminate some of it. The target has to be much farther away.

@TjRaffert Make the existing directed missile batch files double the space to the target and evolve again. We'll also need to monitor to see if/why things crash.

TjRaffert commented 1 year ago

I am currently running the farther directed Missile tests with the 5x5x5 and 3x3x3 variations.

schrum2 commented 1 year ago

The 5x5x5 shapes seem to be creating 6x6x6 slime targets. This is incorrect and needs to be fixed. @TjRaffert

TjRaffert commented 1 year ago

When we are running tests for this it seems to be maximizing fitness early on in a lot of bins. Then it reverts back to where it should be.

schrum2 commented 1 year ago

This definitely needs unit tests to figure out what is going on with the fitness. This may not identify the fitness issue that affects starting generations, but having thorough unit tests is a starting point.

TjRaffert commented 1 year ago

There seems to be a bug in the code. When trying to unit test. The target seems to be spawned based on the prior test. This could be the reason for our error.

TjRaffert commented 1 year ago

https://drive.google.com/file/d/1lijatBZc8SgkDUV-r1AmRpeEUKf-Z-GN/view?usp=drive_link This is a machine that got registered as a flying machine initially. During the post spawn evaluate it gets different results. oscillating? false farthest center of mass : (-498.875, 100.5625, 500.75) noMovementCount: 0 yesMovementCount: 1 result : null shape not moving, calculate final score early XX CALC FINAL SCORE RETURN result final score fitness: 0.44384725503541256 ChangeCenterOfMassFitness: 0.44384725503541256

schrum2 commented 1 year ago

@TjRaffert I just made big changes to the change center of mass fitness #890 that I hope will fix this problem, so run another experiment to test. Also, I think the previous comment should actually have been in #908

schrum2 commented 1 year ago

An earlier concern in this thread was that fitness was being maximized early on, but then reverting to lower values and seeming to evolve "as normal." However, closer inspection revealed that the colors we were seeing in the gnuplots were an artifact of the number of bins being so high. The background was yellow, but actually the bins were empty. They did not contain max fitness.

Since this is no longer an issue, and the concern about flying machine fitness for TNT machines is being addressed in issue #908 , I'm closing this issue.