schrum2 / EvoCraft-SCOPE

0 stars 0 forks source link

CPPN encodes orientation of each block as well #17

Closed schrum2 closed 2 years ago

schrum2 commented 2 years ago

Currently, we are just orienting each placed block in the same way, and for most blocks that is fine. However, for some (especially pistons) the orientation matters. See how different orientations are implemented in the original interactive evolution project (code moved to the directory originalinteractive) and see if we can do something similar. This will definitely require our CPPNs to have additional output neurons.

schrum2 commented 2 years ago

Actually, I think the way to do this is straight forward. Have a command line parameter EVOLVE_ORIENTATION that added 6 outputs to the CPPN (one for each direction), and whichever of those outputs is maximal determines the orientation of whatever block is currently being placed.

schrum2 commented 2 years ago

I think it's safe to start this now. You'll need a command line parameter, you'll need to correctly set config.genome_config.num_outputs in evolution.py to the right number, and the rest will happen in the generate_block function of cppn_generation.py. @richeyme has already done something similar in this function for the Snake issue #23 by adding 7 additional CPPN outputs, 6 of which are used to pick what direction to move in next. You will only need 6 additional CPPN outputs, and will decide how to orient the block rather than which way to move.

However, I think you also have to consider the case where the orientation is evolved AND a snake is being evolved. This means the total number of CPPN outputs is 1 + num block types + 6 + 1 + 6. The 6s are from the NUM_DIRECTIONS (one for orientation and one for movement), the first 1 is for the presence output, and the second 1 is the the continuation output used in the Snake problem.

MuellMark commented 2 years ago

2022-05-24_15 24 21 2022-05-24_15 24 39

These two images showcase that snakes can now be regenerated with different kinds of blocks, with evolved orientations

MuellMark commented 2 years ago

It is now possible to evolve orientations with blocks. First it was added to normal shapes, then to snakes. With evolving blocks enables, you can change the block types but keep the original orientation. Also, The ability to evolve the blocks for snakes was also added here, as it was a quick fi and we found out about it during implementing this 2022-05-24_14 43 12