Soo… I stream every two weeks, today was one of those weeks, so you can even watch this devlog in the four hour long stream version where I actually implement these features. In this stream I also go into a little bit of detail on how I did the procgen for the islands. I’ll try to do a devlog on how I did those somewhere in the future when I actually fully finish the island’s gameplay functionality as well.

Now, to get into the things I’ve actually done.

A core part of the game is the magic system that the player uses to fight enemies. I wanted to make more use of this systems besides combat, and one of the first places I wanted to do this, was in the steering of the boat.

The boat has the functionality of transporting the player from each “choose-your-own-adventure” styled island to the next, while occasionally encountering a group of enemies. However, I didn’t want the player to just control the boat by tugging on a steering wheel (or whatever you call that on a boat), but instead to use a spell to do it instead!

For now, it uses any form of the “beam/ray” spell that I already implemented, but my plan is to make a “wind direction” spell for this specific task that the player can use.

How it technically works, is that I just take the angle from the spell direction when it’s being cast, the mast object then uses this angle to lerp towards (making that satisfying turning animation). After that is done, I make the actual ship in the overworld turn as well, but at a slower rate so that the player has a chance to see it happen as well (plus a boat is very heavy so needs more time to rotate).

Technically I can also make the boat representation of in the player’s view rotate, however, since the game relies on a grid of spells with close coordination of the player with those locations I’ve decided (for now) that the boat in the player view doesn’t rotate with the actual rotation of the ship.

So another challenge for today was making this ship actually stop at one of the island if a player desires it. To do this, I actually found a whole laundry list of bugs in my rendering code for the sea, but I’ll skip over that for now. If you feel like watching me struggle with that for about an hour, check out the stream (link somewhere above).

After fixing those bugs, the implementation is somewhat simple: I start with getting the closest dock, so I just have to run a calculation for it, instead for all. Then I just take the distance between the ship and the tip of the dock, see if it’s within a certain actuating distance and start to slow the ship down.

This actuating distance is just the radius away from the dock, at which I want the ship to start to slow down. I can make this bigger or smaller dependent on how easy I want the ship to dock.Once the ship is within that distance, I divide the actual distance to ship by the actuating distance, causing it to start at 1.0 at the edge of the actuating distance and getting closer to 0 when approaching the point. Then I just make sure that below a certain threshold that percentage is always 0, causing the boat to be at standstill.

To leave the dock, I just turn of that threshold, and the ship will start to move further away from the dock edge, slowly speeding up again!

That’s it for today, I might do another small update tomorrow or go a little bit more indepth on the island generation soon.

Thank you so much for reading, feel free to leave a comment if I’m a little vague or if I didn’t write something clear enough. Also feel free to message me any time, on any platform with questions!

Cheers!

~ Bram