Before Elemental, most of us worked on a little title called Galactic Civilizations 2. In this game, you would do spend a significant amount of time conversing with AI players. They would plead, threaten, and barter with you in as intelligent a fashion as we could muster, with much of that 'intelligent' feeling coming from the PAGES of conversation text written.
Based on everything from relations to military might, the AI would pop up with dynamic dialog that changes based on gameplay. Needing similar dialog text for Elemental, and knowing the annoyances of the GC2 system, we've been able to implement a conversation system that's incredibly extensible that will allow awesome depth and realism to your/our AI opponents.
With that said, let's do a 'not as awesome' adventure through the new FlavorText XML...
<Topic>
Each section of flavor text has a 'topic'. When certain situations arise ('Step into Foreign Territory', for instance) the game will look for FlavorText that fit.
<Text>
The actual flavor text to use. This can have nested naming tags that allow you to interject the world name, faction names, etc. The game accepts multiple <Text> values, storing them all and returning a random one whenever requested.
<SpeakingFaction>
<ListeningFaction>
For story and background specific text, we once again have the ability to specify dialog by faction, and like GalCiv2, you can also couple it to a Listening race to provide Race-To-Race backstory rich dialog. If no factions are specified, the FlavorText is assumed to be for ANY faction.
Now, before you fall asleep, this is where Elemental's Flavor Text get's interesting....
<Rule>
This is where things get interesting. In the GalCiv2 system, much of the more dynamic assigning of text had to be done in code. You'd have topics called DeclareWar_LowerDiplomacy, DeclareWar_HigherDiplomacy, and DeclareWar_BiggerArmy, each with flavor text for a race declaring war who has a high diplomatic ability, low diplomatic ability, or a stronger army. This wasn't HORRIBLE, but it did restrict the untethered creativity of the writers....the moment they wanted text for Declaring War by a race who had Low Diplomacy AND a Big Army they would have to dig into code.
This time, we have stackable RULES, which can identify special player requirements before using them in conversation....
- Race of Men -
0 - A Kingdom speaking
1 - A Kingdom speaking to another Kingdom
2 - A Kingdom speaking to a Fallen nation
- Fallen Race -
10 - A Fallen race speaking
11 - A Fallen race speaking to another Fallen Race
12 - A Fallen Race speaking to a Kingdom nation
- Military Might -
20 - Speaker has a MUCH STRONGER Military than the Listener
21 - Speaker has a Slightly STRONGER Military than the Listener
22 - Speaker has approximately EQUAL Military Might as the Listener
23 - Speaker has a Slightly WEAKER Military than the Listener
24 - Speaker has a MUCH WEAKER Military than the Listener
- Diplomatic Skill -
30 - Speaker is MUCH MORE DIPLOMATIC than the Listener
31 - Speaker is SLIGHTLY MORE DIPLOMATIC than the Listener
31 - Speaker is EQUALLY DIPLOMATIC than the Listener
33 - Speaker is SLIGHTLY LESS DIPLOMATIC than the Listener
34 - Speaker is MUCH LESS DIPLOMATIC than the Listener
So now the coders can unhide hundreds of different situations for the flavor text XML to tap into, which can be used at the writers discretion. The game will take these rules, crunch some numbers to determine the most applicable one, and bring that up to the player.
Have a dragon on your side, but a weak economy and low essence? Imagine your enemy noting this and sending over a kind reminder...
'Your economy is broken and your magic has been spent. Even your mighty friend cannot save your heart from my blade. Give me your lands and perhaps I will show mercy.'
I feel intimidated and I'm just playing in my head.
<RevisitedTopicBarrier>
The last value you can set is the 'Revisited Topic' barrier...basically the number of times this topic has to have come up before a given FlavorText is used.
Perhaps you keep grabbing artifacts within a peaceful neighbors territory. First it's a simple 'Pardon, friend. Perhaps you could refrain from the taking of lost items across our countryside?'. You keep doing it, and you get a 'Again, we ask that your units not pillage the lost goods from our lands.'. One more snatched treasure brings up a stern, 'Your lack of respect disappoints me. I am breaking all treaties between out nations and demand that you leave our borders at once.'
Cool, eh? And all data driven!
Now obviously this creates an IMMENSE matrix of possibilities, and while we'll fill in the obvious and more likely ones, the system is set up to allow <FlavorText> entries to be read in from any file. We expect many mods that are extend and improve upon the conversations that popup throughout each game.
Some of my best GC2 memories involve being surprised by the intelligence displayed by the computer players (even if artificial). A similar system in Elemental will go a long way to bringing weight and history, and 'soul' to the inhabitants of each randomly generated world.