Squatting on another civ's spawn area

As Hannibal I was able to take Rome and Athens happily and storm in Middle East with the simple aim of destroying everyones starts. It really ruins the Roman start (and when the Barbs come and destroy you) they survive but are pretty weak, Babylons are in a lot of trouble with war on either front, Egypt tend to collapse, and (if Greeks settled Byza) Christainity is formed there normally, else it tends to get down in the East.

Basically this allows the Arabs to really get a good start through the Middle East and head West. You really do need Byzam to have Christian because that wont flip to Turkey and can hold its own, then you just need to head West into Spain. Managed it on Monarchy, Emperor the issue is Africa is covered in Barbs, can't handle them all! Worth exploring.
 
As Hannibal I was able to take Rome and Athens happily and storm in Middle East with the simple aim of destroying everyones starts. It really ruins the Roman start (and when the Barbs come and destroy you) they survive but are pretty weak, Babylons are in a lot of trouble with war on either front, Egypt tend to collapse, and (if Greeks settled Byza) Christainity is formed there normally, else it tends to get down in the East.

Basically this allows the Arabs to really get a good start through the Middle East and head West. You really do need Byzam to have Christian because that wont flip to Turkey and can hold its own, then you just need to head West into Spain. Managed it on Monarchy, Emperor the issue is Africa is covered in Barbs, can't handle them all! Worth exploring.

Emperor is doable--I've done Carthage without war with Rome. Key is to collapse Egypt first, then Greece and then Babylon. Or you can even try founding Rome yourself with the previous version (the new patch makes it impossible since the galley is now E of start)...
Just build war elephants and spearmen in Africa and you'll be fine.
 
So remember how to squat in England AND Netherlands we had to build Amsterdam's palace before Germany asks for it some time in the 800's? It is possible!
Start with HR and serfdom. Build Thetford, Lulea and Birka (Amsterdam). Since we need a 4th city right away, all workers stay around Lulea and chop 4 trees for settler (which I sent to Helsingfors, neutral ground but important for the Russians later). Thetford builds worker, Birka builds monument and as soon as Helsingfors is built, switch to palace. Switch to slavery even before Helsingfors is settled (since we'll have to whip out the palace).
Send 2 axemen to raze Bona Mansio (I brought an archer along for safety)--this will take care of Germany's influence there.
All available workers converge on Birka and chop trees. Palace is built with almost 10 turns to spare before Netherlands spawns. Build Constance (Roskild) on the stone to eliminate all Dutch/German influence in that area.
Malmo was built as a bridge between the eastern and western cities (since Germany won't open borders).

The downsides to this land grab are obvious: you lose Ireland so England has much more of a chance to survive, stability takes a double hit (moving palace and switching to slavery), upkeep is higher with a larger empire, and the Dutch have unfortunately spawned close to my future gateway to the Americas. (Maybe I'll go back and open borders with them and see what happens--if they just stood near Amsterdam that'll be good.)
I haven't played this out yet, but it sure looks difficult with war imminent. I may not be able to win the UHV in terms of gold...
 

Attachments

  • Lizzy spawns.JPG
    Lizzy spawns.JPG
    133.6 KB · Views: 400
  • Willem spawns.JPG
    Willem spawns.JPG
    143.2 KB · Views: 389
Well, I played a little sloppily, but finally sunk 29 ships by 1600 (must be a bug, since I've never just sunk 25 ships and won). I had a 5 star economy forever, but due to the multiple anarchy turns and squatting on other people's turf, I was never fully stable after I switched to OR and CS. I had no war at all, had Khmer and Inca as vassals. Everybody was friendly to me (well, all the Christian civs) except for Germany. I've never had a friendly Catherine but I got it this game. Thank God for privateers--wars are so messy.
Actually the lack of England and Netherlands is very important in holding back all the European civs. Germany doesn't open borders so he was behind a lot (due to no trade). England (or should I say Scotland) was completely isolated (was actually Jewish when Russia was already Christian) and collapsed rather early. Mali actually found me and I built the Spiral Minaret in 1100.
Since there's no England or Netherlands, I could have potentially just founded many cities in America, Australia and South Africa and win a domination victory (that is, if I could build enough jails and courthouses).

Another variation to think about is squatting on England first, then build palace in a German location. From my last game the Germans collapse very easily if they're confined to Frankfurt (due to Dutch culture and mine).
 

Attachments

  • The Unified Viking Empire.JPG
    The Unified Viking Empire.JPG
    107.2 KB · Views: 315
Birka (Paris) was my first capital. France is my vassal (because they lost all their starting units and had no knowledge of all the earlier techs, so I gave them one and they were happy with me). I was one move from building the palace in Dorestad (Amsterdam) when Germany wanted it; well he lost 4 units trying to capture Dorestad. Netherlands has all their starting units sitting in Dorestad drinking beer. Didn't have to patience to play this one out because it'll be the same (14 moves to optics in 1080). Germany's going to collapse soon anyway.
 

Attachments

  • French-Dutch squat.JPG
    French-Dutch squat.JPG
    144 KB · Views: 354
So if you want Utrecht (the closest thing to Calais), you can just load all your 4 English longbowman and found Utrecht (on the site of Amsterdam) after Frankfurt flips to Germany. Send a workboat to Utrecht (west of it, not north, since Germany will capture the northern fish initially), and whip walls.
When the Dutch spawns, somehow there will not be any desertions of your longbowmen to them, and crossbowmen/pikemen are no match against fortified longbowmen. So far I have already discovered liberalism/astronomy, going to send my first settler out to Jayakarta, and built Notre Dame, Wat Preah Pisnulok, and University of Sankore.

Incidentally, this proves that Germany is intrinsically unstable whenever one of their cities (be it Kiel, Aarhus or Hamburg) is under the influence of a very cultural Amsterdam/Utrecht/Breme. They're not at war with Russia yet and yet they're already collapsing.
 
So I delved into the reason why my English longbowmen didn't desert to the Dutch. Apparently, if there's no plot outside the city that they can desert to, they will not flip! (For once did not whipping a monument help me) Since Utrecht had its culture eliminated from the east by the Germans when they founded Aarhus, and the west and south by the Dutch, there were no squares that they can go to. This also explains the reason why it didn't work with the Germans founding Utrecht. Presumably this should work if a non-contiguous culture (like Vikings or even Rome) founds a Dutch city.
Which gives me an idea (maybe the Spanish can do the same... and fulfill their historic hold on the Low Countries)...

This assumes I'm interpreting the Python code right, from a layman's viewpoint.

So, essentially, as long as you found a city right smack in the middle of a civ and build absolutely zero culture (also have no state religion spread to it), you can basically defend it without losing any troops. This opens up a whole bag of worms, e.g. China founding essentially any city up north, coupled with a non-state missionary (be it Tao or Confucian), as long as you can defend it, with pikemen and longbowmen (against keshiks and crossbowmen) entrenched behind walls and castles, and then wiping out the rest of the Mongol troops with war elephants.

Another instance would be France building (finally!) a city way into German territory (e.g. at the site of Berlin) but fortifying it with lots of longbowmen, and see their initial troops die, and then wiping out the rest and getting some workers from the settlers! This has to assume that Christianity doesn't spread to Berlin so it'll have 0 culture.
 
So I basically proved my theory above--Utrecht had no culture (actually can't even whip a monument since I got calendar from the hut in Denmark), and Willem could not flip any of my 3 longbowmen (promoted from razing Marseilles and Bordeaux). Got 2 workers from their settlers after they hurled themselves on my wall-less city. Dutch problem solved for the UHV.:lol:

I had so much land and population that Louis SPONTANEOUSLY offered to be my vassal in 1120 AD, solving all my problems with Murcia and Pamplona not having their due resources.:lol: (I know, I basically lost the UHV by having the French as vassals, but this game is turning out to be very interesting. Maybe I'll keep diverting French research from Astronomy and win it that way. And there are always privateers...)

Obviously it's all a house of cards (I had just warriors in Spain and a couple catapults)--if Germany or France decided to invade I would have lost. Thank God for the Christian +3 pleased diplomacy. This obviously only works in Monarch and Viceroy mode.
 
Well, unfortunately it didn't work. I think the unit flipping code says you need land tiles to have flipped units, so that's why the Amsterdam tile was so unique (you get to keep only the city tile and 2 sea tiles). So maybe I got lucky with the English and Spanish squatting on Dutch land because my "betrayal" threshold was not reached 8 times in a row. Tried founding "Chartres" on the northern shores of Germany and because the latter also owns the sea, I was left with 1 tile (the city) and my units deserted anyway even though Germany didn't have any culture around my city.
Can anybody with Python experience explain the following code to me?

Code:
        def unitsBetrayal( self, iNewOwner, iOldOwner, tTopLeft, tBottomRight, tPlot ):
                #print ("iNewOwner", iNewOwner, "iOldOwner", iOldOwner, "tPlot", tPlot)
                if (gc.getPlayer(self.getOldCivFlip()).isHuman()):
                        CyInterface().addMessage(self.getOldCivFlip(), False, con.iDuration, CyTranslator().getText("TXT_KEY_FLIP_BETRAYAL", ()), "", 0, "", ColorTypes(con.iGreen), -1, -1, True, True)
                elif (gc.getPlayer(self.getNewCivFlip()).isHuman()):
                        CyInterface().addMessage(self.getNewCivFlip(), False, con.iDuration, CyTranslator().getText("TXT_KEY_FLIP_BETRAYAL_NEW", ()), "", 0, "", ColorTypes(con.iGreen), -1, -1, True, True)
                for x in range(tTopLeft[0], tBottomRight[0]+1):
                        for y in range(tTopLeft[1], tBottomRight[1]+1):
                                killPlot = gc.getMap().plot(x,y)
                                iNumUnitsInAPlot = killPlot.getNumUnits()
                                if (iNumUnitsInAPlot):                                                                  
                                        for i in range(iNumUnitsInAPlot):                                                
                                                unit = killPlot.getUnit(i)
                                                if (unit.getOwner() == iOldOwner):
                                                        rndNum = gc.getGame().getSorenRandNum(100, 'betrayal')
                                                        if (rndNum >= iBetrayalThreshold):
                                                                if (unit.getDomainType() == 2): #land unit
                                                                        iUnitType = unit.getUnitType()
                                                                        unit.kill(False, iNewOwner)
                                                                        utils.makeUnit(iUnitType, iNewOwner, tPlot, 1)
                                                                        i = i - 1
 
Unfortunately I can't answer your python question Pacifist, but I can give you a :king: for having 8 consecutive posts in the same thread! Is that some kind of a record around here?
 
Well, unfortunately it didn't work. I think the unit flipping code says you need land tiles to have flipped units, so that's why the Amsterdam tile was so unique (you get to keep only the city tile and 2 sea tiles). So maybe I got lucky with the English and Spanish squatting on Dutch land because my "betrayal" threshold was not reached 8 times in a row. Tried founding "Chartres" on the northern shores of Germany and because the latter also owns the sea, I was left with 1 tile (the city) and my units deserted anyway even though Germany didn't have any culture around my city.
Can anybody with Python experience explain the following code to me?

Code:
        def unitsBetrayal( self, iNewOwner, iOldOwner, tTopLeft, tBottomRight, tPlot ):
                #print ("iNewOwner", iNewOwner, "iOldOwner", iOldOwner, "tPlot", tPlot)
                if (gc.getPlayer(self.getOldCivFlip()).isHuman()):
                        CyInterface().addMessage(self.getOldCivFlip(), False, con.iDuration, CyTranslator().getText("TXT_KEY_FLIP_BETRAYAL", ()), "", 0, "", ColorTypes(con.iGreen), -1, -1, True, True)
                elif (gc.getPlayer(self.getNewCivFlip()).isHuman()):
                        CyInterface().addMessage(self.getNewCivFlip(), False, con.iDuration, CyTranslator().getText("TXT_KEY_FLIP_BETRAYAL_NEW", ()), "", 0, "", ColorTypes(con.iGreen), -1, -1, True, True)
                for x in range(tTopLeft[0], tBottomRight[0]+1):
                        for y in range(tTopLeft[1], tBottomRight[1]+1):
                                killPlot = gc.getMap().plot(x,y)
                                iNumUnitsInAPlot = killPlot.getNumUnits()
                                if (iNumUnitsInAPlot):                                                                  
                                        for i in range(iNumUnitsInAPlot):                                                
                                                unit = killPlot.getUnit(i)
                                                if (unit.getOwner() == iOldOwner):
                                                        rndNum = gc.getGame().getSorenRandNum(100, 'betrayal')
                                                        if (rndNum >= iBetrayalThreshold):
                                                                if (unit.getDomainType() == 2): #land unit
                                                                        iUnitType = unit.getUnitType()
                                                                        unit.kill(False, iNewOwner)
                                                                        utils.makeUnit(iUnitType, iNewOwner, tPlot, 1)
                                                                        i = i - 1

I have no idea, but I know Linus Torvalds would yell at whoever wrote it for having that much indentation.
 
I have no idea, but I know Linus Torvalds would yell at whoever wrote it for having that much indentation.

I thought the whole point of Python was readability, and indentation is common (at least that's what some online primers says, don't use notepad but some other editor with built-in indentation).
 
I thought the whole point of Python was readability, and indentation is common (at least that's what some online primers says, don't use notepad but some other editor with built-in indentation).

Well, you indent in C in the same places you'd be indenting in Python. Torvald's thing is basically "if you have to indent more than twice, you should be breaking it up into more functions" from what I understand.
 
Anotherpacifist you are a sick man x) twisting the Rhye's system like that...


but please continue! I am starting to use some of this tricks in my games ( Spanish Lisbon is awesome! )
 
The first if and else if just checks whenever you are the person losing the units or gaining the units and gives you a message accordingly.

It will then go through the XY coords of the locations within the range (set between a start and end for both) and for each tile on them check for units (personally this would be better to only check for OldOwner Units but meh) and makes a range loop of their number if they exist.

Within this loop the following happens:
If the random number generated each loop is above the betrayal threshhold (likely a constant) it will then give that unit to the new owners and remove the old unit.

Then it will low "i" by one (which basically means keep checking the same tile after changing a unit to see if we can change more) to allow the range to continue but on the same tile.

So actually you shouldn't be able to hold the units no matter the location as it is only how high the betrayal integer is set and your luck on the random numbers really.
 
Linus is entitled to his opinion, but if the inner block is used in only one place, putting it inline with a paragraph comment will read better sometimes. It partly depends how well the reader's tool supports browsing a larger number of functions.

There might be a wee bit much indentation in the quoted block, but it's the eight space indent size that's truly barbaric. :viking: :mischief:
 
so 2 questions:
1. What exactly are the coordinates for the betrayal zone?
2. If I don't put any units initially in the betrayal zone, does that mean that i=0, i.e. afterwards I can put units in it? How often is i checked?
 
tTopLeft, tBottomRight are both tuples(I think)(similar to an arraz) holding the tile points, so print them off to get the full list, have to be integers for the range function to work, so see what they are to get the "scope" of the tiles for the area.

Not exactly, it depends for how long that function is called, but as long as you can keep out of it you will not lose people, so again it depends on tTopLeft, tBottomRight.

The best to check what is going on is to use a print statement really.

something like

print "tTopLeft:", tTopLeft, "AND tBottomRight:", tBottomRight

will give you those two tuples, it should print them out like
tTopLeft: (1,2,3,4,5) AND tBottomRight: (1,2,3,4,5)
obviously with differnet numbers.

Those give you the range X and Y coords and well, how they are used I am not sure, but I guess it is based upon the tiles of the map.

Use print statements will give you a good idea how often the function is called, (likely once per turn) but for how long I can't say, best to look at what actually CALLs THAT function to see that.
 
Thanks coko. I couldn't find the coordinates for topleft and bottomright anywhere in the python files (Rhye obviously hid them well), but I suspect they will be the spawn areas of the civ being invaded.
 
These are function calls, which are instructions to run the function:

self.unitsBetrayal(iCiv, iHuman, tCoreAreasTL[iCiv], tCoreAreasBR[iCiv], result)

self.unitsBetrayal(self.getNewCivFlip(), self.getOldCivFlip(), self.getTempTopLeft(), self.getTempBottomRight(), result)​
This is the beginning of a function definition. The names in parentheses are function parameters, which are temporary variables that get assigned the value specified in the function call:

def unitsBetrayal( self, iNewOwner, iOldOwner, tTopLeft, tBottomRight, tPlot ):​
In the first call it's easy, in the second call there's some logic you'll have to trace.
 
Back
Top Bottom