Celtic Mod v2.0 Release

antaine

King
Joined
Aug 1, 2005
Messages
737
Here is the Celtic Mod version 2.0. This one definitely autoplays better, but as a consequence the British city spawns have been changed to Independents and lower sizes ( and since they're not barbarians, there is no free warriors spawn for the Celts anymore). The English core area has been increased to cover the entire island of Britain, so two of the flipped Indy cities are going to want to flip to England, and England shouldn't be content to sit in its little corner, begging to become the human player's vassal.

Because two, if not three, cities will want to automatically flip to the Celts on the British Isles, I have also changed the Celtic UHV that required three British Isles cities by 200AD to be four British Isles cities, two Gallic cities and one city in northern Spain by 500 AD. The Gaulish and Spanish areas are part of the Celts normal and broader areas, but are no longer part of their core. I don't want to make it impossible for the human player to stave off collapse should they find themselves limited to Ireland with three other civs designed to carve out chunks of their core area.

This can be done by founding the capital on the square where you start and using your second settler in northwest France. Allow Cork and Cardiff to flip to you, capturing Edinburgh with troops from Cardiff (or possibly waiting for a flip, but you may never get there) and founding two more Continental cities (one in in western France (Bordeaux is a good choice) and one in northern Spain). You might be thinking," only build two settlers?" but this is easier said than done with Roman expansion, barbarian invasions and a 500 AD deadline that may cause you to expand too fast with stability problems. Success in this UHV will require either granting independence, flipping your cities to France, Spain and England and/or war with the three of them.

The English starting army has been increased since they'll be starting on an island with a hostile civ instead of a few Indy cities (the Celts had been taking London on the first turn, with the English popping back on the next, but with the capital now at Cardiff).

On the first autoplay run, the English took the whole island of Britain, causing the Celts to eventually collapse into Indy cities on Ireland which could be easily picked off by the English (historically accurate). While the English culture per se is only "native" to England and not Scotland, Wales or Cornwall, for the sake of making a playable England (and a scenario resulting in England conquering the Celts more often than not should the human player not be playing the Celts) I went with their historical drive to claim the whole island. I was also hoping that a Celtic resurrection might be better limited to Ireland in that way and not 75% of the English home island cities.

http://www.filefactory.com/file/b005fe3/n/RFC_with_Celts.zip
 
The Gaulish and Spanish areas are part of the Celts normal and broader areas, but are no longer part of their core. I don't want to make it impossible for the human player to stave off collapse should they find themselves limited to Ireland with three other civs designed to carve out chunks of their core area.
I don't know how much of this you have been able to test yourself, but I'm not sure what exactly the Core Area (as defined in the Consts.py file) does for stability. There is however a special kind of collapse designed by Rhye for AI Civs (and AI Civs only). It happens if the Civ in question is completely out of both its Normal and Broader Area, and triggers every few turns (so it in effect becomes a countdown until the actual collapse).

There is also another form of AI collapse that triggers once a Civ loses more than half of its cities (by any means). This is also checked every few turns and thus there's a chance of the Civ to either recapture enough cities to get out of the pickle - or to vasallize to another Civ in order to not collapse. Note that the Medieval spawns in Europe could very well trigger a collapse of this kind.

Use the PythonDbg.log file to see what type of collapse the Celts are actually falling victim to. The standard one would be "collapse: civil war" and triggers when a Civ has less than -40 in stability. The other ones are "collapse: motherland" and "collapse: generic" respectively. (There's actually one more: "collapse: barbarians" that triggers when a Civ loses cities to the minor Civs.)

I was also hoping that a Celtic resurrection might be better limited to Ireland in that way and not 75% of the English home island cities.
A respawn always happens inside the Normal Area (not the Core Area) and there is a limit of a maximum of 5 cities that can flip. So a larger Normal Area would result in a more random outcome, as there would be more cities to potentially flip.

So what I suppose you want is a Normal Area confined to Ireland (and perhaps western Britain or even Bretagne) - and a Broader Area encompassing all of the historical Celtic areas. Design the Celtic Core Area based on where you want them to initially spawn - and maybe even taking stability issues (the "stabilty map") into consideration.
 
ah, well, I suppose it would have been historically possible to have had Ireland remain occupied while Wales or Scotland delcared independence. It's even possible for Brittany to have done so, so I guess it's not that bad to have the normal area as-is.

on another note, if the Celtic player is looking to conquer/destroy/prevent the English from popping up, they may very well be looking to take the place of the British Empire in history. Pursuant to that, I'd like to increase the Celts' broader area to include not only what is included now (which would not be part of the English area) but also areas of strong Celtic influence (albeit due to Irish and Scottish emigration from the UK), namely the US, Canada, Australia and New Zealand (but not India or British holdings in Africa or Asia). That, and some better names in place of the Latin Continental space fillers I've been using...
 
I couldn't resist the temptation of taking a look at your own Python work. :D First of all let me congratulate you on making your first bit of actual programming and making it work as you intended! :goodjob:

The code isn't in the best shape though, so I gave it a quick cleanup, made the structure easier to see, deleted the old Carthaginian code that wasn't doing anything, and added comments to the code. This is what your code probably should or could look like:
Code:
                #Celtic UHVs
                elif (iPlayer == iCeltia): #only check the following code if its the Celtic player's turn
                        if (pCeltia.isAlive()): #...and only if the Celtic player is alive

                                #UHV 1
                                if (iGameTurn <= i450AD): #check if the UHV is completed only if there is still time
                                        if (self.checkOwnedArea(iCeltia, tRoimhTL, tRoimhBR, 1)): #UHV condition
                                                self.setGoal(iCeltia, 0, 1) #set UHV to achieved

                                elif (iGameTurn == i450AD and self.getGoal(iCeltia, 0) == -1): #...and fail it if its the last turn and it hasn't been completed
                                        self.setGoal(iCeltia, 0, 0) #...then set UHV to failed

                                #UHV 2
                                if (iGameTurn <= i500AD):  #check if the UHV is completed only if there is still time
                                        bIsles = self.checkOwnedArea(iCeltia, tBritishIslesTL, tBritishIslesBR, 4) #first UHV condition
                                        bGaul = self.checkOwnedArea(iCeltia, tGaulTL, tGaulBR, 2) #second UHV condition
                                        bIberia = self.checkOwnedArea(iCeltia, tIberiaTL, tIberiaBR, 1) #third UHV condition
                                        if (bIsles and bGaul and bIberia): #check if all conditions are met
                                                self.setGoal(iCeltia, 1, 1)  #set UHV to achieved

                                elif (iGameTurn == i500AD and self.getGoal(iCeltia, 1) == -1): #...and fail it if its the last turn and it hasn't been completed
                                        self.setGoal(iCeltia, 1, 0) #...then set UHV to failed

                                #UHV 3
                                if (iGameTurn == i1700AD and self.getGoal(iCeltia, 2) == -1): #check if its the last turn and the UHV hasn't been completed
                                        self.setGoal(iCeltia, 2, 1) #set UHV to achieved since it hasn't been failed

                                #the code for failing the third UHV is in another location
This could seem like nitpicking as you've actually confirmed that the code works, and that's what matters, right? No, unfortunately there was actually an issue or two with the code, that wouldn't be obvious if you can't actually read Python. For instance, one of the UHVs would have failed if it would have been achieved on the last turn - that wasn't you intention, right?

I suggest you replace your own code with the one above and use it as a basis for any further development. (You can of course delete any of my commenting if you like, as it has no bearing what-so-ever on performance.) A more logical structure will allow you to make changes more easily without causing errors or unintended results (bugs, really). Note how the first and second UHVs follow the same basic structure. You should keep this structure in order to avoid any possible issues going forward.

One thing you probably should try and pick up at this juncture is the indentation of Python code. Every 8th blank spaces at the beginning of a line equates to one hierarchy level. This is key to understanding how the code is structured. Note how the hierarchy goes up one level after every "if" (or "elif") statement, and how every "elif" statement is matched by a "if" statement on the same hierarchy level above it in the code.

Its a matter of logic, really, and this insight will give you that much more power as a Python programmer. :king:

Also, a quick note about "if" and "elif": You could probably rewrite the code to get rid of all the "elif" statements, but those are actually something you wanna use! Because if a "if" statement means, for example, "is the goal completed?" the corresponding "elif" statement could be "or is the goal failed?".

There is also an "else" statement allowing you to throw all the possibilities not covered by the initial "if" statement or the following "elif" statement(s) into one last outcome. So the "if" statement of "is it the color blue?" and the "elif" statement "or is it the color red?" would make all the other possible outcomes fit under "or is it some other color?". It would translate into something like this:
Code:
if (blue):
        some.outcome(here)
elif (red):
        another.outcome(here)
else:
        default.outcome(here)
Makes sense? :crazyeye: (Edited file attached, but the edited code should of course be tested properly before adding it to any kind of release.)
 

Attachments

Pursuant to that, I'd like to increase the Celts' broader area to include not only what is included now (which would not be part of the English area) but also areas of strong Celtic influence (albeit due to Irish and Scottish emigration from the UK), namely the US, Canada, Australia and New Zealand (but not India or British holdings in Africa or Asia). That, and some better names in place of the Latin Continental space fillers I've been using...
No, no... You use the Broader Area to encompass that area on the map where the AI Celts must have a presence - or they will inevitably collapse. I don't believe you meant that only having one city in New Zeeland (and not any other city) would save the AI from collapsing (thus not allowing them to respawn in their Normal Area later on).

What you need to figure out is how to make a stability map. Take a look at these. My best guess is that you should edit those tiles you wanna make "Celtic" (on another continents and whatnot) as for stability purposes into the Settler map, and not use the "areas" defined in the Python code for this purpose.
 
I ran some autoplay to see what you actually have come up with, and noticed something weird: Christianity seems to have been founded by the Independents - in Scotland! :eek: (Screen shot attached.)

Are you messing around with those religion settings again? :rolleyes:

Also, I noticed that the three independent cities that spawned on the isled did so on the same turn. That seemed a bit... scripted. Maybe you could base the spawn dates on some historical dates or something, making it seem like something else was actually going on. You could also put a Goody Hut on those locations from the get go, to indicate local population and also encourage exploration. If the Celtic player isn't cashing in on those the benefit will be lost, but on the other hand his units might prevent the cities from spawning. So the results could be a bit unexpected - in a good way.

Another thing you could consider is to make the Celtic independents be a variety of minor Civs. They represent independent tribes, right? And the Scottish one could be Picts (Barbarians in Civ terms). Because you would wanna be able to declare war on one of the tribes and not end up fighting an United Celtic League, right?

To add some spice to the independent Celts, you could have them spawn with Gallic Swordmen instead of plain Archers. (They are still Celts, after all!) The independent AI(s) won't build more of those units though, so you could actually spawn additional Gallic Swordmen of the various independent flavors in the (independent) Celtic areas. If you use the innerInvasion function I mentioned in another thread those units would only spawn inside their domestic cultural borders, which makes them fairly safe to use in the modmod. (No independent units popping up inside Roman borders or adjacent to cities belong to another Celtic AI.)

I could create a sample Barbs.py file that you could take out for a spin, and use the parts that you like, if you want. Otherwise I'm all too happy to leave the actual development and coding to you. :king:
 
And here's the screen shot... :rolleyes:
 

Attachments

  • Civ4ScreenShot0055.JPG
    Civ4ScreenShot0055.JPG
    253.2 KB · Views: 246
Another note: No other city spawns in France? Surely there should be historical Celtic sites in western France?

Also, I'm not so sure about having the Celtic Civ spawn on Ireland in 820 BC. I'm no historian but shouldn't the Celts really originate from the Halstatt region (in the Alps) and first spread to Western Europe and only then take the leap to Britain and finally end up on Ireland?

I kinda liked the previous version where Ireland was the respawn area, not the original spawn area... Not that the Bordeux area seemed like an obvious choice either...

I do however understand that its a matter of design choices and that you have to take playability and AI performance into account. This is why you're the designer and I'm coming up with constructive criticism. :D
 
well, it is true that the Celts originated on the Continent (actually, there are some historians that argue that they began south of the Caspian Sea and migrated to Europ through Scythia). (Ireland was invaded by Celts from Spain, but about 800 years before the start of the Celts in the game (Milesian invasion), and it is also agued by some historians and linguists that the people they found there were but another type of Celts. Without a doubt, Celtic culture predates the Greeks, who gave them their name, Keltoi. As such, I am comfortable starting them in Ireland c800 BC. Besides, the will absolutely refuse to settle the Isles at all if they don't start there.

Their historic area included northern Spain, all of France and the low countries, northern Italy, a huge, tapering swath to the Black Sea, Galatia in central Turkey and the British Isles, so anywhere in there would make sense. Other than those on the British Isles, which are best known today, the historical record of Celts really picks up with Ceasar's conquest of Gaul, providing my reasoning for the choice of western France in the first place. Honestly, it would still be if only I could figure out how to get them into the British Isles voluntarily. If you feel so inclined, you can move their spawn point back to France, let the four cities pop up as Indy and see if they ever make an attempt to capture them, but I would suspect we'll be waving goodbye to them long before the idea strikes them...

As for those cities, they spring up at the same time because if I wait too much longer, the borders of the capital will expand and swallow their spawn points and so they won't show up at all. Perhaps I could spawn them before the Celts show up, but I don't know if that will send the first settler wandering rather than settling, and it will definitely cut off sea passage to the Continent for the second settler until after Cardiff is absorbed (by which time the AI is not looking to settle so fast. I like the idea of starting them with Gallic Warriors, however.

Besides, I could see how the question of a Celtic league might make sense. If Rome attacked one tribe, it might pull together with neighboring tribes to help defend, whereas some would cast their lot with the Romans.

PS - I thought lutetia and burdigala still popped up there...well, i'll be adding more anyway...
 
pps - I added the coding that reassigns a razed holy city, which is probably how it wound up going to edinburgh.

Still, think historically again, the original holy city of Christianity was Jerusalem, but when that city was razed and the culture cut off from it, it became Rome...then Constantinople...then Avignon got into the mix. Other contenders would also be Bethlehem, Nazareth, Ephesus and Nicaea. While it never really "replaced" Jerusalem, there was a point at which Alexandria was as much a center of Judaism as Jerusalem...replacement cities can wind up in strange places, far flung from their original location...
 
Last post for tonight: It feels comfortable enough that you seem to know your history, so I'm probably not gonna question your design choices any further. I'll just focus on game mechanics instead.

I do believe that you need to try out different setups and run all those autoplays in order to get the best balance. There really is no other way to do it. Eventually you'll find something that's good enough.

By the way, keep in mind than if you spawn cities inside the Core Area before the spawn, those cities will flip. This could be good - or bad. Other than that it really doens't make things easier for you having the Celtic capitol i Dublin, with all that culture accumulating... In a worst case scenario we could ignore the limitations set by Rhye in Barbs.py and make our own Python code that behaves the way we want it to.

The option to have a second spawn area in mid game for the Celtic AI is still open, but that would probably be very hard for you to code yourself. And I think we both feel most comfortable if you take over the coding duties from here on... All I'm saying is that would probably be within my own capabilities if you think that it would solve some problems for you. (Either have the isles flip to the AI Celts based on the continent, or the other way around.) Personally I don't think of it as a "bad" solution, albeit a work intensive one. I would probably reuse that code in my own modding and make my idea of a second spawn reality - for all Civs!

And lastly, I think I forgot to compliment you on a dawn fine modmod! :king: Nice work! :goodjob:
 
Thank you ever so much...thank you for your patience and help.

The other reason I wanted to start them in Ireland is that there is a stability hit for moving your palace, so why force them to do something detrimental? I also didn't want second spawns for everyone, nor something like that only for the Celts (makes them too special).

Rhye didn't start the English out in Saxony and then try to entice them to pack up shop and move to another country (or in game terms, another continent). The modern capital of Celtdom is Ireland and the center of whatever political unity and autonomy Celtic civilization ever managed to achieve was in Ireland (although arguably Scotland as well), so it makes sense to have the core area center around that. There was no vast Celtic civilization I'm overlooking in Gaul, just a bunch of disunited tribes. I think the state of modern Breton culture as compared to the Irish and Scots (who were themselves descended from Irish colonists in the post-Roman period) should make that most reasonable.
 
I put bordeaux back in and changed the starting units of Melpum, Burdigala, Lutetia, Lugodunon, Corcaigh, Caerdydd and Dún Éideann to Gallic Warriors. I may also be adding Naoned (Nantes) as an indy spawn as well, but I have to play it this way a bit first...

as an aside, this is part of Rhye's original code, I believe this is why we keep winding up with Christianity in Lugodunon or Edinburgh. I think it's telling the game to self-found Christianity in Jerusalem, but if it can't to found it in a Independent or Barbarian city. I wonder if we could put a second or third modifier in there to try Jerusalem first, then Rome, then Constantinople, then a random city...

I'm going to script tRome and try to change the primary second attempt to Rome...that should give better european if it happens anyway...

if (not gc.getGame().isReligionFounded(iChristianity)):
iEthiopianModifier = 0
if (gc.getPlayer(con.iEthiopia).isHuman()):
iEthiopianModifier = 15 #for the UHV
if (iGameTurn == i33AD + 8*self.getSeed()/100 + iEthiopianModifier): #Christianity up to 190AD (15 = 330AD)
pJerusalem = gc.getMap().plot(tJerusalem[0], tJerusalem[1])
if (not pJerusalem.getPlotCity().isNone()):
if (pJerusalem.getPlotCity().getOwner() == iIndependent or pJerusalem.getPlotCity().getOwner() == iIndependent2 or pJerusalem.getPlotCity().getOwner() == iBarbarian):
bChristianResult = self.foundReligion(tJerusalem, iChristianity)
tCity = tJerusalem
else:
tCity = self.selectRandomCityReligionCiv(iJudaism, iIndependent)
bChristianResult = self.foundReligion(tCity, iChristianity)
if (bChristianResult == False):
tCity = self.selectRandomCityReligionCiv(iJudaism, iBarbarian)
bChristianResult = self.foundReligion(tCity, iChristianity)
if (bChristianResult == False):
tCity = self.selectRandomCityAreaCiv(tJewishTL, tJewishBR, iIndependent)
bChristianResult = self.foundReligion(tCity, iChristianity)
if (bChristianResult == False):
tCity = self.selectRandomCityAreaCiv(tJewishTL, tJewishBR, iIndependent2)
bChristianResult = self.foundReligion(tCity, iChristianity)
if (bChristianResult == False):
tCity = self.selectRandomCityAreaCiv(tJewishTL, tJewishBR, iBarbarian)
bChristianResult = self.foundReligion(tCity, iChristianity)
if (bChristianResult == False):
tCity = self.selectRandomCityAreaCiv(tEuropeTL, tEuropeBR, iIndependent)
bChristianResult = self.foundReligion(tCity, iChristianity)
if (bChristianResult == False):
tCity = self.selectRandomCityAreaCiv(tEuropeTL, tEuropeBR, iIndependent2)
bChristianResult = self.foundReligion(tCity, iChristianity)
if (bChristianResult == False):
tCity = self.selectRandomCityAreaCiv(tEuropeTL, tEuropeBR, iBarbarian)
bChristianResult = self.foundReligion(tCity, iChristianity)
if (bChristianResult == True):
self.spreadReligion(tCity, 3, iMissionary_Christian)
 
the changes I made to the Christian holy city code seems to have worked as Christianity was founded two turns after 33AD in Rome without the Romans having discovered Theology (I'm not entirely sure I understand why it passed over Jerusalem, but Rome was the first second choice...maybe it was because Jerusalem wasn't Indy...the code seemed to be looking to assign the holy city to a non-civ...well, that's Rome's reward for having to put up with beefy Celts, lol).

as for the new victory coding, I have to stick with my original until I can debug it...it didn't register as achieved when it was...
 
Also, Baldyr, I know at some point you made other civs less friendly to the Celts on startup, but how can I decrease that. The Dutch are beginning in a state of war with me, which should not be, and so did France even though I agreed to the flip and gave them four cities. I could see extra unfriendliness in the Roman, English and Vikings, but the French, Spanish and Dutch should really be more of a neutral start...
 
Also, Baldyr, I know at some point you made other civs less friendly to the Celts on startup, but how can I decrease that.
This is in Consts.py:
Code:
#rnf. Some civs have a double entry, for a higher chance
lEnemyCivsOnSpawn = [
[], #Egypt
[], #India
[iIndependent,iIndependent2,iIndependent2], #China
[iIndependent,iIndependent2], #Babylonia
[iIndependent,iIndependent2,iBabylonia], #Greece
[iBabylonia,iBabylonia,iGreece], #Persia
[], #Celtia
[[COLOR="Red"]iCeltia,iCeltia[/COLOR],iEgypt,iGreece,iGreece,iCarthage,iCarthage], #Rome
[], #Japan
[], #Ethiopia
[], #Maya
[iRome,iEngland,iFrance,iGermany,iNetherlands,iIndependent,iIndependent2], #Vikings
[iEgypt,iBabylonia,iBabylonia,iGreece,iPersia,iCarthage,iRome,iSpain,iFrance,iIndependent,iIndependent2], #Arabia
[], #Khmer
[[COLOR="Red"]iCeltia,[/COLOR]iArabia], #Spain
[[COLOR="Red"]iCeltia,iCeltia,[/COLOR]iArabia], #France
[[COLOR="Red"]iCeltia,iCeltia[/COLOR]], #England
[i[COLOR="Red"]Celtia,[/COLOR]iRome], #Germany
[], #Russia
[[COLOR="Red"]iCeltia,[/COLOR]], #Netherlands
[], #Mali
[[COLOR="Red"]iCeltia,[/COLOR]], #Portugal
[], #Inca
[iIndia,iChina,iChina,iJapan,iPersia,iKhmer,iRussia,iRussia,iIndependent,iIndependent,iIndependent2,iIndependent2], #Mongolia
[iMaya], #Aztec
[iEgypt,iBabylonia,iGreece,iGreece], #Turkey
[iSpain,iFrance,iEngland,iIndependent,iIndependent2] #America
]
All the Celtic entries are marked with red, and every single instance increases the chance of being at war wit that Civ from start. So if you take away one out of two there's only haft the chance of war, and if you have none there is also no risk of war on spawn.

It could be noted that you can put in instances of iIndependent in there if you want Civs to be hostile against your spawned Celtic independents...

I only edited this portion because some Civs were still coded to have a go at Carthage, when it had in fact been turned into Celts... Also, I was assuming the Celtic players spawned in France. So you would wanna reedit this yourself!

There's a couple of other edits in there also, that I need to get back to you about.

As for the Victory.py stuff - I can debug that once I get the chance. I'll also have a look at the Religions.py later. Now I'm off to work!
 
Yeah, I did find that. Also, I managed to do the religion one...if the game wants to pass over Judaism it will found Christianity in Rome, so long as it exists (or a city on that tile)...only if Rome has been razed and the square empty would it then go through the rest of the Indy/Barb routine.

I've managed to achieve two out of three UHVs (haven't gotten to 1700 yet) with the Celts. I'd founded all of France and northern Spain (and the free cities in Britain) by the time of the Eurospawns. I wound up doing a Dunkirk-style army evacuation on the eve of them, and then allowed Spain and France to flip. On one run I tried to resist England...bad idea. I went back to the save at that point, evacuated my units from Britain (I was very unstable at that point for losing more than 50% of my cities in less than ten turns). I granted Scotland and Wales their independence (so I wouldn't actually lose them to the English) and a few turns after the English spawned civil war broke out and Galway and Cork went Indy. Coincidentally, war with one does not equal war with both. In any event, I now had a big army to take them back. For some reason, Milan flipped to me during revolt so I took it, and used that to then take Rome and found two more cities in southern Italy. I'm now very stable and slowly rebuilding my prosperity. So I don't risk losing the 3rd UHV after all that, I'm going to wait 200 years and pass the third UHV, and then try to take back Britain. :evil::evil::evil:

I traded Rome back to the Romans with the peace treaty back in ancient times, so we'll see if that counts as a loss (my UHV still says "not yet" and not "no").
 
Historic victory, but because of all the cities I'd lost I've fallen so far behind in tech I don't think I'll ever manage to retake Britain. Next time, I'm going to just build up there and concentrate on having the units to prevent their spawn and/or sack London when they pop up (harder, because I increased their starting units to they could war with the AI)....then try to take their empire's place in history...
 
Also, I managed to do the religion one...if the game wants to pass over Judaism it will found Christianity in Rome, so long as it exists (or a city on that tile)...only if Rome has been razed and the square empty would it then go through the rest of the Indy/Barb routine.
Are you happy with how it works now? Because the thing to remember about this Python thing is that even if Rhye might have supplied you with an option A and an option B with his code, there really isn't any reason not to go for option C instead - and code that one yourself. I understand you still have much to learn about Python (and so do I) but anyway. Sometimes all it takes is one line of code, or a couple of edits in some line of code.

Coincidentally, war with one does not equal war with both.
Sure, as they might be different Independents. You realize there is Independent and then there is Independent2? This is actually what I was talking about earlier about the city spawns. I still suggest you make some of those cities Independent2 instead of Independent. You could at the very least differentiate between British tribes and continental tribes. (Personally I would pretty much mix them up.)

Historic victory
Congrats! :king: Not to winning the game but to haven verified that the code does what its supposed to. I understand you used your own code in that game? I actually never doubted that the UHVs would work, but I do see an obvious bug in there nevertheless. This is why I posted the corrected code earlier, but also because you seem to have made it work simply by trial and error. (You won't be able to change much without relying on mere luck in order to getting it to work again.) If you don't understand why you should use my code instead, I could always explain in more detail.

In short: Your code is far from optimal, but you will of course use the code you need to use. Its out of my hands! :p

One thing I was meaning to get back to you about was the fact that I did another edit on your Consts.py file (edit in red):
Code:
#AIWars
tAggressionLevel = (
0, #Egypt
0, #India
1, #China
1, #Babylonia
1, #Greece
2, #Persia
[COLOR="Red"]2[/COLOR], #Celtia
2, #Rome
1, #Japan
0, #Ethiopia
1, #Maya
2, #Viking
2, #Arabia
1, #Khmer
2, #Spain
1, #France
1, #England
2, #Germany
1, #Russia
0, #Holland
0, #Mali
0, #Portugal
1, #Inca
2, #Mongolia
1, #Aztec
2, #Turkey
2, #America
0) #Barbs
Now, I'm not exactly sure about what this does, but AFAIK the value is only used in the file AIWars.py to subtract it from a stored value (lAttackingCivsArray) on certain game turns. Since you actually didn't do anything else besides change the name in the code commenting (from "#Carthage" to "#Celtia"), the old value (zero) of the Carthaginians was still in effect.

I simply figured that the warlike Celts would have the same setting as the other warmongers in the game, instead of that of the mercantile Carthage. Since I don't know exactly what it does you might as well experiment with it - or change it back. (There doesn't seem to be any limit on what value you can give it, but Rhye has only used values ranging from 0 to 2, so much higher ones could give unexpected results.) It should work out just fine as it is now though, so I'd recommend to leave it unless you have reason to believe its causing some kind of problem with AI behavior.

Also, I commented out the lines #757-758 in RiseAndFall.py as mentioned in another thread:
Code:
[COLOR="Red"]##[/COLOR]                if (iGameTurn == con.i400BC):
[COLOR="Red"]##[/COLOR]                        self.giveEarlyColonists(iCeltia)
This bit of code activates the free Galley with colonist units (Settler and Archer) that the AI Carthaginians were getting. As you probably can see for yourself, this event is triggered on game turn #114 (year 400 BC) so if you wanna use it for the Celts (AI only) all you have to do is delete the commenting (red) and perhaps also modify the date to better reflect Celtic colonization.

Note that it could be hard to predict what an AI Celtic player would do with those units, but I now know that the units end up on a Coastal tile adjacent to the Celtic capital (regardless of where it is located). As I initially figured the units would spawn in the Mediterranean I promptly commented out those lines... This would be a judgment call for you to make.

You could also create additional such spawn via the RiseAndFall.py file by adding dates to line #757. Like this (example):
Code:
                if (iGameTurn == con.i400BC[COLOR="Red"] or iGameTurn == con.i250BC or iGameTurn == 155[/COLOR]):
Note that the last instance is an actual game turn number and not a variable. You can always substitute one of the con.iDates (which you can find in Consts.py by the way) with a numerical value if you like. This makes it possible to use game turns not predefined by Rhye, because not all game turns are defined with variables!

I believe this would be the last edit I've yet to comment on. Oh yes, and it turns out that the line #352 in CvRFCEventHandler.py should in fact not be commented out. Its pure dumb luck that I noticed that one, as the original code would make the third Celtic UHV less reliable, because there would (most of the time) be a delay - potentially ending up neither granting nor failing the UHV on the specified game turn! If I hadn't already taken care of this issue it could very well have remained a "mystery bug" forever, because I doubt I would have been able to find it if I've tried... :rolleyes:
 
Thanks, I think the warlike decision was wise. I would love for you to explain what the bug is in that UHV code though, because I'd like to get it straightened out, although the current version works passably well but the first attempted fix did not tick as achieved when it was.

I have no problem with the elimination of future colonists for the Celts, although what do you think of a military unit spawn at that time? v2.1 is going to include more Indy and Barb cities, so Celtic settlement will largely be one of conquest (as will Roman). This would be more accurate historically (most Celtic tribes were already in place shortly after the Celtic spawn point in the game. Some geneticists believe that proto-celts and proto-basques may very well have been Europe's aboriginal peoples). They will get a few cities by simply sitting there and accruing culture, but most will have to be taken by force if desired.

If you work more on victory.py, know that I'm adding the Vikings to the list of civs the Celts must not lose cities to.
 
Back
Top Bottom