The limited arc moving code is flawed

The limited arc moving code is flawed

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

The limited arc moving code is flawed

Post by KDR_11k »

When a unit has a limited arc of fire it is supposed to turn that arc towards th enemy. Unfortunately it uses a move command towards the enemy location and full path finding to do that which means that if the enemy is behind an unpassable obstacle (that doesn't block shots) the unit will often turn AWAY from the target because the pathfinding says it has to go around the obstacle. The 8-way movement also gets annoying, a unit might not turn its arc until it's on one of the 8 cardinal directions when the pathfinding says "okay, turn here". All of this will often result in artillery units running way too close to the enemy instead of simply turning towards them.
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

1. Which mod? What units?
2. It is not true that a movement command is used to rotate the unit. That code is directly in the CGroundMoveType class. Rotating does not call the pathfinder. It uses CWeapon::TryTarget (and TryTargetWithRotation).
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Interesting. In Kernel Panic 0.7 (original version, not KDR Edit) pointers often move around obstacles they could shoot over if their arc doesn't include the enemy (if their path ever turns them randomly towards the enemy they'll stop and shoot, of course), when I manually tell them to move towards the obstacle they can fire with no problem.
User avatar
ILMTitan
Spring Developer
Posts: 410
Joined: 13 Nov 2004, 08:35

Post by ILMTitan »

Is this .74b3, or SVN head that you are experiencing this behavior. I believe arced weapon behavior was broken at some point (don't recall if it was before .74b3 or not), and the fix was added somewhat recently.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

74b3.
Post Reply

Return to “Help & Bugs”