2019-12-13 16:53 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000672Spring engineGeneralpublic2007-11-03 17:04
ReporterKDR_11k 
Assigned Toimbaczek 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000672: ProximityPriority tag
DescriptionThis patch adds the proximityPriority tag (float, default 1.0) to weapons which acts as a multiplier for the distance to the target in the priority calculation. In effect that allows modifying the weight a unit puts on proximity, e.g. for long-range units that must prevent enemies from closing in or artillery that doesn't work on close targets (negative values make it prefer distant targets), perhaps even just to make different weapons prefer different targets. May also be useful for dynDamage weapons.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon proxyPrio.patch (2,717 bytes) 2007-11-03 14:13 -
    Index: Game/GameHelper.cpp
    ===================================================================
    --- Game/GameHelper.cpp	(revision 4688)
    +++ Game/GameHelper.cpp	(working copy)
    @@ -428,7 +428,10 @@
     					float modRange=radius+(aHeight-targPos.y)*heightMod;
     					if((pos-targPos).SqLength2D() <= modRange*modRange){
     						float dist2d=(pos-targPos).Length2D();
    -						value*=(secDamage+(*ui)->health)*(dist2d+modRange*0.4f+100)*(0.01f+(*ui)->crashing)/(weapon->weaponDef->damages[(*ui)->armorType]*(*ui)->curArmorMultiple*(*ui)->power*(0.7f+gs->randFloat()*0.6f));
    +						value*=(secDamage+(*ui)->health)
    +							*(dist2d*weapon->weaponDef->proximityPriority+modRange*0.4f+100)
    +							*(0.01f+(*ui)->crashing)
    +							/(weapon->weaponDef->damages[(*ui)->armorType]*(*ui)->curArmorMultiple*(*ui)->power*(0.7f+gs->randFloat()*0.6f));
     						if((*ui)==lastTarget)
     							value*=0.4f;
     						if((*ui)->category & weapon->badTargetCategory)
    Index: Lua/LuaWeaponDefs.cpp
    ===================================================================
    --- Lua/LuaWeaponDefs.cpp	(revision 4688)
    +++ Lua/LuaWeaponDefs.cpp	(working copy)
    @@ -563,6 +563,7 @@
     	ADD_FLOAT("cylinderTargetting", wd.cylinderTargetting);
     	ADD_FLOAT("minIntensity", wd.minIntensity);
     	ADD_FLOAT("heightBoostFactor", wd.heightBoostFactor);
    +	ADD_FLOAT("proximityPriority", wd.proximityPriority);
     
     //	CExplosionGenerator *explosionGenerator;
     
    Index: Sim/Weapons/WeaponDefHandler.cpp
    ===================================================================
    --- Sim/Weapons/WeaponDefHandler.cpp	(revision 4688)
    +++ Sim/Weapons/WeaponDefHandler.cpp	(working copy)
    @@ -429,6 +429,7 @@
     	}
     
     	wd.heightBoostFactor = wdTable.GetFloat("heightBoostFactor", -1.0f);
    +	wd.proximityPriority = wdTable.GetFloat("proximityPriority", 1.0f);
     
     	// get some weapon specific defaults
     	if (wd.type == "Cannon") {
    Index: Sim/Weapons/WeaponDefHandler.h
    ===================================================================
    --- Sim/Weapons/WeaponDefHandler.h	(revision 4688)
    +++ Sim/Weapons/WeaponDefHandler.h	(working copy)
    @@ -200,6 +200,7 @@
     	float cylinderTargetting;					// if greater than 0, range will be checked in a cylinder (height=range*cylinderTargetting) instead of a sphere
     	float minIntensity;							// for beamlasers - always hit with some minimum intensity (a damage coeffcient normally dependent on distance). do not confuse with intensity tag, it's completely unrelated.
     	float heightBoostFactor;					// controls cannon range height boost. default: -1 -- automatically calculate a more or less sane value
    +	float proximityPriority;					// multiplier for the distance to the target for priority calculations
     
     	unsigned int collisionFlags;
     
    
    patch file icon proxyPrio.patch (2,717 bytes) 2007-11-03 14:13 +

-Relationships
+Relationships

-Notes

~0001401

imbaczek (reporter)

i'm not entirely happy about this, it feels incomplete; something like on unitdef side would be nice to have, too.

committed in r4694 regardless.
+Notes

-Issue History
Date Modified Username Field Change
2007-11-03 14:13 KDR_11k New Issue
2007-11-03 14:13 KDR_11k File Added: proxyPrio.patch
2007-11-03 17:04 imbaczek Status new => resolved
2007-11-03 17:04 imbaczek Resolution open => fixed
2007-11-03 17:04 imbaczek Assigned To => imbaczek
2007-11-03 17:04 imbaczek Note Added: 0001401
+Issue History