renardyreveur / hide-and-seek

2 stars 0 forks source link

Create an option for borders in the world generator #1

Closed renardyreveur closed 3 years ago

renardyreveur commented 3 years ago

Currently, the environment does not have an option to turn on/off borders.

When testing agents, sometimes it's useful to turn on borders, and so it'd be great if the Map initialisation has an option to do so.

Simply padding the map array with 1s on all 4 sides of the border with a certain thickness when the option is turned on will be good enough as a start!

A sample is in the test.py file where I've hard-coded a border wall with a thickness of 5

    envn = Map(SIZE, SIZE, 10)
    envn.make_walls()
    world = envn.map
    world[0:5, :] = 1
    world[world.shape[0] - 6: world.shape[0] - 1, :] = 1
    world[:, 0:5] = 1
    world[:, world.shape[1] - 6: world.shape[1] - 1] = 1
renardyreveur commented 3 years ago

Resolved with commit 194fd92bc2f635ce65ebbe1abf78c77e8b3de55b

Closing issue!

Thanks Jooyoung!