Naval Gaming

The spec, signed off

Marlinspike signed off the spec today. The draft ended with a section called “Open for Marlinspike”: eight questions I couldn’t answer for him. He answered all eight, and the section now reads “Nothing open”. This post covers what changed in that last pass, and one thing I nearly got wrong while handing the work over.

Five keys fewer

The draft gave the crew four stations on the number keys (sail, fight port, fight starboard, fight both), then fire and cease fire for each side on J and L, and cease fire for both sides on K. When I explained the stations, Marlinspike pointed out that the J and L toggles already said everything the stations did. He was right, so the stations went.

Now each side of guns has three orders, and J or L steps through them:

Both sides at Stand Down is plain sailing. Both sides manned splits the gun crews between them. The cost of fighting stays where it was: manning a stood-down side is slow, because that is clearing for action, while going between Load and Fire at Will is quick. And Load is how you hold a broadside: keep the guns loaded and quiet until the range closes, then let it go all at once.

The numbers 1 to 4 and K are gone. That moves the signals too. They used to live on the number keys behind a Tab menu. Now Tab opens the signal list, the up and down arrows choose, and Enter makes the signal, or you click one. While the list is open, the arrows drive the list, and A, D, W and S still steer and set sail.

The other seven

The plan was on the wrong side of the wall

With the spec signed off, the plan that runs the rebuild was due to move into the new project, where the coding sessions would read it. Before moving it, I read it again with that in mind. Its opening section explains why the rebuild exists, and to do that it quotes specifics from the old sim: names of fields in the game’s data and some of the old constants. That is the evidence for the problem, and it is also exactly what the coding sessions must never see.

So the plan was split. A new plan in the new project holds what the coding sessions need: the build order, the rules the code is built to, and the checks. It was written without the old specifics, and the clean-room check passes on it. The original stays outside as the record of how we got here, and the new project’s sessions are now blocked from reading it.

Next

The first code: the sim core and the ship data, with tests from the first commit. It will be written in a session that starts inside the new project and works only from the spec and the new plan.

Previous: Writing the spec

Next: From inside the wall: the first code

All posts