The inital vector scaling to compensate previous frame-skipped tracking was not aligned to FrameTime. Removed that code and just divided homer_turn_base values to compensate this offset properly. Thanks to zif for hinting me to that; Added comment about the how and why of the homing missile scaling issue

This commit is contained in:
zicodxx 2010-08-11 16:25:58 +00:00
parent 5611e1c110
commit 2028abb6d5
2 changed files with 10 additions and 3 deletions

View file

@ -1,5 +1,9 @@
D1X-Rebirth Changelog
20100811
--------
main/laser.c: The inital vector scaling to compensate previous frame-skipped tracking was not aligned to FrameTime. Removed that code and just divided homer_turn_base values to compensate this offset properly. Thanks to zif for hinting me to that; Added comment about the how and why of the homing missile scaling issue
20100809
--------
d1x-rebirth.xcodeproj/project.pbxproj, include/physfsx.h, include/pstypes.h, misc/physfsx.c, SConstruct: Add 'Resources' in .app bundle to searchpath for Mac; move bigger functions from physfsx.h to physfsx.c; resolve conflict with definition of 'bool'

View file

@ -959,7 +959,12 @@ void Laser_TurnSpeedLimit(vms_vector* vec_forward, vms_vector* vec_to_target, fi
}
#ifdef NEWHOMER
fix homing_turn_base[NDL] = { 20, 25, 35, 40, 45 };
/*
* In the original game homers turned sharper in higher FPS-values. We do not want that so we need to scale vector_to_object to FrameTime.
* For each difficulty setting we have a base value the homers will align to. This we express in a FPS value representing the homers turn radius of the original game (i.e. "The homer will turn like on XXFPS").
* NOTE: Old homers only get valid track_goal every 8 frames. This does not apply anymore so these values are divided by 4 to compensate this.
*/
fix homing_turn_base[NDL] = { 5, 6, 9, 10, 11 };
#endif
//-------------------------------------------------------------------------------------------
@ -1033,8 +1038,6 @@ void Laser_do_weapon_sequence(object *obj)
speed = max_speed;
}
// Old homers only get valid track_goal every 8 frames. That was changed so scale vector to object accordingly.
vm_vec_scale(&vector_to_object, F1_0/4);
// Scale vector to object to current FrameTime.
vm_vec_scale(&vector_to_object, F1_0/((float)(F1_0/homing_turn_base[Difficulty_level])/FrameTime));