From 2028abb6d5816be37819fefbd5c451a6b138a26a Mon Sep 17 00:00:00 2001 From: zicodxx <> Date: Wed, 11 Aug 2010 16:25:58 +0000 Subject: [PATCH] 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 --- CHANGELOG.txt | 4 ++++ main/laser.c | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 64c34c063..411ba78a5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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' diff --git a/main/laser.c b/main/laser.c index b41dc9934..3c504384d 100644 --- a/main/laser.c +++ b/main/laser.c @@ -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));