View Issue Details

IDProjectCategoryView StatusLast Update
0000260FSSCPgameplaypublic2005-08-31 05:10
ReporterLightspeed Assigned Tophreak  
PrioritynormalSeveritytweakReproducibilityalways
Status resolvedResolutionfixed 
Summary0000260: View cone messed up on spawn missiles
DescriptionSpawn missiles (like the piranha) seem to have messed up view cones on the spawned missile babies. If you fired a piranha on retail, ALL missiles turned towards the target (pretty much full view cone) and chased it. Now, if you do the same thing with FS2open, just two or three of the missiles will "see" the target, turn and chase it (the ones pointing in more or less its direction). It looks like the view cone of the spawned missiles is somehow handled in another way (i.e. it's a lot smaller). If this is indeed a bug, I guess it sneaked in with the firing cone feature for cluster weapons. Someone verify this please, and check if the bug can be fixed.
TagsNo tags attached.

Activities

taylor

2004-11-20 12:06

administrator   ~0001363

It's smaller, by half in fact, but I'm not sure what the reasoning is there since it does change the original behaviour. It's easy enough to change it so that it's back to a full view but I'd rather ask phreak about it first in case there is another reason it's set where it is.

kasperl

2004-11-21 12:02

developer   ~0001367

Phreak made a spawn cone table option, so he would indeed be the person to ask.

phreak

2004-11-21 18:22

developer   ~0001368

they aren't tracking but the spawn angle code isn't an issue, it deafults to a full sphere which what happened in retail.

Lightspeed

2005-01-15 19:30

reporter   ~0001555

T: If you haven't already, revert this to the retail-esque behaviour. It messes up multiplayer mission and singleplayer missions alike, and makes certain weapons pretty much useless.

phreak

2005-01-17 04:30

developer   ~0001558

i looked at this and rand_vec_in_cone() takes an angle and doubles its FOF (it goes from -angle,angle). So it would make sense just to use 180 to get a sphere. However if i use 360 for some reason, the spawned missiles track better (from what i've seen). The relevant code for the default spawn angle is on line 1770 in weapons.cpp in parse_weapon()

kasperl

2005-03-12 20:08

developer   ~0001759

Is this back to it's default behaviour?

phreak

2005-03-12 20:56

developer   ~0001784

oops forgot aboot this.

fixed... hopefully

kasperl

2005-03-12 20:58

developer   ~0001786

Lightspeed, can you test this?

phreak

2005-04-04 17:00

developer   ~0002089

awaiting Lightspeed's feedback, close in a month and reopen and assign back to me if necessary

Goober5000

2005-05-25 02:02

administrator   ~0002484

Reminder sent to Lightspeed

Feedback required.

Lightspeed

2005-05-26 02:14

reporter   ~0002520

Would anyone be so kind to link me to a "fixed" build?

I'd probably be able to run a quick test.

Goober5000

2005-05-26 03:10

administrator   ~0002521

I'm guessing any recent build would have this fixed. Here's one that Phreak posted on 5/22.
http://fs2source.warpcore.org/exes/phreak/fs2_open_phr_05222005.rar

Lightspeed

2005-05-26 22:32

reporter   ~0002524

From what I've seen, it doesn't look as if it were fixed.

Goober5000

2005-08-18 20:07

administrator   ~0003021

Assigning it to myself since it's probably fixable with MISSION_FLAG_USE_NEW_AI.

phreak

2005-08-30 14:45

developer   ~0003202

no it isn't. here are the relavant code changes

http://fs2source.warpcore.org/cgi-bin/cvsweb/cvsweb.cgi/fs2_open/code/weapon/weapons.cpp.diff?r1=2.63&r2=2.64&f=h

Goober5000

2005-08-30 15:15

administrator   ~0003206

Oh excellent... thanks for pointing that out, Phreak. :)

I don't think that's quite the same thing as retail, though. A 180 degree cone is still oriented along the object's forward axis, whereas retail seemed to shoot them off in all directions.

I'll commit this in a sec.

phreak

2005-08-30 15:19

developer   ~0003207

the angle argument in vm_vec_random_cone() uses the range from (-angle,angle), so i think 180 would suffice. I want to try putting some debug lines and alt-pause to see if all of the missiles are properly oriented.

Goober5000

2005-08-30 15:21

administrator   ~0003208

All the same, I'd prefer to use the original code. Here's what it looks like now:

        // phreak's code
        if (The_mission.flags & MISSION_FLAG_USE_NEW_AI)
        {
            // for multiplayer, use the static randvec functions based on the network signatures to provide
            // the randomness so that it is the same on all machines.
            if ( Game_mode & GM_MULTIPLAYER ) {
                static_rand_cone(objp->net_signature + i, &tvec,&objp->orient.vec.fvec,wip->spawn_angle,&objp->orient);
            } else {
                vm_vec_random_cone(&tvec,&objp->orient.vec.fvec,wip->spawn_angle,&objp->orient);
            }
        }
        // original code
        else
        {
            // for multiplayer, use the static randvec functions based on the network signatures to provide
            // the randomness so that it is the same on all machines.
            if ( Game_mode & GM_MULTIPLAYER ) {
                static_randvec(objp->net_signature + i, &tvec);
            } else {
                vm_vec_rand_vec_quick(&tvec);
            }
        }
        vm_vec_scale_add(&pos, &objp->pos, &tvec, objp->radius);

phreak

2005-08-30 22:04

developer   ~0003212

use new AI shouldn't be in there since it pertains to ship AI, not how the missiles are spawned. Plus i don't want to set a flag in every mission in the main FS2 campaign so i could use modded infyrno missiles. Besides making USE_NEW_AI mandatory would also allow the AI to actually use trebs and really screw with the balance of the mission. I sorta want to branch out the USE_NEW_AI flag anyway since people may want to use the AI's better selection of primaries, but not need to worry about trebs flying in every direction.

Goober5000

2005-08-30 23:17

administrator   ~0003213

Last edited: 2005-08-30 23:19

Well part of the purpose of putting USE_NEW_AI in all these places is to flag them so we can come back later with a more flexible customization system.

However since spawn_angle is an optional flag anyway, howabout this instead:

wip->spawn_angle = -1;
if (optional_string("$Spawn Angle:"))
    stuff_float(&wip->spawn_angle);
.
.
.
// phreak's code
if (wip->spawn_angle > 0)

edited on: 08-30-05 19:19

phreak

2005-08-30 23:25

developer   ~0003214

well im curious as to why having 180 as a default doesnt seem to work. It may mean that another bug may exist.

Goober5000

2005-08-30 23:56

administrator   ~0003216

It's because vm_vec_random_cone spins the cone around orient.vec.fvec, whereas vm_vec_rand_vec_quick points the cone in all directions. It's not the same random number generator.

Goober5000

2005-08-31 00:02

administrator   ~0003217

Committed. I'm resolving this. :)

phreak

2005-08-31 04:23

developer   ~0003226

No its not fixed, its just hiding the bug. If someone has the spawn angle set to 180 then its going to display a different behavior then having it not set, even if they're supposed to be the same. Something is going on and its probably effecting behavior when the spawn angle is less than 180 as well

phreak

2005-08-31 04:53

developer   ~0003227

Last edited: 2005-08-31 04:55

ok fixed the right way.

the matrix argument in vm_vec_random_cone() was objp->orient and should have been the matrix, m, formed by vm_vector_2_matrix(&m, &objp->orient.vec.fvec, NULL, NULL);

and guess what? the tracking was also effective if the spawn angle was smaller than 180

edited on: 08-31-05 00:55

Goober5000

2005-08-31 05:04

administrator   ~0003228

Oh. Hm.

Interesting. Well does that mean if you remove the &objp->orient argument it works properly?

I'm still skeptical whether vm_vec_random_cone(&tvec, &objp->orient.vec.fvec, 180) would provide the same result as vm_vec_rand_vec_quick(&tvec).

phreak

2005-08-31 05:10

developer   ~0003229

yea it does now. however i don't want to muck around with special cases

Issue History

Date Modified Username Field Change
2004-09-12 14:10 Lightspeed New Issue
2004-11-20 12:06 taylor Note Added: 0001363
2004-11-21 12:02 kasperl Note Added: 0001367
2004-11-21 18:22 phreak Note Added: 0001368
2005-01-15 19:30 Lightspeed Note Added: 0001555
2005-01-17 04:30 phreak Note Added: 0001558
2005-03-12 20:08 kasperl Note Added: 0001759
2005-03-12 20:56 phreak Note Added: 0001784
2005-03-12 20:58 kasperl Note Added: 0001786
2005-03-12 21:02 phreak Status new => assigned
2005-03-12 21:02 phreak Assigned To => phreak
2005-04-04 17:00 phreak Note Added: 0002089
2005-04-04 17:00 phreak Assigned To phreak => kasperl
2005-04-04 17:00 phreak Status assigned => feedback
2005-05-25 02:02 Goober5000 Note Added: 0002484
2005-05-26 02:14 Lightspeed Note Added: 0002520
2005-05-26 03:10 Goober5000 Note Added: 0002521
2005-05-26 22:32 Lightspeed Note Added: 0002524
2005-08-18 20:04 Goober5000 Status feedback => assigned
2005-08-18 20:04 Goober5000 Assigned To kasperl => Goober5000
2005-08-18 20:07 Goober5000 Note Added: 0003021
2005-08-30 14:45 phreak Note Added: 0003202
2005-08-30 15:15 Goober5000 Note Added: 0003206
2005-08-30 15:19 phreak Note Added: 0003207
2005-08-30 15:21 Goober5000 Note Added: 0003208
2005-08-30 22:04 phreak Note Added: 0003212
2005-08-30 23:17 Goober5000 Note Added: 0003213
2005-08-30 23:18 Goober5000 Note Edited: 0003213
2005-08-30 23:19 Goober5000 Note Edited: 0003213
2005-08-30 23:25 phreak Note Added: 0003214
2005-08-30 23:56 Goober5000 Note Added: 0003216
2005-08-31 00:02 Goober5000 Status assigned => resolved
2005-08-31 00:02 Goober5000 Resolution open => fixed
2005-08-31 00:02 Goober5000 Note Added: 0003217
2005-08-31 04:23 phreak Status resolved => feedback
2005-08-31 04:23 phreak Resolution fixed => reopened
2005-08-31 04:23 phreak Note Added: 0003226
2005-08-31 04:23 phreak Status feedback => assigned
2005-08-31 04:23 phreak Assigned To Goober5000 => phreak
2005-08-31 04:53 phreak Note Added: 0003227
2005-08-31 04:55 phreak Note Edited: 0003227
2005-08-31 05:04 Goober5000 Note Added: 0003228
2005-08-31 05:09 phreak Status assigned => resolved
2005-08-31 05:09 phreak Resolution reopened => fixed
2005-08-31 05:10 phreak Status resolved => feedback
2005-08-31 05:10 phreak Resolution fixed => reopened
2005-08-31 05:10 phreak Note Added: 0003229
2005-08-31 05:10 phreak Status feedback => resolved
2005-08-31 05:10 phreak Resolution reopened => fixed