Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the location of the other car #255

Open
nirs opened this issue Oct 27, 2017 · 0 comments
Open

Expose the location of the other car #255

nirs opened this issue Oct 27, 2017 · 0 comments

Comments

@nirs
Copy link
Member

nirs commented Oct 27, 2017

Currently the driver module gets a world object with this interface:

  • wolds.car.x - the x coordinate of the this car
  • words.car.y = the y coordinate of the this car
  • world.get((x, y)) - return the obstacle at location x, y

There is no way to see the other car, so it is not possible to:

  • Try to avoid collisions with the other car when driving in the other car lane (the other car always win)
  • Try to have a collision when driving in your lane (this car will always win)

Unlike the obstacles location, using the other car location is harder; you have to predict the next step taken by the other car, maybe looking at the history of the other car.

I'm not sure what is the best way to expose the other car location - it seems that we cannot use world.get(), since the a car may be in the same position as another obstacle.

Possible alternatives

car() and obstacle() methods

  • world.car((x, y)) - return the car at x, y. Use same interface to return both this car and the other car
  • world.obstacle((x, y)) - return the obstacle at x,y

Expose the raw game state sent by the server

Replace the world object with the state dict sent by the server. The players will have to look for the players and the obstacles, and will have to find an efficient way to find obstacles and cars for planning the next step.

The new drive method:

def drive(state):
    """ Return the next action """

I think the second option is better, making the game more interesting, and the code easier to maintain.

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

No branches or pull requests

2 participants