View Issue Details

IDProjectCategoryView StatusLast Update
0000445FSSCPgameplaypublic2005-06-22 20:04
ReporterSuperCoolAl Assigned Totaylor  
PrioritynormalSeverityminorReproducibilityrandom
Status resolvedResolutionfixed 
Summary0000445: Hidden objects are targetable when hit by EMP or friendly AI targets it
DescriptionIf, while playing, you are hit by an EMP missile it is possible to have a hidden object targeted after all the targetting is scrambled up. Apparently it is also possible if a friendly AI manages to target a hidden object.
Additional InformationApparently this has been occuring since retail.

http://dynamic.gamespy.com/~freespace/forums/showthread.php?s=&postid=681942#post681926
TagsNo tags attached.

Activities

SuperCoolAl

2005-06-04 15:08

reporter   ~0002590

Scroll down a bit on that link after you click it (the chopped off bit doesn't make a difference).

WMCoolmon

2005-06-07 04:45

developer   ~0002604

You do not have permission to access this page. This could be due to one of several reasons:

   1. You do not have permission to access the page that you were trying to. Are you trying to edit someone else's post or trying to access administrative features? Check that you are allowed to perform this action in the Forum Rules.
   2. If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

WMCoolmon

2005-06-07 05:04

developer   ~0002605

Also, I may have commited a fix to CVS for the emp problem, at least.

Goober5000

2005-06-07 06:53

administrator   ~0002608

The thread is in the Inferno private forum, but it doesn't say anything that isn't said here.

WMC, I looked over your ship_get_random_targetable_ship and it seemed rather inelegant. Might it be better to build a list of all targetable ships and *then* pick a random one? This would avoid "rolling the dice" possibly several times in a row.

You wouldn't have to make a linked list or anything fancy; just create an integer array of MAX_SHIPS size. Then copy all the indexes of the targetable ships into the array, and pick a random index from the ships available.

SuperCoolAl

2005-06-07 18:01

reporter   ~0002609

Yea sorry bout that WMC I just can't figure out how to edit the original bug report :)

taylor

2005-06-20 03:12

administrator   ~0002654

Ok, bit cleaner code in now. Even Goober deserves to be happy. :P

So the other problem is that if a friendly AI targets a hidden object then you can target it as well? That's what I get from reading what you wrote so please correct me if I'm wrong. If the friendly ship get's hit by EMP and that's why it's happening then I think this should fix both cases.

Goober5000

2005-06-20 06:35

administrator   ~0002656

Thanks, taylor. :)

As I understand it, the only thing "hidden-from-sensors" does is affect the player ship's sensors. AI ships do not suffer from this handicap (they aren't as smart as us, apparently). So Volition simply added hooks throughout the code wherever the player's target is changed.

The problem occurs when you add a new targeting key or method and forget to add the hook. This is one instance. I'm not sure which other instances there are; the "J" key is a problem in FS1 but I think it was fixed in FS2.

SuperCoolAl

2005-06-20 07:53

reporter   ~0002657

I meant you can target a hidden object when you target your target's attacker.

Example is targetting the Chimeras in Inferno R1 M15.

taylor

2005-06-20 08:45

administrator   ~0002658

Last edited: 2005-06-20 08:48

Ok, I know I've been awake a while but this code looks so backwards to me right now I must be imagining things. Assuming the "pre" tag works here (EDIT: nope, it doesn't)... Should this, in hud_target_closest():

// bail if player does not have target
if ( Player_ai->target_objnum == -1) {
    if ( Objects[attacked_objnum].type != OBJ_SHIP ) {
        goto Target_closest_done;
    }

    // bail if ship is to be ignored
    if (!(Ships[Objects[attacked_objnum].instance].flags & TARGET_SHIP_IGNORE_FLAGS)) {
        goto Target_closest_done;
    }
}

be this:

// bail if player does not have target
if ( Player_ai->target_objnum == -1) {
    goto Target_closest_done;
}

if ( Objects[attacked_objnum].type != OBJ_SHIP ) {
    goto Target_closest_done;
}

// bail if ship is to be ignored
if (Ships[Objects[attacked_objnum].instance].flags & TARGET_SHIP_IGNORE_FLAGS) {
    goto Target_closest_done;
}

The modified version appears to work, the original version never appeared to happen (in a right world). I'm not going to commit that until I've looked at it again with more sleep but a second opinion would help.

Also found another targetting issue when target-subsys-in-reticle gets pressed. It never even checked for hidden ships before giving you the target.

edited on: 06-20-05 04:48

taylor

2005-06-22 20:04

administrator   ~0002676

Umm, might as well mark this as fixed I guess. It looks to be working just as required and no side effects have been noticed. I'll reopen/fix if it turns out to cause issues in my newest build.

Fixered.

Issue History

Date Modified Username Field Change
2005-06-04 15:05 SuperCoolAl New Issue
2005-06-04 15:08 SuperCoolAl Note Added: 0002590
2005-06-07 04:45 WMCoolmon Note Added: 0002604
2005-06-07 05:04 WMCoolmon Note Added: 0002605
2005-06-07 06:53 Goober5000 Note Added: 0002608
2005-06-07 18:01 SuperCoolAl Note Added: 0002609
2005-06-20 03:12 taylor Note Added: 0002654
2005-06-20 03:12 taylor Status new => assigned
2005-06-20 03:12 taylor Assigned To => taylor
2005-06-20 06:35 Goober5000 Note Added: 0002656
2005-06-20 07:53 SuperCoolAl Note Added: 0002657
2005-06-20 08:45 taylor Note Added: 0002658
2005-06-20 08:48 taylor Note Edited: 0002658
2005-06-22 20:04 taylor Status assigned => resolved
2005-06-22 20:04 taylor Resolution open => fixed
2005-06-22 20:04 taylor Note Added: 0002676