AI barbarian waves : Step 4/5 is complete!

I ended up inverting the 2 last tasks and completing the AI waves system instead of the Techs first ( though the work on the Tech system is under way ).

So i have now added a basic system of barbarian ‘waves’, which adds challenge to the game and purpose to defending your cities.
The point of this system is also to allow players to regularly experience battles and improve their strategy, as wars between players will be much more rare and punitive (as, like in reality, when someone attacks its usually because they already made sure they would have all the chances to win ).
Its also a simple thing that added a lot to the fun of the game, as there’s now a ‘stress’ to develop and to be efficient enough to keep up with the increasing difficulty. It also adds the possibility to actually lose the game, which is important to make things fun!

Barbarian cities appear near your settlements and every once in a while they spawn a barabarian warband that will try to raid or sack one of your cities.
They increase in difficulty with time and eventually will even attempt to invade. After a while it gets quite challenging to deal with them, and it also opens opportunities for your human player enemies.
The barbarian cities can be attacked and destroyed, which allows you to recover all the ressources they have pillaged and managed to take back to their city. You could eventually get rid of barbarian waves if you destroyed ALL the barbarian cities around you, to a certain radius.
Its important to note that this is a gameplay feature independent of game rules: the barbarian raids are spawned from nothing, and depart from any nearby barbarian region to target one of your regions.
Their choice of units is affected by their region of departure:  you’ll face different units if its a barbarian camp located in an arid region or a nordic one.
Each player now has a ‘hidden’ system of game-events points and difficulty. With time, difficulty increases and increments points that will trigger negative or positive events. For now , AI barbarian waves are the only event, but of course with time other will be added to this, to make things more interesting. This is a component based and tailored for each player, meaning a player joining a game late would start with a low difficulty while the ones already there would face much more challenging events.

Barbarian cities now spawn automatically near your settlements and regularly launch raiding parties to pillage your lands.

There is also a new NPC faction called the Free cities, which also spawns cities around players in the same way barbarians do. For now they’re useless, but eventually they will export and purchase things on the market. All players are by default at peace with these cities with trading rights opened. The point of  these cities is to ensure a minimum of trading activity and to provide basic natural ressources, as you can hardly get them all yourself.

These new features also mark the completion of the first foundations required to eventually develop proper AI players: there’s now the embryo of an AI that manages these barbarian and NPC regions. It’s able to place some basic buildings and i’ve started to organize how it will ‘think’ to face problems and develop regions. Eventually i’ll develop this enough to allow the Free cities to exploit successfully their natural ressources and sell them on the market as well as buying resources sold by players. And on an even longer term, this region AI will be used as a base to create a proper “AI player”.

Besides all that i’ve playtested the game for more than 50 hours with a couple of friends. Only with 3-4 players in “realtime mode” for now, but its been quite fun especially since the addition of the barbarian waves that added spice to the game. This has allowed me to fix countless bugs and balancing issues.
These tests lead to the addition of some miscellaneous new features such as:

Burning buildings during a barbarian raid

– maintenance and state power costs for active policies
– maintenance cost for infrastructures like walls or gardens (making it impossible to build an infinite citadel of walls, as its now pretty expensive to maintain)
– added a new policy: a state subvention allowing you to help a specific class of population ( gives additional income to the population class, paid by the state ).
– burning buildings effect during battles (cosmetic effect to add ambiance, instead of the building switching instantaneously to ruins when destroyed by enemy troops)
– range attack bonus/malus depending on the height difference. Archers on top of cliffs or walls now have a damage bonus + a bonus to hit while its inverted for range units trying to target them from lower positions.
– range attack malus against moving units (proportionally to the target’s speed )
– new charging bonus for melee units based on unit’s mass and movement speed.
– a new ‘reach’ stat for melee weapons ( spears have a higher reach than short-swords ) , affecting many things in combat like giving a bonus against high-mass units like cavalry.
– ground fertility now affects the fields productivity.
– arid and desertic rivers now generate a new highly fertile ground type, giving more specific pros and cons to these climates : smaller agricultural surface but highly productive, which is a big bonus in early game ( less fields to make but produces much more )  while in late game you won’t be able to produce as much as a continental region because of the smaller available surface. Regions with gravely ground types (low fertility) like hills are now at a disadvantage for agriculture, compensating for their defensive advantages.

The great “battle of the 4 armies” that ended one of our test games : while the red player was attacked by a massive barbarian army, the blue player launched a surprise attack as well while i sent reinforcements to help defend the red city. An epic battle ensued, while reinforcements from all sides rushed to the city, extending the battle… Eventually the city was successfully defended with only a few troops left standing. The blue player made a mistake attacking too soon: his army ended up fighting both the red garrison of the fort and the barbarians raiders – who are hostile to everyone! Had he waited a bit more, and the victory would’ve surely been his.

The industrial district of Cochonville, during a test game.

Trade routes implemented : step 3/5 is complete!

The trading system is now implemented, completing the 3rd task of the 5 remaining! I am now moving to the 4th one : technologies.

There is 4 different types of commercial activities in Ymir.
The first one is the most primitive and basic one : manually loading resources into a group carrier units, travelling to destination and unloading the goods from their inventory.
The second one is the most common one among games of this genre : trading offers to sell and buy amounts of resources at  specific prices. You can put any material resource for sale and it will be available for sale to anyone in your trading network.
The third one is more advanced: Trade Routes. They allow for the constant transfer of a resource instead of a one-time sale. For instance, with a trade route, you can arrange to constantly transfer a certain amount of food produced in a farming region to your capital.
The fourth one is related to trade routes as well: to work, a trade route needs a service called Cargo. Cargo represents the fact ships and caravans are required to constantly carry the goods along a trade route.

CARGO
You can produce this service by building docks in your city. This special service can be ‘rented’ from any of the cities of your trading network, and when you open a trade route, you have to choose an “operator” : the city that will provide the required cargo service for this trade route and deal with the transportation of goods. You can choose your own city for this, but also any city of your trading network that has enough cargo available.  The cargo required for a trade route depends on the volume of resources traded, but its also affected exponentially by the total distance of the trade route.
Now this is where it gets interesting : the distance is calculated from the operator’s location. This means that choosing an operator in the middle of your trade route will make it A LOT cheaper than choosing to operate the route yourself from one end of the route, where the distance factor is maximal.
This also means that strategically placed cities can thrive simply by ‘operating’ trade routes, without producing anything themselves, but simply by providing cargo to others and effectively becoming a “trading node”. Cargo generates incomes for your traders, which in turn generates tax revenues for the city. But on top of that, cities can raise a customs tariff, taxing a percentage of the value of all goods of every trade route operated by the city, generating additional income.

TRADE ROUTE COSTS
When you sell goods via trade route or regular sales, the generated income doesn’t belong to you ( the state ) but to the owners of the sold resources ( local producers in your city ).
When you buy goods however, it is you (the state) that buys them at the price specified in the offer. The imported goods therefore belong to you, and not to local producers in your city.
Later on, If these goods generate incomes ( by beeing sold to local population via merchants or consumed by industries ect .. ) , the generated incomes will this time go directly to the state, potentially reimbursing you the cost of importation. For instance, if you import tomatoes at a price of 2 but that they are worth 3 on the local market of your city,  you could very well generate profits for yourself.
However , trade routes are expensive as not only do you have to pay upfront for the imported goods but you also need to pay for the cargo service, and to eventually pay a customs tariff.

The cost of a trade route includes 3 things : the cost of the imported goods themselves (paid to the exporting city), the cost of the cargo service to carry the goods (paid to the operator) and the cost of the customs tariff (paird to the operator).

TRADING NETWORK
You can only trade with your own cities , or cities belonging to a state that has given you access to its trade ( via a diplomatic treaty ). You will only be able to sell and see the trade offers from cities of your trading network.

When selling something, you are free to sell it at any price regardless of its local price in your region. The offer will then be visible from any region that has trading rights with yours.

All buildings are in : step 2/5 is complete!

All the buildings for the planned release version are now ingame.
All their new functionalities are also implemented , including a new kind of resources : services. Each service building mostly produces its own service resource, so for example a Tavern will produce a Tavern service.
Some services are consumed directly by the population to satisfy their needs, like the services of Taverns or Theaters that satisfy the social or entertainment need.
Some other services are also consumed by population but have other effects : doctors, washhouses or public baths will for example improve health of the population accessing it.
Other services have more specific uses :
– Builders produce a construction service now required to build most things.
– Docks produce a cargo service, which will be used to operate trade routes.
– Markets produce a trading service, which will be used to create ‘inter-city’ trade offers.
– Scribes produce an administrative service that increases administration of the city.
– Schools produce a service that increases intelligence of the population accessing it.
– Magistrates produce a justice service that reduces conflict in the population.
– Tax collectors produce a service that reduces waste ( a % of incomes lost, increased by population and bad administration ).

I added a new need in the pyramid of needs of population: the social need, of priority 2 (meaning it comes after vital needs of water and food).
For now, its satisfied only by Taverns and Forums ( a kind of plaza you can build in your town center where people gather  ).

Water has been added. Its now required as a vital need. You can produce it with wells or with water collection points placed on the shore of rivers. Water is also used by various industries or buildings like the public baths or bakeries.

The building production UI has been redesigned and completed with additionnal informations. It is now possible to choose a specific material to use for a production ( when more than one is available ), or to leave it in automatic mode. The UI now also shows the budget of the building itself, allowing you to see how much taxes this building is generating, how its production is used and sold, or how much each one of its workers earn.

The new production UI: here a bakery requires a combustible ( wood, charcoal or coke ), flour and water to produce bread. The building’s budget shows where this building’s income is coming from and how it is used. Here the building generates 1 of taxes, and 2.6 income shared between the 2 workers.

I added a new kind of annex : the efficiency annex. These annexes increase the efficiency of the building they belong to.
For now, this type of annex is used for waterwheels and windwheels, which are used for example by flour mills.

The game now has its definitive look, and i’m moving to the next step!

 

An ‘iron age’ settlement.

A late game city with ‘classical age’ buildings, including the new multi-story houses.

An industrial district with furniture makers, carpet makers, weavers, paper mill, brickworks, weapon makers, fundry, steel maker… There’s also a forum plaza with a tavern, a bakery and a public bath.

A lot of cosmetic tools have been added : different kinds of gardens, lawn, flower beds, plazas of mosaic and marble, roads, fences… You can use all these tools to design your parks and gardens around important buildings or fancy houses.

All unit graphics finished : step 1/5 is complete!

All the unit graphics are now completed:
I’ve added about 30 types of units including mounted units on horses, camels, elephants but also the dreadful giant Mammoths.
Bigger and stronger than elephants, its ultimate form , the Megaphant, comes equipped with a full steel plated armor and 3 archers. This will be the ultimate tank of the battlefield!

The glorious Megaphant: a steel plated armored mammoth

For infantry units, there is now different types of swordpigs additionally to the spearpigs.
I’ve added heavy infantry with steel plated armors, including the Martelsnout, the heaviest armored infantry so far equiped with warhammers and steel shields. There’s also 2 handed longswords, battle axe warriors, heavy helbardiers in the fashion of Swiss pikemen, hoplites and more…
Range units now include longbowpigs and crossbowpigs.
Mounted horses and camels each include 4 units : one light unit , one heavy “cataphracted” unit with scale armor, one heavy “pig-at-arms” with plated armor , and one mounted archer.

The different military units of the game

Now that all the main graphic assets are complete, i’m moving to the next step : implementing service buildings. I’ll also have to render and format all these assets and add them to the game, wich is pretty time consumming!

All resources completed!

After the buildings, i’ve now completed all the resource graphics!
Generic tools resources have been replaced by specific tools : hammers, saws, shovels..
There is now proper ores for each metal, and i added tin, bronze, steel, coal and coke.
There’s also furnitures and carpets, rum, blocs for each stone types, cotton, wool… plus the missing sprites for all the food types like rice, cheakpeas, dates, figs, beans…
All previously existing sprites have also been re-rendered and improved with new shaders.

I’m also adding lots of pieces of military equipment. There is now about 20 types of equipment: armors, shields, helmets and weapons. They will be used to recruit various units.
Which leads to the last step of graphical contents : units.

A preview of some of the resource sprites