Theory on why airplane could fail landing in Spring 96

Theory on why airplane could fail landing in Spring 96

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
msafwan
Posts: 38
Joined: 16 Dec 2010, 14:44

Theory on why airplane could fail landing in Spring 96

Post by msafwan »

There's problem with airplane landing in Spring 96. It sometimes go far far away from the airpad and never return. Luckily I think I have an idea why it could happen ... (I hope it could help)

I tried implementing the tracking code for Starburst Missile onto ZK gadget which control airplane landing . I found out that it (will) behave just like the clunky Spring 96+ landing bug, where airplane can go further and further away from the airpad and took long time to return.

Well, what did happen?

My theory is:
the tracking code (which is a math operation) tell the airplane to go backward toward the airpad (if it goes further away from airpad), but the problem is: if the airplane is facing away from the airpad then the airplane couldn't possibly go backward. The code expect it to stop in mid-air & go backward, which is invalid behaviour. So the airplane keep going forward and never stop.

This is the code that gave me those behaviour when I applied it on airplane: (I translated it to LUA)

Code: Select all

float3 targetErrorVec = (targetPos - pos).Normalize();
targetErrorVec = targetErrorVec - dir;
targetErrorVec = targetErrorVec - dir * (targetErrorVec.dot(dir));
targetErrorVec.Normalize();
dir = (dir + (targetErrorVec * turnrate)).Normalize();
CWorldObject::SetVelocity(dir * speed.w);
(I was hoping that someone who changed the airplane landing behaviour read this)
Post Reply

Return to “Engine”