How I adapted Rhye's DLL to my map and civs

srpt

Deist
Joined
May 10, 2010
Messages
2,038
Location
Toronto
I just finished adapting Rhye's DLL to my map and civs and since there is at least 1 person getting ready to do the same who I think is a beginner I thought I would write up what I did. I'm still having python issues with the mod but I think the DLL is fine. Anyway this gives the scope of the task, which is always helpful to people doing something for the first time. if I am missing anything crucial just tell me. my starting point was RFC Marathon and when I started the dll the mod already had all or almost all the xml done, in this case new tech tree, civs units, extra religions etc.

this is a bit of a "cheater's guide" as I am not telling you to go learn programming. if you are a complete beginner, as I am, you will still need to look at statements in the code and figure out what they are doing. you will have to backtrack and read some chapters of some tutorials at some point. I can't say I know C++, but I know quite a bit more about it then I did when I started.

1. Compiling
get Asaf's tutorial (link in his signature) and compile the regular DLL and then Rhye's DLL. there are other ways but this one worked for me and Asaf is active on the forums and answered all my questions when I had them.

2. make your source code changes
there are 2 files you will change almost completely: Rhyes.cpp and Rhyes.h. these have the list of civs, list of techs, building etc and the settler maps start dates and other things.

for the rest of the files you are basically changing references from Rhyes objects (civs, techs, whatever) to yours. there are also unique powers, which you can either comment out or give to one of your civs, lots of late start conditions for Rhye's 600AD start, which again you can use or comment out. search for "Rhye", "edead" to find the places to change.

then just run the compiler and fix bugs as it finds them. this took me a long time but all the errors it presented made sense to me except for 2, which both turned out to be weird typos and nothing fundamental.

to give you an idea of the changes, here is the list I made when I went through Rhye's source code with winmerge (not offering this as comprehensive, but to give you the scope)

Spoiler :
Cv files

CvArea.cpp - include CvRhyes.h, barb/ind power levels
CvCity.cpp - late civ growth bonuses, speedtweaks, other changes
CvCity.h - building & culture count changes
CvCityAI.cpp - noncritical changes
CvDeal.cpp - tweaks
CvDefines.h - max players, tweak
CvDLLButtonPopup.cpp - civ name display
CvDLLEntity.cpp
CvDLLEventReporterIFaceBase.h - add #pragma once to top
CvDLLWidgetData.cpp - include CvRhyes.h, stability, UHV and dynamic civ names
CvDLLWidgetData.h - as above
CvGame.cpp - many important changes
CvGame.h - important change
CvGameCoreDLL.cpp - small debug feature
CvGameCoreUtils.cpp - AI tweaks, edead's turn/year counter
CvGameCoreUtils.h - edead's turn/year counter
CvGameInterface.cpp - 1 comment and tweaks
CvGameTextMgr.cpp - date visibility, UHV display, extra civic column, embassies
CvGameTextMgr.h - 1 line
CvGlobals.cpp - tweaks
CvGlobals.h - tweaks
CvInfos.cpp - contact breaking, balance, stability
CvInfos.h - balance, tweaks
CvMap.cpp - tweaks, continents
CvPlayer.cpp - UPs, tweaks, dynamic names, balance, settler maps
CvPlayer.h - important changes
CvPlayerAI.cpp - city razing, no. of players, balance, tech choices
CvPlayerAI.h - tweaks plus 1 line
CvPlot.cpp - plot clearing, salt lakes, auto-play fix, culture block, tweaks, odd indent difference
CvPlot.h - tweaks, plot clearing
CvRandom.cpp - 1 line
CvSelectionGroup.cpp - fixes, tweaks
CvTeam.cpp - many changes
CvTeam.h -tweaks plus 2 lines
CvTeamAI.cpp - many changes
CvTeamAI.h - tweaks plus 1 line
CvUnit.cpp -mostly tweaks and balance
CvUnit.h - 1 line about upgrades
CvUnitAI.cpp - tweaks and changes
CvUnitAI.h - 2 lines
CvXMLLoadUtilitySet.cpp - 1 line


when you have something that compiles without errors, you can move on to the python, which is where I am now. I am still getting a "You have been defeated" when starting as the later civs so I may have to go back and recompile, but the auto-play works.( I should also say that when I first ran the map with the modded dll stability plus the basic rhye's python structure was already in the mod, not bug free but in place, and I know there are lots of stability references in the dll source so I don't know what would happen if you tried to use the dll with a mod that didn't have that python already.)

I hope this is helpful to someone. I had a great time doing it and learned a lot. Looking forward to playing Rhye's and Fall of Mesoamerica and India.
 
Exactly the same way. You can either create a new project file and add all the cpp & h files, or use the project files from Asaf and add CvRhyes.cpp and CvRhyes.h to it.
 
It looks okay when I compile it, but I keep getting errors when I try to run it:

Assert Failed

File: CvGlobals.cpp
Line: 3612
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: info type ERA_ANCIENT not found, Current XML file is: xml\GameInfo/CIV4GraphicOptionInfos.xml

----------------------------------------------------------

Assert Failed

File: CvXMLLoadUtilityGet.cpp
Line: 656
Expression: false
Message: Error in GetChildXmlVal function, unable to find a child node

----------------------------------------------------------

Assert Failed

File: CvGlobals.cpp
Line: 3612
Expression: strcmp(szType, "NONE")==0 || strcmp(szType, "")==0
Message: info type BUILDING_RIHLA not found, Current XML file is: xml\Buildings/CIV4BuildingInfos.xml




Also, which .rc file should I be using? There isn't one in the SoI source files...
 
Back
Top Bottom