2022-12-05 12:05 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003890Spring engineUnit Scriptingpublic2013-08-01 03:31
ReporterFLOZi 
Assigned Toabma 
PrioritynormalSeveritymajorReproducibilitysometimes
StatusresolvedResolutionfixed 
Product Version94.1.1+git 
Target Version95.0Fixed in Version 
Summary0003890: Unloaded units fly across the map (S44)
DescriptionInfantry units fly across the map when unloaded from trucks. Happens in 94 but not 93.

May take a few attempts to reproduce.
Steps To ReproduceRun S44 through Spring.exe on Moro River map (also other maps)

/cheat /give geropelblitz

Load infantry squad into the truck.

Unload either single click or area

Watch poor dudes fly.
Additional InformationDemo is from 94.0 with S44 SVN rev 3829

http://sourceforge.net/p/spring1944/code/3829/

That revision did seem to reduce incidence but not remove.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • ? file icon 20130720_124503_1944_Moro_River_V1_94.sdf (25,706 bytes) 2013-07-20 14:11
  • ? file icon 20130723_142441_1944_Moro_River_V1_94.sdf (16,832 bytes) 2013-07-23 15:26
  • ? file icon 20130723_160455_1944_Moro_River_V1_94.1.1-693-g5717870 develop.sdf (21,226 bytes) 2013-07-23 17:08
  • ? file icon 20130723_203426_Greener_Fields no wind_94.1.1-730-g1852c22 develop.sdf (186,049 bytes) 2013-07-23 20:44
  • gif file icon sliding_box_and_angry_transport.gif (4,610,916 bytes) 2013-07-28 06:08
  • diff file icon mantis3890.diff (15,746 bytes) 2013-08-01 02:59 -
    diff --git a/rts/Sim/MoveTypes/ClassicGroundMoveType.cpp b/rts/Sim/MoveTypes/ClassicGroundMoveType.cpp
    index cca8516..1ad0a9f 100644
    --- a/rts/Sim/MoveTypes/ClassicGroundMoveType.cpp
    +++ b/rts/Sim/MoveTypes/ClassicGroundMoveType.cpp
    @@ -29,7 +29,7 @@ bool CClassicGroundMoveType::Update() { return false; }
     void CClassicGroundMoveType::SlowUpdate() {}
     void CClassicGroundMoveType::StartMoving(float3, float) {}
     void CClassicGroundMoveType::StartMoving(float3, float, float) {}
    -void CClassicGroundMoveType::StopMoving() {}
    +void CClassicGroundMoveType::StopMoving(bool, bool) {}
     void CClassicGroundMoveType::KeepPointingTo(float3, float, bool) {}
     void CClassicGroundMoveType::KeepPointingTo(CUnit*, float, bool) {}
     bool CClassicGroundMoveType::CanApplyImpulse() { return false; }
    @@ -337,7 +337,7 @@ void CClassicGroundMoveType::StartMoving(float3 moveGoalPos, float moveGoalRadiu
     	}
     }
     
    -void CClassicGroundMoveType::StopMoving() {
    +void CClassicGroundMoveType::StopMoving(bool callScript, bool hardStop) {
     	StopEngine();
     
     	useMainHeading = false;
    diff --git a/rts/Sim/MoveTypes/ClassicGroundMoveType.h b/rts/Sim/MoveTypes/ClassicGroundMoveType.h
    index 406f160..03e1b3e 100644
    --- a/rts/Sim/MoveTypes/ClassicGroundMoveType.h
    +++ b/rts/Sim/MoveTypes/ClassicGroundMoveType.h
    @@ -19,7 +19,7 @@ public:
     
     	void StartMoving(float3 pos, float goalRadius);
     	void StartMoving(float3 pos, float goalRadius, float speed);
    -	void StopMoving();
    +	void StopMoving(bool callScript = false, bool hardStop = false);
     
     	void KeepPointingTo(float3 pos, float distance, bool aggressive);
     	void KeepPointingTo(CUnit* unit, float distance, bool aggressive);
    diff --git a/rts/Sim/MoveTypes/GroundMoveType.cpp b/rts/Sim/MoveTypes/GroundMoveType.cpp
    index a0b54d7..0afee60 100644
    --- a/rts/Sim/MoveTypes/GroundMoveType.cpp
    +++ b/rts/Sim/MoveTypes/GroundMoveType.cpp
    @@ -205,6 +205,53 @@ void CGroundMoveType::PostLoad()
     	}
     }
     
    +bool CGroundMoveType::OwnerMoved(const short oldHeading, const float3& posDif, const float3& cmpEps) {
    +	if (posDif.equals(ZeroVector, cmpEps)) {
    +		// note: the float3::== test is not exact, so even if this
    +		// evaluates to true the unit might still have an epsilon
    +		// speed vector --> nullify it to prevent apparent visual
    +		// micro-stuttering (speed is used to extrapolate drawPos)
    +		owner->speed = ZeroVector;
    +
    +		// negative y-coordinates indicate temporary waypoints that
    +		// only exist while we are still waiting for the pathfinder
    +		// (so we want to avoid being considered "idle", since that
    +		// will cause our path to be re-requested and again give us
    +		// a temporary waypoint, etc.)
    +		// NOTE: this is only relevant for QTPFS (at present)
    +		// if the unit is just turning in-place over several frames
    +		// (eg. to maneuver around an obstacle), do not consider it
    +		// as "idling"
    +		idling = true;
    +		idling &= (currWayPoint.y != -1.0f && nextWayPoint.y != -1.0f);
    +		idling &= (std::abs(owner->heading - oldHeading) < turnRate);
    +
    +		return false;
    +	}
    +
    +	// note: HandleObjectCollisions() may have negated the position set
    +	// by UpdateOwnerPos() (so that owner->pos is again equal to oldPos)
    +	// note: the idling-check can only succeed if we are oriented in the
    +	// direction of our waypoint, which compensates for the fact distance
    +	// decreases much less quickly when moving orthogonal to <waypointDir>
    +	oldPos = owner->pos;
    +
    +	const float3 ffd = flatFrontDir * posDif.SqLength() * 0.5f;
    +	const float3 wpd = waypointDir * ((int(!reversing) * 2) - 1);
    +
    +	// too many false negatives: speed is unreliable if stuck behind an obstacle
    +	//   idling = (owner->speed.SqLength() < (accRate * accRate));
    +	//   idling &= (Square(currWayPointDist - prevWayPointDist) <= (accRate * accRate));
    +	// too many false positives: waypoint-distance delta and speed vary too much
    +	//   idling = (Square(currWayPointDist - prevWayPointDist) < owner->speed.SqLength());
    +	// too many false positives: many slow units cannot even manage 1 elmo/frame
    +	//   idling = (Square(currWayPointDist - prevWayPointDist) < 1.0f);
    +	idling = true;
    +	idling &= (math::fabs(posDif.y) < math::fabs(cmpEps.y * owner->pos.y));
    +	idling &= (Square(currWayPointDist - prevWayPointDist) < ffd.dot(wpd));
    +	return true;
    +}
    +
     bool CGroundMoveType::Update()
     {
     	ASSERT_SYNCED(owner->pos);
    @@ -231,24 +278,21 @@ bool CGroundMoveType::Update()
     
     	ASSERT_SYNCED(owner->pos);
     
    -	bool hasMoved = false;
    -	bool wantReverse = false;
    -
     	const short heading = owner->heading;
     
     	if (owner->IsStunned() || owner->beingBuilt) {
     		ChangeSpeed(0.0f, false);
     	} else {
     		if (owner->fpsControlPlayer != NULL) {
    -			wantReverse = UpdateDirectControl();
    +			UpdateDirectControl();
     		} else {
    -			wantReverse = FollowPath();
    +			FollowPath();
     		}
     	}
     
     	// these must be executed even when stunned (so
     	// units do not get buried by restoring terrain)
    -	UpdateOwnerPos(wantReverse);
    +	UpdateOwnerPos(owner->speed, GetNewSpeedVector(deltaSpeed, myGravity));
     	AdjustPosToWaterLine();
     	HandleObjectCollisions();
     
    @@ -257,54 +301,7 @@ bool CGroundMoveType::Update()
     	// <dif> is normally equal to owner->speed (if no collisions)
     	// we need more precision (less tolerance) in the y-dimension
     	// for all-terrain units that are slowed down a lot on cliffs
    -	const float3 posDif = owner->pos - oldPos;
    -	const float3 cmpEps = float3(float3::CMP_EPS, float3::CMP_EPS * 1e-2f, float3::CMP_EPS);
    -
    -	if (posDif.equals(ZeroVector, cmpEps)) {
    -		// note: the float3::== test is not exact, so even if this
    -		// evaluates to true the unit might still have an epsilon
    -		// speed vector --> nullify it to prevent apparent visual
    -		// micro-stuttering (speed is used to extrapolate drawPos)
    -		owner->speed = ZeroVector;
    -
    -		// negative y-coordinates indicate temporary waypoints that
    -		// only exist while we are still waiting for the pathfinder
    -		// (so we want to avoid being considered "idle", since that
    -		// will cause our path to be re-requested and again give us
    -		// a temporary waypoint, etc.)
    -		// NOTE: this is only relevant for QTPFS (at present)
    -		// if the unit is just turning in-place over several frames
    -		// (eg. to maneuver around an obstacle), do not consider it
    -		// as "idling"
    -		idling = true;
    -		idling &= (currWayPoint.y != -1.0f && nextWayPoint.y != -1.0f);
    -		idling &= (std::abs(owner->heading - heading) < turnRate);
    -		hasMoved = false;
    -	} else {
    -		// note: HandleObjectCollisions() may have negated the position set
    -		// by UpdateOwnerPos() (so that owner->pos is again equal to oldPos)
    -		// note: the idling-check can only succeed if we are oriented in the
    -		// direction of our waypoint, which compensates for the fact distance
    -		// decreases much less quickly when moving orthogonal to <waypointDir>
    -		oldPos = owner->pos;
    -
    -		const float3 ffd = flatFrontDir * posDif.SqLength() * 0.5f;
    -		const float3 wpd = waypointDir * ((int(!reversing) * 2) - 1);
    -
    -		// too many false negatives: speed is unreliable if stuck behind an obstacle
    -		//   idling = (owner->speed.SqLength() < (accRate * accRate));
    -		//   idling &= (Square(currWayPointDist - prevWayPointDist) <= (accRate * accRate));
    -		// too many false positives: waypoint-distance delta and speed vary too much
    -		//   idling = (Square(currWayPointDist - prevWayPointDist) < owner->speed.SqLength());
    -		// too many false positives: many slow units cannot even manage 1 elmo/frame
    -		//   idling = (Square(currWayPointDist - prevWayPointDist) < 1.0f);
    -		idling = true;
    -		idling &= (math::fabs(posDif.y) < math::fabs(cmpEps.y * owner->pos.y));
    -		idling &= (Square(currWayPointDist - prevWayPointDist) < ffd.dot(wpd));
    -		hasMoved = true;
    -	}
    -
    -	return hasMoved;
    +	return (OwnerMoved(heading, owner->pos - oldPos, float3(float3::CMP_EPS, float3::CMP_EPS * 1e-2f, float3::CMP_EPS)));
     }
     
     void CGroundMoveType::SlowUpdate()
    @@ -394,7 +391,7 @@ void CGroundMoveType::StartMoving(float3 moveGoalPos, float moveGoalRadius) {
     	#endif
     }
     
    -void CGroundMoveType::StopMoving() {
    +void CGroundMoveType::StopMoving(bool callScript, bool hardStop) {
     #ifdef TRACE_SYNC
     	tracefile << "[" << __FUNCTION__ << "] ";
     	tracefile << owner->pos.x << " " << owner->pos.y << " " << owner->pos.z << " " << owner->id << "\n";
    @@ -405,7 +402,7 @@ void CGroundMoveType::StopMoving() {
     	// this gets called under a variety of conditions (see MobileCAI)
     	// the most common case is a CMD_STOP being issued which means no
     	// StartMoving-->StartEngine will follow
    -	StopEngine(false);
    +	StopEngine(callScript, hardStop);
     
     	useMainHeading = false;
     	progressState = Done;
    @@ -1390,7 +1387,7 @@ void CGroundMoveType::StartEngine(bool callScript) {
     	nextObstacleAvoidanceFrame = gs->frameNum;
     }
     
    -void CGroundMoveType::StopEngine(bool callScript) {
    +void CGroundMoveType::StopEngine(bool callScript, bool hardStop) {
     	if (pathId != 0) {
     		pathManager->DeletePath(pathId);
     		pathId = 0;
    @@ -1407,6 +1404,9 @@ void CGroundMoveType::StopEngine(bool callScript) {
     	}
     
     	owner->isMoving = (pathId == 0);
    +	owner->speed *= (1 - hardStop);
    +
    +	currentSpeed *= (1 - hardStop);
     	wantedSpeed = 0.0f;
     }
     
    @@ -2201,11 +2201,7 @@ float3 CGroundMoveType::GetNewSpeedVector(const float hAcc, const float vAcc) co
     	return speedVector;
     }
     
    -void CGroundMoveType::UpdateOwnerPos(bool wantReverse)
    -{
    -	const float3 oldSpeedVector = owner->speed;
    -	const float3 newSpeedVector = GetNewSpeedVector(deltaSpeed, myGravity);
    -
    +void CGroundMoveType::UpdateOwnerPos(const float3& oldSpeedVector, const float3& newSpeedVector) {
     	const float oldSpeed = math::fabs(oldSpeedVector.dot(flatFrontDir));
     	const float newSpeed = math::fabs(newSpeedVector.dot(flatFrontDir));
     
    diff --git a/rts/Sim/MoveTypes/GroundMoveType.h b/rts/Sim/MoveTypes/GroundMoveType.h
    index ab789a5..740f978 100644
    --- a/rts/Sim/MoveTypes/GroundMoveType.h
    +++ b/rts/Sim/MoveTypes/GroundMoveType.h
    @@ -26,7 +26,7 @@ public:
     
     	void StartMoving(float3 pos, float goalRadius);
     	void StartMoving(float3 pos, float goalRadius, float speed) { StartMoving(pos, goalRadius); }
    -	void StopMoving();
    +	void StopMoving(bool callScript = false, bool hardStop = false);
     
     	void KeepPointingTo(float3 pos, float distance, bool aggressive);
     	void KeepPointingTo(CUnit* unit, float distance, bool aggressive);
    @@ -60,7 +60,7 @@ private:
     	float3 Here();
     
     	void StartEngine(bool callScript);
    -	void StopEngine(bool callScript);
    +	void StopEngine(bool callScript, bool hardStop = false);
     
     	void Arrived(bool callScript);
     	void Fail(bool callScript);
    @@ -105,7 +105,8 @@ private:
     	float GetGroundHeight(const float3&) const;
     	void AdjustPosToWaterLine();
     	bool UpdateDirectControl();
    -	void UpdateOwnerPos(bool);
    +	void UpdateOwnerPos(const float3&, const float3&);
    +	bool OwnerMoved(const short, const float3&, const float3&);
     	bool FollowPath();
     	bool WantReverse(const float3&) const;
     
    diff --git a/rts/Sim/MoveTypes/HoverAirMoveType.cpp b/rts/Sim/MoveTypes/HoverAirMoveType.cpp
    index 07ee2c8..2936960 100644
    --- a/rts/Sim/MoveTypes/HoverAirMoveType.cpp
    +++ b/rts/Sim/MoveTypes/HoverAirMoveType.cpp
    @@ -286,7 +286,7 @@ void CHoverAirMoveType::ExecuteStop()
     	}
     }
     
    -void CHoverAirMoveType::StopMoving()
    +void CHoverAirMoveType::StopMoving(bool callScript, bool hardStop)
     {
     	forceHeading = false;
     	wantToStop = true;
    diff --git a/rts/Sim/MoveTypes/HoverAirMoveType.h b/rts/Sim/MoveTypes/HoverAirMoveType.h
    index afc5370..d70e9ab 100644
    --- a/rts/Sim/MoveTypes/HoverAirMoveType.h
    +++ b/rts/Sim/MoveTypes/HoverAirMoveType.h
    @@ -73,7 +73,7 @@ public:
     	void StartMoving(float3 pos, float goalRadius);
     	void StartMoving(float3 pos, float goalRadius, float speed);
     	void KeepPointingTo(float3 pos, float distance, bool aggressive);
    -	void StopMoving();
    +	void StopMoving(bool callScript = false, bool hardStop = false);
     
     	void ForceHeading(short h);
     	void SetGoal(const float3& pos, float distance = 0.0f);
    diff --git a/rts/Sim/MoveTypes/MoveType.h b/rts/Sim/MoveTypes/MoveType.h
    index 77bad64..6b71015 100644
    --- a/rts/Sim/MoveTypes/MoveType.h
    +++ b/rts/Sim/MoveTypes/MoveType.h
    @@ -22,7 +22,7 @@ public:
     	virtual void StartMoving(float3 pos, float goalRadius, float speed) = 0;
     	virtual void KeepPointingTo(float3 pos, float distance, bool aggressive) = 0;
     	virtual void KeepPointingTo(CUnit* unit, float distance, bool aggressive);
    -	virtual void StopMoving() = 0;
    +	virtual void StopMoving(bool callScript = false, bool hardStop = false) = 0;
     	virtual bool CanApplyImpulse(const float3&) { return false; }
     	virtual void LeaveTransport() {}
     
    diff --git a/rts/Sim/MoveTypes/ScriptMoveType.h b/rts/Sim/MoveTypes/ScriptMoveType.h
    index 89cc6ad..98f720b 100644
    --- a/rts/Sim/MoveTypes/ScriptMoveType.h
    +++ b/rts/Sim/MoveTypes/ScriptMoveType.h
    @@ -31,7 +31,7 @@ class CScriptMoveType : public AMoveType
     		void StartMoving(float3, float goalRadius, float speed) {}
     		void KeepPointingTo(float3, float distance, bool aggressive) {}
     		void KeepPointingTo(CUnit* unit, float distance, bool aggressive) {}
    -		void StopMoving() {}
    +		void StopMoving(bool callScript = false, bool hardStop = false) {}
     
     		void SetGoal(const float3& pos, float distance = 0.0f) {}
     		void SetMaxSpeed(float speed) {}
    diff --git a/rts/Sim/MoveTypes/StaticMoveType.h b/rts/Sim/MoveTypes/StaticMoveType.h
    index 92805d6..eef65fd 100644
    --- a/rts/Sim/MoveTypes/StaticMoveType.h
    +++ b/rts/Sim/MoveTypes/StaticMoveType.h
    @@ -13,7 +13,7 @@ public:
     	CStaticMoveType(CUnit* unit) : AMoveType(unit) {}
     	void StartMoving(float3 pos, float goalRadius) {}
     	void StartMoving(float3 pos, float goalRadius, float speed) {}
    -	void StopMoving() {}
    +	void StopMoving(bool callScript = false, bool hardStop = false) {}
     
     	void SetMaxSpeed(float speed) { /* override AMoveType (our maxSpeed IS allowed to be 0) */ }
     	void KeepPointingTo(float3 pos, float distance, bool aggressive) {}
    diff --git a/rts/Sim/MoveTypes/StrafeAirMoveType.cpp b/rts/Sim/MoveTypes/StrafeAirMoveType.cpp
    index 852cc83..9828059 100644
    --- a/rts/Sim/MoveTypes/StrafeAirMoveType.cpp
    +++ b/rts/Sim/MoveTypes/StrafeAirMoveType.cpp
    @@ -1156,7 +1156,7 @@ void CStrafeAirMoveType::StartMoving(float3 pos, float goalRadius, float speed)
     	SetGoal(pos);
     }
     
    -void CStrafeAirMoveType::StopMoving()
    +void CStrafeAirMoveType::StopMoving(bool callScript, bool hardStop)
     {
     	SetGoal(owner->pos);
     	SetWantedMaxSpeed(0.0f);
    diff --git a/rts/Sim/MoveTypes/StrafeAirMoveType.h b/rts/Sim/MoveTypes/StrafeAirMoveType.h
    index cc12af9..bf3212d 100644
    --- a/rts/Sim/MoveTypes/StrafeAirMoveType.h
    +++ b/rts/Sim/MoveTypes/StrafeAirMoveType.h
    @@ -38,7 +38,7 @@ public:
     	void KeepPointingTo(float3 pos, float distance, bool aggressive) {}
     	void StartMoving(float3 pos, float goalRadius);
     	void StartMoving(float3 pos, float goalRadius, float speed);
    -	void StopMoving();
    +	void StopMoving(bool callScript = false, bool hardStop = false);
     
     	void Takeoff();
     	bool IsFighter() const { return isFighter; }
    diff --git a/rts/Sim/Units/UnitTypes/TransportUnit.cpp b/rts/Sim/Units/UnitTypes/TransportUnit.cpp
    index 505cef7..e379c0b 100644
    --- a/rts/Sim/Units/UnitTypes/TransportUnit.cpp
    +++ b/rts/Sim/Units/UnitTypes/TransportUnit.cpp
    @@ -325,18 +325,19 @@ void CTransportUnit::AttachUnit(CUnit* unit, int piece)
     	TransportedUnit tu;
     		tu.unit = unit;
     		tu.piece = piece;
    -		tu.size = unit->xsize / 2;
    +		tu.size = unit->xsize / SPRING_FOOTPRINT_SCALE;
     		tu.mass = unit->mass;
     
     	transportCapacityUsed += tu.size;
     	transportMassUsed += tu.mass;
     	transportedUnits.push_back(tu);
     
    +	unit->moveType->StopMoving(true, true);
     	unit->CalculateTerrainType();
     	unit->UpdateTerrainType();
     
     	eventHandler.UnitLoaded(unit, this);
    -	commandAI->BuggerOff(pos, -1.0f); // make sure not to get buggered off :) by transportee
    +	commandAI->BuggerOff(pos, -1.0f);
     }
     
     
    
    diff file icon mantis3890.diff (15,746 bytes) 2013-08-01 02:59 +

-Relationships
+Relationships

-Notes

~0011035

PepeAmpere (reporter)

true, oh i thought its reported here long ago :) otherwise i would do it, too. thx flozi

~0011036

user744

copied from http://springrts.com/phpbb/viewtopic.php?f=75&t=30007&p=544588#p544588

xta has similiar problem, when unloading com from sea transport it can bounce around the map. should be http://replays.springrts.com/replay/e2a ... 82fa89bc1/
watch my commander:
4min right side of map
7:25 again
12:10 again
(several times inbetween, other players coms too. Seems to happen if you load from sloped terrain into water?)

But some transport bugs were fixed , so wanted to try again in testversion. Or try to use MoveCtrl hold unit in place/set speed to zero if want to fix modside.
--
That coms can only be (un)loaded in water is bug itself in 94.1, maybe fixed together with
http://springrts.com/mantis/view.php?id=3617 ?

~0011041

yuritch (reporter)

wrt test version: bug still happens with 94.1.1-693-g5717870 and same S44 svn revision.

~0011050

cleanrock (reporter)

I tried to reproduce this in both XTA and 1944 but i only seen it maybe once or twice in 1944 (i tried many times).
Please come up with a solid way to reproduce this in last released XTA and 1944 in spring develop or 94.1.
I dont think this need to be on 95 roadmap since its so seldom it happen (at least for me).

btw, both the mentioned demos above dont run in 94.1.

~0011051

FLOZi (reporter)

Last edited: 2013-07-23 15:28

View 2 revisions

Uploaded a new replay;

Engine: 94.1
Map: 1944 Moro River v1 ( http://springfiles.com/spring/spring-maps/1944mororiverv1 )
Game: S44 Operation Most III ( http://spring1944.net/files/Build/S44v162_MostIII.sdz )

Replay shows both single click and area unload.

Happens 9/10 times for me on Moro River.

~0011052

cleanrock (reporter)

flozi,
Error: Spring: Fatal Error (general) Demofile corrupt or created by a different version of Spring: /home/johanr/tmp/20130723_142441_1944_Moro_River_V1_94.sdf

~0011055

FLOZi (reporter)

[14:59:23] <BrainDamage@IRC> 94 / 94.1 have replays incompatible between win & linux due to pointer size bug

:(

~0011058

FLOZi (reporter)

Last edited: 2013-07-23 17:44

View 4 revisions

If at first you don't succeed;

Engine: http://springrts.com/dl/buildbot/default/develop/94.1.1-693-g5717870/win32/

Map & Game as before.

edit: Also I was incorrect earlier; bug is present in 93.0 also

edit2: Infact it is present in http://springrts.com/dl/buildbot/default/develop/91.0.1-757-gd8ba840/win32/ which is the earliest working build still in that dir, 91.0 does *not* exhibit the bug

~0011062

abma (administrator)

happens in BA too: just build an transport load unit, unload unit, then maybe 10% of units fly away. so to reproduce: build 100 units to load, enough transports (hover or air doesn't matter) and unload them.

sometimes a transport loaded with a unit "drifts" away, too.

~0011063

abma (administrator)

my guess what the cause is:

it looks like units are unloaded from the trans slightly above or below the ground, and then they get some impulse and fly away because nothing seems to slow them down.

add some air drag constant to all units? (and get a nice physic simulation?)
also units seems to be immune to gravitiy / ground rubbing.

~0011064

abma (administrator)

maybe is the height where the unloaded unit is created inaccurate?

~0011065

abma (administrator)

save way to reproduce in ba:

/give 20 armthovr
/give 100 armpw

load...unload... flyyyyyy awaaay :)

~0011066

azaremoth (reporter)

I have seen this bug also for the cursed, when units were released from bunkers. After releasing units from a transport points slightly above the ground and doubling unit masses, the bug disappeared/appeared very seldom.

~0011067

FLOZi (reporter)

My concern is that it wasn't present *at all* in 91.0. I don't want to mess around with unit masses as they are set up with a purpose in mind already.

I've tried moving the transport point in the model and yuritch tried setting it in the script and neither seemed to have much impact.

~0011068

user744

Last edited: 2013-07-24 19:00

View 2 revisions

It does not always happen, but here is how to easier reproduce it:
1 pause game
2 set transport to "repeat:on"
3 give area load order
4 shift-que area unload order, to same area as load
5 unpause, watch transport pick up&put down until the passenger eventually flies away
Will attach a replay when I get home.

~0011069

cleanrock (reporter)

Last edited: 2013-07-24 19:28

View 2 revisions

I was first unable to reproduce this with abmas recipe but I found a very solid way to reproduce it:
Put units to be picked up on patrol around transports.
Load em while they run around transports, unload em and you will see most will fly away, works in both BA and 1944.

Looks like some unit states are not cleared when they are picked up.

This code is rather unknown to me, best would be if kloot or jk takes a look at this. I will probably continue to look at it just to understand the code though.

~0011070

abma (administrator)

indeed, picking up already moving units seems to trigger the bug much more often. also it seems the speed the unit has at the pickup time influences the speed it has after unloading...

~0011071

abma (administrator)

this fixed it for me:

https://gist.github.com/abma/6076088

but i have no clue if i did it the right way :-|

~0011072

abma (administrator)

awww, edit: no, doesn't fully work. unit now just fully stops before it is loaded, but maybe moves at unload again. i had a different fix before where

unit->speed = ZeroVector;

was set on unload, but this looks unclean to me. i'm a spring-sim-noob :-|

~0011099

Google_Frog (reporter)

"add some air drag constant to all units? (and get a nice physic simulation?)"

Please not this. We do not need any more hardcoded special behaviour which is impossible to workaround. Especially if it is just to workaround some newly introduced bug. Games which want airdrag can add it easily and games which don't want airdrag don't want the overhead.

~0011121

FLOZi (reporter)

Tried adding this in UnitUnloaded:

DelayCall(Spring.SetUnitVelocity, {unitID, 0, 0, 0}, 16)

They do pause after half a second but then continue to fly away, so it looks like more than just velocity is at fault?

~0011122

abma (administrator)

Last edited: 2013-07-31 22:40

View 2 revisions

created a widget to test further:

https://gist.github.com/abma/6125933

-> load a moving peewee (velocity is ~ 2.7) into a trans,
-> velocity is still ~ 2.7 but the trans is not moving!

~0011124

Kloot (developer)

patched (22+ posts on a simple issue like this...)
+Notes

-Issue History
Date Modified Username Field Change
2013-07-20 14:11 FLOZi New Issue
2013-07-20 14:11 FLOZi File Added: 20130720_124503_1944_Moro_River_V1_94.sdf
2013-07-20 20:37 PepeAmpere Note Added: 0011035
2013-07-20 21:36 user744 Note Added: 0011036
2013-07-21 17:47 yuritch Note Added: 0011041
2013-07-23 02:11 abma Product Version 94.1 => 94.1.1+git
2013-07-23 02:11 abma Target Version => 95.0
2013-07-23 13:49 cleanrock Note Added: 0011050
2013-07-23 15:26 FLOZi File Added: 20130723_142441_1944_Moro_River_V1_94.sdf
2013-07-23 15:28 FLOZi Note Added: 0011051
2013-07-23 15:28 FLOZi Note Edited: 0011051 View Revisions
2013-07-23 15:29 cleanrock Note Added: 0011052
2013-07-23 16:01 FLOZi Note Added: 0011055
2013-07-23 17:07 FLOZi Note Added: 0011058
2013-07-23 17:08 FLOZi File Added: 20130723_160455_1944_Moro_River_V1_94.1.1-693-g5717870 develop.sdf
2013-07-23 17:29 FLOZi Note Edited: 0011058 View Revisions
2013-07-23 17:36 FLOZi Note Edited: 0011058 View Revisions
2013-07-23 17:44 FLOZi Note Edited: 0011058 View Revisions
2013-07-23 20:43 abma Note Added: 0011062
2013-07-23 20:44 abma File Added: 20130723_203426_Greener_Fields no wind_94.1.1-730-g1852c22 develop.sdf
2013-07-23 20:47 abma Note Added: 0011063
2013-07-23 20:48 abma Note Added: 0011064
2013-07-23 21:17 abma Note Added: 0011065
2013-07-23 23:09 azaremoth Note Added: 0011066
2013-07-24 13:58 FLOZi Note Added: 0011067
2013-07-24 19:00 user744 Note Added: 0011068
2013-07-24 19:00 user744 Note Edited: 0011068 View Revisions
2013-07-24 19:22 cleanrock Note Added: 0011069
2013-07-24 19:28 cleanrock Note Edited: 0011069 View Revisions
2013-07-24 19:45 abma Note Added: 0011070
2013-07-25 03:15 abma Note Added: 0011071
2013-07-25 03:20 abma Note Added: 0011072
2013-07-28 06:08 PepeAmpere File Added: sliding_box_and_angry_transport.gif
2013-07-28 06:33 Google_Frog Note Added: 0011099
2013-07-31 20:22 FLOZi Note Added: 0011121
2013-07-31 22:40 abma Note Added: 0011122
2013-07-31 22:40 abma Note Edited: 0011122 View Revisions
2013-08-01 02:59 Kloot File Added: mantis3890.diff
2013-08-01 03:19 Kloot Note Added: 0011124
2013-08-01 03:31 abma Changeset attached => spring develop 29ba410a
2013-08-01 03:31 abma Assigned To => abma
2013-08-01 03:31 abma Status new => resolved
2013-08-01 03:31 abma Resolution open => fixed
+Issue History