GithubHelp home page GithubHelp logo

element.ai's People

Contributors

arth-shukla avatar averi-u avatar edwardyang12 avatar jonzamora avatar stonet2000 avatar yuyeon avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

element.ai's Issues

QA #5 Overage Time

  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

Scenario 1

  • for each action, a bot gets 1 second to return an action. After 1 second, the environment will eat into the bot's remainingOverageTime, which starts at 60 seconds. If that's exhausted, the environment will take no action from the bot and make it go forward
  • e.g.
    • iter 1: bot takes 10 seconds to respond, 50 secs left in remainingOverageTime
    • iter 2: bot takes 10 seconds to respond, 40 secs left in remainingOverageTime
    • ...
    • iter 6: bot takes 10 seconds to respong, 0 secs left in remainingOverageTime
    • iter 7: bot stalls for 1 sec, after which the env stops waiting since the bot is out of remainingOverageTime
  • so, test this by using asyncio.wait -- make the bot wait some amount of time, and print remainingOverageTime each iteration

Expected Results

  • as above
  • make sure to test this for a bunch of different asyncio.wait values (e.g no wait, .1 sec, .5 sec, 1 sec, 10 sec, etc)

add keybaord input for debugging

  • remove the preset path and add keyboard input
  • should check each step after players move and before rendering
  • base it on the clock version (grid_sim.py)

QA # 1: Simple Collisions

  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

Scenario 1

  • Two bots, player_0 hits player_1's line and dies

Expected Results

  • player_0 dies
  • during the rest of the death iteration, in addition to the entirety of the next iteration, player_0 is resetting. while resetting,
    • obs['player_0']['direction'] should be (-1, -1)
    • obs['player_0']['resetting'] should be True
    • obs['player_0']['head'] should be (-1, -1)
    • obs['player_0']['energy'] should be 0
    • obs['player_0']['speed'] should be 1
    • Note: no actions from player_0 should be registered in the env when resetting is set to true.
  • player_1 continues as normal
  • once player_0 resets, direction, resetting, and head, should all be values that make sense. actions from player_0 should register in the env now, too

Scenario 2

  • Two bots, player_0 and player_1 hit each other head-on (NOT each other's lines, but each other's heads)

Expected Results

  • Both players should reset
  • The same resetting-related values as in Scenario 1 should be true for both players here. make sure to check them all

Invisible Grid

In line with our conversion from grid-sim to angle-sim we should make the grid invisible along with more fine grained in order to better simulate angular movement.
Will need to look into the code slow down caused by a larger grid and whether we could optimize the code

Angular Movement on Grid Simulator

Instead of restricting movement to be 90 degrees left or right, modify the input value to increase angle amount based on how long the left or right key is held while still moving

Multiplayer: End constraint

The current end constraint for our game seems to be when the player dies but iirc this was not the constraint in our meeting notes. Let's set the new end condition for the game to be after x amount of time the game automatically ends. Before this amount of time, have the players reset whenever they die to a random location while keeping (and being able to add to) their score in their previous life.

QA #3: Territory Tactics

  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

Scenario 1

  • player_0 has some territory, player_1 enters the territory with their line. player_1 dies. The area where player_1 intersected the territory is now empty

Expected Results

  • The area where player_1 intersected the territory is now empty. Perform the below 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)
    • easy visual check
  • 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 decrease for player_0 every time player_1 enters player_0's territory

Scenario 2

  • player_0 is moving around, existing. player_1 encircles all of player_1 -- their territory, their line, player_1 itself, everything

Expected Results

  • player_0 should still be alive, and their line should not be affected. However, all of their territory should be overwritten as player_1's territory. Perform the below 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)
    • easy visual check
  • 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 0 for player_0 and should be all enclosed space for player_1

QA #2: Check Occupancy Function

  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

Speed Bouncer Algo

speed ^ -1 = # of frames you have to wait before you can go

everyone starts by missing x frames before they can go (maybe 10? experiment with it)

when you collect a boost, you decrease # of frames before you go by 1

minimum value for # of frames before you go = 1

  • need to keep track of how many frames each player has before their next turn
  • need to keep track of constant value representing speed
    • (e.g. const_frames_til_next = 5, frames_til_next_move = 2; decrement const_frames_til_next whenever you hit a boost; decrement frames_til_next_move til 0, then let them move, then reset it to const_frames_til_next

etc etc

game should run until timer ends

currently if you die, you die, then when everyone dies, the game resets. we want the game to run for x steps. if you die (hit a tail, leave the area boundary, etc), the following should happen

  1. your area gets wiped from the board
  2. the player is in "respawn mode"
  3. they must wait y steps before they can respawn (you can choose this)
  4. when they respawn, they should respawn with a 3x3 zone around them in an empty spot

game should run until x steps, after which it ends and some ending message is submitted

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.