Day_6Adding some cultureHey for this update I have been working mostly on underlying code. I imagined the world to be filled with different races/civilizations/cultures. So I worked on creating a system for this. My idea was that each race can be a specific number of difference cultures. I explained this a few posts ago. The cultures will control mostly the macro behavior of a civilization, like initial city placement, expansion behavior, and perhaps the likes and dislikes when it comes to trade goods. It will also add some decisions to the player. Would you like to play a dwarf, with easy access to very valuable goods and a long life, but have a harder time traveling? Or play a human with more flexibility and offspring, but more expendable offspring?
The first thing I needed to implement was this macro behavior. First of all, lets just add a simple system, the culture will just control city placement for now. Here is an example culture XML file:
<culture>
<name> Agricultural </name>
<requiresBiome> Plains </requiresBiome>
<requiresBiome> Forest </requiresBiome>
<requiresBiome> Tropical Forest </requiresBiome>
<requiresBiome> Beach </requiresBiome>
<createsHarbors> TRUE </createsHarbors>
</culture>
<culture>
<name> Mountain Dweller </name>
<requiresBiome> Mountain </requiresBiome>
<createsHarbors> FALSE </createsHarbors>
</culture>
This is the cultures I use for human/medieval societies and dwarves respectively.
Civilizations are like containers for these cultures. Grouping abstract behavior together to form more advanced behavior, also civilizations will define more global behavior, like language and naming. A civilization definition file looks like this:
<civilization>
<name> Medieval </name>
<culture> Agricultural </culture>
<smallCityName> Hamlet </smallCityName>
<mediumCityName> Town </mediumCityName>
<largeCityName> City </largeCityName>
<maxCivCount> 2 </maxCivCount>
</civilization>
<civilization>
<name> Dwarves </name>
<culture> Mountain Dweller </culture>
<smallCityName> Mountain Home </smallCityName>
<mediumCityName> Mountain Halls </mediumCityName>
<largeCityName> Dwarven Fortress </largeCityName>
<maxCivCount> 3 </maxCivCount>
</civilization>
Here is the civilizations that makes use of the cultures I defined earlier. For now I have not gone into languages, they should be mostly aesthetic anyway so they can wait for now.
Lastly races control the stats of the individuals spawned, but also what kind of civilizations this race can spawn. Here is one for humans:
<race>
<name> Humans </name>
<spawnCivilization> Desert Traders </spawnCivilization>
<spawnCivilization> Medieval </spawnCivilization>
<spawnCivilization> Norse </spawnCivilization>
<spawnCivilization> Jungle People </spawnCivilization>
<minAge> 2592000 </minAge> <!-- 60 years -->
<maxAge> 4320000 </maxAge> <!-- 100 years -->
<matureAge> 648000 </matureAge> <!-- 15 years -->
<fertility> 0.15 </fertility> <!-- 0.15%/year About 1 in every 6 years~ -->
</race>
Humans can spawn three different civilizations, that will have different placement, expansion and trading behavior, when it is implemented.
Either way, after implementing the city placement system to make use of these parameters I tested the system out, and whether it will scatter some capitals around properly. The results are promising, and now that the "system" is figured out, adding some more advanced and interesting behavior will be easy:
I disabled roads for now, they were randomly placed and "for show" anyway. They will be added in again when I start working on civilization behavior.
That's it for day 6, I know there were not a lot of screenshots, but this was mostly abstract work anyway.