Introducing support for mobile devices
Posted by Oleksandr on June 26, 2019
June 2019 development update (v6) brings support for mobile devices, engine and infrastructure improvements for the game and the website, and plenty of bugfixes.
Running on mobile devices
Most of the work this development cycle was spent implementing all the required changes for the game to be able to run smoothly on (relatively) underpowered phone hardware, supporting small screen sizes in the UI, and making it installable as an app.
Currently, you would need Chrome or Firefox on Android. iOS support will come when Apple implements
missing features in their browser engine. Also right now you would need to enable
experimental WebAssembly threads support in your browser of choice. In Chrome, open
chrome://flags
and set WebAssembly threads support
to "Enabled".
In Firefox, open about:config
and set javascript.options.shared_memory
to "true".
Installable app
You can now install the game as a Progressive Web App. This works both on desktop and mobile. When in game, open the main menu and press "Install App...". You will get the launcher icon on your desktop / app drawer, and the game will now run in its own window / fullscreen activity, separate from the browser.
All important changes since v5 release (March 2019)
- State borders are now easier to read when the camera is zoomed out.
- Improved performance of "Switch Perspective" feature in the demo mode.
- Improved support for high resolution screens (at 2x and higher pixel ratio).
- Implemented responsive UI layouts for narrow screens (i.e. mobile devices).
- Touch gestures from the edge of the screen are ignored to avoid interfering with system UI on mobile devices.
- Client is automatically reloaded on reconnect when a new version is available.
- Camera position and user settings are now persistent (saved locally).
- "Waiting for server reply..." message is shown when the server reply takes too long to arrive.
- WebAssembly is used instead of plain JavaScript, which improves performance.
- WebGL 2 is used when available, to reduce CPU overhead.
- Implemented support for ASTC texture compression format in the tools and the game engine, needed for mobile devices.
- The game is now installable as a Progressive Web App on desktop and mobile.
- Improved handling of errors and network offline state on the loading splash screen.
- Adopted modern JavaScript and CSS features, dropped support for legacy browsers.
- Gallery mode for images in the blog. Improved layout of images on blog pages.
- Website remains readable even when JavaScript is disabled.
- Improved internal analytics tools. Client-side crashes/errors are now recorded.
Naval units, new demo mode features
Posted by Oleksandr on March 3, 2019
March 2019 development update (v5) introduces naval units, improved world generator with support for multiple continents and islands, AI logic to support naval exploration and combat, and some new features in the demo mode (when observing AI players).
Naval units
- Trireme: First available ship, can only move near the coast (in shallow waters). Carries 2 units.
- Caravel: Can go into the deep ocean. Carries 2 units.
- Frigate: First ship capable of bombarding coastal tiles. Carries 3 units.
- Ironclad: Combat-focused unit for establishing maritime supremacy. Can bombard. Does not carry units.
- Transport: Specialized on ferrying land units. Can not attack. Carries 4 units.
- Cruiser: Fastest ship available (4 moves per turn). No bombard. Does not carry units.
- Battleship: Toughest ship with heavy weapons. Can bombard. Does not carry units.
Bombarding works like a siege attack and does collateral damage to all units and the city on a tile. Unlike the siege attack, it does not require one turn of preparation.
Ships can move into coastal cities. This means that you can build a canal city linking two bodies of water together.
World generator can now produce multiple continents and islands, and ensures quality of player start locations by scoring each tile for quality of the area nearby, and then selecting start locations only from the top 25% of them.
AI logic to support naval units and multiple continents
The AI implementation had to learn a lot of new things to deal with the fact that there is now more than one landmass, and that units have to be carried by a ship to get across.
The major new thing is that now it parses the world into zones (either water or land), and manages exploration, expansion, and warfare separately for each zone.
When a land unit wants to get to a different landmass, it invokes the pathfinder to build a path which would get it there if the unit was capable of moving on water tiles. Then it checks which water zone did that path cross, and request a transport within that zone. If there is a transport available, it gets assigned to the job, otherwise the transport request will prompt coastal cities to construct it. The transport will then try to pick multiple passengers and unload them at a closest viable location on the target landmass.
New features in the demo mode
You can now speed up animations (up to 8x) by pressing the "fast forward" button in the bottom right corner. The button cycles between these presets: 1x (with all the normal animations and delays), 2x, 4x and 8x.
"Switch perspective" button in the bottom left corner above the unit context panel can now be used to observe the game from the perspective of another player (the one you have selected currently).
All important changes since v4 release (May 2018)
- Added naval units.
- Transports: certain ships can carry land units.
- Bombard: certain ships can bombard enemy targets on coastal tiles.
- World generator can now generate multiple continents/islands with a specific target of total landmass in the world.
- Quality of player start locations is now ensured (enough land with good workable tiles around).
- AI now has awareness of continents and oceans (separate zones of land/water mass), and can plan its strategies accordingly.
- AI can use transports to carry units from one landmass to another.
- In the demo mode you can now speed up animations (up to 8x) and switch perspective (observe another player).
- Better camera behavior when bringing into view locations at the edge of the world.
- Implemented a CPU profiler to help diagnose performance issues.
- Added debug commands to modify the world to speed up iteration times during development.
- Minor website and blog improvements, in particular bot spam prevention.
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).
Combat mechanics update, supply units, military ranks
Posted by Oleksandr on January 1, 2018
January 2018 development update (v3) brings new gameplay and UI features, and other changes, which are available in newly created game sessions and in the demo.
Melee and siege units now deal collateral damage to other units on the same target tile when attacking. The exact amount of such damage is proportional to unit attack strength (bonuses included), but is weaker than damage done to the primary target. Siege attacks don't have a primary target, but instead hit every unit in the target tile with collateral damage. Cities are also affected by these attacks: stored food supply is destroyed, which can cause population to drop.
Collateral damage mechanics with a new limit of 4 units per tile should effectively deal with the "stacks of doom" issue, while at the same avoiding the "carpet of doom" of 1 unit per tile setup, where battlefield logistics can quickly turn into a nightmare.
Each move near an enemy military unit or a city with stationed units now takes all remaining move points, due to these tiles being in the "zone of control" of the enemy player. Such tiles are highlighted with red glow when you're moving units.
Path preview when moving a unit now uses red arrows and special marker to visualize attacks. It is now also possible to get move preview for units not controlled by the player. Simply try to move them as if they were your units and you'll see the calculated path (but of course the command itself won't be executed).
For attacks there is now a combat preview UI that accurately predicts the outcome of a battle. It shows all affected units (including those hit by collateral damage). When attacking a city, stationed units are not known in advance, so in such case you won't get an accurate prediction.
Now you can restore health of military units on the battlefield (or elsewhere) without pillaging by using supply units (Supply Wagon and later Logistic Support). When such unit is nearby, "Resupply" action becomes available, which recovers health at the expense of supply unit's health. This action takes one movement point.
Military units now earn combat experience which improves their performance (up to 50%). Based on experience they get assigned ranks (Regular, Veteran, Elite). Veteran and Elite units are marked on the world map with badges. Certain city buildings (Barracks, Military Academy) provide experience for newly produced units. Unit experience decays over time unless stationed in a city with military buildings.
Some of ancient-era units have received modern versions available after researching certain technologies:
- Explorer (replaces Scout): faster movement and more durable. Unlocked by Invention tech.
- Pioneer (replaces Settler): with more health and defense strength. Unlocked by Invention tech.
- Engineer (replaces Worker): 50% more efficient and can build Railroads. Unlocked by Railroad tech.
AI got some updates to work with the new gameplay mechanics, in particular supply units. Also it is now better with exploration.
All important changes since v2 release (September 2017)
- Melee and siege units now deal collateral damage to other units (and city) on the same target tile.
- A single tile can now contain no more than 4 units.
- Units now attack with reduced strength when movement points are exhausted.
- Zone of control.
- Improved path preview visualization when moving a unit.
- It is now possible to simulate and preview moves for units not under player's control.
- Improved UI for stationed units in a city.
- Combat preview UI.
- Supply units (Supply Wagon, Logistic Support) that can be used to heal units in the field.
- Unit experience and ranks (Regular, Veteran, Elite).
- Certain city buildings (Barracks, Military Academy) provide experience for newly produced units.
- Modern versions of ancient-era units: Scout → Explorer, Settler → Pioneer, Worker → Engineer.
- Tweaked terrain movement cost calculation.
- Tweaked unit health decay.
- AI has received updates to handle new and updated game mechanics.
- Further backend work to ensure that new code is compatible with existing game sessions.