Advertisement
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Project & Mod Development > Civ4 - Rhye's and Fall of Civilization > Rhye's and Fall Modmods

Notices

Reply
 
Thread Tools
Old Mar 19, 2011, 06:20 PM   #1
dnewhous
Chieftain
 
Join Date: Oct 2006
Posts: 63
Civ4 BTS Enabling tech trades immediately and allowing to change civs multiple times

There are a couple of restrictions that really bother me.

Tech trading is forbidden to starting civs with alphabet for an arbitrary number of turns at the beginning. I would like to eliminate this restriction.

I can't switch civs multiple times. The switches that I would like to make are Egypt->Carthage->Rome.

If I switch to Carthage, I do not get the option to switch to Rome.

I understand these changes will require a recompilation. Could someone just point out where to start looking to make the changes?
dnewhous is offline   Reply With Quote
Old Mar 19, 2011, 07:12 PM   #2
Leoreth
Knight of Time
 
Leoreth's Avatar
 
Join Date: Aug 2009
Location: Land of Heat and Clockwork
Posts: 14,997
It's only the trade techs thingy that requires to recompile the DLL. I've seen the guide here recommended quite often, it seems to be the most up-to-date. Tell me when you've managed to get the compiler running, we can then find out where exactly to make the changes.

The civ switch thing appears to be completely Python, so you can change it rather easily. It's actually two "rules" you have to take care of:

1) One that prohibits you from switching more than once.
2) One that prohibits you from switching between civs that spawn to close to one another (should be an issue for Carthage/Rome)

You can turn off (1) by opening Assets\RiseAndFall.py and search for "def getAlreadySwitched". You'll find that snippet of code:
Code:
        def getAlreadySwitched( self ):
                scriptDict = pickle.loads( gc.getGame().getScriptData() )
                return scriptDict['bAlreadySwitched']
Either delete it or comment it out (# at the beginning of all lines) and replace it with:
Code:
	def getAlreadySwitched( self ):
		return False
For (2), search for "tDifference" in the same file. You'll see a list of numbers associated with the civilizations in chronological order. These numbers mean that if you play the civ belonging to entry x, you can't switch to the following x civilizations. Setting all these numbers to 0 should take care of your problem here.

Please mind that I didn't test these modifications, so I can't guarantee everything works out without side effects.
__________________
Deep Thought is in everyone and everyone's in deep thought all the time.

Play RFC Dawn of Civilization version 1.10 and relive the history of the world!
Conquer Iberia as the Moors, dominate Asian trade as the Tamils, or resist colonization as the Kingdom of Kongo.
Leoreth is online now   Reply With Quote
Old Mar 20, 2011, 03:09 PM   #3
dnewhous
Chieftain
 
Join Date: Oct 2006
Posts: 63
Quote:
Originally Posted by Leoreth View Post
Tell me when you've managed to get the compiler running, we can then find out where exactly to make the changes.
I've got the compiler running. If I wanted to use brute force I suppose I could use BeyondCompare on every source file until I found the difference that inhibits tech trading.

Last edited by dnewhous; Mar 20, 2011 at 03:53 PM.
dnewhous is offline   Reply With Quote
Old Mar 20, 2011, 05:24 PM   #4
Leoreth
Knight of Time
 
Leoreth's Avatar
 
Join Date: Aug 2009
Location: Land of Heat and Clockwork
Posts: 14,997
Okay, then look for CvTeamAI::AI_techTrade and remove the two if clauses after "Rhye - start (no trading the first turns, for the exploit)".
__________________
Deep Thought is in everyone and everyone's in deep thought all the time.

Play RFC Dawn of Civilization version 1.10 and relive the history of the world!
Conquer Iberia as the Moors, dominate Asian trade as the Tamils, or resist colonization as the Kingdom of Kongo.
Leoreth is online now   Reply With Quote
Old Mar 20, 2011, 06:09 PM   #5
dnewhous
Chieftain
 
Join Date: Oct 2006
Posts: 63
Thanks. What exactly is the exploit? Seams to me more like Rhye doesn't like certain playing styles and is trying to force people to play the game a certain way.

Last edited by dnewhous; Mar 20, 2011 at 06:13 PM.
dnewhous is offline   Reply With Quote
Old Mar 20, 2011, 06:23 PM   #6
Leoreth
Knight of Time
 
Leoreth's Avatar
 
Join Date: Aug 2009
Location: Land of Heat and Clockwork
Posts: 14,997
I guess it's because it's possible to vassalize a newly-born civ by mass-gifting techs to get it both friendly and comparatively weak in its beginning turns.
__________________
Deep Thought is in everyone and everyone's in deep thought all the time.

Play RFC Dawn of Civilization version 1.10 and relive the history of the world!
Conquer Iberia as the Moors, dominate Asian trade as the Tamils, or resist colonization as the Kingdom of Kongo.
Leoreth is online now   Reply With Quote
Old Mar 20, 2011, 06:33 PM   #7
dnewhous
Chieftain
 
Join Date: Oct 2006
Posts: 63
One defect has been introduced - the wait at end of turn functionality no longer works, which only happens after switching to a new civilization.

While I'm at this, is how would I change the starting position of Egypt? Change the position of Carthage's 2nd city? I mean, without actually playing the civs.

Last edited by dnewhous; Mar 20, 2011 at 11:23 PM.
dnewhous is offline   Reply With Quote
Old Mar 23, 2011, 12:31 PM   #8
Cosmos1985
Prince
 
Cosmos1985's Avatar
 
Join Date: Sep 2008
Location: Aarhus, Denmark
Posts: 486
Kindof related; how hard is it to erase the erase-on-spawn thing, where newborn civs automatically raze cities at or around their spawn tile?
__________________
Civilization took my life, and all I got was this lousy sig.
Cosmos1985 is offline   Reply With Quote
Old Mar 23, 2011, 12:46 PM   #9
Leoreth
Knight of Time
 
Leoreth's Avatar
 
Join Date: Aug 2009
Location: Land of Heat and Clockwork
Posts: 14,997
Quote:
Originally Posted by dnewhous View Post
One defect has been introduced - the wait at end of turn functionality no longer works, which only happens after switching to a new civilization.

While I'm at this, is how would I change the starting position of Egypt? Change the position of Carthage's 2nd city? I mean, without actually playing the civs.
That defect has always been there when you switched civilizations. Save and reload your game and it should go away.

Starting positions are in Consts.py, the tCapitals tuple specifically.

You can try to influence the AI city placement by editing the settler maps in CvRhyes.cpp.
__________________
Deep Thought is in everyone and everyone's in deep thought all the time.

Play RFC Dawn of Civilization version 1.10 and relive the history of the world!
Conquer Iberia as the Moors, dominate Asian trade as the Tamils, or resist colonization as the Kingdom of Kongo.
Leoreth is online now   Reply With Quote
Old Mar 23, 2011, 12:57 PM   #10
srpt
Deist
 
srpt's Avatar
 
Join Date: May 2010
Location: Toronto
Posts: 1,241
I got rid of it without saving and reloading, just turn it off and back on.
srpt is offline   Reply With Quote
Old Mar 23, 2011, 05:43 PM   #11
dnewhous
Chieftain
 
Join Date: Oct 2006
Posts: 63
Quote:
Originally Posted by Cosmos1985 View Post
Kindof related; how hard is it to erase the erase-on-spawn thing, where newborn civs automatically raze cities at or around their spawn tile?
I've only had that happen when my city is right next to where they want to spawn. Since you can't have two cities right next to each other, and that rule makes a lot of sense, I don't see a possible workaround.

Something else that annoys me -

if I capture a city with a worker and sleeping ships, they all go into oblivion. I think I should get any worker or settler and the loser should get to keep his ships - ejected outside the city. The game frequently pushes my ships around if I have them anchored next to another civ's cultural border.

If you put Egypt's capital one tile to the north of the default starting location it will develop into a truly awe inspiring city. I played Egypt well enough to give them 500 culture by turn 84 and the capital is well defended enough that they can dust 4 legions like bunt cake (city walls are the magic trick). The coastal city isn't worth the trouble without the capital, it will get squeezed between the Egyptian and Greek cultural borders.

The best part of taking Carthage early game is you get a free worker out of it. The worst part is that North African cities are poor and take too much effort to defend once the barbarian migrations really get going. Maybe trying to make something out of a city in southern Italy is the better idea after all. Carthage's 2nd city, if it's built one tile to the west of the default location, can develop into a good city once you can build windmills.
dnewhous is offline   Reply With Quote
Old Mar 23, 2011, 06:21 PM   #12
Leoreth
Knight of Time
 
Leoreth's Avatar
 
Join Date: Aug 2009
Location: Land of Heat and Clockwork
Posts: 14,997
Well, it's possible to flip the already existing city to the new civ instead. Edead does it for the Ottomans and Mamluks in SoI, and the Byzantines in DoC work that way as well.
__________________
Deep Thought is in everyone and everyone's in deep thought all the time.

Play RFC Dawn of Civilization version 1.10 and relive the history of the world!
Conquer Iberia as the Moors, dominate Asian trade as the Tamils, or resist colonization as the Kingdom of Kongo.
Leoreth is online now   Reply With Quote
Old Mar 25, 2011, 12:29 PM   #13
dnewhous
Chieftain
 
Join Date: Oct 2006
Posts: 63
Quote:
Originally Posted by Leoreth View Post
You can try to influence the AI city placement by editing the settler maps in CvRhyes.cpp.
Uh, roughly speaking, does a higher number mean they are more or less likely to build at a particular site? What is the significance of the number 20?

Then I just have to figure out which numbers correspond to which map tile. It would probably behoove me to write a program to parse the .cpp file if I figure out the system. Someone must understand it, the position of Greece's cities has shifted a little from the installed version of Rhye's.

Also, I do no like the way military unit treachery is handled when spawning new civs. If I wanted to make it so that the 50/50 chance is rolled only if the unit is in a city that decides to leave my empire despite my choice to keep the city, is that doable? Otherwise, I'd like to just keep all of my units, regardless.
dnewhous is offline   Reply With Quote
Old Mar 25, 2011, 01:10 PM   #14
hoplitejoe
Villager: Soul Pillager
 
hoplitejoe's Avatar
 
Join Date: Mar 2010
Posts: 3,680
By the time you are finished with rfc you will have a completely new mod dnewhous
__________________
The inner animal has been crossed
hoplitejoe is offline   Reply With Quote
Old Mar 25, 2011, 01:57 PM   #15
Leoreth
Knight of Time
 
Leoreth's Avatar
 
Join Date: Aug 2009
Location: Land of Heat and Clockwork
Posts: 14,997
Quote:
Originally Posted by dnewhous View Post
Uh, roughly speaking, does a higher number mean they are more or less likely to build at a particular site? What is the significance of the number 20?
Yes. 20 means sea, 3 otherwise unsettlable (peak, marsh). The AI also does not settle on tiles with a value of less than 90.

Quote:
Then I just have to figure out which numbers correspond to which map tile. It would probably behoove me to write a program to parse the .cpp file if I figure out the system. Someone must understand it, the position of Greece's cities has shifted a little from the installed version of Rhye's.
No need to write such a program, simply select the whole settler map matrix and paste it into a table calculation program like MS Excel or Open Office Calc.

Quote:
Also, I do no like the way military unit treachery is handled when spawning new civs. If I wanted to make it so that the 50/50 chance is rolled only if the unit is in a city that decides to leave my empire despite my choice to keep the city, is that doable? Otherwise, I'd like to just keep all of my units, regardless.
Well, currently, only units that are inside the new civ's core are affected. Your change would basically open up even more ways of exploitation, because your armies besieging recently flipped cities would be safe.

Anyway, it's probably easy to insert a condition like
Code:
if gc.getMap().plot(unit.getX(),unit.getY()).isCity():
into the flipping code.
__________________
Deep Thought is in everyone and everyone's in deep thought all the time.

Play RFC Dawn of Civilization version 1.10 and relive the history of the world!
Conquer Iberia as the Moors, dominate Asian trade as the Tamils, or resist colonization as the Kingdom of Kongo.
Leoreth is online now   Reply With Quote
Old Mar 26, 2011, 05:19 PM   #16
dnewhous
Chieftain
 
Join Date: Oct 2006
Posts: 63
Quote:
Originally Posted by hoplitejoe View Post
By the time you are finished with rfc you will have a completely new mod dnewhous
I'll have a modmod.

One issue at at time.

As currently written, I can't send a scout from Egypt to Carthage without an escort.

Where is barbarian generation at?

Come to think of it - I've noticed that the AI likes to generate an army of barbarians around goodie huts as well, and that definitely wasn't true in the default version of Rhye's. I want to turn that off, too. If I can't figure out how to be subtle about it, I'd like to remove the barbarian state altogether.

Rhye's has made workers the most useful scouts, they have 2 movement and don't inspire the game to generate more barbarians at every step. I disocvered this while playing Ethiopia which starts off with 3 of them. I'd like barbarian generation to work for every unit like it does for workers.

Last edited by dnewhous; Mar 26, 2011 at 05:25 PM.
dnewhous is offline   Reply With Quote
Old Mar 26, 2011, 08:33 PM   #17
Leoreth
Knight of Time
 
Leoreth's Avatar
 
Join Date: Aug 2009
Location: Land of Heat and Clockwork
Posts: 14,997
I don't know in the slightest what you're talking about. Afaik barbarians are only created on a "in certain turns" basis.
__________________
Deep Thought is in everyone and everyone's in deep thought all the time.

Play RFC Dawn of Civilization version 1.10 and relive the history of the world!
Conquer Iberia as the Moors, dominate Asian trade as the Tamils, or resist colonization as the Kingdom of Kongo.
Leoreth is online now   Reply With Quote
Old Mar 26, 2011, 11:08 PM   #18
dnewhous
Chieftain
 
Join Date: Oct 2006
Posts: 63
Including animals? The random generation function, createBarbarianUnits, has been modified from BTS so it only generates animals.

Last edited by dnewhous; Mar 27, 2011 at 06:33 PM.
dnewhous is offline   Reply With Quote
Old Mar 27, 2011, 07:40 AM   #19
King Yngvar
Chieftain
 
Join Date: Apr 2007
Posts: 21
Thanks for this information Leoreth, just what I was looking for
King Yngvar is offline   Reply With Quote
Old Mar 27, 2011, 11:32 PM   #20
dnewhous
Chieftain
 
Join Date: Oct 2006
Posts: 63
Does anyone know what the difference is between getImprovementType and getRevealedImprovementType?
dnewhous is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION IV > Civ4 - Creation & Customization > Civ4 - Project & Mod Development > Civ4 - Rhye's and Fall of Civilization > Rhye's and Fall Modmods > [BTS] Enabling tech trades immediately and allowing to change civs multiple times

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Advertisement

All times are GMT -6. The time now is 08:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This site is copyright © Civilization Fanatics' Center.
Support CFC: Amazon.com | Amazon UK | Amazon DE | Amazon CA | Amazon FR