Around The World, Part 35: Sailing

This post is part of a series about Around The World, a game of exploration and discovery at sea. The game is currently in early development. If you're new to this project, you can read up on it here.

After all the procedural generation and visuals, we’re finally getting into game design and gameplay territory! And none too soon.

In Around The World, the player sails a fleet of ships across the sea. This sailing forms the innermost “game loop” if you will, so it’s important to get it right. How exactly does the player control the fleet? Bear in mind that the game uses a third-person “chase” camera hovering behind the player’s flagship.

In the prototype, it was a simple point-and-click interface as you’d see in RTS games: the player clicks, and the ship sails in a straight line to the clicked point. The prototype had no pathing logic; if the ship hit land, it would simply stop. This works well for a top-down 2D game, and could be done in 3D as well.

In fact, this is how I originally implemented it: just right-click on a point (land or sea) and the ship will sail towards it… but with some subtleties because life at sea is never easy.

If you click on land, the ship will keep its bow pointed at that point and keep going until it has been reached.

If you instead click on water, the ship will sail to that point but continue on past it, letting you set a course into the open sea without having to keep clicking. In fact it will maintain a fixed compass bearing, but due to wind and currents this might not be the actual direction of movement! Information from charts can help you compensate for this, giving charts another use besides just finding the next port.

But what if there’s an island or other landmass in between? Would you need to click-click-click throughout the route to plot a course around it? That would be really tedious. Rather, the ship should figure this out on its own using a pathfinding algorithm. I had this implemented, but it never felt quite right, not to mention that limitations in Godot’s navigation system caused the ship to behave weirdly and sail away from the goal sometimes.

The problem is that this approach, especially with automatic pathfinding, gives the player little control over how the ship sails there. What if there are obstacles along the way? One gameplay mechanic I would like to support is underwater hazards like reefs, sandbars and rocks; you would need to use charts to avoid these. So maybe a more direct control scheme would be better.

WASD or arrow keys

The obvious candidate for more direct control would be WASD keys, like in a first or third person shooter. (Actually, I prefer ESDF on qwerty layouts and .OEU on dvorak, but that’s a story for another time.) With one difference: you don’t have to hold down the up/forwards key to keep sailing; you just press it once to raise your sails, and off you go. I quickly implemented this, and it just felt much more immersive and powerful than point-and-click control. This was a keeper!

  • controls and how they changed from point&click to WASD
  • sails animation
  • wake rendering
  • time warp
  • wait for sunrise
  • port interaction buoy