schrum2 / EvoCraft-SCOPE

0 stars 0 forks source link

Control evolution from inside of Minecraft #4

Closed schrum2 closed 2 years ago

schrum2 commented 2 years ago

The approach proposed by #1 should work, but going back and forth between Minecraft and the external console is not fun. It would be way better to select objects to evolve from inside the game directly.

I'm not sure what the full range of possibilities of the EvoCraft API are. I know that Minecraft support switches, buttons, pressure plates, etc, and any of these could be used as a means of selecting objects to evolve in the game. However, I don't know if the EvoCraft API is capable of detecting the various possible states of these redstone components, which would be required for the evolution code to know which shapes were selected.

However, I'm fairly certain that the EvoCraft API can detect when a piston is extended (the extended portion is its own block type that can be read from the world), so here is my idea. Put a face-up piston in front of each object. Set up some kind of switch or other mechanism that supplies power to the piston and extends it. If the piston in front of a shape is extended, then it is considered as selected. If the piston is down, then the shape is not selected.

In addition to this, you will also have to have some sort of mechanism (could also be a piston) that the user activates to indicate that the selection process is done, and the code can move on to generating shapes for the next generation.

richeyme commented 2 years ago

This is my idea for what the lever mechanism should look like: 2022-05-18_13 30 00 2022-05-18_13 30 09 2022-05-18_13 31 57

richeyme commented 2 years ago

This is another model with a redstone lamp that turns on and off instead of a glow stone that pops up: 2022-05-18_13 50 08

2022-05-18_13 51 22

2022-05-18_13 53 23

richeyme commented 2 years ago

This is what I have so far for each of the structures 2022-05-18_16 23 45

schrum2 commented 2 years ago

All we need now is the switch that advances to the next generation. However, as Mark found out #13 , some block combinations destroy a lot of the ground. We will need to add some checks that reconstruct the control switches if they are ever destroyed ... eventually.

richeyme commented 2 years ago

This is what the switches (both the selection and next gen) look like: 2022-05-19_15 16 57