Thoughts about some tweaks

Scripting is not programming, though. I'm pretty sure the core of Oblivion is also coded in C++ or a similar language.
 
You mean Occupation? They need the necessary tech, otherwise it will flip back to the standard civic. Exceptions like Egypt's UP need to be coded in the DLL.
 
So I found out. Where in the DLL?

in other news. I'm considering adding special features to each religion. So far Islam is the only one I have a definite idea for. Basically making Mosques and Temples work as high-powered courthouses. Allowing players to conquer and not worry too strongly about the costs.
 
I think if you open all the .cpp files at once in Notepad++ and search for "EGYPT" you will find it. I remember copying that change and it was not hard to figure out what to do. then you have to compile.
 
wait....I am technologically illiterate. Explain compiling to me.

This has some useful info http://modiki.civfanatics.com/index.php/Civ4_SDK

And about my 'futile' efforts at Better AI and RAND...
I managed to merge and compile them! And the game fired!... and of course on starting a new game the Autoplay sequence doesn't work and all civs spawned at once :lol:. But at least I learned some things (like how to spot a function header:mischief:), so I will try again, and again, until I inevitably succeed!:rolleyes:
 
Unlike Python code, C++ can't be interpreted by the game directly, but has to be compiled to machine code so the game can "understand" it. That's done by a C++ compiler that has the Civ4 Software Development Kit (SDK) installed. You can learn how to do that here.

It may look daunting at first, but it's really an easy step-by-step guide.

The method you're looking for is CvPlayer::canDoCivic(), by the way.
 
Okay I searched line-by-line and honestly I have no idea what I am looking for. Egypt has the misfortune of being named 0 in the python script so it is hard for me to find what line i need to edit
 
its not in the Python folder. its in the CvGameCoreDLL folder. the file is CvPlayer.cpp
 
Wow, I finally made it!!:rockon: Autoplay works fine, everything seems to work fine! I can't believe it.
There were some very uneasy spot, particularly in CvPlayerAI and CvUnitAI.cpp, which Better AI had changed almost completely, and I wonder if my merge there has been adequate. Off the top of my head, I've kept the Better AI code for defensive pacts, which can be customized in the xml, and I haven't merged Rhye's code for targeting minor civs' cities since I didn't know how to convert it to Better AI format.
There's undoubtedly some tiny errors here or there, things which could have done better due to my lack of knowledge, but the end result is definitely Better AI + RAND!
Plus a few more things:
Spoiler :
SDK, PYTHON, XML
- Merged Better AI 1.02a + Unofficial Patch 1.6
- Merged Global Warming mod 1.11 by Minor Annoyance (http://forums.civfanatics.com/showthread.php?t=302649)
- Merged some changes from Mongoose SDK 3.3 (http://forums.civfanatics.com/showthread.php?t=325318), either directly or included in the UP 1.6
-- FloodPlainsFix
-- AITargetCityValueFix
-- TransportUpgradeFix
-- CargoLoadFix
-- CargoInterceptFix
-- PromotionRefundFix
-- ExperienceNeededMod
-- CollateralDamageMod
-- FlankingDamageMod
-- CityTileCommerceMod
-- FeatureGrowthMod
-- EventTileDowngradeMod
-- PillageOwnRoadsMod
-- TeleportingIntoLakeFix
-- CameraZoomFix

- Merged Varietas Delectat 9.2 by avain (http://forums.civfanatics.com/downloads.php?do=file&id=17916)

PYTHON
- Consts.py: Enabled Hatshepsut for Egypt as the early AI leader, she gets replaced by Ramesses around 1600BC and is selectable to play with. Changed Ming Tai Zu (now Taizong) to appear circa 500AC
- Stability.py: Holy Roman Rathaus also increases stability
- UniquePowers.py: Added Religious Inmigration by Panopticon (http://forums.civfanatics.com/showthread.php?t=338241), changed so that it doesn't favor any religion and restricted by theology
- CvPediaMain.py, CvPediaBuilding.py: the new UU and UB (see civilizations below) will now appear in the Civilopedia, as well as some previously hidden leaders
- CvRFCEventHandler.py, UniquePowers.py: Arabia now also receives a state religion cathedral upon building a temple in the city, to avoid them being virtually impossible to build in settler-built cities
- CvRFCEventHandler.py: acquiring a city in a trade or having it collapse no longer removes national wonders turned to world wonders in RFC, nor the Triumphal Arch, and does remove the Olympic Park and Palaces

ART
- CIV4ArtDefines_Terrain.xml, Assets\Art\Terrain\Textures: Changed the marshes' graphics and art schema to Marsh terrain graphics from Colonization by johny smith (http://forums.civfanatics.com/showthread.php?t=293601)
- CIV4ArtDefines_Leaderheads.xml, CIV4GameText_RFCWarlords.xml, Assets\Art\leaderheads\Taizong: changed Wang Kon/Ming Tai Zu with Taizong (http://forums.civfanatics.com/showthread.php?t=293107)

BUILDINGS
- Fixed all national wonders turned to world wonders in RFC so that they give no culture when captured (Colosseum, Channel Tunnel, Mt. Rushmore)
- Turned Triumphal Arch into a regular building and it is always captured
- Moved all embassies to their own special building category, they become obsolete with Electricity
- Interpol is again a regular building, requires Communism
- Amphitheatre gives +1 happiness for Football Events, UB versions don't (they are all already better off)
- Market and Forum give +1 happiness for Cotton
- American Mall gives no happiness for Football Events
- Pyramids never go obsolete (karadoc)
- Statue of Zeus requires just a monument in the city, since they often go obsolete too soon to have bothered building 4+ of them

CIVILIZATIONS
Basically I've added a UU and UB to some civs if their culture generally encompasses that of a civ which doesn't appear in RFC
- Babylonia: Gets back the Garden UB, added Vulture UU (+Sumeria), you can now select Gilgamesh to play
- Byzantium: Added Odeon UB, which is present in Athens in the 600AD scenario (this is just to prevent Athens having an Amphiteatre and an Odeon, which generally won't happen anyways)
- China: Added Hwacha UU, Seowon UB (+Korea), changed Ming Tai Zu with Taizong
- Germany: Added Landsknetch UU, Rathaus UB (+Holy Rome)
- Rome: Added Cataphract UU, Hippodrome UB (+Byzantium)
- Greece: Added Cataphract UU (Lone Wolf)

GAME INFO
- Serfdom: +1 gold and +1 hammer from Fort, -1 gold from Town

UNITS
- Added Commando promotion to Great Spy (PieceOfMind)
- Workboats incur no military support and get no military production modifiers (PieceOfMind)
- Gunship, Mobile Artillery, Missile Cruiser and Stealth Destroyer require Aluminum (Civ V)
- Battleship requires Artillery (PieceOfMind)
- Missile Cruiser requires Rocketry
- Attack Submarine requires either oil or uranium, has +75% attack against Battleship
- Jet Fighter has +50% against helicopters (Civ V?)
- Infantry no longer can upgrade to SAM Infantry (Fuyu)
- Grenadier can upgrade to SAM Infantry (Fuyu)
- Increased iPower of: Catapult (5->6), Cannon (12->14), Artillery (18->19), Mobile Artillery (26->28), Missile Cruiser (14->42) as per Fuyu and PieceOfMind's recommendations
- City Garrison promotions give protection against revolts (10, 15 and 20%)
- Mali Skirmisher is now a Longbowman replacement, with strength 7
- Gunship can move over peaks
- Paratroopers can move through Jungle and Marsh
- Panzer starts with Mobility instead of Commando and requires Oil instead of Combustion (Leoreth)
- Mercenaries get +100% gold from pillage
- Renamed Phalanx to Hoplite and Oromo warrior to Askari (Leoreth)
- Lowered evasion chance of guided missile to 90%
- Added the Asault Mech from Next War! Its an armored, national unit, 3 allowed. Combat 50, cost 450, -10% city attack, 15% withdrawal, 20% interception with range 2, 2 moves, 1 first strike, collateral up to 60% to 6 units, no def. bonuses, starts with Blitz and Morale. Requires: Fusion, Robotics, Aluminum and Uranium

Now, to merge the Epic and Marathon game speeds, and maybe some more. I wonder what would be a good name for this project? Better RAND AI? Rhye's and Fall of the AI?

Also, for my idea about the Arabian UP, where would be the code that controls the behavior of PrereqBuildingClasses?

EDIT: first problem I've encountered, and quite bad. the AI is stockpiling settlers, but building few to no cities. In an American start, almost no civ had built more than two cities, China, Mongolia and Russia had 5 settlers in the capital and no cities beside it. The European civs had built some cities in the new world.
Any ideas about what could cause this? I honestly have none...

EDIT2: seems like I have orphaned content out of CvPlayerAI::AI_foundValue. Now to figure out where is the bracket causing the mess... Any tips about C++ I should know to deal with such cases? EDIT3: a bracket has to be commented like // }, not like //} it seems...:run:
 
I corrected errors, but to no avail, the AI is simply not founding any cities:cry:

I've settled for a merge with the regular Unofficial Patch 1.6, at least I can make full sense of its changes, and after trying the result out the AI is back to building cities as always. The merge with Better AI is therefore postponed indefinitely... because after so much coding without knowing code I just want to play, dammit :D
 
In other news I continue to encounter a terrible annoying issue with Arabia. (Although giving the camels the drill promotions helps) Generally the civ seems downright fearful of trying to attack north africa. Maybe it's just my map edits but overall it is just...annoying to me.
 
Easiest solution is to add a Python callback to all events that verifies that the player isn't a minor.

Now that I'm looking into this, I'm thinking of barring all events to barbarians and minors directly in the SDK. I found what might be the code controlling them globally, in
Code:
bool CvPlayer::canDoEvent(EventTypes eEvent, const EventTriggeredData& kTriggeredData) const
Is that the basest function which determines whether an event can happen at all? If so, I assume I just have to add there:
Code:
if (GET_PLAYER(kTriggeredData.m_eOtherPlayer).isBarbarian() || GET_PLAYER(kTriggeredData.m_eOtherPlayer).isMinorCiv())
{
	return false;
}
The thing is, I didn't found an isBarbarian() check there, but events can't target barbarians in any way already AFAIK, neither they can have it nor can they target them from another civ. Would the function/s I'm looking for be somewhere else then?

My next target, remove the minors from the diplomacy screen and from any AI considerations regarding relations to other players.


In other news I continue to encounter a terrible annoying issue with Arabia. (Although giving the camels the drill promotions helps) Generally the civ seems downright fearful of trying to attack north africa. Maybe it's just my map edits but overall it is just...annoying to me.
I had Arabia conquering and holding North Africa and making Spain its vassal once, but not in time for their UHV. Pretty exceptional though. Generally speaking, if you want the AI to act competently, you have to lead them yourself :D
 
Yes indeed XD.

Although as a quick note I found that adding baghdad as a byzantine city (I might even make persia byzantine. If anything just to represent the Sassanids at the time rather then just vague city-states) Has encouraged the arabs to head east. Almost always conquering up to India.

Alas they still leave NA alone -__-. Now of course I did remove alexandria and hesperides and replaced them with Berenice.

Could be the reason.
 
No idea where the barbarians are excluded, but what you're proposing there should work at least.
 
valid point. You do mean representing the Sassanids with barbs yes?

In other news. I thought of giving the Jans the leadership promotion. But at the same time remove the ability to upgraade them to Riflemen.

Why do this? Bbecause I still want the ottomans to be able to fight on par with other units using highly-promoted janissaries. But by the time Infantry rolls around you'll probably had to have dispensed of the long-outdated janissaries.
 
To prevent the possibility of all my work being lost, and mainly because I want to share with other Civ players what has been my first contact with SDK, Python, XML, and Civ modding in general all at once, I'm intending to release my work so far, with proper credits to the work of everyone involved. The problem is that the final product is 700MB big, 200MB without the .FPK files from Varietas Delectat, so I'm going to have problems hosting it.

I have read the file upload guide, http://www.civfanatics.com/misc/guides/file_upload, so it would seem I need an external host. ModDB seems too professional for the scope of this, which is mainly an amalgamation of already existent mods with my tweaks here and there.

Sorry to be asking this, which seems a bit out of context, but anyone could suggest me what to do if I wanted to release this? Or should I release it at all?
 
Back
Top Bottom