Zoc

Oldfrt

Warlord
Joined
Apr 26, 2006
Messages
119
Does anybody else miss ZOC's? I think it is a shame they arent there - would be nice to have them - would help make defending more interesting - and also make forts more useful. Also, as an attacker, it makes things more interesting as you either have to i) Attack straight through or ii) Find a way around.

I have been trying really hard to think of a way that ZOC can be implemented easily.

Possibly the easiest way, if it is possible at all, would be to have a promotion that causes adjacent units to suffer a negative on movement (maybe half the available movement ?), that way units can always move out of a ZOC. Could it be set so the effect only occurs if the unit is "fortified"?

You could give it as a starting promotion to standard "defender" type units and maybe let other units acquire it as it goes along....

What does the devel team think? Is this a posibility?
 
I cant speak for the whole team, but for myself I think that forts are just useless as they are. Im more tempted to remove them from the game than try to fix them in their current implementation because I dont think that the current design is worthwile.

If you really wanted to do forts the right way (in my opinion) you would have to have ZoC. I dont know what the exact impact of ZoC would be, probably a free attack at those that pass by and/or a bonus to friendly units in area.

The big problem with ZoC is getting the AI to understand it. Both in making intellegent movement around an enemys zone of control and building its own ZoC defence system. Unfortunatly that is such a huge challenge that its unlikely to be anything we decide to tackle anytime soon.
 
Thats why I was thinking of the movement penalty and leaving it at that..... because, lets face it, if you are a weak little unit, you may slow enemy units passing, but you certainly aint going to go charging out and attack them.....

It would also mean you could have a unit there to do the holding and another to do the attacking.... am not to keen on the "free attack" principle.

I agree with the forts.... they are totally useless as it stands...

Anyone feel up to the challange of developing a ZOC promotion that Kael & gang can just plug in?
 
Any way of perhaps changing the where forts can be placed? A fort wasn't used to hold setteld and safe territory(not usualy anyways) it woudl help push out the borders.. If there could bea way of allowing forts to be built out of Influence control (be a neutral improvement, useable by anyone) within 2 or 3 squares of the closest city borders then it'd help make it much more useful even w/o ZOC's And the ability for a fort to be worht more defensively on a hill and/or add a sentry bonus to forts. On smaller maps it woudlnt' work out great, but on the larger ones tha thave so very much barb spawning capabilites it could still be a viable build
 
I think that just giving a +100% withdraw rate for units in a fort would give an effective ZoC effect. Units in the fort could attack without risk of getting killed, and would retreat back to the fort (though they'd be suitably weakened). Also, perhaps an enhanced healing rate would be a good idea.
 
Kael said:
I cant speak for the whole team, but for myself I think that forts are just useless as they are. Im more tempted to remove them from the game than try to fix them in their current implementation because I dont think that the current design is worthwile.

If you really wanted to do forts the right way (in my opinion) you would have to have ZoC. I dont know what the exact impact of ZoC would be, probably a free attack at those that pass by and/or a bonus to friendly units in area.

The big problem with ZoC is getting the AI to understand it. Both in making intellegent movement around an enemys zone of control and building its own ZoC defence system. Unfortunatly that is such a huge challenge that its unlikely to be anything we decide to tackle anytime soon.

I'm working on implementing this now. I was hoping to have something worth sharing by next week.

My plan is this as far as the AI goes:
Add the possibility of moving to a fort to the following missions -
AI_DEFEND, AI_HEAL, AI_GUARDBONUS

Thus, forts should be populated by units.

In addition, I was going to add the ZOC from JFort. This ZOC only stops units that move into the zone of a manned fort. So, you can't just run past the fort.

Then, I wanted to add increaced healing to units in forts.
Since I don't know how to get the AI to take it's units and use the attack that they would have if given a 100% withdraw rate, I am going to instead give a free attack to all units based in a fort to all units entering any plot in the ZOC.

This wouldn't likely kill any units unless the fort was really loaded or you ran circles around the fort untill you died.

However, I think the AI would be smart enough to use this feature and benefit from it indirectly. As it made AI_COUNTER and AI_DEFEND and AI_ATTACK units to push back anyone near its fort, those units would get injured and would run to the fort to heal.

In addition, the AI can't help but benefit from having units stop dead in their tracks rather than reaching the city. Even an extra turn or 2 should help the AI out as far as that goes. but we'll see...

Fort placement by the AI isn't too difficult to fix. I may try one or two lines in the SDK to get forts placed just outside the fat cross of cities more often, but most fort placement can be addressed with XML.

I would like to add an isChokepoint method to the SDK such that the Ai will place forts on squares that will be sure to stop the enemy in their tracks...so anyplace it could cover all passable plots it would be more likely to place a fort.

As for the AI vs forts...that may be a bit harder. I haven't looked deeply into the matter but I doubt it will be easy to convince the AI to run around forts whenever possible...though perhaps an isZOC method could be used to detect forts along the path and artificially add to the distance calculated for the AI's path and help it to choose a different path.

If there was a wish list from the design team or the community I could try to make things happen.
 
I like the idea of giving a free first strike to units in forts. It is hard to storm a fort because normally you have to withstand an initial strike as you are approaching the fort.

By giving forts something different than cities, you would give defenders a reason to try to make sure that battles happened in forts rather than at the city walls.
 
I'm torn as to where to post this as there are now Design: Improvment, Fortresses, and ZOC threads...but here it is.

Since Kael has previously stated that plans for defensive improvments were scrapped because of AI stupidity, it seems like a priority that the AI be able to use any fortifications well.

How do we define "well" in this case?
First, the AI must build forts competantly. Where is it good to build forts?
As a rough estimation, and assuming that forts have +50% defense, a ZOC, and can exist in forrest, I'd say the following:
- On hills
- next to bonuses
- in forrest
- next to rivers
- in chokepoints
- just outside workable city radii

Most of that can be done via XML...but to do the rest, and do it well, SDK changes will be required.

Second, the AI must man the forts and gain benefit from them.
I think that adding retreatToFort as an option in the AI_HEAL, and AI_DEFEND, and perhaps looking for adjacent forts with the AI_GUARDBONUS mission will result in ample manning of forts. I'll be experimenting with this.

Third, the AI must not be a dunce when it comes to attacking and moving past forts.
I think that with an isZOC method in the SDK, the AI can be convinced to go around enemy forts ZOC for many missions that would otherwise require paths near a fort.
Other missions, such as pillaging bonuses would need to move right up to the fort unless it was too dangerous. This would also require another SDK function. If ZOC allowed a dozen units in a fort a free hit against you when you moved next to the fort, the AI should want to avoid that if at all possible, unless it's mission requires going by or through the fort.

I think that if the preceding can be done, then the fort AI would be "good enough", what do others think?
 
Maybe give units inside a fort +1 sight as well... bonuses like that may help the AI value the location.
 
I completed my first stab at python code last night and here is what I made happen (mostly)...

I added about a dozen lines to the onUnitMove event handler of FFH.

When a unit moves, all the plots surrounding the unit are checked for fort improvments with visible enemy troops.
If an enemy fort is found in a surrounding plot, then the moving unit is stopped.
Then, each enemy unit in the fort gets to do some damage to the passing unit as follows: Take the defensive STR of the unit in the Fort and multiply it by the combat odds as if the passing unit were attacking the fort and then apply that much damage to the passing unit.

As an example of how I think it's working:
A 3 STR Archer is in a 100% defense fort and along comes a 6STR chariot into the ZOC. The chariot stops it's movement and then takes damage.
the 6 Defensive STR of the Archer * the 50% combat odds results in 3hp of damage to the chariot.

Now that I have this kinda working (thanks to JFort and RealFort mods), I'll focus on getting the AI to put, and leave, units in forts better. This probably requires some SDK changes so it might take a few more days...
 
Has anyone considered making settlements the "new" fort. Basically allow all civs to build settlements. All things considered, I don't think that takes away much from the Kuriotates. Settlements act pretty much like what a fort did IRL (expanded the borders, provided buildings for healing and defense).
 
... tying to think of simple ways that the AI can identify/value forts.

What if all units inside a fort gain +50% defence promotion, yet (enemy) units next to an occupied for gain a -25% defence promotion.

I believe the AI already values/handles the defensive capabilities of tiles quite well - so by manipulating it that way, it can re-route troops around forts as needed.

It also removes the need of forts to have a free attack - I dont like that idea... historically forts are there to "hold" the enemy rather than attack them.

It would also increase the risk of attacking a fort... you going to sit there outside with a -25% defence and risk getting counter-attacked?
 
Maybe an additional bonus to archery units inside a fort? +25% strength, or maybe a couple of first strikes? And let this bonus stay with them when they attack units just outside the fort. Archers wouldn't have to go down into the field to fight them, they could stay up high, firing with immunity.
 
sounds simple and could work.... would certainly give forts a more meaningful position than they currently occupy.

Actually the 50% defence might be a bit weak... maybe a 100% would be more logical given they are designed as defensive structures....
 
Simple ZOC rules proposal:
If any unit moves from a square that is next to an enemy unit of same domain, to a square next to an enemy unit of same domain, it loses any remaining movement points.

This would prevent fast and/or commando from rushing though a small gap between units without the chance to kill them.
Enemy units could attempt to pass by your forts/citys/units in forest hills, but they will be slowed down,and vulnerable to attack.

This would have no effect on one movement stacks ploding through, but they are slow enough that you can mount a better counter attack by the time you need to anyway. Haste could mitigate these effects by being casted after you lose the movement.
 
AlazkanAssassin said:
Simple ZOC rules proposal:
If any unit moves from a square that is next to an enemy unit of same domain, to a square next to an enemy unit of same domain, it loses any remaining movement points.

I think that some units should be able to just out flank or out manuver other units, and this isn't something that should be limited to units with the haste spell.

however, I do think ZOC would be nice to have on some limited units.

I've already implemented the code that can do this. Since I'm checking each square surrounding a unit with each "onMove" event for a fort, it would be trivial to add a check for units with a particular promotion or XML flag that indicated they had a ZOC. If a ZOC was detected, from a fort or otherwise, the ZOC code would continue on and it could stop movement and/or get a free attack as things went by.

I think perhaps the free attack is more reasonable for most things than the stop movement aspect.

Stop movement should be limited to a few units. Maybe shieldwall or something like that and high level casters? It could be a nice secondary effect to tsunami and tremor that they stop all units that move next to them until the next turn. Such an effect would also make Entangle a lot more powerful.
 
My ZoC code. I plan to test this together with making the Commando promotion much easier to get.

Code:
	def onUnitMove(self, argsList):
		'unit move'
		pPlot,pUnit = argsList
		player = PyPlayer(pUnit.getOwner())
		unitInfo = PyInfo.UnitInfo(pUnit.getUnitType())
		pPlayer = gc.getPlayer(pUnit.getOwner())

		iSummoned = gc.getInfoTypeForString('PROMOTION_SUMMONED')
		iSummoned2 = gc.getInfoTypeForString('PROMOTION_SUMMONED2')
		iSummoned3 = gc.getInfoTypeForString('PROMOTION_SUMMONED3')
		iMounted = gc.getInfoTypeForString('UNITCOMBAT_MOUNTED')
		iNaval = gc.getInfoTypeForString('UNITCOMBAT_NAVAL')
		iRecon = gc.getInfoTypeForString('UNITCOMBAT_RECON')

       		iX = pUnit.getX()
		iY = pUnit.getY()
		for iiX in range(iX-1, iX+2, 1):
                	for iiY in range(iY-1, iY+2, 1):
                        	p2Plot = CyMap().plot(iiX,iiY)
				if p2Plot.isOwned():
					pPlot = pUnit.plot()
					p2Player = gc.getPlayer(p2Plot.getOwner())
					eTeam = gc.getTeam(pPlayer.getTeam())
					i2Team = p2Player.getTeam()
					if (eTeam.isAtWar(i2Team) and pPlot.getOwner() != pUnit.getOwner()):
						if p2Plot.getImprovementType() == gc.getInfoTypeForString('IMPROVEMENT_FORT'):
							iRnd = CyGame().getSorenRandNum(100, "Maniac")
							if pUnit.isHasPromotion(iSummoned):
								iRnd = iRnd + 100
							if pUnit.isHasPromotion(iSummoned2):
								iRnd = iRnd + 100
							if pUnit.isHasPromotion(iSummoned3):
								iRnd = iRnd + 100
							if pUnit.getUnitCombatType() == iMounted:
								iRnd = iRnd + 50
							if pUnit.getUnitCombatType() == iNaval:
								iRnd = iRnd + 50
							if pUnit.getUnitCombatType() == iRecon:
								iRnd = iRnd + 25
							if iRnd <= 100:
								pUnit.finishMoves()
								CyInterface().addMessage(pUnit.getOwner(),True,25,'The nearby Fort hampers unit manoeuvres.','AS2D_COMBAT',1,'Art/Interface/Buttons/Builds/BuildFort.dds',ColorTypes(8),pUnit.getX(),pUnit.getY(),True,True)
						if p2Plot.isCity():
							iRnd = CyGame().getSorenRandNum(100, "Maniac")
							if pUnit.isHasPromotion(iSummoned):
								iRnd = iRnd + 100
							if pUnit.isHasPromotion(iSummoned2):
								iRnd = iRnd + 100
							if pUnit.isHasPromotion(iSummoned3):
								iRnd = iRnd + 100
							if pUnit.getUnitCombatType() == iMounted:
								iRnd = iRnd + 50
							if pUnit.getUnitCombatType() == iNaval:
								iRnd = iRnd + 50
							if pUnit.getUnitCombatType() == iRecon:
								iRnd = iRnd + 25
							if iRnd <= 100:
								pUnit.finishMoves()
								CyInterface().addMessage(pUnit.getOwner(),True,25,'The nearby City hampers unit manoeuvres.','AS2D_COMBAT',1,'Art/Interface/Buttons/Buildings/City.dds',ColorTypes(8),pUnit.getX(),pUnit.getY(),True,True)
 
M@ni@c said:
My ZoC code. I plan to test this together with making the Commando promotion much easier to get.

Code:
if (eTeam.isAtWar(i2Team) and pPlot.getOwner() != pUnit.getOwner()):
	if p2Plot.getImprovementType() == gc.getInfoTypeForString('IMPROVEMENT_FORT'):

I used something like:

if p2Plot.getImprovementType() == gc.getInfoTypeForString('IMPROVEMENT_FORT') and p2Plot.getVisibleEnemyUnits () > 0)

Which you may or may not prefer. I think my way allows your enemies to be in forts that they don't own and still trigger the code, while your way requires that a unit own a plot in order to derive benefit from the fort.
i suppose it's a preference as to how to do it, but in case you prefer my way I thought i'd point it out.
 
Back
Top Bottom