-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OTC and targeting mechanics are inter-independent? #21
Comments
Turrets targeting in H/V direction should depends from OTC. Turrets tracking speed depends from installed mechanics. I'll check OTC, probably, some kind of bug. |
Oh, wait. First case to reproduce doesn't work. Indeed, with missing OTC targeting doesn't work in both H/V. I assumed first true from second, without special check (strange, I thought I checked it). |
Hmm... I can't reproduce second case with "Weapon Targeting Mode" set to "Sim" (see Difficulty for Pilot Profile). All works fine for me. |
Don't turrets rotate to sides, when OTC is installed, but no mechanics? |
Turrets should not rotate on 1.4.1 without mechanics too. |
Did not inspect code yet (though it seems there is no other way), but I also tried manually built version, first from v1.4.1, then from master. With master I also tried first with -O2 -march=native, than with -O0. Btw, it is not even necessary to have enemies to test targeting - asteroids are enough. It is easiest to notice when firing, and if weapons are at big side distance (e.g. two rear positions) - though they are hidden under rear hull parts, projectiles show how they target. In case of asteroids - projectiles focus at some point above selected target. Previous method I tried - just visually watching weapons at front slots. Though it also allowes to notice instant rotation, there are usually too much targets in range, so weapons rarely turn to big angles (only in very begining of first mission). I created separate pilot for test. First time made it to full difficulty (150%), but last time tried to turn to minimum all besides controls and enemy armor (less than 100%). Though I'm not sure wether it can affect this bug. Edit: For each rebuild I create new build dir inside srcdir, runing |
Tried some code analysis - it seems no need to go far to see where is difference. For now in search for correction. Edit: I suspected, reason is that 'z' transformation must be handled as well, but it doesn't help (vertical speed breaks by breaking code for any of 'x' or 'y' coordinates). |
It seems, that horizontal orientation doesn't follow TargetingSpeed at all (probably all code about NeedAngle_y has no effect). Even with this: |
This code works only with OTC 3 and 4 (MOTC). Just make sure, you test it in proper way. |
o_O How? I learned slighter deeper - as far as I understand, x,y,z in sModel3D::Rotation should be angle in different planes, is not it? (btw, first time I misinterpreted sVECTOR3D Rotation as rotation matrix). Does it means, that code, implementing turret rotation physics (rotation speed) depends on used OTC? I though, OTC goal is to assign targets, via GetWeaponOnTargetOrientation() call as in switch block above. Is not it? I don't know now, where to search. Thought about sharedWeapon->SetRotation() call, but only found cWeapon->SetRotation(), which clearly should be common, including for ground turrets, which never experienced instant rotation. |
OTC routine provide end rotation angle to target So, in case if you have OTC 1 or 2, after OTC routine https://github.com/viewizard/astromenace/blob/master/src/object3d/space_ship/space_ship.cpp#L1355 you don't have horizontal angle changes, since OTC 1 and 2 don't provide horizontal precision. this code smell, but I don't have time now to refactor it.
No.
As you can see, rotation speed depends from |
This is right that code, which I described as meaningless (telling about meaningless of NeedAngle_y and NeedAngle.y change). Meaning, that even if I replace I'm probably going to do some debugging (just rebuild with flags -O0 -g3 -ggdb3). |
Ah... I finally understand what you mean. Looks like only |
I was able to reproduce this one time, but can't reproduce this again (for now). Looks like some time https://github.com/viewizard/astromenace/blob/master/src/object3d/space_ship/space_ship.cpp#L1397 don't work proper and some time don't care about real |
Found the fix, before even trying to debug. Hint: swap signs between comparisons: Edit: Strange, that rotation still didn't work. Weapons would just rotate out of enemies. Btw, best test moment is when first long alien sequence moves in some horizontal wave, so weapons constantly rotate. |
Yeah, I also found this :)) |
Looks like place for optimizing. Bit ops could be used to treat ally and player as some common class (more exactly - two fields, faction number and player/or_not field). Edit: Or even have same OTC check for ally, with them using only basic OTC - I have seen them sometimes hitting asteroids. |
First change, that are found (from start):
Looks like it can't show more exact info due to some massive changes near to end - too hard to look all of them. Does it mean, that it depends on OpenGL implementation? Of so, should not GL allow to check this (coordinate system) type? |
This should not depend from OpenGL implementation for sure. That was one of "fix all around" commit I did, that should be not allowed in any project for sure. |
Expected Behavior
I expected, that mechanics affects targeting in both H/V direction. And OTC handles only target selection for turrets (probably missile locking as well). According to what I just discovered, turret rotation speed is reflected at visible turret rotation too, and thus visible horizontal rotation should not be instant (this is first thing, that I discovered after looking how different vertical weapon rotation is).
Both OTC and turret mechanics must present to be useful. Complete removal of one should make another useless.
Actual Behavior
It seems, despite naming, OTC controls horizontal aiming only, while turret mechanics - vertical. I got successfuly working horizontal aiming with removed mechanics. Of course, no vertical correction was done, and thus I discovered, that most (at least first) targets at first level are placed slightly lower (so that all shots go above without correction), though not enough to let player ship just pass above. I remember, that something changed in auto-aiming since 1.4.0 (difficulty?), but could not find what, before these observations.
Steps to Reproduce the Problem
The text was updated successfully, but these errors were encountered: