You can find your Assignment 3 grade and comments in your mailbox. Click “more” to double check that the grade is entered correctly. As usual, if there is any surprise in my comments and your grades, let me know ASAP.
This is an open ended assignment and many different solutions are submitted. The best (and closest to the solution I came up with) is the one by Yang Shun and Hieu (read their report here). Basically, the idea is to find the set of ships that could possibly collide with a rocket, and only send the “fire” commands to these ships. Two other teams have similar solutions. This turned out to be tricky to compute, but with some thoughts, it is doable.
Another popular solution that does not work as well is to use cell-based, distance IM (either a fixed distance or a “cross” ala Problem Set 2). If “turn” or “fire” are sent only when the ship/rocket enters into the AOI, the player will see sudden appearance / teleportation of ships/rockets. Depending on the implementation, this could be either subtle or annoying. Another tricky part is to compute the cell a ship/rocket is in efficiently. If you compute the cell every gameLoop(), it is going to be slow. So you need to predict when a rocket/ship will cross the boundary and update the cell the rocket/ship belongs to only then.
Most of you got the efficiency part right, by considering only rockets and ships in each other’s AOI. But, note that if you recompute the AOI of every rocket and every ship in a loop before checking hasHit(), it does not actually make it more efficient! It would be more efficient only if hasHit() is more expensive to compute than the AOI, which is not the case here.
Several teams tried the multiple server solutions, but none got it perfectly right.
024U 12 063M 16 075E 13 076N 14 103N 12 217A 12 234N 14 422A 13 441B 10 454U 10 498A 16 541L 12 557Y 12 613L 12 656X 13 676R 13 683X 13 695H 13 718U 13 726B 13 734A 15 742W 12 747W 13 751U 12 758E 12 812X 14 829B 14 856J 12 860W 13 909Y 12 924M 12 924R 13 934R 15 988U 12 998R 13