[MODCOMP] Renaissance Project: Out of the Dark Ages!

smeagolheart

Monarch
Joined
Sep 4, 2007
Messages
924
Location
Phoenix, AZ
The lowdown:

The Tech tree is locked after middle ages until a special project called "The Renaissance" is built. This project is available with available with Theology. No renaissance tech may be researched until this is complete. This project grants a tech "The Renaissance" (complete with full voiceover) that enables further research. Anyone who later gets this tech through trade, espionage, etc can research renaissance and later techs.

Version History
1.0 Initial Release
1.1 Added AI to Project

Download Link: Link

The Renaissance (French for "rebirth"; Italian: Rinascimento, from ri- "again" and nascere "be born") was a cultural movement that spanned roughly the 14th to the 17th century, beginning in Florence in the Late Middle Ages and later spreading to the rest of Europe. The term is also used more loosely to refer to the historic era, but since the changes of the Renaissance were not uniform across Europe, this is a general use of the term.

Screens:
SS-1.jpg

ss2.jpg


More Screens:

Spoiler :
MP_EraStop.jpg


ss-3.jpg
 
Nice idea, well done, but i guess with the CannotResearch callback, the performance will not be that great :scared:.

I haven't measured the performance but I don't think it could possibly be that big a deal.

I *think* it would only look into python whenever you look at the tech tree or try to research something which shouldn't be every mili-second or anything.

Anyone who tries this, we're looking for a performance report :D

:science:
 
I think it´s needed if AIs don´t build the project.

I have meant to add some "ai priority" code for it and I'll get to it when I get some time, probably this weekend for version 2 :D

The concept for this is a fairly easily overcome bottleneck. Kind of like walking through a paper wall or something. It's not supposed to stop a civ for a huge long period of time. If it needs adjustment let me know and it'll get in there.

As I've said I can think of lots of potential uses for this if adapted - a sci fi era unlocked or going from neolithic into the main game.

I'll take code donations if anyone has any "hey ai value this project" code they can offer if they want it done sooner. That is pretty much the only thing missing from this :D

I can't say that the Ai don't build the project. Regardless, what is really important is the tech that comes from the project *is* weighted for the AI to be worthwhile AI so they will actively purse it. The renaissance tech is what actually unlocks the tech tree, not the project. If you (or the AI) gets the tech from trade, espionage, etc then the project is unbuildable (and not needed anymore).
 
I have meant to add some "ai priority" code for it and I'll get to it when I get some time, probably this weekend for version 2 :D

The concept for this is a fairly easily overcome bottleneck. Kind of like walking through a paper wall or something. It's not supposed to stop a civ for a huge long period of time. If it needs adjustment let me know and it'll get in there.

As I've said I can think of lots of potential uses for this if adapted - a sci fi era unlocked or going from neolithic into the main game.

I'll take code donations if anyone has any "hey ai value this project" code they can offer if they want it done sooner. That is pretty much the only thing missing from this :D

I can't say that the Ai don't build the project. Regardless, what is really important is the tech that comes from the project *is* weighted for the AI to be worthwhile AI so they will actively purse it. The renaissance tech is what actually unlocks the tech tree, not the project. If you (or the AI) gets the tech from trade, espionage, etc then the project is unbuildable (and not needed anymore).

I´ve not tested this. I only pointed out a potential issue with this modcomp ;)
 
How's this look for AI to create the project?

Code:
	def AI_chooseProduction(self,argsList):
		pCity = argsList[0]

## Renaissance Start ##
		iOwner = pCity.getOwner( )
		pPlayer = gc.getPlayer( pCity.getOwner( ) )	
		iProject = gc.getInfoTypeForString("PROJECT_RENAISSANCE")
		iTech = gc.getInfoTypeForString('TECH_RENAISSANCE')
		tTech = gc.getInfoTypeForString('TECH_THEOLOGY')

		if ( gc.getTeam(pPlayer.getTeam()).isHasTech(iTech) == false ):
			if ( gc.getTeam(pPlayer.getTeam()).isHasTech(tTech) == true ):
				if pCity.canCreate( iProject, 0, 0 ):
					gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( ).pushOrder( OrderTypes.ORDER_CREATE, iProject, -1, False, False, False, True )
					return True	

## Renaissance End ##
		return False

EDIT: It worked in my test mod but that was not a full blown game with a lot of things going on. Any possible issues you think?
 
It should work, atleast there's nothing wrong that I can see. But one thing I wonder is why you use
Code:
[B]gc.getMap( ).plot( pCity.getX( ), pCity.getY( ) ).getPlotCity( )[/B].pushOrder(....)
can't you use
Code:
[B]pCity[/B].pushOrder(....)
instead?
 
Hey Smeagol, would it be possible to rewrite the Python Code in CvGameUtils.py to lock the techtree also for i.e. Ancient Era --> Classical Era? As it is written now only one lock seems possible, or am I wrong?
Your code:
Code:
	def cannotResearch(self,argsList):
		ePlayer = argsList[0]
		eTech = argsList[1]
		bTrade = argsList[2]
		
		# <---------- begin tech limit changes ----------------->
		# Change the following number to limit eras civs can tech to
		# 0 = Ancient, 1 = Classical, 2 = Medieval, 3 = Renaissance, 4 = Industrial, 5 = Modern, 6 = Future
		iMaxEra = 2
		
		iTechEra = gc.getTechInfo(eTech).getEra()
		
## RENAISSANCE Start ##
		pPlayer = gc.getPlayer(ePlayer)

		iTech = gc.getInfoTypeForString('TECH_RENAISSANCE')
		
		if eTech == iTech:
			return True

		if ( gc.getTeam(pPlayer.getTeam()).isHasTech(iTech) == false ):
			if( iTechEra > iMaxEra ) :
				# True means cannot research
				return True
		
		# <---------- end tech limit changes ----------------->
## RENAISSANCE End ##			
		return False
One extra tech tree lock:
Code:
	def cannotResearch(self,argsList):
		ePlayer = argsList[0]
		eTech = argsList[1]
		bTrade = argsList[2]

## ANCIENT AGE Start: LOCK TECH TREE ANCIENT-CLASSICAL ##		
		# <---------- begin tech limit changes ----------------->
		# Change the following number to limit eras civs can tech to
		# 0 = Ancient, 1 = Classical, 2 = Medieval, 3 = Renaissance, 4 = Industrial, 5 = Modern, 6 = Future
		iMaxEra = 0
		
		iTechEra = gc.getTechInfo(eTech).getEra()
		
		pPlayer = gc.getPlayer(ePlayer)

		iTech = gc.getInfoTypeForString('TECH_WHATEVER')
		
		if eTech == iTech:
			return True

		if ( gc.getTeam(pPlayer.getTeam()).isHasTech(iTech) == false ):
			if( iTechEra > iMaxEra ) :
				# True means cannot research
				return True
		
		# <---------- end tech limit changes ----------------->
## ANCIENT AGE End: LOCK TECH TREE ANCIENT-CLASSICAL ##			

## RENAISSANCE Start: LOCK TECH TREE MEDIEVAL-RENAISSANCE ##		
		# <---------- begin tech limit changes ----------------->
		# Change the following number to limit eras civs can tech to
		# 0 = Ancient, 1 = Classical, 2 = Medieval, 3 = Renaissance, 4 = Industrial, 5 = Modern, 6 = Future
		iMaxEra = 2
		
		iTechEra = gc.getTechInfo(eTech).getEra()
		
		pPlayer = gc.getPlayer(ePlayer)

		iTech = gc.getInfoTypeForString('TECH_RENAISSANCE')
		
		if eTech == iTech:
			return True

		if ( gc.getTeam(pPlayer.getTeam()).isHasTech(iTech) == false ):
			if( iTechEra > iMaxEra ) :
				# True means cannot research
				return True
		
		# <---------- end tech limit changes ----------------->
## RENAISSANCE End: LOCK TECH TREE MEDIEVAL-RENAISSANCE ##		
		return False
Would something like this work?
 
Back
Top Bottom