Rivers, terrain rendering improvements

Posted by Oleksandr on May 19, 2018

May 2018 development update (v4) introduces rivers, and contains many improvements and tweaks for the terrain rendering.

Rivers

Rivers flow between tiles, make the world more appealing visually, and affect gameplay. Riverbank areas get additional 1 food (and a minimum of 2 food), and yield at least 1 production and 1 trade. This can make even desert or tundra tiles useful in presence of a river. Moving units across rivers takes all of their remaining movement points, unless there is a road (i.e. bridge). Melee attacks across rivers have a 50% penalty. Additional gameplay effects are likely to come in the future.

Interesting facts about technical implementation of rivers:

Rivers are generated starting from the ocean tile, and then moving inland step by step, taking random turns. There are checks to make sure that rivers does not intersect itself, or enter another body of water.

Tributary rivers are generated with a second pass, starting from certain points on primary rivers.

When generating terrain surface, river segments are smoothed and distorted to make them look natural, instead of going exactly along angular tile edges.

Various overlays (roads, tile highlights, etc) are rendered with additional elevation over rivers. This way roads become bridges, and highlights are continuous without a drop in geometry.

Additional shadows are generated below road bridges.

Other visual improvements

Oceans now have two levels of depth: shallow (near the coast), and deep. Ocean floor now has a varied non-flat surface. Transition from ocean to unexplored tiles is now smooth without a visible geometry break of the seabed mesh.

Unexplored tiles themselves are covered with soft gray shading, which makes it easier to see world boundaries and where your visible area is in it. Also if you try to scroll too far away from the world, camera will automatically bounce back, so that you never get lost in the dark.

Forests now use three different tree meshes depending on the climate zone, with gradual transition between them. Warm areas use palm trees, cold areas use pine trees. Terrain surface shader has been tweaked to increase detail at a close zoom level.

All important changes since v3 release (January 2018)

Rivers.

Improved forest meshes, now with 3 different types depending on the climate zone.

Added extra detail in the terrain surface shader.

Camera now automatically bounces back to the world area if you move it too far away.

Improved visuals for oceans and unexplored tiles.

There are now deep and shallow ocean tiles.

Seamless terrain LOD transitions.

Blog improvements (pagination, sidebar).

Users can now submit feedback by using form on the website.

Improved HTTP error pages (404 Not Found, etc).

Further backend work (deployment scripts, analytics, etc).

NOTICE Browser feature required for Statebuilder to work out of the box (SharedArrayBuffer) have been unfortunately disabled by all major browser vendors in January after the Spectre CPU vulnerability was discovered, since apparently it can be used to implement high-precision timers needed for the exploit. This means that for now users have to manually enable the option to try the game. Google Chrome is expected to re-enable it by default soon (relevant bug).