New Mod Idea: In-game History

Dom Pedro II

Modder For Life
Joined
Apr 3, 2002
Messages
6,811
Location
Exit 16, New Jersey
I think of this more as a module than a modification... since it will be an addition to the regular game without making any changes to it, and I hope it will fit into other people's modifications without need for change or at the very least only slight changes necessary.

Anyway, the idea behind this is that it would create a history of your civilization from the very beginning of the game to the very end. Think of it as a textual expanded version of the simulation that runs at the end of the game.

I'd like to make it accessible through the Civilopedia, but if that's not possible, then I'll opt for some other way. It would be readable at any point in the game and would be added to as new events occur.

It wouldn't be a simple list like this:

Chinese civilization founded in 4000 BC.

China goes to war with Persia in 3000 BC.

Judaism founded in Tyre (China) in 2700 BC.

China adopts Slavery in 2500 BC.

No no... that would defeat the purpose of it. It would look something more like this:

Spoiler In-game History :

The Chinese people were a group of hunter-gatherers in the Yangtzi river valley that settled down and formed their first urban center of Beijing around the year 4000 BC. The Yangtzi river with its rich silts proved a fertile location for China's fledgling agriculture. The next Chinese settlement was the city of Shanghai founded in the Gobi desert region of China. This city's economy centered around shepharding and horse breeding.

The Persian Invasion - 3000 BC - 2500 BC

In 3000 BC, the armies of Persia invaded China. The Persian horse archers had some early successes around the city of Guangzhou. In 2800 BC, the Chinese launched an offensive against the city of Tyre. The Chinese captured the city of Tyre in 2800 BC and quickly appointed a new territorial governor to rule over it. Having lost several cities to the Chinese army, the Persian sued for peace in 2600 BC, which Qin Shi Huang accepted.

Foundation of Taoism

Historians generally agree that prior to 2700 BC, Judaism was little more than a collection of folklore and rituals. In 2700 BC, local religious leaders in the city of Tyre under Chinese occupation, gathered to set the belief and law of the Jewish faith down in writing and set 2700 BC as year 0 in the Jewish calendar. Judaism quickly spread from conquered Tyre to the rest of the Chinese Empire reaching Beijing in 2500 BC. Emperor Qin Shi Huang's adoption of slavery and persecution of the Taoists actually aided the spread of the faith to Chinese cities.

Adoption of Slavery

In spite of having been successful against the armies of Persia in the Persian Invasion, the people of China were exhausted and their resources depleted from years of fighting. For that reason, Emperor Qin Shi Huang adopted slavery to make use of the plentiful supply of Persian labor in the lands of Tyre.


So how can this be done? Simple: using variables and XML text banks. It would work much in the same way as the diplomacy screen does. A Python events script would check for certain events as well as multiple values being true or false at once, and select an appropriate line of text from the XML file.

The data would be broken down into sentences rather than paragraphs or even longer lengths of text so that they can be fit and refit together to not only make events more specific, but also to keep it from seeming repetitive from game to game. So if the civic Slavery, for example, is adopted in the middle of a war that's being won, it produces one sentence, if it's in the middle of a war being lost, it produces another. If the war is over yet another. If there hasn't been any war, it creates still another.

Time consuming? Absolutely, but the content contained in the XML files is by far the easiest part of the process.

What will be more difficult is the Python events script. I personally don't have experience with Python specifically though I do have experience with programming logic, which is somewhat universal even if the syntax is different.

But basically, I'm looking for people who want to go in this project with me, and I'd like to use this thread as a place to hash out ideas, determine what works and what doesn't work, and find ways to streamline the whole thing if and when possible. Any help from people with programming experience would be greatly appreciated.

If you are actually interested in a more hands-on part in the creation of this (with all due credit of course) then convo me and we'll get cracking on it. :D

At the moment, I'm thinking the easiest way to do this would be to have the game create a new XML file for storing the full text that could then be simply spit out on the screen when someone wants to view it rather than setting up a complex script to display the information stored. Naturally, there are advantages and disadvantages to both, but I think having the game run the condition checks and write the text from the XML banks to a single new XML file every turn would be the best way to go.

Anyway, that's my idea thus far. Comments, criticisms and compliments are welcome :)
 
I like the idea Dom. Sort of like the AARs people were writing in Europa Universalis. When well written they are better than the game themselves! Mine wasn't, but that's another story. :)

I have zero experience in XML so I'll be watching from the sidelines, but very eager to try anything out that you come up with.
 
Another great sounding idea. Quite alot of them (like religion founding), could be very generalised. Unfortunetely you may need vast amounts of text for it not to become too repetative.
 
The Great Apple said:
Another great sounding idea. Quite alot of them (like religion founding), could be very generalised. Unfortunetely you may need vast amounts of text for it not to become too repetative.

Indeed, as I said, that will be time consuming, but ultimately, it will be the easier part of it. The trick is going to be trying to be to keep the events script as small as possible. We don't want to bring the game to a grinding halt (anymore than it already is ;) ) for something with such limited effect on the game itself.

Basically, the XML is the easiest part and can be done by people without computer programming experience. By having them construct two or three different sentences to say the same thing, and then build in a random number generator into the events script to pull one of those sentences... so every game, any given paragraph will be comprised of sentences you may or may not have seen before but will have different names and places and will also be followed by sentences that they were not followed by in the last game.

Unfortunately, the layout will have to be somewhat formulaic. So the content will be different each time, but the way its presented will be basically the same.

The other good news is that modders will be able to create NEW XML documents if people do find the texts to be getting repetitive, and so they can simply change the content of the XML document to display entirely new text and there'll be no need to change the events script so long as their XML document is well-formed and uses the existing tags.
 
Sounds really, really awesome. I've always wanted something like this to be shown at the end of TBS games like Civ.
 
I loved this kind of a feature in King of Dragon Pass, years ago...
It created epic, readable-for-fun stories out of the gameplay.
 
I like the idea quite a bit. How would you catch these events without the SDK? I didn't see anything on the Python side, and the XML is just a glorified set of config files.
 
This is a most intriguing idea, and should be loads of fun when implemented.

As for what I might be able to contribute, well, I have a BA in Creative Writing. :D I also have experience with coding, but since I'm currenly working on figuring out how to tweak other aspects of the game using xml besides this, I think I can help best in my writing capacity -- which will overlap with the xml anyway. If you (and whoever else is working on this) can show me the TXT lines you want more variants of, hopefully I can help proliferate one or two into six, twelve... eighteen. :)

One comment though: I think including leader names in the text could cause serious problems with timeline continuity, for those who care. Having the same leader mentioned in 2000 BC and 2000 AD would be kind of odd. You could leave leader names out all together, OR every time a civ-leaders name is supposed to appear (per paragraph?), a numeral could be appended to his/her name. The first time the leader of Arabia gets mentioned, he'd be Saladin I, the second time he'd be Saladin II, etc. -- so you'd get King Saladin III fighting the Mali in 900 AD, and President Saladin XII launching the Apollo program in 1960 AD. This way it would remain clear who (what leader of what civ) was being discussed, reinforcing the information that would be given in context, while, in a fun and almost humerous way, would maintain a semblance of the proper timescale. Sound nifty, or no?

And a question: how would you script the "founding" paragraph? Would you get python to look for local geographical features around the first city or two and then emplace names on them based on names from the civs historical geographical range?? Sounds pretty complicated.
 
Uty said:
I like the idea quite a bit. How would you catch these events without the SDK? I didn't see anything on the Python side, and the XML is just a glorified set of config files.

Yeah, the XML is not meant to perform any actual functions but is really just a place to store and describe information.

But I figure Python will be the weapon of choice for this since basically what we need is an events script. The events in the scenarios included with the game utilize Python, so I imagine that should work here. I'll have to investigate further..

But on the off-chance we have to wait until the SDK, then we'll just have to wait until the SDK.

Master Kodama said:
As for what I might be able to contribute, well, I have a BA in Creative Writing. I also have experience with coding, but since I'm currenly working on figuring out how to tweak other aspects of the game using xml besides this, I think I can help best in my writing capacity -- which will overlap with the xml anyway. If you (and whoever else is working on this) can show me the TXT lines you want more variants of, hopefully I can help proliferate one or two into six, twelve... eighteen.

Thanks, that'd be a lot of help. Exactly the kind of stuff I'm looking for. I'll post my list of needed text at some point and then we can hash it out from there what's needed and what's not, what should be added, etc.


Master Kodama said:
One comment though: I think including leader names in the text could cause serious problems with timeline continuity, for those who care. Having the same leader mentioned in 2000 BC and 2000 AD would be kind of odd. You could leave leader names out all together, OR every time a civ-leaders name is supposed to appear (per paragraph?), a numeral could be appended to his/her name. The first time the leader of Arabia gets mentioned, he'd be Saladin I, the second time he'd be Saladin II, etc. -- so you'd get King Saladin III fighting the Mali in 900 AD, and President Saladin XII launching the Apollo program in 1960 AD. This way it would remain clear who (what leader of what civ) was being discussed, reinforcing the information that would be given in context, while, in a fun and almost humerous way, would maintain a semblance of the proper timescale. Sound nifty, or no?

Yeah, I was considering something like this. It'd probably be the best way to go about it.

Master Kodama said:
And a question: how would you script the "founding" paragraph? Would you get python to look for local geographical features around the first city or two and then emplace names on them based on names from the civs historical geographical range?? Sounds pretty complicated.

Well, the idea for that was to just use the tile upon which the city was founded as the basis for the geographical location. I'm not exactly sure at this point how to go about doing that, but I'm sure it'll be possible.

But I hadn't really planned on matching up geographic types with geographic types. I mean, it could just as easily end up being Gobi river and Yangtzi desert I suppose... it'd just pull a name from a word bank of Chinese geographic names stored in an XML file.
 
Dom Pedro II said:
But I hadn't really planned on matching up geographic types with geographic types. I mean, it could just as easily end up being Gobi river and Yangtzi desert I suppose... it'd just pull a name from a word bank of Chinese geographic names stored in an XML file.
Works for me either way, I suppose. Would be easier to do it in the latter fashion. I'm not about to argue with easier. ;)

As for checking the base tile and those surrounding a city, it's definitely possible. I ran across rezaf's "Terrain Adaption Mod" (should be terrain "adaptation," but whatever) in the Completed Mods forum, which checks the terrain around your founding city and gives you bonuses for working that terrain type, to represent how civs adapt to their native environment. That seems proof enough to me.

Oh, and I seriously doubt that we'll need the SDK to do this. But then again what do I know? :crazyeye:
 
Master Kodama said:
As for checking the base tile and those surrounding a city, it's definitely possible. I ran across rezaf's "Terrain Adaption Mod" (should be terrain "adaptation," but whatever) in the Completed Mods forum, which checks the terrain around your founding city and gives you bonuses for working that terrain type, to represent how civs adapt to their native environment. That seems proof enough to me.

I clearly should be checking out the completed mod forums... :eek:

This is an amazing idea and one I only thought about in passing... into the mod with ya! :)
 
Weasel Op said:
This is a really good idea. I think it would be possible with just Python and XML.

That terrain mod sounds cool. I haven't been checking the subforums much because I thought they were all XML tweaks and new civs. I guess I was wrong. :wow:

I was under that same impression :lol:
 
How's this one shaping up Dom? I'm finding that AARs can be more fun than playing. I'm starting to delve into XML so I might be able to do some grunt work if you need help.
 
Back
Top Bottom