[Religion and Revolution]: Mod Development

Status
Not open for further replies.
How is it solved in "Further Age of Discovery"? Does it check every time a unit moves? I am not sure this concept is what I was thinking.

Age of Further Discovery handles this generally just the same as I am suggesting. ;)

-> At the End of Turn, when logic is looping through the cities.

Here the main code for this feature in Age of Further Discovery:

Spoiler :

Code:
void CvCity::doTurn()
{
	PROFILE_FUNC();

	CvPlot* pLoopPlot;
	int iI;

	if (!isBombarded())
	{
		changeDefenseDamage(-(GC.getDefineINT("CITY_DEFENSE_DAMAGE_HEAL_RATE")));
	}

	setLastDefenseDamage(getDefenseDamage());
	setBombarded(false);

	// PatchMod: City bombard START
	[COLOR="Red"]doBombard();[/COLOR]
	// PatchMod: City bombard END

	AI_doTurn();

	bool bAllowNoProduction = !doCheckProduction();

	doSpecialists();

	doYields();

	doGrowth();

	doCulture();

	doPlotCulture(false, getOwnerINLINE(), getCultureRate());

	doProduction(bAllowNoProduction);

	doDecay();

	doMissionaries();

	doRebelSentiment();

	if (!isDisorder())
	{
		for (iI = 0; iI < NUM_CITY_PLOTS; iI++)
		{
			pLoopPlot = getCityIndexPlot(iI);

			if (pLoopPlot != NULL)
			{
				if (pLoopPlot->getWorkingCity() == this)
				{
					if (pLoopPlot->isBeingWorked())
					{
						pLoopPlot->doImprovement();
					}
				}
			}
		}
	}

	if (getCultureUpdateTimer() > 0)
	{
		changeCultureUpdateTimer(-1);
	}

	if (getOccupationTimer() > 0)
	{
		changeOccupationTimer(-1);
	}

	for (uint i = 0; i < m_aPopulationUnits.size(); ++i)
	{
		m_aPopulationUnits[i]->doTurn();
	}

	// ONEVENT - Do turn
	gDLL->getEventReporterIFace()->cityDoTurn(this, getOwnerINLINE());
}


Spoiler :

Code:
// PatchMod: City bombard START
void CvCity::doBombard()
{
	if (isHasBuilding((BuildingTypes)GC.getDefineINT("BUILDING_FORT")) || isHasBuilding((BuildingTypes)GC.getDefineINT("BUILDING_FORTRESS")))
	{
		CvWString szBuffer;
		CvPlot* pPlot = plot();
		CvPlot* pAdjacentPlot = NULL;
		CvUnit* pBombUnit = NULL;
		CvUnit* pLoopUnit = NULL;
		CvUnit* pLoopUnit2 = NULL;
		bool bCanBomb = false;
		CLLNode<IDInfo>* pUnitNode = NULL;
		CLLNode<IDInfo>* pUnitNode2 = NULL;
		int iDamage = 0;

		pUnitNode = pPlot->headUnitNode();

		while (pUnitNode)
		{
			pLoopUnit = ::getUnit(pUnitNode->m_data);
			pUnitNode = plot()->nextUnitNode(pUnitNode);

			iDamage = 0;

			if (pLoopUnit->bombardRate() > 0 && pLoopUnit->getOwnerINLINE() == getOwnerINLINE())
			{
				//bCanBomb = false;
				//if (pLoopUnit->getFortifyTurns() > 0)
				{
					bCanBomb = true;
					pBombUnit = pLoopUnit;
				}

				if (bCanBomb && iDamage == 0)
				{
					for (int iI = 0; iI < NUM_DIRECTION_TYPES; iI++)
					{
						pAdjacentPlot = plotDirection(getX_INLINE(), getY_INLINE(), ((DirectionTypes)iI));
						if (pAdjacentPlot != NULL && iDamage == 0)
						{
							if (pAdjacentPlot->isWater())
							{
								pUnitNode2 = pAdjacentPlot->headUnitNode();
								while (pUnitNode2)
								{
									pLoopUnit2 = ::getUnit(pUnitNode2->m_data);
									pUnitNode2 = pAdjacentPlot->nextUnitNode(pUnitNode2);

									if (getTeam() != pLoopUnit2->getTeam() && GET_TEAM(getTeam()).isAtWar(pLoopUnit2->getTeam()) && !pLoopUnit2->isCargo())
									{
										int randNum = GC.getGameINLINE().getSorenRandNum(100, " ");
										if (randNum < 30)
										{
											iDamage = pLoopUnit2->maxHitPoints() * pBombUnit->bombardRate() / 100;
										}
										else if (randNum < 35)
										{
											iDamage = pLoopUnit2->maxHitPoints();
										}
										else
										{
											iDamage = 0;
										}

										pLoopUnit2->changeDamage(iDamage, pBombUnit);

										if (iDamage > 0)
										{
											if (pLoopUnit2->isDead())
											{
												int iExperience = pLoopUnit2->attackXPValue();
												iExperience = ((iExperience * pLoopUnit2->currCombatStr(plot(), pBombUnit)) / pBombUnit->currCombatStr(NULL, NULL));
												iExperience = range(iExperience, GC.getDefineINT("MIN_EXPERIENCE_PER_COMBAT"), GC.getDefineINT("MAX_EXPERIENCE_PER_COMBAT"));

												pBombUnit->changeExperience(iExperience, pLoopUnit2->maxXPValue(), true, plot()->getOwnerINLINE() == pBombUnit->getOwnerINLINE(), true);

												szBuffer = gDLL->getText("TXT_KEY_FORTBOMB_YOU_SUNK");
												gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_CIVIC_ADOPT", MESSAGE_TYPE_MINOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(), getY_INLINE(), true, true);

												szBuffer = gDLL->getText("TXT_KEY_FORTBOMB_THEM_SUNK");
												gDLL->getInterfaceIFace()->addMessage(pLoopUnit2->getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_CIVIC_ADOPT", MESSAGE_TYPE_MINOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoopUnit2->getX_INLINE(), pLoopUnit2->getY_INLINE(), true, true);
											}
											else
											{
												szBuffer = gDLL->getText("TXT_KEY_FORTBOMB_YOU_HIT", iDamage);
												gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_CIVIC_ADOPT", MESSAGE_TYPE_MINOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(), getY_INLINE(), true, true);

												szBuffer = gDLL->getText("TXT_KEY_FORTBOMB_THEM_HIT", iDamage);
												gDLL->getInterfaceIFace()->addMessage(pLoopUnit2->getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_CIVIC_ADOPT", MESSAGE_TYPE_MINOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoopUnit2->getX_INLINE(), pLoopUnit2->getY_INLINE(), true, true);
											}
										}
										else
										{
											szBuffer = gDLL->getText("TXT_KEY_FORTBOMB_YOU_MISS");
											gDLL->getInterfaceIFace()->addMessage(getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_CIVIC_ADOPT", MESSAGE_TYPE_MINOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_GREEN"), getX_INLINE(), getY_INLINE(), true, true);

											szBuffer = gDLL->getText("TXT_KEY_FORTBOMB_THEM_MISS");
											gDLL->getInterfaceIFace()->addMessage(pLoopUnit2->getOwnerINLINE(), false, GC.getEVENT_MESSAGE_TIME(), szBuffer, "AS2D_CIVIC_ADOPT", MESSAGE_TYPE_MINOR_EVENT, NULL, (ColorTypes)GC.getInfoTypeForString("COLOR_RED"), pLoopUnit2->getX_INLINE(), pLoopUnit2->getY_INLINE(), true, true);
										}

										if (pAdjacentPlot->isActiveVisible(false))
										{
											// Bombard entity mission
											CvMissionDefinition kDefiniton;
											kDefiniton.setMissionTime(GC.getMissionInfo(MISSION_BOMBARD).getTime() * gDLL->getSecsPerTurn());
											kDefiniton.setMissionType(MISSION_BOMBARD);
											kDefiniton.setPlot(pAdjacentPlot);
											kDefiniton.setUnit(BATTLE_UNIT_ATTACKER, pBombUnit);
											kDefiniton.setUnit(BATTLE_UNIT_DEFENDER, pLoopUnit2);
											gDLL->getEntityIFace()->AddMission(&kDefiniton);
										}

										if (pLoopUnit2->isDead())
										{
											pLoopUnit2->kill(false);
										}
									}

									if (iDamage > 0)
									{
										pUnitNode2 = NULL;
									}
								}
							}
						}
					}
				}
			}
		}
	}

	return;
}
// PatchMod: City bombard END


I do hope "Firing when Enemy moves by a city" isnt forgotten. That was the main feature idea I had.

Sorry, I do not want to do that. :(
(Performance and Implementation Efforts.)

I would have to check at every move a unit does !
(With my suggested solution I can really simply loop through the cities at end of turn.)

Does it really make such a big difference if it is "End of Turn Next to City" or "While Passing City" ?
(My suggested solution is easier to implement and also more performant ...)

In many cases (especially for military on land) the result would be just the same. :dunno:

Please let us not make this feature too complicated. :)

There are a few things I would like:

1. Keep efforts for implementation and also risk of bugs low.
(To be honest, this feature is only a "Nice-To-Have" for me.)

2. Ensure, that it does not destroy balance.
(AI should not loose too many units on this feature because it does not know how to handle like a human player does.)

3. Performant logic, so game turns do not get unnecessarily longer.
 
Natives and Treasures

Let us simply transform a Native Treasure into gold, once it has reached a Native village. :dunno:
Oh great! That's even better !
Scorelist
Robert, if you are interested, then go ahead. :thumbsup:
Ok !
About alliances...
Answer: AI. :)
(AI is not smart enought to handle things like "breaking contracts", like a human player could.)
You're probably right Ray...
Answer 2: I don't think it is needed.
(You already have cases and the according diplomacy in game when other players join into a war on a certain side.
Which basically is an Alliance. It is even treated / called like that in DLL.)
Well yes but, you will probably lose all your diplomatic bonuses. And if you want to be sure to have "allies" on your side, you would probably have to pay...

For me having "Defensive Pact" and "Permanent Alliance" is just fine. :dunno:
Actually I agree with Gomer_Pyle... I'm not totally ok with "Defensive Pact" and "Permanent Alliance". Defensive pacts are useless if you have an aggressive strategy! Permanent alliances isn't just an alliance, the ally becomes a team member... Defensive pact is a little too weak, and permanent alliance too strong.
So, in my opinion something is missing (that is "true" alliance). But I haven't thought it through...

Have you an idea Gomer_Pyle ? How would it work technically?
 
"Cannons in Citadel bombarding Enemies outside City" - OK, too.

Is it just ok (meaning you don't really care) or is it interesting (meaning you would like to have it) ? :)
 
Is it just ok (meaning you don't really care) or is it interesting (meaning you would like to have it) ? :)

"OK" means that this feature is interesting for me and I would be happy if it would be in the mod.

Opposite case: "Limitting Size of Stacks". This feature is not so interesting for me and the team is free to refuse or to accept it.
 

Does it really make such a big difference if it is "End of Turn Next to City" or "While Passing City" ?
(My suggested solution is easier to implement and also more performant ...)

In many cases (especially for military on land) the result would be just the same. :dunno:

Please let us not make this feature too complicated. :)


I have been thinking. Do not give up on this. I have been thinking and i think it is acceptable that also "Musketmen" defending settlements (shooting from stockade) check on end of turn if any enemies is standing outside cities. It would also be acceptable that it only could attack ONE unit per turn? (actually attacking after end turn is clicked right???) I really want this defensive feature implemented.
 
I have been thinking and i think it is acceptable that also "Musketmen" defending settlements (shooting from stockade) check on end of turn if any enemies is standing outside cities.

Actually this is not very realistic to me. :dunno:

Muskets had a very limited range.
Why should an enemy be dumb enough to get close enough to the Palisades before he really attacks ... :confused:

Also, this would shift balance even more towards Defense. :(
(And towards Europeans, because Natives cannot do that.)

actually attacking after end turn is clicked right?

Yes, it would be "between" turns (of the units).

I really want this defensive feature implemented.

However, I will bow to majority. :)
(If the rest of the team wants it like that, I will do it.)

Let us wait for feedback of the others. :thumbsup:
 
Ok. Thanks. Lets wait and see. This feature is actually 10 times more worth too me than the cannon firing feature. And there is nothing wrong with a good discussion.

It has nothing to do with range of muskets. Game doesnt know if enemy is 50 meters from or 500 meters from settlement in this game? If enemy are in tiles of production of city I would say that as a game they would be within range... That is my argument in this.

Also I think it is a good thing this drift the balance over to defence because it is not that hard to take a settlement in this game is it...
 
When you are in Multiplayer with TAC 2.02b only the "host" is able to have the camera centered on his unit when attacked. When the player who is "not host" of the game server is attacked he wont notice that he has been attacked until he actually check the unit. Is this from Vanilla maybe? I do beleave I havent encountered this bug in vanilla u see. I play alot of multiplayer and this is a very annoying bug. Possible to fix?
 
When you are in Multiplayer with TAC 2.02b only the "host" is able to have the camera centered on his unit when attacked. When the player who is "not host" of the game server is attacked he wont notice that he has been attacked until he actually check the unit. Is this from Vanilla maybe? I do beleave I havent encountered this bug in vanilla u see. I play alot of multiplayer and this is a very annoying bug. Possible to fix?

koma is working explicitly on fixing issues for Multiplayer after TAC 2.02b until TAC 2.03. :thumbsup:
 
Wild Animals, Pirates, Fleeing Crimals / Indentured Servants / Slaves

Idea is to bring a little more life and danger into the gameworld.
However it should not be annoying, not slow down game and not ruin AI.

So the power of these features is limited.
It is just an addition for a little more fun.

These features are not supposed to dominate gameplay. ;)

Wild Animals

1. There are different wild animals like Polar Bear, Bear, Black Bear, Boar, Cougar, Panther, Wolf, ...
(@Robert: In my preview you can find many graphics under ...\Assets\Art\units\Animals)

2. There are 2 Types of (Re-)Spawning possible:

A) By Terrain

Thundra, Permafrost -> Polar Bear, Wolf
Marsh, Light Green Savanna -> Panther, Boar
Prairie -> Cougar, Bear
Savanna -> Black Bear, Boar, Wolf

B) By degree of latitude

Around Equator -> Panther, Boar
Close to Equator -> Cougar, Bear
Further away from Equator -> Black Bear, Boar, Wolf
Far away from Equator -> Polar Bear, Wolf

I personally prefer variant A).
(It is probably easier for me to implement.)

3. There is a maximum limit of wild animals to be (Re-)Spawned defined at the mapsizes. (XML)

4. The frequency / chances of Respawning will be set at Difficulty. (XML)

5. There will be a game option to turn this featue of.

6. Wild Animals cannot enter a field next to a city. (These are save areas)
(Of course they will also not be spawned there.)

7. Wild Animals are generally relatively week and only pose a real thread to non-military units.

8. Natives and Wild Animals will never attack each other.

9. Killing a Wild Animal will give you a little Fur. (Automatically at the next city.)

10. European AI will attack Wild Animals of course.

11. The UnitAI of Wild Animals will attack units that are weaker and run away from units that are stronger.

Pirates

1. Similar to the Wild Animals there will also be spawned Pirateships on the ocean.

  • Maximum Limit of Number at Mapsize
  • Frequency at Difficulty Level
  • Possibility to turn of as Gameoption

2. There are 3 Types of Pirateships

Weak
Normal
Strong

Their chances of creation will be set at GlobalDefinesAlt.xml.
Also there will be settings for minimal rounds to be played berfore spawning of "Normal Pirates" and "Strong Pirates".
(So in the beginning there will be only "Weak Pirates".)

3. Eventually we could even have some kind of diplomacy with Pirates.

For example bribing to not attack own ships for the next 20 rounds.
There could be a button to start diplomacy with pirates at Port Royal Screen.

4. European AI will attack Pirates of course.

5. Pirates will be balanced to generally be weaker than strong military ships.

"Strong Pirates" would be as strong as one of your own Privateers.
They only pose a real threat to non-military ships.

6. Killing Pirateships will gain you a little money.

7. The UnitAI of Pirates is almost the same as the existing one of Privateers.

8. Probably no need to mention: Pirates are no playable Civ.

9. Once a Pirateship destroys another ship, it will head for an "Ocean-Field to Travel to Europe" and disappear.
(They will secure their bounty. Thus also much less danger of totally ruining a player.)

10. In TAC there is a feature of capturing ships.
However it is not possible to capture pirateships.
They can only be destroyed.

11. Pirates do not have any landunits and do not have or found citites.

Fleeing Criminals / Indentured Servants / Slaves

As already mentioned, we will introduce Slaves.

Also in TAC it is possible that Criminals / Indentured Servants run away.
(Currently they will only disappear.)

1. This will change.
There will be units running away.
(New unit graphics and new UnitAI.)

2. These units do not pose a thread to anybody.

3. Natives will ignore them.

4. Wild Animals will kill them.

5. Europeans can (re-)capture them and get back unit Criminal / Indentured Servant / Slave

6. However you should be fast in capturing them.
After a few rounds (random) they will simply disappear.

7. Chances for Fleeing will pretty much be the same as currently in TAC.

8. This feature cannot be turned of in GameOptions.
(There are already possibilities to disable Fleeing in XML.)

-----------------------

Implementation:

Wild Animals, Pirates and Fleeing will be implemented as own "Barbarian Civ" each.

This has several advantages:
A) It is much easier to control the behaviour of Natives / Europeans towards each fraction.
B) It might allow us to have diplomacy with Pirates.
C) It is much easier to separately deactivate in Gameoptions for example.

-----------------------

Feedback ? :)

Really nice that you want to add animals into your mod :)

Them not entering into tiles adjacent to cities is a good gameplay compromise, as otherwise they would interrupt (tile) production too often, and cause other problems. I also prefer option A in regards to re-spawning; since we already have terrain that is related to latitude (savannah, etc.), it already covers in most part the reason for choosing the other option.
 
Really nice that you want to add animals into your mod :)

We will add a lot of cool features to this mod. :)
(But yes, "Wild Animals" is one of my favourites, too.)
 
We will add a lot of cool features to this mod. :)
(But yes, "Wild Animals" is one of my favourites, too.)
It's one of my favorite too...


Ok. Thanks. Lets wait and see. This feature is actually 10 times more worth too me than the cannon firing feature. And there is nothing wrong with a good discussion.
I can understand! But I agree with Ray, this basically didn't seem realistic to me. But... But... If you consider this feature very important, I really think we should discuss this again (for instance the Wind and Strom feature is really important to me and you all took your time and considered discussing with me even though you didn't seem thrilled)

It has nothing to do with range of muskets. Game doesnt know if enemy is 50 meters from or 500 meters from settlement in this game? If enemy are in tiles of production of city I would say that as a game they would be within range... That is my argument in this.
This actually makes sense! ;) So do you want an automatic firing or not? Could you be interested by a "bombard" feature? Let me try to explain. In Civ4 some units have ranged attacks. Is this what you're looking for, or not?
This may not make many sense but the interesting part of the feature was the fact that a land unit (a cannon) could attack a naval unit (a ship)... But you're beginning to convince me. What do the others think about it?

Also I think it is a good thing this drift the balance over to defence because it is not that hard to take a settlement in this game is it...
Well in vanilla C4C, it's easy to capture enemy cities and quite hard to lose one of your one. AI is a little ...(let's say) weak :crazyeye:
But with TAC, I can't exactly tell. You find the defense is too weak? I really can't tell
:dunno:
 
Wind and Strom feature ... even though you didn't seem thrilled

No, that is not correct. :)
I really like the feature idea of "Wind and Storms".
I simply want us (as a team) to find the best concept possible and do a really good implementation. :thumbsup:

the interesting part of the feature was the fact that a land unit (a cannon) could attack a naval unit (a ship)

That is already in the concept Cannons in Citadel bombarding Enemies outside City. :)
 
I do love your project Wind and Storms too. I really do. And I know if you can add something like that then adding a feature like this should be a cakewalk. :P

This actually makes sense! ;) So do you want an automatic firing or not? Could you be interested by a "bombard" feature? Let me try to explain. In Civ4 some units have ranged attacks. Is this what you're looking for, or not?
This may not make many sense but the interesting part of the feature was the fact that a land unit (a cannon) could attack a naval unit (a ship)... But you're beginning to convince me. What do the others think about it?

Bombard... Hmm. Not if it is the feature cannons have. What the feature I am after needs is an automatic firing effect. Example: You got a settlement with a musket man with a stockade. (Has to be stockade) Then when a native/enemy or a number of enemies comes into tile around city when you click end turn "your code" needs to check if enemies is near and select "ONE" target per settlement per turn only. Then shoot at it, not possibility to shoot back i think (almost like ambush). Not sure how it was solved in other mods since it has been a while since i played that. If there is not stockade then no such feature should be possible. I think the key is that only "ONE" target per turn per city is attacked. Not too powerfull then.

Well in vanilla C4C, it's easy to capture enemy cities and quite hard to lose one of your one. AI is a little ...(let's say) weak :crazyeye:
But with TAC, I can't exactly tell. You find the defense is too weak? I really can't tell
:dunno:

I am playing TAC now on medium difficulty and to be honest I find taking "European" cities too easy. The game itself is hard enough I think, but the fact is that in my last game the "English" had 100% liberty (should have won victory automatic?). Year was 1570. He had two times the number of victory points that I had. If he was to fight the king he would be dead. He had like an army of 50-100 units all expert farmers and units like that and a handfull of cannons. Not a single veteran soldier that i could find. Europeans uses more stacks and makes it easier that way compared to natives which go everywhere and are really hard. I do feel the AI prioritize wrong. Since they go for 100% liberty so soon and being so far from actually being ready. So yeah I do think it is too easy to capture cities in this game. Also this feature should be available for AI too? Or is that not possible to do? Even if it should be automatic?

Just out of curiousity does anyone know how the game triggers/finds out that the AI has won independence? I have actually never checked this. But why in my last game didnt the english win even if he had 100%?

On another note. When TAC 2.02c is released we start implementing a working version or you waiting for 2.03 no matter what? I also do think after reading all these features we are adding that we should have a organized way of testing. Having test versions with 1 or 2 features at the time? And work our way forward that way. Or what is the plan?
 
Also this feature should be available for AI too? Or is that not possible to do? Even if it should be automatic?

AI would use this, of course.
(Since it is automated and does not involve any decisions, that is no problem.)

As I said before, my main points why I do not really like "Musketmen in City with Palisades firing on Enemies outside City":

A) For me this does not feel right / realisitc.

B) It would further shift balancing towards Defense and towards Europeans.

I still don't like that idea, but as I said, I will bow to majority. :thumbsup:
(KJ and colonialfan should give their opinion on that, too.)
 
Just out of curiousity does anyone know how the game triggers/finds out that the AI has won independence? I have actually never checked this. But why in my last game didnt the english win even if he had 100%?

Because with "Independence" you also have to beat the king's army.

When TAC 2.02c is released we start implementing a working version or you waiting for 2.03 no matter what?

When TAC 2.02c is released we start integrating our features. :thumbsup:
Later on we will do a merge with TAC 2.03 once that is released.

However our first public release will only be after TAC 2.03.

I also do think after reading all these features we are adding that we should have a organized way of testing. Having test versions with 1 or 2 features at the time? And work our way forward that way. Or what is the plan?

Development and Testing will generally be in parallel.
However we will also take some time to do only testing before we have a public release to community.

We will have an extra thread "Qualitymanagement" to organize our testing.
Everytime a feaure is done, we will post a "Request for Testing" in that thread.
 
Status
Not open for further replies.
Back
Top Bottom