1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Adding new civilizations

Discussion in 'Civ4 - Rhye's and Fall of Civilization' started by Jarkov, Nov 3, 2010.

  1. Jarkov

    Jarkov Chieftain

    Joined:
    Oct 23, 2010
    Messages:
    158
    I have gone now and tried to do the impossible: to actually add another civilization, without having to erase another.
    In a first run, I have tried now to add the Koreans.

    I have done an extensive search of the C++ and the Python and the XML files in order not to miss any bit of code that has to be altered to allow a new civilization. And I have used the RFCMarathon files to do so.

    Nevertheless, after adding all that seemed necessary, it still isn't working, so I'm posting now all the files I have changed, and I hope that someone can see what more has to be done to make the whole thing work:

    In the game's XML:


    • Civ4ArtDefines_Building: added a Korean embassy
    • Civ4ArtDefines_Civilization: added Korean civ button

    • Civ4BuildingClassInfos: added the Korean embassy
    • Civ4BuildingInfos: added the Korean embassy

    • Civ4CivilizationInfos: modified the Korean civilization (removed cities that were to appear in their citymap, removed their free techs)
    • Civ4LeaderHeadInfos: made Wang-Kon their leader again (in RFC he is another Chinese leader)

    • In the text directory, the Koreans had to be added in almost every file, and a dynamic civ names file for the Koreans had to be created. However, they all work fine.


    In Python:


    • CvPediaBuilding.py: unique building added
    • CvPediaMain.py: the other Korean-specific entries


    • AIWars.py: added Korean war map
    • Barbs.py: removed the spawning of the independant city Hanseong in Korea
    • CityNameManager.py: added Korean citymap, added necessary name conversions
    • Communications.py: added Korea to the various pools
    • Constants.py: changed virtually everything, Korea was sorted between Ethiopia and the Maya, which means that all civs coming after Korea have been assigned a new number, and the NumMaxPlayers is now 32
    • RiseAndFall.py: added Korea in the three lists (iCivilization, player, team), and the array below, in the setup for both and early start, added the Hwacha instead of the catapult to their "on first contact" units, added starting units and additional starting units, starting workers, 600AD starting units, 4000BC starting units, 600AD techs, and early start techs
    • Stability.py: added the Korean UP (less of a stability hit when losing cities)
    • Stored data.py: modified or added arrays to be able to store data on the Koreans
    • Victory.py: Added the Korean UHVs, all of them copied in a way or other from other civilizations.



    In C++


    • CvCity.cpp: added Korean era modifier, added Korean culture modifier
    • CvCityAI.cpp: added Korean "favourite" units and wonders, and their willingness to build embassies
    • Defines.h: increased the number of max players by 1
    • CvGame.cpp: added updating for Koreans
    • CvInfos.cpp: added unit cost percents, research percent, distance maintenance percent, cities maintenance, civic upkeep percent, and health bonus for Koreans
    • CvPlayer.cpp: added starting era and max starting era for Koreans, how much production is needed by Koreans for wonders and regular stuff, Korean inflation rate, great people threshold, start era switch, growth threshold
    • CvPlayerAI.cpp: added Korean taken tiles switch , city values, compact empire modifier, values (distance for war), values (techs)
    • CvRhye.cpp: again, almost everything: modified arrays or added arrays, especially settler maps
    • CvRhye.h: added Korea in the civ definitions, and moved the later civs up one step consequently
    • CvTeamsAI.cpp: added Korea into an array in regard to defensive pacts
    • CvUnit.cpp: added Korean work rate


    In the WBS:
    • added the Koreans (and empty EndTeam - BeginTeam tag, and a BeginPlayer - EndPlayer tag with the usual information).



    Now, there is no problem with the dll compilation (which makes me sure that there is no syntax error), and the game notes no problem with the XML. I am able to start the mod, select a scenario, and even to choose the new Koreans, which show all the newly added corresponding text, but when the game begins, every civilisation starts dead, and the game is lost in the first round.

    So, if anyone has an idea what might be wrong, or what is still missing, please tell me.
     
  2. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    32,886
    Gender:
    Male
    Location:
    Leblanc
    From what I see here, you don't seem to be the person who forgets this, but I'll ask the tech support question anyway: do you have Python exceptions enabled?

    Because from here it seems your Python code has fallen apart somewhere.
     
  3. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,560
    Location:
    The city of the original vlaai
    I had a bit the same problem with my 2nd UB modcomp. When a civ spawns, they have no units and are dead. (except the 4 starting civs.) IIRC, it was over when Leoreth gave me the new CvGamecore.dll. I'm not a coding expert, but it could be that. (In other words, their is a problem is in the CvGamecore.dll.)
     
  4. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    32,886
    Gender:
    Male
    Location:
    Leblanc
    Well, he said his DLL compiled without problems, and from what he listed everything seems right there at first glance, so I'd still look at the Python code first.
     
  5. merijn_v1

    merijn_v1 Black Belt

    Joined:
    Dec 29, 2008
    Messages:
    5,560
    Location:
    The city of the original vlaai
    I also didn't have any problems at first glance. I only had problems when I loaded the game. (And in the civilopedia.)
     
  6. Jarkov

    Jarkov Chieftain

    Joined:
    Oct 23, 2010
    Messages:
    158
    It was the Python, and since I had to re-install Civ 4 some days ago, I didn't remember to enable python exceptions again. Many, many thanks for remembering me.
    Turns out the game didn't read some indentations as indentations.

    Now the whole thing is working fine, though, and I'll load it up once I fine tuned the new UHVs.
     
  7. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Nice! :goodjob:
     
  8. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    32,886
    Gender:
    Male
    Location:
    Leblanc
    Awesome! :)

    Edit: I can't wait till you release your modmod (if everything works, it would be great to have a guide of how to add civilizations). Maybe you could reveal some details already, Korea's UP and UHV for example.
     
  9. Jarkov

    Jarkov Chieftain

    Joined:
    Oct 23, 2010
    Messages:
    158
    I'll probably release it tomorrow.

    I'm not really good at Korean history (most of my knowledge comes from wikipedia), so it may be possible that there are better choices for UP and UHVs, but so far they are:

    UP: Power of Perseverance:
    The stability hit for loosing cities is reduced. This is to reflect the various occasions in which the Koreans were occupied or defeated by China, Japan, and the Mongolians, and the fact that they still managed to get by.

    UHVs:

    1. Acquire, through trade or otherwise, 3 silk resources by 455 AD. (Because the Koreans were famous for their production of silk. 2 resources are already around, the third one will be hard, as it is normally owned by China).

    2. Be the first to discover Printing Press (as the Koreans discovered the printing press much earlier than the Europeans did).

    3. Don't lose any cities to the Chinese or the Japanese before 1945 (which they never managed to do, and which will not be easy, as China and Japan will probably both declare war to Korea - in all my test games, at least one of them did so quite early).
     
  10. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    32,886
    Gender:
    Male
    Location:
    Leblanc
    Sounds good. How much cities do you intend for them to own? Only Seoul, or also some cities in Manchuria? Because if it's usually Seoul alone, the third condition becomes rather trivial (and the UP as well ...).

    Another idea would be to include the Vikings' goal of sinking a certain amount of ships, maybe against Japan and China only (to represent Korea's strong navy, especially under Yi Sun-sin).

    When I was thinking about a Korean UP, the following came to my mind:
    The Power of Adaptation: +50% research speed on every tech already discovered by Japan and China until the discovery of Printing Press.

    Also, do you use the standard BtS colors and coat of arms? Because it would be cool to see them using the Ihwamun seal instead. :)
     
  11. corovanrobber

    corovanrobber Chieftain

    Joined:
    Feb 13, 2009
    Messages:
    619
    Location:
    Germany
    Which colour is your Korea? I'd like to see it blue, y'know that light blue of vanilla Civ America.
     
  12. Jarkov

    Jarkov Chieftain

    Joined:
    Oct 23, 2010
    Messages:
    158
    They are intended to extend into Manchuria, and are quite good when they have two cities in Korea. I also made Pyongyang their capital, as that was the older city. So usually, they have enough cities to be captured by their enemies.

    Interestingly, my first thought regarding their UP was of the turtle ships, but the problem was that both Japan and China tend not to produce too many ships, at least not in my games so far - which would both mean that this UP wouldn't be very good, and that a UHV requiring them to sink Chinese and Japanese vessels would be hard to achieve.

    Until now I used the original BTS colour and coat of arms, but that's not too hard to change.
     
  13. corovanrobber

    corovanrobber Chieftain

    Joined:
    Feb 13, 2009
    Messages:
    619
    Location:
    Germany
    Oh in RFC Inca already are using the BTS Korean colour.

    I suggest Kaesong instead of Pyongyang (it's the same location). Ihwamun has to be red... Besides it's just the royal crest.
     
  14. Jarkov

    Jarkov Chieftain

    Joined:
    Oct 23, 2010
    Messages:
    158
    I know, and that makes the Inca appear orange like the dutch, which I have yet to fix.

    Kaesong is already there, but located on the tile south of Pyongyang.
     
  15. corovanrobber

    corovanrobber Chieftain

    Joined:
    Feb 13, 2009
    Messages:
    619
    Location:
    Germany
    That's on the silk? Well must be fine with another city in South Korea, perhaps even Seoul. Needs more resources though.

    I don't see the point in their UP. Seriously who loses cities to the barbs that much there has to be an unique power to accomodate that?
    How 'bout additional reducing of the cost of researching technologies of civs that you have in contact. Like if you know France, and they have Compass, and therefore the cost of researching Compass lowers for you by e.g. 7%. And if you know England with Compass also, it further lowers by 7%. However once they come out of contact with you, it goes up again. On a second thought I'd make it a Japanese UP, but whatever.
     
  16. Jarkov

    Jarkov Chieftain

    Joined:
    Oct 23, 2010
    Messages:
    158
    Pyongyang is on the silk. As far as I have played, the resources were plentyful enough, and all the important ones are there.

    The stability hits occur, if I'm not mistaken, every time you lose a city, regardless to whom. And since you're likely to lose some to Japanese, Chinese, Mongolians, or even Khmer (when you go to southern China / Vietnam to get a third silk resource), I think there is at least a bit reason to have this UP. But I'm not really that glad about it either.
    Your idea may not be bad, but at the time I really rather wouldn't have to code that.
     
  17. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    32,886
    Gender:
    Male
    Location:
    Leblanc
    Exactly. As are the three lions, the fleur de lys, the Ottoman tughra ... :D
     
  18. corovanrobber

    corovanrobber Chieftain

    Joined:
    Feb 13, 2009
    Messages:
    619
    Location:
    Germany
    But the UHV is to not lose cities to them?

    Meh.

    I am increasingly disappointed with non-Koreans making Korea modmods.
     
  19. Jarkov

    Jarkov Chieftain

    Joined:
    Oct 23, 2010
    Messages:
    158
    So? Is the UHV the only way to win?


    Well, my actual goal was to add another civilization without losing one. I picked the Koreans because they seemed to be the easiest to integrate into the game.

    Of course you can also try and traid for a third silk resource, or go and attack china, or whatever you want. If I reduced it to the silk resources already found in Korea, it wouldn't be much of a challenge.

    But please, come up with better UHVs, both more historically accurate and easy to code, and I'll gladly change mine.
     
  20. corovanrobber

    corovanrobber Chieftain

    Joined:
    Feb 13, 2009
    Messages:
    619
    Location:
    Germany
    To general understanding UHV and UP are to be in harmony for they are mutually dependent. I mean who the fuсk plays either for UP or for UHV only. Not even me.

    Better easily coded UHV's?
    Have three cities in manchuria in AD 830 (probably unchallenging)
    printing press etc
    hurr goal: invade Japan (by 16th century perhaps?)
     

Share This Page