• Civilization 7 has been announced. For more info please check the forum here .

[SDK MODCOMP] Civ4 Core Community Project

The Great Apple

Big Cheese
Joined
Mar 24, 2002
Messages
3,361
Location
Oxford, England
Firstly, I realize there are 2 other threads, however we've gone through a minor overhaul lately, and it was decided that I would post this as the generally thread, rather than having versions in the thread. This should be the last thead for a while...

Version: 1.61.0005a
Release Date: 7 August 2006
Compatability: Civ4 1.61 patch

Download link

Aims
The aim of this mod is to improve the game with improvements which, if not specifically enabled by the user, do nothing. While doing this, we are also working on adding modding tools for other modders to use. Our 6 key areas are:

1) AI
2) UI
3) Performance
4) Moddability
5) Bug Fixes
6) Gameplay tweaks

Currently the focus has been largely toward moddability improvements, but work is going on on other sectors as well.

How to contribute
If your interested in joining our project you'll want to access our forum. To do this you'll have to join our group (go to "Group Management" in the UserCP (http://forums.civfanatics.com/profile.php?do=editusergroups, and apply to join the "Civ4 Community Enchancement Project" group). This is where we discuss ideas, collect together work, and generally sort things out.

If you want to see what we've done so far I would recommend dowloading TortiseCVS. This should allow you to download the latest version including source code direct from our CVS.

Known issues
Lots of savegame incompatablitly. Save games from anything else just don't work, and are likely to give you a hard CTD.

Changelog
Spoiler 1.61.0005a :
2) UI:
- (Configurable) Improved Dawn of Man Screen (The Lopez)
- (Configurable) Enhanced Tech Splash Screen (Gaurav & Spocko)

4) Modding:
- Event manager pathced. Fixed bug where error would occur when python file changed. (SimCutie)
- AI Testing mod added (TGA)
Spoiler :
- DEMO_AITester.py: will run games autominously and log results
- CvGame::newGame(int iWorldSize, int iClimate, int iSeaLevel, int iGameSpeed, int iNumPlayers, int* paiCivilizations, int* paiLeaderHeads, int* paiTeams), CyGame.newGame(int iWorldSize, int iClimate, int iSeaLevel, int iGameSpeed, int iNumPlayers, int* paiCivilizations, int* paiLeaderHeads, int* paiTeams), Starts a new game with the inputted settings
- CvGame::restartGame(), CyGame.restartGame() restarts a game with current settings
5) Bug Fixes:
- Civics screen now correctly shows unhappness from religions (TGA)
Spoiler 1.61.0004a :
2) UI:
- (Configurable) Enhanced Game Text (SimCutie)
- (Configurable) Additional city info (12Monkeys)
- (Configurable) Number of possible promotion display
- (Configurable) City cycler on main window

4) Modding:
- New event and custom optoins handling interface. Supports "drag-and-drop" of compatable python mods for very easy combination, and dynamic options menu generation for in-game customisation of mods.
- Additional colour values available (SimCutie)
- CV***Info search routines (SimCutie)
- Real unique IDs for units (SimCutie)
- Script data preserved across upgrade/gift (SimCutie)
- Misc new routines (SimCutie)
- New unit events (unit reborn, and additional argsList info on some others) (SimCutie)
- Other new events called at various points in the game (SimCutie)
- Defines that can be set by the modder to find info on individual mods generically (SimCutie)
- Custom Widget interface (SimCutie)
- jdog5000's AI AutoPlay mod
- Lopez's Improvments Outside Borders mod

5) Bug Fixes:
- Fixes included from LunarMongoose:
Spoiler :

- Updgaded transport bug fix
- MP Camera fix
- First strike fix
- Intercept Domain Blocking Fix
Spoiler 1.61.0001a :
1) AI:
Nothing - Further more the AI is oblivious of all of the other changes though they may benifit from them they cant "see" the benifit and will not value them any more because of the added effects.

3) Performance:
- Camera Zooms in on all combats not just Offensive ones (Roger Bacon)

4) Modding:

- Enhanced game utils. The following checks have been incorperated into python to better control the game (12monkeys):
Spoiler :

called from CvCity.cpp
----------------------------
canCityWorkOnPlot -> if you want to prevent a certain plot to be workable
canCityHurry -> to prevent hurry production in a city
canCityConscript() -> to prevent conscripting in a city
calculateCityDistanceMaintenance() -> to change the distance maintenance for a certain city. Eg. by a special building.
calculateCityNumCitiesMaintenance() -> to change the num cities maintenance for a certain city. Eg. by a special building.
spreadReligionToCity -> to take action if a new religion is spread to your city
called from CvUnit.cpp
----------------------------
doUnitCommand() -> be informed about all unit commands and take action if necessary
canUnitMoveInto() -> do restrict/allow a plot for unit movement
canUnitFortify -> Eg. for fantasy mods a "restless" cast
canUnitHeal -> to prevent a unit from healing (eg. for fantasy mods)
canUnitNukeAt -> to allow to nuke a friend or yourself (return TRUE to be able to nuke yourself!)
canUnitSpread() -> eg. to decide if a missionary can spread a religion
unitUpgradePrice -> to change upgrade price for certain units (due to a special building in a city?)
isUnitInvisible -> changes a units invisiblity (maybe for TheLopez' sniper mod)
canUnitJoinGroup -> to define if a unit can join a group. Eg. for limited group sizes.
called from CvPlayer.cpp
----------------------------
canPlayerContact -> influence diplomatic abilities of a civ
canPlayerTradeItem -> influence in what players can trade.
canPlayerTradeNetworkWith -> to temporarily interrupt trade networks
canPlayerRazeCity -> have influence if a city can be razed or not
razeCity -> be informed/take action when a city is razed
canPlayerFoundCity -> influence where a city can be found
canPlayerConvert -> have influence on the religion conversion of a certain player
playerFoundReligion -> to prevent a religion being founded
called from CvSelectionGroup.cpp
----------------------------
canGroupStartMission -> decide what group mission is allowed or not
groupStartMission -> be infromed when a group starts a mission

- New XML tags. Won't cause errors if not included. Full interface & 'pedia support, check the new Schema files to see ware the tags need to be placed, putting them in the wrong spot will generate XML load errors.
Spoiler :

By Roger Bacon:

Civ4UnitInfos.xml
--------------------------
<bFlying> Allows a Domain Land unit to move over water, units still obey <terrainImpassible> tags and need new <UnitAI> to function properly

Civ4TraitInfos.xml
----------------------------
<iHappiness> - Adds set happiness in all cites. Negative values supported.
<iDiplomacy> - Any leader with Diplomacy altering traits experiences a bonus/penalty to all Diplomatic relations
<iSpecialists> - Any leader with the trait will get the perscribed number of free specialists in all cities
<iVoteModifier> - The number of Votes a player recives in the UN is multiplied by the modifer.
Civ4BuildingInfo.xml
----------------------------
<LocalSpecialistYieldChange> - Increases the yield of the set specialist for this city only
<LocalSpecialistCommerceChange> - As above but for commerce
<FreeWithTech> - gives the Building for free in all cities when the tech is discovered

Civ4TechInfos.xml
----------------------------
<SpecialistYieldChange> - Allows specialists of a certain type to increase their yield by the set amount on discovering the tech
<SpecialistCommerceChange> - As above but for commerce

-------------------------------
<ImprovmentMakesValids> allow an improvment to require another improvment creating in essense an upgrade if this is the only thing validating the Improvment, the AI will probably be screwed by this so it needs considerable testing.
Civ4 CommerceInfos.xml
-------------------------------

- Two new python methods: bool CyPlot.isOcean(), and bool CyCity.isConnectedToOcean() (12monkeys)
- Debug function added for SDK. Check out mod readme for details (12monkeys)

5) Bug fixes:
- Fixed a bug where increasing the number of commerce type would cause bad things to happen. (Impaler[WrG])
- Fixed a bug where units being transported by units which get upgraded, and lose transport capacity because of being upgraded (caravels --> frigates), were still transported. Now transported units will jump to the nearest valid plot, like when you are pushed by culture. (12monkeys)
- Fixed relocation due to culture/end war for ships. They will no longer get stuck in lakes when they were originally on the ocean. (12monkeys)
- Fixed an issue where production queues could be loaded in new games allowing construction of other Civ's UUs. Production queues can still be loaded, but you can no longer build other Civ's UUs. (12monkeys)

6) Optional Gameplay:
- (configurable) GreatPeoplePointPooling by Impaler[WRG]. Re-directs all GreatPeople Points generated in an Empire to a central Pool attached to the player. Set with the GameInfo/GameOptionsInfo.xml set the <bDefault> to 1 and any game you start will perminently use the Pooling.
- (configurable) Chalids Slow Cultural Borders, also controled through GameOptionsInfo.xml and is permiently stamped on the game, recommend you combine with modification to the Cultural levels.
 
7 Demo mods available at present. To install, unzip the file anywhere inside the python sub-directory of the CCP folder.

Demos included:
DEMO_ActionButton - shows how to add an action button
DEMO_AIAutoPlay - shows how to use the AI_Autoplay mod
DEMO_CustomOption - shows how to add an option to the options screen
DEMO_MoreCityName - ask SimCutie... :mischief:
DEMO_SimpleUnitName - ask SimCutie... :mischief:
DEMO_DemolitionMod - based on Snaitf's Demolition Mod. Allows buildings to be demolished
DEMO_AITester - will run games autominously and log results.

Download link
 
Here is a temporary list of new features (I'll remove this once TGA gets the first post finished). SimCuties extensive mod set form the core of this version (and I will let him give the details on these) but some other mods were also included.

POPULAR MODS INCLUDED:

jdog5000 AI AutoPlay (note the use of the new event manager used to integrate it) - press Ctrl + Shift + X to bring up a popup, enter a number of turns and the AI plays for you for that number of turns (at a rate of several turns a second), you regain control and can continue to play normaly after each use.

Lopez's Improvments Outside Borders - allows a new tag in ImprovmentInfos.xml which will allow the improvment to be built outside cultural borders. The ImprovmentInfos.xml files used in Lopez's mod will be cross compatable with the CCP.
 
Okies - I've updated the changelog. If I've got anything wrong, missed anything out, or otherwise made a mistake feel free to shout at me, and post a replacement/addition that I can easily shove in!
 
How about links for all the built-in enhancements?

In my case, there is an altered sdk and some of your ideas are quite good, so I'd like to have them, not all, but some of them.
 
Which built-in enhancements would you want the ability to remove? We should be able to make any/all of them configurable if you want, so that they can be disbaled/enabled at will. If you're using it as a base for a mod, then it should be fairly easy to set it so that the built-in things are forced to a value.
 
I didn't find the "readme" at all cear... where do I extract each folder/file to?
 
Okay, I deleted and then replaced all of the files in the "Custom Assets" folder from My Documents/My Games/Civ 4. Question now, will these changes take effect if I load a mod (guess is not) or do I have to play a new vanilla civ game?
 
With the CCP in your CustomAssets (place everything in the downloads Assets folder into CustomAssets) then you can run any of your traditional Mods with CCP enhancements (note that any game play altering enhancments are default off). So long as the Mod dose not have its own DLL, MainInferface or EventManager their shoul be no conflicts. If the Mod has thouse file the contents of CustomAssets will over-ride it and some of the mods effects may be lost untill they are configured to work with the CCP. Atempting to load save-games made under vanila Civ4 might cause a crash, theirs code that can load older games but its not bulletproof yet, test it out if you like.

The easiest way to test if you have successfully loaded the new DLL is to open the Civolopedia, click Improvments and mouseover a land based Improvment, in addition to the normal information you should now see "XXX Build Time" telling you the Build time (in workrate units, a worker has a base work rate of 100, incressed to 150 with Steam Or HagiaSophia so divide to get your actual turns). I added this because it always anoyed me that one of the most important pieces of information on improvments was totaly absent from the Pedia, its always on so if you see it you know the DLL loaded.
 
Would it be possible for any of you guys to add in an XML tag similar to UnitClassAttackMods, but for unit combat types instead? So you could, for instance, make it so that the horse archer gets a bonus attacking all siege units rather than just the catapult (I'm using for a mod I'm making).

I was thinking that it hopefully wouldn't be too difficult for someone who is C++ literate to do since it would be nearly identical to one of the current tags. If it isn't too much trouble would it also be possible to just include this change by itself rather than with the entire CCP? I'm already working with some modified SDK files and it would be a nigh on impossible (at least for me ;)) task to merge them with the entire CCP.

I would do it myself, but I'm a mere programming novice who has just started to get a real handle on python this week. The SDK just seems so big and intimidating :crazyeye:

Thanks
 
That not already possible? Spearmen and Axemen get bonuses against Similar types (Mounted and Melle) Seige is of the same type as thouse so it should be possible right now.

Whats the nature of your SDK work, were always looking for more good stuff (and more help getting it merged). Our main goal is to avoid these kinds of difficulties in merging.

P.S. Its seems likley that we will be making the CCP forums Open in the near future, once it is fully open requests can be made their (preferably on a "Make your Requests Here" Thread)
 
Impaler[WrG] said:
That not already possible? Spearmen and Axemen get bonuses against Similar types (Mounted and Melle) Seige is of the same type as thouse so it should be possible right now.
Ah, see thats what I assumed too, that this would already be possible. It makes so much sense that it should be in, but it isn't. The bonus that Axemen get is against Melee units on attack and defense. What I want is the ability to have it just be on the attack. Its already implemented so that you can have an attack or defense bonus against a unit class, but not a unit combat type.


Impaler[WrG] said:
P.S. Its seems likley that we will be making the CCP forums Open in the near future, once it is fully open requests can be made their (preferably on a "Make your Requests Here" Thread)
I think that would be a very good idea. Seems like there wouldn't really be much of an advantage to having the forum closed.
 
So do you think you're going to do this Impaler? I actually found a way to do it that I think I would be able to code, but its not nearly as good as an xml option. http://forums.civfanatics.com/showpost.php?p=3932295&postcount=20. I'd really only want to have to do that if I'm forced to.

So could you get back to me with whether or not its a possibility so that I'll know if I should do my workaround method? I'd be really appreciative if you did :)
 
Its ofcorse possible, the issue is "is it possible without huge blood-sweat-and-tear or messy code (no offense to Kael but I would slash my own wrists before I hardcoded an XML value into the code)

I think the best way would be the addition of 2 booleans to <UnitCombatMods>

<AttackOnly> <DefenceOnly> these would then be loaded into a signed char Attack true gets +1, Defence true gets -1 (so they would cancel out if someone tried to use the illogical combination of both at the same time). Defalut status of zero indicates the normal behavior of an allways on bonus. The code then just dose some simple switching to apply or not apply the bonus based on who is the attacker and the defender. The code could be re-resed for <DomainMods> aswell.
 
That sounds like a good implementation.

What I meant by "Is it possible" was "Is it possible that you will do this?" I know that Kael's method will work, I just don't want to do that if you are going to do a much better way.
 
As far as I am aware that was already supported, however it was shown incorrectly in the civics screen. There should be a fix for that in the next update, which should either be later today, or in the next few days.
 
The Great Apple said:
As far as I am aware that was already supported, however it was shown incorrectly in the civics screen. There should be a fix for that in the next update, which should either be later today, or in the next few days.[/Q]

Well my mistake, yes the negative values are suported but it is shown incorrect in civic screen. Sevo had managed to get this showing thing work. I'm interested to get it work in warlords, so i want to know how it can be done..
 
Top Bottom