G-Major 107

Here are the notes I took prior to SGOTM15:

How do you get all this info? Code-diving and searching; experience or some sort of unknown program that allows you to see functions called while playing.

Last option is one thing I hoped it existed.
Instead of seeing world events, I would see specific kind of functions called.
 
How do you get all this info? Code-diving and searching; experience or some sort of unknown program that allows you to see functions called while playing.

Last option is one thing I hoped it existed.
Instead of seeing world events, I would see specific kind of functions called.

I simply did a text search on the CvGameCoreDLL folder, and inspected the results for their effects.
 
----UnitAI----
Settlers don't retreat to city
Units very occasionally conisder to worker-steal

Interesting. You found the exact lines that call the settler to part from their escorts. In CvUnitAI.cpp I guess.
Where are they?
 
Interesting. You found the exact lines that call the settler to part from their escorts. In CvUnitAI.cpp I guess.
Where are they?

Parting from escorts in response to danger is a different phenomenon, although that is located in the same place.

CvUnitAI::AI_settleMove is the function involved.
Code:
if (!GC.getGameINLINE().isOption(GAMEOPTION_ALWAYS_PEACE) && !GC.getGameINLINE().isOption(GAMEOPTION_AGGRESSIVE_AI) && !getGroup()->canDefend())
	{
		if (AI_retreatToCity())
		{
			return;
		}
	}
In particular, this piece of code intrudes, before an unescorted settler can walk to a city founding site, except with Always Peace or Aggressive AI.
 
You don't mind if I practise my code reading because I have zero code knowledge, so be sure to understand:

GC.getGameINLINE() : I still don't know what does it mean, but I think it is a function that calls a state or simply means "go fetch me this" then we put a "dot" then the actual info we want to fetch just like "isOption(GAMEOPTION_ALWAYS_PEACE)"

In a nutshell:

Under condition:

Not being an Always peace game AND
Not being an AggAI game AND (that is &&)
the settler can't group with another unit that can defend.

Just to be sure, what does mean those dots and ->?

Then another condition calling a subroutine "AI_retreatToCity()" and if ok,
push forward to make the code compiles via return;.


Ouch. My head.

I really need to understand basic syntax to get going myself, but where to find it. Mods section?
 
Just wanted to add that I had a lot of fun playing with Oromo Warriors and trying to get them as early as possible on Ancient through Renaissance Eras. I learned a lot about getting to Gunpowder and later Steel on all four of the above mentioned starting Eras, Ancient, Classical, Medieval/Mediaeval/Mediæval, and Renaissance. Also, finally learned to get there with enough Production and whipping growth potential to take advantage of that Military Technology lead.

Some things I learned (some through playing; other through fellow player sharing their experinces in this thread):

1. Classical Era worker stealing is fairly safe to perform on even flat, clear plots, since one starts with an Archer and at least peaceful AIs prefer not to counter attack. I was able to nab two Workers with the lone Archer sometimes, really setting that AI back.

2. Subsequently moving that Archer unto a Forested Hill near the AIs capital can really choke the AI. I did this mainly to deny that AI access to nearby Horse/Copper/Iron/Ivory.

3. Renaissance Era worker stealing via initial Longbowmen may not be worthwhile. I stole a Worker from Bismarck and Mansa Musa, and both were a problem from the point that they finally broke my choke by trading for a strategic resource like Mansa Musa did or finally killing my Longbowman like Bismarck did via multiple Musketman and Maceman attacks. Workers can be built or whipped quite quickly on a Renaissance Era start.

4. Aggressive AI probably slows the AI's Research rate down enough to compensate for more AI units. The extra AI units are easy enough to kill, if they cower in cities waiting to be bombarded and barraged by one's huge stack of seige.

5. The Oromo Warrior Drill IV unit can kill decimated units turn after turn without sustaining any damage; normal attacking units are often exhausted after one turn of fighting and are too weak to fight again without an interval of healing.

6. 'No Vassals' option may be a mistake on Large and Huge, where a Domination Victory with Vassals might be quicker; I'm on the fence with this one; 'No Vassals' option may still be better, but heavily depends on other options used.

7. All four Eras should start with a rush earlier than Oromo Warriors.

7a. On Ancient Era, use an early Axeman/Chariot/Swordsman/Horse Archer/War Elephant rush (Horse Archer rush might be best).

7b. On Classical Era, the same rushes should work (Axeman and Chariots rushes need no research to start and Horse and Copper are revealed t0), but the AI improves Copper and even Iron rather quickly, so attention to pillaging these resourses must be done.

7c. On Medieval Era, one should have Ivory and immediately build War Elephants while the AI is weak; Add Catapults before all AI's Capital Culture reaches Def 40 or there are too many Walled Cities.

7d. For Renaisance Era, start with a Knight rush while the AIs are weak; Add Trebuchets before all AI's Capital Culture reaches Def 40 or there are too many Walled Cities.

8. Research for Horse Archer rush on both Ancient and Classical Era starts: Beeline Writing through Aninmal Husbandry (Ancient only); Chop/whip Library; Hire 2 Scientists to generate Great Scientist; beeline Horseback Riding and Archery; Great Scientist bulb Mathematics when there are many Foersts to chop.

9. To complete Gunpowder on a Renaissance Era ASAP, adopt Hereditary Rule, Bureaucracy, Slavery, Mercantilism and Pacifism; May use smaller number of opponents to increase odds of founding one of the seven Relgions IBT 5/6 (turn 5); Hire Engineer in both cities by turn 2; After turn 5, convert to newly founded Religion; Connect cities for natural religion spread as soon as desired; By turn 20, a Great Engineer is generated which is used to bulb about 2/3 of Gunpowder; A high Commerce start will allow the other 1/3 to be researched by t20, so Oromo Warriors become available on turn 20; additional Great Engineers can bulb 1000+B of Steel or even Chemistry; Great Scientists could bulb Chemistry, but Printing Press would need to be bulbed first (would be too early to trade PP), but this would require Caste System and probably mess up Great Engineer generation.

EDIT: Credit for suggesting several of the above goes to vranasm, whose contributions to several past gauntlets can only be characterized as altruistic! A great many thanks to you!

Sun Tzu Wu
 
Last edited:
You don't mind if I practise my code reading because I have zero code knowledge, so be sure to understand:

GC.getGameINLINE() : I still don't know what does it mean, but I think it is a function that calls a state or simply means "go fetch me this" then we put a "dot" then the actual info we want to fetch just like "isOption(GAMEOPTION_ALWAYS_PEACE)"
That's close enough. The actual mechanism of "going to fetch this" is a little hard to follow if you don't know what to expect - some code is hidden away in the executable, and hence not visible in the SDK.
In a nutshell:

Under condition:

Not being an Always peace game AND
Not being an AggAI game AND (that is &&)
the settler can't group with another unit that can defend.
Well, the third condition is actually, "the settler isn't in a group with a unit that can defend".
The code to group with an escort actually happens elsewhere - a spare City Defence (or some others) unit will see the settler and decide to escort it, rather than the settler looking around for escorts. (Having said that, a settler in a city will make it more likely to build escorts).
Just to be sure, what does mean those dots and ->?

Then another condition calling a subroutine "AI_retreatToCity()" and if ok,
push forward to make the code compiles via return;.


Ouch. My head.

I really need to understand basic syntax to get going myself, but where to find it. Mods section?
I'd suggest looking for a brief C++ tutorial on the internet.
Unless something tells the computer not to, the program will execute one line of code after another until it runs out of code. return; is one of those commands to break the sequence.

In very informal terms, Object->PropertyX and Object.PropertyY are two different ways of looking up a property of an object (or of calling subroutines associated with the object). Read up on pointers call-by-reference if you wish to learn the details of the differences.

e.g. RedCar13554.Seats might tell you how many seats RedCar13554 has.
 
Yes, she pioneered the strategy of perpetual anarchy while chopping all the forests to produce units the one turn she wasn't in anarchy.

This was such a strong strategy that is was banned by the HOF, but I think the games that utilized it in the past were allowed to stay.

**Edit**

Ok, my memory is a bit fuzzy it seems. The GOTM staff thinks it is an exploit here, but I don't see it banned in HOF rules. I suspect it is banned somewhere. Maybe perpetual anarchy was for Vanilla and BTS changed something to fix it so that it was never an issue again.

The game designers patched this flaw long ago, but probably after Moonsinger used it. I don't believe that BtS ever had it.

All current versions of Vanilla, Warlords and Beyond the Sword, enforce a period of 5 non-anarchy turns between sequences of anarchy. This exploit has been fixed. Not sure why xTOM still considers this an exploit, since it has no longer been possible to do in submitted games for several years now, but I believe they keep such exploits documented, since they haven't been officially removed and maybe for archival purposes. It just clutters the rules too much, in my opinion, with verbage that describes exploits that have been fixed by an official patch from 2k.

We would all be better off just allowing other so called exploits that have no reliable method of enforcement. While I admire the attempt to call Civ IV a "gentlemen's game", I am reminded that in past eras, gentlemen often resolved their disputes via duels (from swords to pistols and many other weapons as well). I can assure you that there are players who would cheat to win; I assure you that I'm not one of them. My arguments against unenforceable bans is motivated by pragmatics; making such bans only penalizes the honest players and the cheaters will by definition never be caught. In the end, such bans only promote more cheating. Nothing promotes cheating more than the certain knowledge that one can not possibly be caught cheating. So, such ill conceived bans should never be imposed.

Sun Tzu Wu
 
You don't mind if I practise my code reading because I have zero code knowledge, so be sure to understand:

GC.getGameINLINE() : I still don't know what does it mean, but I think it is a function that calls a state or simply means "go fetch me this" then we put a "dot" then the actual info we want to fetch just like "isOption(GAMEOPTION_ALWAYS_PEACE)"

In a nutshell:

Under condition:

Not being an Always peace game AND
Not being an AggAI game AND (that is &&)
the settler can't group with another unit that can defend.

Just to be sure, what does mean those dots and ->?

Then another condition calling a subroutine "AI_retreatToCity()" and if ok,
push forward to make the code compiles via return;.


Ouch. My head.

I really need to understand basic syntax to get going myself, but where to find it. Mods section?

as ZPV said it's object oriented programming... for the sake of simplicity

the first is instance of class (GC) and the second is method called (determined by the "(", can have arguments), you can reference properties (then you don't use "("), but they can be private/public etc, so common way of doing things in object oriented programming is using methods of classes.

the "->" is used when you use pointer and not instance, generally you need to use pointers when you past instance to method working with the instance.

it is very important to know the returned type of method since sometimes methods only refer inner saved properties. That "getGameINLINE()" most probably just returns pointer to another data structure/class for access to another methods.

you can chain this way methods...

let's say we will have function 'getConnection()' which returns instance of class "Connection", this class then allows to open connection through "open(server)", you can then write

GC.getConnection().open("server") etc etc.

the GC in our example will have it's class called GameControl and declaration is GameControl GC;
but if you declare it as GameControl *GC;
then you use GC->getConnection().open("server").

if the "getConnection()" returns Connection * then you use GC->getConnection()->open("server")
 
This gauntlet is now closed.

Results:
G-Major 107 - Domination, Deity, Large, Normal
1st tachywaxon 760 AD
2nd Kaitzilla 900 AD
3rd kovacsflo 1180 AD

Well done all :thumbsup:

Congratulations Tachywaxon, Kaitzilla, and kovacsflo!

We all now better understand the synergy of the Classical Era and Tribal Villages due to Tachywaxon's #1 AD 760 win. :goodjob:

I didn't play a single game with Tribal Villages on. I don't like them on for Conquest and Domination Victory Conditions. I've been resounded convinced otherwise for Classical Era and no doubt it works even better on later Eras, except those start too late to be competitve with Ancient and Classical Era starts.

Sun Tzu Wu
 
No, huts work best for Classical era. You get huge techs from it, not cheap ones like Ancient times. And later eras simply have not a single tech available in the techs list in huts.
Anyways, medieval and later stages are not competitive. I knew classical ages would fit best and had a slight hope for ancient to take the flag. Still, it was the large map factor that made me doubtful.

=================

Thanks Vranasm+ZPV for your explanations. I'm going to look a bit into C++ databases to know better lists of commands and structures. I'm definitely looking forward to know a bit code diving.
 
No, huts work best for Classical era. You get huge techs from it, not cheap ones like Ancient times. And later eras simply have not a single tech available in the techs list in huts.

You are right, with a couple of exceptions that don't really help much:

Compass can be found in a Tribal Village at the beginning of a Medieval Era start.

Astronomy can be found in a Tribal Village at the beginning of a Rennaisance Era start.

Here's a complete list of Technologies that can be found in Tribal Villages (XML bGoodyHut value is 1):

http://forums.civfanatics.com/showpost.php?p=5684977&postcount=10

EDIT: The above list is incomplete/inaccurate; it is missing Aesthetics which was bulbed with Horseback Riding in tachywaxon's game. Look here for the definitive source:

Beyond the Sword\Assets\XML\Technologies\CIV4TechInfos.xml

I'm disappointed that Gunpowder can not be found in a Tribal Village. However, that is just as well, since I'd prefer that Tribal Villages were banned; I just wanted all options to be allowed for this gauntlet.

Sun Tzu Wu
 
DanF5771 brought a more updated list. Anyways, getting directly from the XML files is a sure way to not miss it.

Classical Start is the strongest along huts because of possible instantaneous military techs one can get. If lucky, someone gets a combo of math+construction. Later stages have some free techs, but the for purpose of this gauntlet, they were useless.

EDIT: I was deeply troubled by the combo of Aesthetics+HBR in less than 4 turns.
But that was definitely the strongest path possible because wars start right away. A stronger game was simply a smaller as mine was around 1100 land tiles IIRC.
 
Top Bottom