This week I’ve been primarily working on the narrative event system. An event is a random occurance, given certain conditions, which presents the player with a situation and one or more answer options. For example, an event could be a volcanic eruption. The condition is that the holding is located at a volcano, and the change it fires given the conditions could be 0,1%. Your answer options are how to deal with: do nothing, evacuate, sacrifice something to the volcano, etc. The outcome depends on your answer. If you´ve ever played a Paradox game, you should be familiar with it.



I’m really excited about how the event system turned out. It’s flexible, moddable and comprehensive. All events are stored in plain text files. An event consists of the following parts:



Scope: It can apply to a holding, a country, a single faction, a province or the whole world. A passing comet would be applicable to the whole world.



Jurisdiction: Which faction is the one answering the event. For many events, this will be related to the portfolio the faction holds. An event triggered by foreign action is most likely diplomatic. But currently you can also simply give it to the most powerful faction.



Definitions: Its title, text and tooltip, but also whether the events demands an answer or can remained unanswered.



Conditions: The conditions for the event to occur. A certain location at the holding (again, the volcano example), or a certain weather or season.



Probability: This contains a base probability, but this can be modified given certain conditions. For example, if the volcano is tagged as an active volcano, it can be 20 times more likely for the event to fire.



Then, the answers have their own parts:



Definitions: Similar to the event itself, this consists of the title and tooltip.



Conditions: Conditions which need to be met for the answer to appear. For example, if you want to sacrifice Elves to the volcano, you’d need first need to have Elves in your population.



Effects: The actual effects of the answer. This can be extremely varied, though currently they all still relate to changing the population one way or another, since the game doesn’t feature much else yet.



AI instructions: You can give answers weight for the AI to consider, so you can limit and guide its choices.



Here you have an example of the volcano events. The answers aren’t necessarily logical, but it gives an impression how an event is constructed in the text file.

########################Volcano Event

>>Scope

Holding

>>Jurisdiction

MostPowerfullFaction

>>Definitions

TitleTargetNameSuffix

String

A volcano is about to erupt in

##endelements##

PlainMessage

String

A volcano has been rumbling for a few days and is about to erupt. How should we deal with this?

##endelements##

##enddefinitions##

>>Conditions

RequiredLocationTag

LocationTag

volcano

##endelements##

##endconditions##

>>Probabilities

Base

Double

1

##endelements##

FactorIncreaseByLocationTag

Double

20

LocationTag

activevolcano

##endelements##

##endprobabilities##

>>>>>>>Answers

>>>>>>>First answer: do nothing, lose 20% of all your population

>>Definitions

PlainTitle

String

Okay…

##endelements##

PlainTooltip

String

This kind of things happen. (Each population will decrease 20%)

##endelements##

##enddefinitions##

>>Conditions

##endconditions##

>>Effects

FactorSizeAllPops

Double

0.8

##endelements##

##endeffects##

>>AI instructions

AnswerWeight

Double

100

##endelements##

##endAI##

##endanswer##

>>>>>>>Second answer: sacrifice 10 Elves

>>Definitions

PlainTitle

String

Throw Elves in it!

##endelements##

PlainTooltip

String

Perhaps throwing Elves in will appease the Volcano. (Elven population decreases by 10)

##endelements##

##enddefinitions##

>>Conditions

MinPopRacePresence

Race

Elves

IntQuantity

10

##endelements##

##endconditions##

>>Effects

DifSizeRacePop

IntQuantity

10

##endelements##

##endeffects##

>>AI instructions

AnswerWeight

Double

200

##endelements##

BannedForRaceFaction

Race

Elves

##endelements##

##endAI##

##endanswer##

>>>>>>>Third answer: sacrifice a population

>>Definitions

InstancePerPop

GiveTag

targetedpop

##endelements##

TitlePopNameSuffix

String

Sacrifice

FindTag

targetedpop

##endelements##

PlainTooltip

String

Sacrifice this population to quiet the volcano. (It will be gone).

##endelements##

##enddefinitions##

>>Conditions

##endconditions##

>>Effects

RemovePopByTag

FindTag

targetedpop

##endelements##

##endeffects##

>>AI instructions

##endAI##

##endanswer##

##endanswers##

And this is how it then looks in the game. Still working on presentation in the UI, such as names instead of numbers, but it should give you the idea. Also the text deviates slightly from the script above, but only in details.







I continued working on modifiers. Modifiers are basically little tag objects which modify the game object they apply to. For example, a 10% population growth boost for 10 turns. These modifiers can be given and removed by events, and events can check for these modifiers. Since you can also make modifiers with just a plain tag which an event can check for, this becomes a very powerful tool to control event chains, thereby creating little storylines..



I changed the racial nativity locations as well. The previous system was clunky, and now I have modifiers, so instead a holding simply gets a nativitylocation modifier tagged to a race.



The following event (again, just an example, final game will feature something more refined) uses this mechanic. It increases each population having its nativity location at the holding by 100.





########################Nativity location event

>>Scope

Holding

>>Jurisdiction

MostPowerfullFaction

>>Definitions

TitleTargetNameSuffix

String

Nativity population increase

##endelements##

PlainMessage

String

All populations having its nativity spot here are increased by 100

##endelements##

##enddefinitions##

>>Conditions

RequiredModifierType

ModifierType

HoldingNativityLocation

##endelements##

##endconditions##

>>Probabilities

Base

Double

1

##endelements##

##endprobabilities##

>>Answers

>>First and only answer

>>Definitions

PlainTitle

String

More population!

##endelements##

PlainTooltip

String

Each population having its nativity location here gets 100 increase

##endelements##

##enddefinitions##

>>Conditions

##endconditions##

>>Effects

DifSizeNativityPop

IntQuantity

100

##endelements##

##endeffects##

>>AI instructions

AnswerWeight

Double

100

##endelements##

##endAI##

##endanswer##

##endanswers##



In order to ensure eager players can easily make their own races, locations and events, I’m now writing a documentation with instructions how to use each feature of the system. This way it’s excessively easy to add something to the game. And, frankly, I use it myself as well, since it’s quicker to work from the documentation.



So this is the event system. Due to its versatility I can use it to add a lot of mechanics to the game without needing to implementing whole new features. Once I’m done with a few last refinements, I’ll be moving on the production, trade & economy, which will be a big part of the game.