Winds of Trade now has... well, winds

Last night I took a few hours to implement basic wind behavior in the game. After all, a game set in the "Age of Sail" definitely should have wind affect the whole trading system. Wind severely affects the ships' speed, thus it also affects travel time and which trade routes are more profitable than others.

Moving a fully-loaded galleon against a strong wind could prove to be frustrating and almost impossible, while your small and sleek schooner (full of illegal goods, of course) can ride the waves swiftly when the air is blowing in the right direction, so no pirates or port authorities will ever dream of catching you and your ill-gotten rum.

From a technical point of view, this basic wind implementation has two parameters that define it. Yes, you guessed right, speed and direction. Those two parameters slowly change over time. The wind speed changes in such a way that it will always try to remain around an average value, with a few calm days and a few windy ones. Here you have a distribution chart with the wind speeds of 2 game years:


Regarding the wind direction, the current implementation is really simple but it still provides a good user experience. Basically every 30 or 40 game days I decide a new direction for the wind to blow from and I slowly start interpolating so it changes just a little bit every day towards that direction. When that direction is reached it remains there with just some small random variations.

Here you have a couple of videos showing how the smoke coming out of buildings is affected by different wind speeds. I thought that was an important detail to consider, so the player can simply take a look at the smoke columns and find out how strong the wind is and where it comes from. Of course, he can also use the compass in the minimap, but seeing how the smoke behaves provides very immediate and intuitive feedback.


Comentarios