schrum2 / EvoCraft-SCOPE

0 stars 0 forks source link

Confine the snakes #40

Closed schrum2 closed 2 years ago

schrum2 commented 2 years ago

Make a command line parameter CONFINE_SNAKES that is used with the snake generation option #23

Then, have two options for how to confine the snakes.

REDIRECT_CONFINED_SNAKES: When used, directions that would lead outside the confines of the fence or under ground will be impossible (their direction preference replaced with float(‘-inf’) which will make the direction impossible to select). The next best option will be chosen.

STOP_CONFINED_SNAKES: Whenever a snake chooses to go out of bounds, simply set the stop condition to True so no more blocks are generated.

richeyme commented 2 years ago

Both redirect confined snakes and stop confined snakes work as they should. The redirect method makes the snakes a lot more curly and the stop method makes very linear snakes