You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
defdrive(state):
""" Return the next action """
I think the second option is better, making the game more interesting, and the code easier to maintain.
The text was updated successfully, but these errors were encountered:
Currently the driver module gets a world object with this interface:
There is no way to see the other car, so it is not possible to:
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
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:
I think the second option is better, making the game more interesting, and the code easier to maintain.
The text was updated successfully, but these errors were encountered: