Author Topic: $Free Flight Time: question  (Read 8823 times)

0 Members and 1 Guest are viewing this topic.

Re: $Free Flight Time: question
I checked that. Didn't really seem related to this.

The problem is basically that the code calculates the firing vector (the function doing that can decide how to do that, here the flag comes in effect)
That's all nice and fine.

later an additional vector from the turret to the predicted target position is calculated. That one is basically just used to determine target-in-field-of-view checks and the distance to the target,

But someone somehow missinterpreted this and used the helper vector to initialize the weapon instead of the really-calculated one, so the weapon is always fired exactly towards the predicted target position instead of towards the calculated one.

So the only real issue is, that the wrong vector is used. That's a one line fix. Where that originated I cannot tell, it was back in CVS days. It was already there when you guys moved to SVN.

I wrote a detailed description of the problem and the callings in Mantis. Check it out for details.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: $Free Flight Time: question
AFAIK weapon being fired from the turrets at the predicted position instead of the direction where the actual firing vector is a retail thing. That is :v: didn't seem to be able to get turrets work like they wanted to without it.

What you can try - presuming this is not massively used weapon - is to use swarm: 1 type weapon
Do not meddle in the affairs of coders for they are soggy and hard to light

 
Re: $Free Flight Time: question
Well.. we already fixed it and a patch was already committed.. check mantis for details.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: $Free Flight Time: question
Yes.. i checked the patch.. and from what i saw it does change the retail-like behavior. That is it needs to be bound via ai_profiles options or otherwise it will change balance in existing campaigns played after the patch.
Do not meddle in the affairs of coders for they are soggy and hard to light

 
Re: $Free Flight Time: question
Another "fix this bug" flag? Do you know how many "oh my.. we need to keep this bug or we'll break everything" flags we have already?

If you guys really want to maintain this policy.. fine... add another flag. But if I were in your shoes I'd really start re-evaluating this. Keeping retail behavior is one thing. Keeping retail bugs (like the afterburner usage of AI or the inability to link weapons correctly due to a bug in energy percentage calculation etc tec) is quite another. This is stuff the developers might have fixed back then with an official patch if they had noticed it and they wouldn#t have cared one bit about breaking the before buggy behavior.

So I'd really suggest a distinction between retail wanted behavior and retail bugs.

if you decide against it. go ahead and add the flag and we'll use it. But I'm not very fond of these solutions anymore.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: $Free Flight Time: question
None of us are fond of these solutions but the simple fact is that a little tweak here, a little tweak there, all of them having only a minor effect on the game and all of a sudden we'll find that FS2 is unplayable on FSO. Which defeats the point of backwards compatibility.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline FUBAR-BDHR

  • Self-Propelled Trouble Magnet
  • 212
  • Master Drunk
    • 165th Beer Drinking Hell Raisers
Re: $Free Flight Time: question
Also you have to remember it's not just retail compatibility anymore how many other things depend on that working the way it does now.  I'm sure if 2 years down the road a problem was found and fixed that rendered Saga unplayable you wouldn't be too happy about it. 
No-one ever listens to Zathras. Quite mad, they say. It is good that Zathras does not mind. He's even grown to like it. Oh yes. -Zathras

 

Offline Tolwyn

  • The Admiral
  • Administrator
  • 214
  • Ridiculously Old Fraud
    • Wing Commander Saga
Re: $Free Flight Time: question
Also you have to remember it's not just retail compatibility anymore how many other things depend on that working the way it does now.  I'm sure if 2 years down the road a problem was found and fixed that rendered Saga unplayable you wouldn't be too happy about it. 

I'd burn you in hell. :nod:
Wing Commander Saga: A Legend Is Reborn | WingCenter
 
Tolwyn’s reputation for risk taking with other people’s lives was considered  to understate the facts. The admiral’s willingness to sacrifice anyone or anything to achieve his objectives had long been lauded in the popular press. He was “the man who got things done”.- Colonel Blair

No errors, no random CTDs, just pure fun and proof of why getting hit with missiles is a bad thing.
-WC Saga's beta tester


Report Wing Commander Saga bugs with Mantis

 
Re: $Free Flight Time: question
Also you have to remember it's not just retail compatibility anymore how many other things depend on that working the way it does now.  I'm sure if 2 years down the road a problem was found and fixed that rendered Saga unplayable you wouldn't be too happy about it. 

Not that that has happened time and again with us having to adjust.

But thats not what I'm saying. I'm not talking about not keeping retail compatibility. I'm just saying that bugs shouldn't ge considered retail compatibility.
The original game certainly was never meant to be played with an AI that was unable to link primaries properly because there was a bug in the code and stuff like that.
This qualifies as a bug for me and so does this firing vector thing. There's even a comment in the code stating exactly:

// Fire in the direction the turret is facing, not right at the target regardless of turret dir.
right above the line where that "vector to target" is calculated to emphasize that it is NOT meant for usage as a firing direction. So the intention of the original developers is pretty
clear to me.

If it was at least one flag "fix-retail-bugs" or something...but a flag for each bugfix... that's pushing it in my opinion.

And don't get me wrong... this doesn't concern me from Saga's point of view. We pretty much don't care how it is implemented as long as it works. But I'm really concerned that such decisions
will at some point render FSO in a state where further development is given up because nobody can make heads or tails of the codebase because all of this unnecessary stuff.

Just my 2 cents. At the end of the day it is still your decision, just offering an opinion.

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: $Free Flight Time: question
Granted that i have been far too busy lately and unable to test this but... If it is handled via the method proposed... then how are normal single part turrets supposed to hit anything as they essentially never point to the target?
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline CaptJosh

  • 210
Re: $Free Flight Time: question
I believe this is specifically supposed to be about missiles and only affect multipart turret code, but there's no guarantee it won't affect other things to. And that's the big debate.
CaptJosh

There are only 10 kinds of people in the world;
those who understand binary and those who don't.

 
Re: $Free Flight Time: question
Granted that i have been far too busy lately and unable to test this but... If it is handled via the method proposed... then how are normal single part turrets supposed to hit anything as they essentially never point to the target?

I'm pretty sure that this affects only multipart turrets, I remember reading something in the code. Also don't mistake this for now always firing along the normal. That is still only activated by the appropriate flag for the turret in ships.tbl.

The problem here was, that the game calculates a firing vector for the turret. And two possible vectors can result. Either the standard one, or the one along the normal if the flag is set.
I'm not exactly sure how the standard one works, I didn't look much at the code, but I think it goes from the firing point to the predicted enemy position.
So this wasn't the issue really.

The issue was that this vector, no matter which one of the two calculations was used, is never used later in the code. Instead a helper vector is used, which always points from the turret base position to target.

So if you want to keep that behavior you can just as well remove the entire calculation code before that because the results are never used anywhere anyway (except the turret location vector, the turret firing vector is totally ignored).

We can do some more testing on this, sure, but I'm very sure that this doesn't have a lot of negative implications. After all from the comments in the code this was the original intention of the developer anyway.
The code has been committed already, so you can just build it and test it with several differnt turrets. From what I could see multipart laser turrets work fine in Saga, so do single-part missile turrets. The rest must be determined I guess.

One thing is for sure.. a non-movable laser turret with "fire along normals" set will never hit a target. But I think that's only logical and fully correct. The flag simply makes no sense for turrets that cannot move. Without the flag they should work just fine. But as I said, we can test it to make sure.
Someone else has to do that though, since I don't have any model in Saga that has a non-movable laser turret, unless I can improvise something by switching a turrets weapon or something.

 
Re: $Free Flight Time: question
Well, just tested this:
single part turrets with fire along the normal can't hit anything.
multi part turrets still hurt.

flag must be set for the turret in question.
STRONGTEA. Why can't the x86 be sane?

 
Re: $Free Flight Time: question
Yeah, that's obvious. fire-along-normal mustn't be set for such single-part turrets. Without the flag they should hit everything just fine.

Edit: Just tested this myself by hacking one of our single-part missile launchers to fire lasers and locking the multiparts in position by giving them 0.0 turning rate.

They all work fine. They fire right on target as long as "fire along normal" flag is not set. And that flag makes no sense for a single-part turret without homing weapons anyway.
It DOES make a lot of sense for a single parter WITH homing weapon though, and that finally works now.

I see no turret behavior broken so far.
« Last Edit: July 04, 2009, 10:22:13 am by KeldorKatarn »

 
Re: $Free Flight Time: question
I've been playing through the main campaign for FS2, can report Shivans and NTF as deadly as usual (with the path from Mantis 1948)
STRONGTEA. Why can't the x86 be sane?

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: $Free Flight Time: question
Yeah.. it seems like the change works as advertised (luckily i was wrong)

However there seems to be some accuracy issues related to the code change combined with the 'fire down normals' flag... For example triton multipart turret was unable to hit stationary uly from 250 m even after giving it 3 minutes time to try. Without either (or both) of the code change and the flag in use the turret was able to hit the same target almost immediately.
« Last Edit: July 04, 2009, 10:30:22 am by Wanderer »
Do not meddle in the affairs of coders for they are soggy and hard to light

 
Re: $Free Flight Time: question
I just checked the code again to verify nothing changes for NON_fire-along-normal turrets:


This was the vector that was originally used (and should only have been used for field of view checks etc)

vm_vec_sub(&v2e, &predicted_enemy_pos, &gpos);
dist_to_enemy = vm_vec_normalize(&v2e);

So this gets a normalized vector from the turret position to the predicted enemy position.

Well... this is what is used now:

ship_get_global_turret_gun_info(&Objects[parent_objnum], ss, &gpos, &gvec, use_angles, &predicted_enemy_pos);
(ignore all parameters except gvec, the rest is just used to find out where the global position of the turret is.

This happens in that function:

if (use_angles)
    model_find_world_dir(gvec, &tp->turret_norm, tp->model_num, tp->turret_gun_sobj, &objp->orient, &objp->pos );
else {
    //vector   gun_pos2;
    //vm_vec_add(&gun_pos2, gpos, gun_pos);
    vm_vec_normalized_dir(gvec, targetp, gpos);
}

As you can see... if use_angles is NOT set (this is what fire-along-normal sets to true)
then we use EXACTLY the same vector as before. a normalized vector from the turret to the predicted enemy position (that one was passed to the targetp parameter).

So from a code review point of view the behavior cannot have changed for turrets that don't use the fire-along-normals flag.

 
Re: $Free Flight Time: question
We're testing multiparts with the flag set - I'm getting a hit rate of approx 60%, and wanderer is getting 0%, just trying to reproduce
STRONGTEA. Why can't the x86 be sane?

 
Re: $Free Flight Time: question
However there seems to be some accuracy issues related to the code change combined with the 'fire down normals' flag... For example triton multipart turret was unable to hit stationary uly from 250 m even after giving it 3 minutes time to try. Without either (or both) of the code change and the flag in use the turret was able to hit the same target almost immediately.

Well.. since the turret ALWAYS fires exactly along its firing normal if the flag is set, it relies on the turret being EXACTLY pointing towards the target.
And since the later weapon creation code also adds a certain inaccuracy with the $FOF: value, this can indeed get difficult.

I'd say fire along normals really only makes sense for missile launching turrets.  I mean other turrets can't have relied  on the flag until now since it had no effect anyway.

if one doesn't want a multipart turret to start shooting before it is roughly aligned with its target, well that's what the fire-on-target flag is for, which only checks what the turret is roughly
pointing to before firing, but it doesn't change the firing vector.

So I'd say we're fine here..
« Last Edit: July 04, 2009, 10:50:26 am by KeldorKatarn »

 
Re: $Free Flight Time: question
We're testing multiparts with the flag set - I'm getting a hit rate of approx 60%, and wanderer is getting 0%, just trying to reproduce

I know. I just wanted to make sure and emphasise again that we didn't break any old behavior with this change.