Skip to content

QA #2: Check Occupancy Function #22

Description

@arth-shukla
  1. all print statements should be printed to stderr, NOT stdout (printing to stdout will break the program) i.e. print(stuff, file=sys.stderr
  2. in addition to the expected results, please check ALL other items in obs['player_0'] (or whatever player number) to make sure everything makes sense (e.g. obs['player_0']['resetting'] is not True while the players should be alive). if smth seems off, pls flag it
  3. if the respawning bombs and boosts are annoying, at line 208 change self.place_boost_bomb(rate = 0.1) to self.place_boost_bomb(rate = 0). make sure you don't commit this change
  4. once done, @ me in the comments and explain what you found

Tests

  • Please check this scenario with multiple different enclosings, not just one. Different shapes, sizes, etc.

Scenario 1

  • You only need 1 bot for this one
  • player_0 moves around the map (without dying) and returns to their zone, enclosing an area
  • Please test with bombs and boosts - you can turn off bomb/boost respawning if you want, but at least keep the initial bombs and boosts. This is because, if an enclosed territory includes bombs or boosts, that will still be considered a part of that territory

Expected Results

  • Perform both checks
  • Visual check via the replay (include -o test, which outputs to test.json. upload test.json to the replay script: https://colab.research.google.com/drive/1ncSEI2xelHIanrWlnqZVIWYn51UTqq7g?authuser=1#scrollTo=zUWD3nDJ4kOi)
    • all of the area that player_0 encloses (including this own line) should become a part of the zone
    • no area outside of this should be enclosed
    • If there is a bomb or boost, it's still there on the board, but it's added to player_0's territory in obs['board']['players_state']
  • Programmatic check for values
    • set board = obs['board']['board_state']
    • set player_owned = obs['board']['players_state']
    • set player_num = obs[self.player]['player_num'])
    • set PASSED = 1
    • set occupied_territory = np.where(np.logical_and(board != PASSED, player_owned == player_num))
    • find num_squares = len(occupied_territory[0])
    • num_squares should be the correct number of tiles occupied

Scenario 1

  • You need 2 bots for this one
  • player_0 has some territory. player_1 intersects that territory and encircles it such that some of player_0's territory is inside the encircled area
  • player_0's territory inside the encircled area should be overwritten as player_1's territory
  • Please test with bombs and boosts - you can turn off bomb/boost respawning if you want, but at least keep the initial bombs and boosts. This is because, if an enclosed territory includes bombs or boosts, that will still be considered a part of that territory

Expected Results

  • Perform both checks
  • Visual check via the replay (include -o test, which outputs to test.json. upload test.json to the replay script: https://colab.research.google.com/drive/1ncSEI2xelHIanrWlnqZVIWYn51UTqq7g?authuser=1#scrollTo=zUWD3nDJ4kOi)
    • all of the area that player_0 encloses (including this own line) should become a part of the zone
    • no area outside of this should be enclosed
    • If there is a bomb or boost, it's still there on the board, but considered a part of the territory
  • Programmatic check for values
    • set board = obs['board']['board_state']
    • set player_owned = obs['board']['players_state']
    • set player_num = obs[self.player]['player_num'])
    • set PASSED = 1
    • set occupied_territory = np.where(np.logical_and(board != PASSED, player_owned == player_num))
    • find num_squares = len(occupied_territory[0])
    • num_squares should be reduced for player_0 and increased for player_1 by the correct amounts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions