Previously targeted spells now choosing "best plot"?

Bringa

King
Joined
Jan 23, 2006
Messages
678
Hi,

I noticed that some spells (crush, for instance, or pillar of flame) which you previously were able to aim at one plot now look for the "best plot" automatically. Was this a workaround around some interface problem with BtS or a design decision? I really hope it wasn't the latter...
 
They caused OOS in multiplayer, and this is how the AI uses them anyway, so the mechanics were switched to the new ones. It's a bit less micro, too.
 
I love how it is now, its much better streamlined. The targeting system was cumbersome at best. And it helps the AI a lot.
 
Yeah well it's a bit less micro but you can now prevent your hero from being targeted by any of those spells simply by putting a large stack in the tile next to him. A large stack of workers or warriors or hunters with birds for instance. In MP, this is really abusive. I'd like it if this issue wasn't considered "solved" but rather "hot-fixed" and if the team would come back to trying to fix this eventually. It's really made those spells very bad in mp.
 
Yeah well it should do a count of the total str value of the stack as well as factoring levels of the stack, withdraw spell resistances, etc to come up with which stack to pick instead of just number of units.
 
Still, it's always better to give the player control. After all there can be lots of situations where a str count alone is not sufficient.
 
I'd agree if it was a game option somehow, and if even if you turned that game option on, it wouldn't use the targeting system if there are only 1 viable tile to target.
 
I like the idea of a game option to turn it on (but still have AI target the old way)... is that possible?
 
Yeah well it should do a count of the total str value of the stack as well as factoring levels of the stack, withdraw spell resistances, etc to come up with which stack to pick instead of just number of units.
In my last .25 game, I came across several examples where this wasn't the case (not even close - I had a spell target a single injured worg rider in lieu of a stack of healthy macemen).

I haven't had the chance to test it yet in 30, though.
 
vorschlumpf, you misunderstood grey fox. He said it *should* do that. It doesn't do that right now. To restate: currently the logic only counts the amount of enemy units in all plots in a 4x4 square around the caster and then picks the plot with the highest number of enemy units which does not have neutral units in it. This is really suboptimal.
 
I never found new targeting bad, it never hindered the gameplay for me, but I guess that manual targeting would be better once all OOS problems are solved.
And siege should use that system as well (ala civ3). I really miss civ3 style siege units, and with actual hit points instead of civ3 'energy blocks' I think it would work beautiful.
 
Kael got rid of tareting for the sake of the AI. He said a while back that sometime down the road he might make it so that a Human could target while the AI still autocasts. However, this is not a very hight priority.

Personally I don't like auto-targeted spells and really wish he would go ahead and add the human-player targeting back inot the game, possibly as a option. Also, the marskman promotion sould use the targeting mechanic, allowing you to choose which unit to attack.
 
Nikis: I understand how the targeting logic works, and I am not surprised because of any unexpected behavior. What I'm saying is that the current mechanic can easily be exploited in multiplayer games: I just move a stack of two warriors one tile next to my hero, et voila, the enemy can no longer cast Crush/Pillar of Flames/Entangle etc on my hero. I consider this broken.
 
Id like to allow humans to target manually while keeping the AI on the auto-target. Forcing humans to use the same logic allows use to perfect that algorithm because I want to see how it targets (granted that just basing it on the number of units in the tile is very basic).

So the next step is to make the algorithm more intellegent (as you guys suggested maybe basing it on unit strength). Maybe we will make it smart enough that human targeting wont be nessesary. :)
 
I doubt that human targeting will ever be unnecessary for the simple reason that humans are tricky bastards. If both players know how the targeting mechanism works, the one at the receiving end of pillar of flames will always use this knowledge to his advantage and keep the other player from hitting what the other player wants to hit.

If we want to make a *really* good targeting logic (and even that could still be abused by the victim), we'd need to take a lot of context into account. First of all: what is the attacking side's current agenda? Are we defending a town? Are we besieging a town? Are we just hunting down this hero to deny the other side a strong unit? This is a very difficult subject so I propose to ignore this for now. Again, if we want the AI to use these spells well eventually, we will need to build this kind of reasoning algorithm.

So, a simpler approach: as someone's already pointed out, merely counting enemy units is insufficient. We need to add strengths, factor in magic resistance, and we also need to be aware of how much damage we can still inflict on these units.

Off the top of my head in pseudo code:

Code:
maxDmg = spell.getMaxDamage() # the max amount of damage the spell can do; that is, iDamageLimit from CIV4SpellInfos.xml
highestValue = 0
for plot in targetablePlots:
	stack = targetablePlot.getUnits()
	plotScore = 0
	for unit in stack:
		curHP = unit.getCurrentHitpoints()
		resistanceFactor = unit.getResistance(spell.getDamageType()) # multiplied by some factor to get
		 # 0 for magic immune < resFac < 1 for no resistances
		unitValue = (curHP * unit.getFullStrength()) - (maxDmg * unit.getFullStrength())
		unitValue *= resistanceFactor
		plotScore += unitValue
	if plotScore > highestValue:
		highestValue = plotScore
		targetPlot = plot

Again, this ignores current strategic context and other questions such as "will we have units around to finish the enemy off or will they just sit in their city and heal the damage unharassed", but I think this would already be a good deal better than the current implementation. Obviously someone who knows the actual names of the method would have to implement this ;)
 
If it hits a small weak stack while ignoring a larger stack, the larger stack probably had a neutral unit in it.
At the time, the game contained me, my vassal, and the endless hordes of barbarians that were trying to destroy us. No neutral units, and the stack of macemen was definitely more than the single worg rider.

However, this was a previous version, so I'm not reporting this as a bug. If I get deep enough into a .30 game to use these spells again, I'll certainly keep an eye out for similar problems.
 
Back
Top Bottom