View Issue Details

IDProjectCategoryView StatusLast Update
0000291Spring engineGeneralpublic2006-10-01 16:05
ReporterILMTitan Assigned Totvo  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Summary0000291: [Patch] Better behavior of Fight and Patrol
DescriptionCurrently, units on a fight/patrol command that attack a unit (or reclaim or repair) will return to the spot they left the fight command from before continuing. This patch changes it so that they return to closest point on their old path.
TagsNo tags attached.
Attached Files
FightReturnChanges.patch (Attachment missing)
Checked infolog.txt for Errors

Activities

jcnossen

2006-09-19 22:51

reporter   ~0000381

I think the closest point on line can be done better without trig (faster and clearer IMO):

float3 ClosestPointOnLine(const float3& l1, const float3& l2, const float3& p)
{
    float3 dir(l2-l1);
    float length=dir.Length();
    if(length==0)
        length=0.1f;
    dir/=length;

    float a=(p-l1).dot(dir);
    if(a<0)
        a=0;
    if(a>length)
        a=length;

    return l1+dir*a;
}

Otherwise, it looks ok, but we're waiting with committing until after the 0.73b1 release.

tvo

2006-10-01 16:05

reporter   ~0000406

not committed, but implemented it myself from scratch while cleaning up a certain mess in the CommandAI code.

Issue History

Date Modified Username Field Change
2006-09-10 10:26 ILMTitan New Issue
2006-09-10 10:26 ILMTitan File Added: FightReturnChanges.patch
2006-09-19 22:51 jcnossen Note Added: 0000381
2006-10-01 16:04 tvo Status new => assigned
2006-10-01 16:04 tvo Assigned To => tvo
2006-10-01 16:05 tvo Status assigned => resolved
2006-10-01 16:05 tvo Resolution open => fixed
2006-10-01 16:05 tvo Note Added: 0000406