Celtic Mod v2.0 Release

One more thought: Since the Celts are a new addition to RFC Rhye hasn't been able to tweak it as for stability. This is in fact something that could be done if need be. I know that Rhye has alleviated some of the instability due to isolation and stagnation for some Civs, or taken account the starting location/date of other ones.

So if you feel, or if play report eventually will show, that something needs to be tweaked, that could then be taken care of. Any tweaks to stabiltiy would require rigorous testing though...

Also, if you conclude that all the Medieval spawns in Western Europe is making the Celtic AI too prone to collapse, something could be done about this also. Its simply a matter of adding some line of code excepting the Celts from some of the prerequisites for collapse. It would hardly brake the mod since the Celts weren't supposed to be playable to begin with... There could also be a grace period of sorts during the period when all that spawning is taking place - if the objective here would be to keep the Celts in the game.

Talking about stability brings these settings (Consts.py) to mind:
Code:
#for stability hit on spawn
lOlderNeighbours = [
[], #Egypt
[], #India
[], #China
[], #Babylonia
[iEgypt, iBabylonia], #Greece
[iEgypt, iBabylonia, iGreece], #Persia
[COLOR="Lime"][iGreece], #Celtia[/COLOR]
[iEgypt, iGreece, [COLOR="Red"]iCeltia[/COLOR]], #Rome
[], #Japan
[iEgypt], #Ethiopia
[], #Maya
[], #Vikings
[iEgypt, iPersia], #Arabia
[iIndia], #Khmer
[[COLOR="Red"]iCeltia[/COLOR], iRome], #Spain
[[COLOR="Red"]iCeltia[/COLOR], iRome], #France
[[COLOR="Red"]iCeltia[/COLOR]], #England
[iGreece, iRome, iVikings], #Germany
[iPersia, iGreece], #Russia
[iRome, iGermany], #Netherlands
[iEthiopia], #Mali
[[COLOR="Red"]iCeltia[/COLOR], iRome], #Portugal
[], #Inca
[iChina, iJapan, iKhmer, iRussia], #Mongolia
[iMaya], #Aztec
[iBabylonia, iGreece, iPersia], #Turkey
[iSpain, iFrance, iEngland, iNetherlands, iPortugal, iAztecs, iMaya] #America
]
I'm afraid I don't remember whether or not I actually edited this portion of your Consts.py :rolleyes:, but I do believe I did! :eek: As I understand it (I haven't bothered to look this up in RiseAndFall.py for sure) the line commented as "#Celtia" (green) is where those Civs that get hit by the Celtic spawn would be entered. (iGreece is there at the moment as the only default Carthaginian neighbor, but that could of course be changed.) Any instance of iCeltia on any other line would give a stability hit for the Celtic player when these Civs spawn! (Right now those would be, in order, Spain, France, England and Portugal.) You should probably go through these settings and try different variations out.

As an afterthought, the American spawn will affect all the Western European Civs negatively. Does this mean that also the Celts should be negatively affected by the coming of the Americans? (If they in fact are still around - or have already respawned.)

One interesting aspect of your modmod, by the way, is that it could make things much more interesting regarding the English AI! I can see how England might end up not being as prominent or advanced due to the Celtic presence. And the mere thought of having Ireland pop up later as a major Civ is sending sensations of excitement up my spine! :king:

The Celts might, as well, end up breaking the English... :rolleyes:
 
I had originally included stability hits on the Celts for every western european civ, but now that they are basically Gaels who might possibly have continental holdings they must relinquish (which would have originally been indy tribes), I think I'll just leave in the Romans and English for now (maybe I'll put the French back in eventually).

As for the whole English thing, here's what I'm finding happens...the Celts are limited to the British Isles by the time the English spawn, and then England takes whatever cities they have on Britain (accurate). This is usually half or one more than half, so it causes stability problems for the Celts, but the English seem to do just fine (originally, dublin or belfast/cork were indy/minor spawns and not set to automatically flip). I've found that simply being in the area doens't prompt an automatic flip, there still needs to be cultural pressure from a neighboring city. The Celts tend to collapse and then can be absorbed by the English no harm no foul (history back on track). Honestly, as much as I'd like to see Ireland kick England's butt (and am looking forward to doing that myself), I feel that the history produced by the game in the Isles shouldn't be fundamentally different from real history if the human is playing a civ other than the Celts.

In reality, the Irish were not even close to resisting the English invasion due to disunity and technological disadvantage. By making them a major civ in the game, I'm giving the human player a *chance* to make better choices at key points in history and perhaps produce a different result, but I think the AI should behave as close to its historical counterpart as possible. In short, I'm very happy to see the AI collapse and lose every time to the English but knowing that a human could possibly to better by thinking outside the box.
 
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.
First of all you could just use my code, as it should take care of any issues with your code. I will in fact test that tonight to see I perhaps overlooked something. If I don't get back to you with any correction then it works fine. No harm in trying it out in a real game, though...

But here goes:

This is what your code for the second UHV looks like (with my comments added):
Code:
                elif (iGameTurn == i500AD): #you ask if its game turn 174
                                if (self.getGoal(iCeltia, 1) == -1): #you ask if the UHV is still undecided
                                        self.setGoal(iCeltia, 1, 0) #because then you set it to failed


                                              
[COLOR="Red"]                if (iPlayer == iCeltia): #you first check if it really is the Celtic players turn (why?)[/COLOR]
                        if (iGameTurn <= i500AD): #you check if its game turn 174 or any previous turn
                                 bIsles = self.checkOwnedArea(iCeltia, tBritishIslesTL, tBritishIslesBR, 4) #you get condition 1
                                 bGaul = self.checkOwnedArea(iCeltia, tGaulTL, tGaulBR, 2) #you get condition 2
                                 bIberia = self.checkOwnedArea(iCeltia, tIberiaTL, tIberiaBR, 1) #you get condition 3
                                 if (bIsles and bGaul and bIberia): #you check if all the conditions are met
                                        self.setGoal(iCeltia, 1, 1) #only then do you set the UHV to achieved
First of all about everything is in the wrong place (see my version for the correction) and the line marked with red is totally redundant, except that it adds to the hierarchy of indentation. But you did make it work by, evidently, changing the indentation around. (I'll get back to that in a moment.)

Second of all, you should have the code for failing the UHV after the code that lets the player achieve it. Since the game will run the code in sequence, the UHV could already have been set to failed once it checks if its in fact achieved. This would get very confusing if its actually game turn #174! :eek:

I still believe the code could work just fine, but you'd have to double check if there can be an exception as for the last turn. It is very confusing to try and read in any case.

If you wanna have any control over what you do with your Python, it needs to be as readable to you as would plain English. This is one reason to have the code logically structured and in sequence. The other reason would be that a computer will only understand logic, and if you make any changes to you code it could very easily become illogical - to the game. And thus not work as intended.

Sure, you've managed to get by by the skin of your teeth on this occasion, but you might not be as lucky next time. Or the time after that.

As for indentation, its not there to make the code readable to the programmer himself - or to any other person viewing the code. It actually is required to follow principles of logic - in order to work! (Some programming languages would allow you to use any indentation that you feel is comfortable or practical - but not Python.) So you can't decide how much indentation to use for a line - or for a piece of code - on a whim. This can actually be a hassle sometimes, as long stretches of code can make it unclear where in the hierarchy some piece of code really is. But that is something we have to live and learn to cope with.

You could learn how this works in practice by simply looking at the code Rhye has done, or you could read up on the subject. Its not very hard, honestly! :king:

If you're unclear about these matters or if you for some reason can't seem to make a piece of code work, you could always send it to me privately and I'll take a look. Most of the time its really basic stuff and you will be able to learn from your mistakes instead of repeating them and ending up changing the indentation around randomly the next time you need to add a piece of code.

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?
As it would make sense historically I'm not opposed to it, as long as its only for the AI. I do believe that the human player should be required to build units of his own, and also make his own decisions as to what the goal or strategy of the game will be. Getting free units to do a scripted invasion... no. Not for me at least.

But you could, and should, try anything out. You might think its the best idea ever once you try it!

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.
No, not doing any more work on your files. :p Its really not practical to have several people work on the same set of files, and you seem to be doing well enough on your own now. And how would you ever learn if you don't at least try? :goodjob:
 
No problem with the victory file, it does create issues while you're correcting one aspect while i'm developing the next version separately. v2.1 will probably include the same code I had, but I'll be working on fixing it up for v2.2

And I agree about the free units, I'm not going to give them to either the human or to the AI.
 
...the Celts are limited to the British Isles by the time the English spawn, and then England takes whatever cities they have on Britain (accurate). This is usually half or one more than half, so it causes stability problems for the Celts, but the English seem to do just fine (...)
It should be noted that its not actually instability that makes a Civ that looses half (or more) of its cities collapse. The Civ might as well be having a Golden Age with +50 stability, AFAIK. Its only determined by the number of cities lost, even if there are some exceptions also (like being a vassal).

I've found that simply being in the area doens't prompt an automatic flip, there still needs to be cultural pressure from a neighboring city.
No, I don't believe this to be true. There could be a limit on how many cities that can flip in one spawn though, but I'd have to check the actual code to find that out for sure. (With respawns its max 5 cities, I believe.)

In short, I'm very happy to see the AI collapse and lose every time to the English but knowing that a human could possibly to better by thinking outside the box.
Ok, I understand you standpoint and I don't disagree myself. Some folks might however think its a bit scripted to have the same (albeit historical) thing happen every single time. (Like have the Celts collapse on cue, because of whatever calamity hits them first.)

So, as for the design of your modmod, the outcome of the English spawn visa-vi the AI Celts could be made a bit more open-ended. There could at least be a grace period for the turns following the English spawn, disabling the AI only collapse trigger due to losing cities. The Celts should still collapse due to the loss of stability (caused by the loss of the cities) though, but in the rare case when they have enough stability they might actually survive long enough to put up a united fight once the English actually invade. And then collapse. :lol:
 
No problem with the victory file, it does create issues while you're correcting one aspect while i'm developing the next version separately. v2.1 will probably include the same code I had, but I'll be working on fixing it up for v2.2
Yeah, you should probably do that. But do take a closer look at my example to see how the whole thing could be improved and cleaned up. There is a lesson there for you to learn, if you're interested. :king:
 
Well, a little more variety could perhaps be added by allowing the English to try to flip London, York, Cornwall and Wales, but leaving Scotland outside their core...then they might take it in war sometimes and not take it at others...


as it is, the result isn't *always* the same, just "usually similar"
 
Yeah, Scotland actually has a history of independence, so I'd leave them out.

One thing I noticed about the English while running autoplay, by the way, was that they founded Hamburg and Copenhagen! :eek: I've never seen them do that before, so your modding would be to thank/blame for this development! :crazyeye:

edit: This makes me think that the AI will only make an effort to settle land that it knows about. Make sense?
 
I was just thinking that maybe i'd eliminate that second settler...they also sometimes got to Sweden (all historic locations for Saxons and their ancestors), but Hamburg-area cities are lost after the Germans and Dutch spawn, so perhaps it's okay. I think they're just looking for open space and now have a major civ to contend with.

In my autoplays, the English tend not to rename the Celtic cities they flip, even though their namemap has English names for them. Any idea why?
 
also, how would I change this in consts to make the celts more likely to sometimes fight civ spawns (especially the english)?

#war during rise of new civs
tAIStopBirthThreshold = (
80, #Egypt
80, #India
60, #China
50, #Babylonia
50, #Greece #would be 80 but with Turks must be lower
70, #Persia
80, #Celtia
80, #Rome
80, #Japan
80, #Ethiopia
80, #Maya
80, #Viking
80, #Arabia
80, #Khmer
80, #Spain #60 in vanilla and Warlords
80, #France #60 in vanilla and Warlords
50, #England
80, #Germany #70 in vanilla and Warlords
50, #Russia
80, #Holland
70, #Mali
60, #Portugal
70, #Inca
70, #Mongolia
50, #Aztec
70, #Turkey
50, #America
100,
100,
100,
100,
100)
 
I was just thinking that maybe i'd eliminate that second settler...they also sometimes got to Sweden (all historic locations for Saxons and their ancestors), but Hamburg-area cities are lost after the Germans and Dutch spawn, so perhaps it's okay. I think they're just looking for open space and now have a major civ to contend with.
You could try this as an experiment:

Edit the scenario file (World Builder save) to reveal some desirable tiles to the Celts, so that they actually know about the areas you have marked up for them in the Settler maps.

There should be several ways to achieve this, the simplest could be to just give them a Workboat at the shores you'd like them to colonize. Since the Civ hasn't spawned yet that unit should do exactly nothing, but just to be sure, edit in a Barbarian Galley on an adjacent tile. Both will be gone forever once the first turn is over, but once the Celts spawn they will have knowledge of the area surrounding the former unit. (This is true both for the human player and the AI.)

In my autoplays, the English tend not to rename the Celtic cities they flip, even though their namemap has English names for them. Any idea why?
This would be because the actual plotting isn't achieving the dynamic names. Its actually the code beneath, in the lower section of the CityManager.py file. I can actually see that you haven't added any dynamic names for the Celts either (although some seem to already be there). The code is pretty straight forward though, so you shouldn't have any problems editing it.

Start with the Celts first (line #4552+) and work your way through the rest of the Civs. Good luck! :goodjob:
 
oh, i didn't mean the celtic settler, which they invariably take to western france, but the english settler. the celtic settler actually allows for variation depending on whichof their favorite four tiles they choose, affecting indy city spawns...
 
also, how would I change this in consts to make the celts more likely to sometimes fight civ spawns (especially the english)?
This is actually so simple I'm surprised you ask, but since there are no stupid questions regarding Python, here's an answer:

The entry on the line commented as "#iCeltia" is the percentile probability for the AI Celts to declare on a spawning Civ trying to take over cities or units. Since its already 80% this should happen most of the time. Not?

Well, if you rise it to an even 100% it should happen every single time, at least that's what the code reads like to me... Get back to me if it doesn't and I'll take another look.
 
oh, i didn't mean the celtic settler, which they invariably take to western france, but the english settler. the celtic settler actually allows for variation depending on whichof their favorite four tiles they choose, affecting indy city spawns...
I guess I'm still thinking about v1 where you wanted the Celts to move to Britain. Maybe they would have, if they'd known about such a thing as "Britain". But since they had ships and all I might just be wrong on this.
 
no, they wouldn't use settlers even when I put them on the island, exposing the tiles.

The Celts rarely contest a spawn...I dont' think i've seen it yet...but I dont' want them to do it all the time, either.

i'll get to work fixing the names
 
The Celts rarely contest a spawn...I dont' think i've seen it yet...but I dont' want them to do it all the time, either.
Hmm... How would you know? Have you been playing as the English then?

I believe the only thing AI Civs will do to newcomers is to declare war on them. I don't even think they get the option "contest" anything. They lose the cities and units, and sometimes declare war on the perpetrator. End of story.

There is however some extra units in it for the spawning Civ. For every old Civ that reacts by declaring war, the new Civ will get some extra units.

In my Russia scenario I made it so that the Mongols would always be at war with pretty much everyone when they spawned. I remember having problems with achieving this at first though, and I don't quite recall how I solved the problem either. But it works now, that much I know...

Now its sleepy time for me, since I feel I really need to get some shut eye this week... :rolleyes: Be good! :goodjob:
 
I wonder if doubling the name entries in "stability hit on spawn" works like in the other similar list, making the english give the celts a double stability hit...especially good if they're not autoflipping edinburgh, too...
 
there seems to be two celtic dynamic city names lists down there...does it matter that the main bulk of the city names are in the list labeled "#late start condition?" Will it simply read those names as long as Celtia "isalive," or only if the old 600AD start is chosen?


***apparently it works either way :goodjob:
 
Changes made in v2.1

http://www.filefactory.com/file/b00bcd7/n/RFC_with_Celts.zip

- I have added more Indy city popups at staggered intervals (when the cities actually came to be)

- Celtic (and Roman and English) expansion will largely be of conquest rather than settlement (historically accurate for this period).

- The second English settler has been eliminated, since their island is already pretty full by spawntime and they tend to just use it to settle in Sweden or Germany anyway.

- This produces more accurate Roman, French, Spanish and English AI expansion. Even the Vikings tend to like to take the Independent Eabhrac (York) if the AI Celts don't, which is also historically accurate (Celtic Eabhrac -> Roman Eboracum -> Viking Jorvik -> English York).

- If the Celtic capital is founded on the start square, or north of it, Independent Irish cities of Gaillimh (Galway) and Corcaigh (Cork) will eventually spawn, as well as Independent Welsh Caerdydd (Cardiff). Other British spawns representing independent Celtic tribes are eventually Dún Éideann (Edinburgh) and Eabhrac (York). A barbarian Londinium (London) representing the Roman settlement (the Roman AI never makes the attempt to settle there) will also pop up.

- In Gaul there is one addition to Rhye's original three Lutetia, Burdigala and Lugdonum (Paris, Bordeaux, Lyon), Roazhon (Rennes).

- In Galicia, the Independent city of Xixón (Gijón) will self-found.

-All independent Celtic cities will self-found with two Galician Warriors, to represent their symbolic culture.

- Settling one square south of the start location of Tara and founding Dublin will prevent Cork and Cardiff from showing up. Likewise, settling one square south of Rennes and founding Nantes will prevent Bordeaux and Rennes from showing up. I mention the one about Nantes because half the time the Celtic AI uses a starting settler to found it.

-for the UHV, the territory of Gaul now covers all of historic Gaul instead of just the western seaboard.

- The Celts now must not lose cities to the Romans, English OR the Vikings.

- stability hits on spawn for Spain, Portugal and the Netherlands have been removed. Celtic stability hits still occur for the English, French and Romans.

- Dynamic city names have been updated (mostly) for the English, French and Celts

This scenario usually results in AI Roman Italy, Gaul and Iberia and AI Celtic Britain and Ireland giving way to Portugal, Spain France and a still-strong England with an AI Celtic collapse and loss (or similar situation…never been exactly the same twice). Basically, when all civs are played by the computer the scenario produces something very close to history as it was :king:

Still to be corrected are the following:

- "Rome declares war on Rome" type errors

- Celts still absent from the civilopedia

- translations need to be done for the UHVs
 
I wonder if doubling the name entries in "stability hit on spawn" works like in the other similar list, making the english give the celts a double stability hit...especially good if they're not autoflipping edinburgh, too...
I doubt it. It should be a regular list, as "if name in list" - then... I could look it up though.
there seems to be two celtic dynamic city names lists down there...does it matter that the main bulk of the city names are in the list labeled "#late start condition?" Will it simply read those names as long as Celtia "isalive," or only if the old 600AD start is chosen?
The other ("late") set of code is for Byzantium. As the Celtic Civ gets replaced by the Byzantine one in the AD 600 start.

If you see a reference to "late start condition" in the Python the code following this "if" statement doens't concern your modmod. (This is in fact what I meant previously by you breaking the AD 600 scenario. Since you replaced Byzantium with Carthage... :rolleyes:)
 
Top Bottom