Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: ARSPR on April 08, 2006, 05:07:44 am

Title: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on April 08, 2006, 05:07:44 am
While using Function Keys Multitarget feature, you get a light grey box arround these targets but you get no info of them. I think DISTANCE info in HUD would be great, (more info could be too much one). Now you only get it for out of view targets. This can make more realistic spying missions where you can't get close to enemy fighters/crafts. (I can't imagine a "real" spacecombat computer not telling you which is the closer one).

I think this feature could be triggered by a flag in a similar way as "-targetinfo".
Title: Re: Suggestion for a new feature (HUD distance inf
Post by: Galemp on April 08, 2006, 02:54:53 pm
-targetinfo won't work for multitargets? Huh. That should be fixed.

It would also be neat if multitargets had an itty-bitty lead indicator, like just a little dot like Freelancer, just in case. Asteroids are a good example of when you would need it.
But that's a different request.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on April 11, 2006, 03:14:59 am
I like this idea, so I took a crack at it.  Very easily done, fortunately.  In HUDtarget.cpp, do a search for "if ( OBJ_INDEX(targetp)" [no quotes].  Inside that section, replace the draw_bounding_brackets line with these two lines:
Code: [Select]
float dist = hud_find_target_distance(targetp, Player_obj);
draw_bounding_brackets(x1-5,y1-5,x2+5,y2+5,5,5,dist,OBJ_INDEX(targetp));

Though ASPR is right, more than just distance can be too much info... and since multitarget groups are usually set up by wing, it isn't as essential.  So if that is the general consensus, get rid of the OBJ_INDEX(targetp) argument from above and we're set.

Perhaps there could be more done to this to tidy it up... the ship info is a little too close to the white brackets, and dist is calculated twice in the function.  Plus the white brackets show up on the ship that is actually selected, is this desired?

I like the lead indicator idea too, so I'll bang on that when I have time.  :hammer:
Title: Re: Suggestion for a new feature (HUD distance inf
Post by: karajorma on April 11, 2006, 08:08:08 am
We should be signing you up so you can commit your own changes :)
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: DaBrain on April 11, 2006, 04:44:49 pm
Just before I read your posting I thought " Where is this guy's SCP avatar?!?". ;)



@Backslash I send you the final version of the request you've requested soon... Hopefully this week.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on April 11, 2006, 05:21:20 pm
Heh heh.  Thanks!  I'm flattered, but don't assume too much about my programming skills  ;)  I took a bunch of classes in university, so know enough to experiment with things, but I still don't know the very advanced stuff.  (I couldn't get the thing to compile without a friend's help. :ick:)  So far you'll notice most of my changes involve already-existing code.  Like this one, I just looked at how the asteroids show the distance, then applied it to the multitargets.

That said, there's still a lot that can be done with that sort of slicing, eh?  I'd love to help in any way I can.  Where do I sign up?  :D


BTW, where can I find out more about this multitarget?  I only recently discovered it.  Can't find anything about it in the wiki.  For FREDing, is there a general standard of what to assign hotkeys to, besides of course Alpha wing?
Title: Re: Suggestion for a new feature (HUD distance inf
Post by: karajorma on April 11, 2006, 06:03:32 pm
Yep. You can assign default hotkeys in FRED and you can set them up yourself by pressing (IIRC) the F3 key in mission.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: WMCoolmon on April 11, 2006, 09:18:08 pm
Keep in mind that the same style of distance tracking is used for player-detonated missiles, and those have the same color as multitargetted ships. (So they would look identical)
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on April 20, 2006, 06:11:25 am
Yeah the player-detonated missiles and these look similar, but eh, it's not like you don't know you have a player-detonated missile out there.

Would you believe I had never realized what the F3 menu was for??  BOY missions are going to be different now.  :yes:

Here's a test build with Galemp's reticle idea... (not so tiny though)
http://www.qeyleb.net/files/fs2_open_r.exe
What I did was make a function similar to hud_show_lead_indicator, but passed an object targetp.  Then removed the secondary weapon checks and the hud_set_iff_color bits.  Then that function is called from the same place as mentioned above.  More details and source upon request.

I rather like this result.  Makes it much easier to, for example, spray a whole wing of bombers (or pesky heavy fighters) that I'm trying to dissuade from attacking a target.  Gave me a few ideas too, on how to expand the multitarget idea... to see what I could do, I added a new command, Select Target's Wing, which I've bound to the W key on my setup.  Try it out!

Well so far this is easier than I thought.  Yeah, let me know who to contact or what to do to sign up :-)
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: neoterran on April 20, 2006, 09:20:59 am
dude backslash needs a SCP badge, don't cha think?
Title: Re: Suggestion for a new feature (HUD distance inf
Post by: Goober5000 on April 20, 2006, 10:28:57 am
What say you, Backslash? :)
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on April 20, 2006, 11:47:14 am
Backslash DO JOIN SCP NOW !!!. And please submit your code changes to WinCVS or SCP crew. (WinCVS hasn't got multitarget HUD distance info included yet).

Just one tweak about HUD distance info in multitarget. The multitargeted AND targeted ship has now two distances one over the other making a mess. Could you code to show just one? As the multitarget box is bigger, I would leave the multitarget one (white one) but making it take the target colour (green, red or whatever). Also check that this target distance is drawn over the rest of multitargets distances as it currently does.

Great job  :yes:

And now a noob question. What do the points you get on the upper right corner of the target box mean? I've notice you get from one to four.
Title: Re: Suggestion for a new feature (HUD distance inf
Post by: Shade on April 20, 2006, 12:55:26 pm
Those points are the number of other friendlies attacking the target.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on April 21, 2006, 01:33:23 am
Thank you, Shade.

And to Backslash: I think an easier way to fix the two distance overlayed info in the Targeted and Multitargeted ship could be just coding not drawing multitarget box and distance (the white one) for this ship.

The only problem with your exe is that as multitargets now have aiming point, you've made me change my joystick bindings to have a direct button to "Targeting target's wing" and I'm still not used to it ...  ;)
Title: Re: Suggestion for a new feature (HUD distance inf
Post by: Backslash on April 21, 2006, 04:50:13 pm
What say you, Backslash? :)
We fight!
...uh I mean, yes please!  So, where do I start?  I'll do my best to not screw everything up  :p

Good points ARSPR.  Can't believe I missed that, I did think of it.  Should be a simple fix.  I have a few other tweaks to do too.  Including a fix for one thing I may have broken but I'm not sure if anyone ever used -- as far as I understand, hotkey group 8 was a virtual group that prevented the ship from showing up on the hotkey list menu during the briefing (I guess so you don't spoil the surprise, "omg a sathanas" or whatever).  Anyone know about this?

the 'problem' you mention, is hard to fix  :D  Really, I think this feature will really change the feel of defense missions, change in a good way I mean.  About that, I have a question on what would be preferred: When you push Shift-F5 (through Shift-F12), it assigns the selected ship to that hotkey, a la X-wing.  (Only recently did I discover this.  It is awesome.)  My question: When a wing is selected with my new way, should the whole wing be then assigned to that F5 hotkey if Shift-F5 is pushed?  Or just the one ship actually selected?
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on April 22, 2006, 01:56:02 am
I rather like this result.  Makes it much easier to, for example, spray a whole wing of bombers (or pesky heavy fighters) that I'm trying to dissuade from attacking a target.  Gave me a few ideas too, on how to expand the multitarget idea... to see what I could do, I added a new command, Select Target's Wing, which I've bound to the W key on my setup.  Try it out!

As you have asked for them, here you have more suggestions about possible Multitargeting improvements:

1. Showing multitarget distance and aiming point should be optional. As you are modifying the behaviour of "retail" FS2, purist players could prefer not to enable these features that are giving you some advantage. I think the best way is to enable them through a launcher flag. "Target target's wing" can be left always enabled as you can always avoid using it if you want. Nevertheless I would rename "Target Target's Wing" to "Multitarget Target's wing" to make a clear difference.



2. Turning some cycling targeting actions in multitargeting ones. The next targeting actions:
+ Next escort ship.
+ Next / Previous Uninspected Cargo
+ Next / Previous Hostile Bomb or Bomber
would be great if they are converted in multitarget ones. You'll get ALL ships/bombs of their kind in a similar way Function Keys work with their assigned group. Like the previous feature it would be enabled through Launcher Flag as some people may want to avoid them. Or if you don't want to code a launcher flag, code these actions as new targeting ones (so you could bind E to "Target Next escort ship" or to "Multitarget Next Escort ship", or even use another key binding for the last one).

Also, it would be great that the multitargeted group kept updating in real time. I mean if NEW escort ships appear (or whatever), they would be automaticaly added to the multitargeted ones. This autoupdate would be specially useful for tracking enemy bombs (these are the items that re-appear more frequently). This autoupdate would continue working till you target any other kind of ship outside of the group. I mean that if you change your target with any action, ("Ship in reticle" or "Next Target" or whatever), but it is still a ship within the multitargeted group, the autoupdate should continue working.

Also if some ship keeps in play BUT doesn't attach to the selected group anymore, (example: the cargo you have just scanned), it should disapear from the multitargeted group and then your target should move to next target.



3. Turning "Target Nearest xxx" behaviour into "Target Next xxx" and making it multitarget. The next targeting actions:
+ Closest Attacking Ship
+ Target's Nearest Attacker
can be converted in multitargeting ones as 2.. In this way the first time you press their action key, you will get the nearest xxx. But after then, you will get the next ship of group. Also like 2. you should code a launcher flag to enable this feature or you could code new actions if it is easier. And like the former one, the autoupdate would be great.

Maybe, the behaviour of autoupdate will need to be slightly different with ships that keep playing but not in the group. I mean, if you start attacking one of the attackers of a friendly ship, and then this ship just change its objetive to yourself, it has no point to delete it as a target or multitarget. So autoupdate should add ships BUT not remove them, just when you press the action key again the full group should be recreated.




Well, these are YOUR TASKS for the May exam, and you have 1h 30min to finish them. But as they are really easy, it will only take you about 30min. If you can code the three ones you'll get an "A" (10 in Spain). ;)

(In fact, I would do it myself, but I just don't waste my time with such little, easy and stupid changes).  :eek: :eek2: :nervous:



My question: When a wing is selected with my new way, should the whole wing be then assigned to that F5 hotkey if Shift-F5 is pushed?  Or just the one ship actually selected?

My opinion is them all, BUT again if you are changing Retail FS2 behaviour, use a Launcher Flag to enable it. (I mean, if you have a multitargeted group and then you assign them to another Fxx key, what does NOW happen? Do you add the full group or just your targeted ship?).

Nevertheless personally I don't normally use Shift+Fxx. I prefer to plan my groups through F3 window.


Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on April 24, 2006, 09:14:01 pm
I have fixed the small issue with the two distance indicators.  File updated.

I will work on making things optional with a -multitarget flag to turn them on.

Great ideas!  I like all of them!  I'll do what I can.  Some are quite complicated, but I am interested in them myself too.  Autoupdate may be a little difficult unless I can call such a function every time something arrives.
My question: When a wing is selected with my new way, should the whole wing be then assigned to that F5 hotkey if Shift-F5 is pushed?  Or just the one ship actually selected?
My opinion is them all, BUT again if you are changing Retail FS2 behaviour, use a Launcher Flag to enable it. (I mean, if you have a multitargeted group and then you assign them to another Fxx key, what does NOW happen? Do you add the full group or just your targeted ship?).
Currently, it just adds / removes the targeted ship.  (And if you do it to a ship that is already in that group, it will remove it.)  I'll probably make it add / remove the whole wing if -multitarget is on.  Though, hypothetical case:  Aries 2 is in group F8.  I multiselect Aries wing and push Shift-F8.  Should all of Aries wing be put into F8, or all of Aries wing but Aries 2 removed?

Hmm, I wonder if I could make the Shift-F(keys) update the lists in the F3 window...
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on April 25, 2006, 01:34:19 am
Hmm, I wonder if I could make the Shift-F(keys) update the lists in the F3 window...

I haven't tried it but doesn't it happen now?  :confused: I thought F3 window was just another interface to Fxx groups, I mean if you add something to F7, (it doesn't matter how), it would show in F3 window.

I will try your new build ASAP but maybe I'm not going to be able to do it till Thursday.  :sigh:

PLEASEEEE, join SCP and merge your changes with CVS ASAP. SCP crew DOES a great effort keeping FS2 updated and any talented help is always good news.
Title: Re: Suggestion for a new feature (HUD distance inf
Post by: karajorma on April 25, 2006, 02:52:16 am
Backlash is in but he doesn't have CVS access just yet what with someone parking their car in Inquisitor's living room and all.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on April 25, 2006, 09:42:13 am
Another suggestion before trying the new build: if it is not done and it is easy can you make multitargeting aiming point smaller (about half size)? I feel even normal targeting aiming point is too big but as you only have one it actually doesn't matter. But a lot of big white circles are annoying and as you don't have missile info, a little circle will be enough.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on April 25, 2006, 10:08:19 am
Hey, I have been able to make a try with the new Backslash's build and I've noticed that exiting subspace doesn't work. When I press Alt-j, the subspace sound plays but I get no exiting message neither subspace is engaged.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on April 25, 2006, 06:35:25 pm
Woo, look at my new SCP icon ;)

Heh, yeah I was wrong about the F3 window -- it does update, how nice.  I didn't know you could click the wing icons to expand the list to show all the ships.  What can I say, this window is still new to me :D

I'll make the aiming point smaller if I can figure it out... the current method was really easy, just make a stripped-down function that displays the same way the standard aimpoint does, primary weapon only.  If one of the other existing icons is the size we want, or at least less obtrusive, I'll use that.  Of course, if you want ALL the targeting aiming points (including the original) to be smaller, I could whip up a little image file to put in data\interface to try.

Don't know what's up with the alt-j.  Could be I messed something up trying to import the latest CVS -- the stuff I've coded myself has nothing to do with jumping at all.  Of course my build is unofficial until I get the bugs worked out and can commit.  Meanwhile I'll try a new compile when I get home, I'm currently out of town.  But thanks for the feedback!
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on May 03, 2006, 01:55:19 pm
Any news on this, Backslash?

Have you solved the alt-j issue? Have you made any progress on the multitargeting enhacements? Have you submited the changes to SCP (I've just made an update and I've seen lots of changes from my previous version)?

(As you can see I'm getting anxious and you are spending more than 2 hours in coding them  :D)

OTOH, keep aiming point sizes as they are now. I think it's a less priority enhacement.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on May 03, 2006, 08:01:15 pm
Yeah looks like I missed the May exam  :p

Sorry man, we're in kind of a feature-freeze at the moment, getting rid of bugs and stuff.  This is too big a change for now.

On the sort of bright side, by the time I can submit it, it'll probably be in such good shape that no one will have any possible objection, maybe  :D

There is one way you could help.  Hopefully you've got a decent collection of mods and campaigns from here and there?  Well please do a search, find ANY mention of "+Hotkey: 8" (no quotes) in missions, besides FSPort.  (Use some text editor that has 'find in files' to save time.)

I can do most of your suggested groups somewhat easily, I think (though depending on what you find above I have to change how it works so as to not break compatibility).  It's the autoupdate that's a bit more tricky (and yet useful enough that I still want to do that, provided there's no performance hit).  Kinda busy this week but hopefully the weekend will be good.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on May 04, 2006, 01:56:49 am
Of course I will search that string. I've got the next mod/campaigns (as I remember):

+ Derelict SCP Version (my favourite campaign over them all even FS2 main campaign).
+ Shrounding The Light
+ Trascend
+ Sync
+ Fsport (v2.3 and 3.0)
+ Deux ex Machina

OTOH, what is the problem that can happen if "+Hotkey: 8" is present? I can also check it with your FIRST build or with your SECOND build.

And please, can anyone tell me a free Windows editor or text finder with find in files function? (Just to avoid opening every single .fs2 file).
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on May 04, 2006, 02:19:47 am
Some people like PSPad (http://www.pspad.com), some people like TextPad (http://www.textpad.com), some people like others that I don't know about.

The +Hotkey: 8 thing isn't really a PROBLEM, it's just a compatibility thing I might have to keep in mind.  According to comments in the code, "if the hotkey is the last hotkey in the list, then don't add it either since this hotkey is a special marker to indicate that this ship should remain invisible in the hotkey screen until after mission starts."  and as far as I can tell, the last hotkey in the list is number 8.  So if I add more hotkeys this won't work any more.  (It's already broken in my test builds.)

It's a hackish way of coding this that :v: did.  I aim to make it more expandable for the future (with cross-platform possibilities among other things), but if any campaigns use it I may have to put in a workaround.  So far I see FSPort 3.0 did it, but I don't know if it was intentional (I wonder if it was in FS1?).  Otherwise, I suspect nobody knew about this feature.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: karajorma on May 04, 2006, 06:48:51 am
I use Windows Grep (http://www.wingrep.com/index.htm) for stuff like that. Does a pretty good job and it's nagware  (and not even that persistant about nagging). 
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Goober5000 on May 04, 2006, 09:37:13 am
Google for WinGrep.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on May 04, 2006, 10:07:25 am
The +Hotkey: 8 thing isn't really a PROBLEM, it's just a compatibility thing I might have to keep in mind.  According to comments in the code, "if the hotkey is the last hotkey in the list, then don't add it either since this hotkey is a special marker to indicate that this ship should remain invisible in the hotkey screen until after mission starts."  and as far as I can tell, the last hotkey in the list is number 8.  So if I add more hotkeys this won't work any more.  (It's already broken in my test builds.)

I must be FULLY nerd, but what are the hotkeys?, where do you set them?, where is the hotkey screen?  :mad:

I mean:
+ I only use numbers keys after command (c) to say what to do and who is doing that.
+ While playing I've set Fxx to diferent groups from F5 to F12 including F8 WITHOUT problems, and they all seem to work in the same way. (Although I think I've never used F8 with your builds, I will try all Fxx keys with them ASAP).

Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: karajorma on May 04, 2006, 10:09:54 am
Those are the hotkeys. F5 = hotkey 1 cause F1 to F4 are used for other functions by the game.

Google for WinGrep.

Top result is the one I linked to. The others don't seem much of an improvement. One guy actually wanted $149 for his version of grep. :rolleyes:
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on May 04, 2006, 12:15:52 pm
yeah, forgot to explain.  F5 is directly coded as +Hotkey: 0, F6 as +Hotkey: 1, and count up from there.  so F12 is +Hotkey: 7, and 8 is off the scale.

Sounds like you're already doing everything right, just a mismatch of terms ;)  F3 is the hotkey screen I meant.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Goober5000 on May 04, 2006, 12:57:58 pm
Top result is the one I linked to.

Whoops.  Didn't even see the second page... :o :nervous:
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: karajorma on May 04, 2006, 01:10:42 pm
yeah, forgot to explain.  F5 is directly coded as +Hotkey: 0.

Flagellates self with the zeroth order cat O' eight tails. :rolleyes:
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on May 05, 2006, 01:24:28 am
Well, I did the "+Hotkey: 8" search in the following mod/campaigns:
+ Origininal FS2.
+ SCP FS2 (media vp 3.6.8. delta)
+ Port v2.3 and 3.0
+ Derelict SCP
+ Inferno
+ Sync
+ Trascend
+ Deux Ex Machina
+ Lightning Marshal (1 to 4)
+ Shrounding The Light

and this string only appears in Port (both versions).

But, I was playing a bit with it and I think you should fix it as it allows to make missions with more briefing quality (although I've never used F3 window in briefing before):

+ It seems that this feature allows to hide ships that are going to be present from the mission start BUT you are not supposed to know about them.

+ I don't know how, there's another way to show ships in F3 window that they're not actually present when the mission starts (example: a mission in Derelict where you are supposed to attack a pirate base, and when you start, the base is already destroyed).
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on May 17, 2006, 01:19:27 am
This one goes to Backslash:

Yesterday, I downloaded and gave a quick try to Taylor's latest build, (I didn't find the hidden feature, but I will keep trying...  :mad:). It looks simply GREAT and it has solved asteroid field issues. BUT, after trying your beta builds I do really like your multitargeting enhacements.

So, if they are not getting CVS soon, can you post a new beta build over latest CVS, please?
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on May 22, 2006, 02:54:55 am
Sorry if I'm a bit dull.

Backslash, can you  post a beta build with your multitarget enhacements, please?
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: karajorma on May 22, 2006, 03:26:36 am
Backlash should hopefully have CVS access by now (if not he will do soon) so once he commits his code we can have a proper CVS build with this in :)
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on May 22, 2006, 11:17:53 pm
Sorry guys, but my living state is in flux... I kinda had to start over on a different machine, compile-wise, but the good news is I now can compile with MSVC 2005 Express while on the go.  Bad news is I can't always test it :nervous:

So uh... here's a build, but I make no guarantees.  http://www.qeyleb.net/files/fs2_open_r_multitarget.exe (http://www.qeyleb.net/files/fs2_open_r_multitarget.exe)  ...Still got some minor bugs, so you might want to back up any pilot file you try with it. 

It is nice to see that the feature is so liked :D  I'll do my best to get the code into shape in order to commit to CVS, but it'll be slower going this week...  (among other problems, I'm compiling on a frelling 700MHz :ick:)
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on May 23, 2006, 02:09:26 pm
Hi Backslash, I have just tried your new build:

+ It seems to work fine. It hasn't got the Alt-j issue anymore.
+ I haven't made any test about Hotkey 8.
+ You have shown your next intentions (although it doesn't do anything yet  :hopping:).
+ PLEEEASE, add the optional launcher flag, test it, ask me to test it, retest it and retest it again BUT submit the code to CVS yesterday or even the day before ;)  (Just the "old features" would be great). I do want it "official" ASAP

EDITED--------

+ I have tested Hotkey by editing first FS Port 2.3 mission and making GTC Orff "dissapear" from F3 window (+Hotkey: 7 --> 8 ) and it works now. Great!!  :yes:

I'm going to play for a while and if I notice something I'll post it.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on May 24, 2006, 06:27:17 pm
Build updated.  The 'next intentions' does something now ;7, but doesn't autoupdate.  That's going to take a lot more work than I expected, but it'll be worth it I think.  Oh, if you don't have anything targeted, it (should) get the attackers of yourself; should I make a separate control for that?

A couple small but frustrating to track down bugs remain.  For one, please test the function of these commands in a nebula with limited awacs.

I'd commit this already if it didn't modify the pilot files.  I think I should ask permission from the leaders.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: taylor on May 24, 2006, 07:10:12 pm
I'd commit this already if it didn't modify the pilot files.  I think I should ask permission from the leaders.
No pilot file breakage until after 3.6.8.  And even then it will be the new pilot file code, which is a MAJOR rewrite.  Any pilot file changes made now will not be included in the new code since I can't diff it (the changes are too extensive).  There is a Mantis bug about pilot file issues so just make a patch of what you want to add and attach it, and a small blurb about what it's supposed to do, to that bug and I'll fold it into the new code and commit the whole thing at once when it comes time to do so.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on May 25, 2006, 09:38:20 am
Build updated.  The 'next intentions' does something now ;7, but doesn't autoupdate.  That's going to take a lot more work than I expected, but it'll be worth it I think.  Oh, if you don't have anything targeted, it (should) get the attackers of yourself; should I make a separate control for that?

A couple small but frustrating to track down bugs remain.  For one, please test the function of these commands in a nebula with limited awacs.

I'd commit this already if it didn't modify the pilot files.  I think I should ask permission from the leaders.

GREAT. I'm going to download and test it now with the famous "A game of TAG" and the SOC mission where you have to find your mate through nav buoys.

OTOH, I would split it because I, (and I suppose most of the people too), have Auto-targeting always enabled so I nearly never have no active target AND attackers on my own. (In fact I fairly use "Target Nearest Target's Attacker")


EDIT ----------------

Impressions with your new build:

1. GREAT work.

2. One bug. It shows the orders for all targeted ships even enemy ones (within these ones it should be hidden).

3. Other issue. The first time you press it, it keeps your actual target (or no one if you haven't) and only multitargets the attackers. At the second press and next ones, it leaves the current target (which should have happened from the begining) and cycles through the multitargeted group.
(I didn't notice before that your new multitarget commands cycled through the group. I don't know if it is a new feature or I was just asleep :) )

4. I've tried it within "A Game of TAG" and I haven't found any other crashes or bugs:

4.1. I have left Alpha 2 fighting with the mara wing (which also engages alpha) and I've flown more than 15 Km away (more than radar range for detection of last virgo wing at least). Multi-targeting attackers keeps working   but I can normally target every ship even at this distance, (once you have detected a ship it seems you can always target it even if you are far far away).

4.2. When the last virgo wing arrives, and it isn't shown in radar, it can't target Lucity or any other ship (due an actual FSOpen bug). So I can't check "Multi-target attackers" over this ship. (It just doesn't do anything).

If you have some problematic mission and steps to make it crash or detect bugs, please post and I will try it.


5. Which logic does the code use to select the "attackers"?

I will use an example. I have used FSPort 3.0 "The darkness and the light". I have ordered my wing (3 ships) to attack the Aten cruiser (I don't remember its name, let's call it ATEN). Then ATEN shows 3 red dots in its HUD target box. When my wing reaches ATEN, its cover fighters defend it so you can see how ATEN has only 2 dots, then 1 dot and finally 0 dots because my wing is disengaging ATEN to defend themselves. Through all this time, "Multitargeting ATEN's attackers" always select my full wing. I do feel this is the right behaviour because all of them have the order of attack ATEN even if they're not doing it just at the moment.

But then I order my wing to "Engage enemy", so it means no orders AFAIK. In this situation if I target the ATEN it can have zero, one, two or three dots but the "Multitarget ATEN's attacker's" action doesn't select that exact number of fighters from my wing. Sometimes they're the same but other times they're not.

So, how do you build the group of attackers?



I continue testing... (But not today)
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on May 27, 2006, 02:54:45 am
2. One bug. It shows the orders for all targeted ships even enemy ones (within these ones it should be hidden).
heh, this is semi-intentional for testing.  course now that I've tried it I quite like it (we did have this ability in TIE Fighter), but it's kind of an unfair advantage I suppose.  I'll put it back when done.
Quote
3. Other issue. The first time you press it, it keeps your actual target (or no one if you haven't) and only multitargets the attackers. At the second press and next ones, it leaves the current target (which should have happened from the begining) and cycles through the multitargeted group.
(I didn't notice before that your new multitarget commands cycled through the group. I don't know if it is a new feature or I was just asleep :) )
Yeah, already noticed this and will fix it.  Funny side effect of reusing code from Target Wing... with Target Wing you don't want to change targets the first press ;)
The cycling through the group worked but not always... so it's not exactly 'new' as much as 'improved'.
Quote
4.1. I have left Alpha 2 fighting with the mara wing (which also engages alpha) and I've flown more than 15 Km away (more than radar range for detection of last virgo wing at least). Multi-targeting attackers keeps working   but I can normally target every ship even at this distance, (once you have detected a ship it seems you can always target it even if you are far far away).
4.2. When the last virgo wing arrives, and it isn't shown in radar, it can't target Lucity or any other ship (due an actual FSOpen bug). So I can't check "Multi-target attackers" over this ship. (It just doesn't do anything).
If you have some problematic mission and steps to make it crash or detect bugs, please post and I will try it.
Ah!  well maybe that particular bug is fixed.  Thanks.  The other bug... if I knew how to reproduce them it'd be fixed :p  Will let you know when I have something else for you to test.
Quote
5. Which logic does the code use to select the "attackers"?
I'm using some of the same code as the regular 'Target Nearest Attacker', so basically it checks if the ai of (the attacker) has (the targeted ship) targeted.  Problem is, I haven't implemented the idea of 'deselect a target if it's no longer attacking the thing' yet... so maybe that explains some of what you observe?  Try multitargeting the attackers, then selecting something completely different when ordering the 'Engage Enemy', then multitargeting again.

I hope to implement auto-remove-from-list (when they switch targets), and eventually auto-adding new ships that arrive.  Both of those are more complicated -- I'd have to find places from which to call a 'check if this should be added to / removed from a set' function, and without a performance hit of course.  Lots of exploring the code and learning to do.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on May 27, 2006, 03:04:24 am

Quote
5. Which logic does the code use to select the "attackers"?
I'm using some of the same code as the regular 'Target Nearest Attacker', so basically it checks if the ai of (the attacker) has (the targeted ship) targeted.  Problem is, I haven't implemented the idea of 'deselect a target if it's no longer attacking the thing' yet... so maybe that explains some of what you observe?  Try multitargeting the attackers, then selecting something completely different when ordering the 'Engage Enemy', then multitargeting again.

I hope to implement auto-remove-from-list (when they switch targets), and eventually auto-adding new ships that arrive.  Both of those are more complicated -- I'd have to find places from which to call a 'check if this should be added to / removed from a set' function, and without a performance hit of course.  Lots of exploring the code and learning to do.

Within all my explanation I'm always multitargeting the attackers, (so ATEN isn`t targeted any more), then I manually re-target ATEN again and press multitarget its attackers to rebuild this group of figheters.

I don't know how FS2 selects which the attackers of a ship are, but I can say it's a different way from the logic used to count them and displaying the dots in the HUD target box.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on May 28, 2006, 03:47:14 pm
More tests with your build:

+ F3 window doesn't work. In this window the Function Key that appears in upper-right corner is erased. So you cannot add/delete Fxx from any ship to make groups. When you press any Fxx key, it briefly blinks in the corner but it's erased.

+ I can't find any logic in how Attackers Group is built. Following with "The Darkness and the Light" mission:


I don't know if you can find any logic through reading the code. AND I don't know if your new code has messed the attacker selection code or probably this was the "official retail" behaviour but it couldn't be detected till now. If this last one is the true one, then you shouldn't change or repair anything about it IMO.
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: Backslash on June 01, 2006, 06:23:34 pm
Good catch with the F3.  Arrgh, I have a general idea what the problem is and it may not be easy to fix.  Or it'll take some creativity.

Updated the build with a Target My Attackers type control, and fixed the Target Attackers not-selecting-the-first-attacker problem.

Hmm, I can't figure out the logic behind how it's choosing the attackers either... all I tell it to do is check if the ai of the attacker has a certain ship targeted.  The AI code is agreed by everyone to be hard to figure out.  I haven't changed the attacked selection code at all.  The way you describe it almost sounds like the AI has more than one target, or can target one ship while doing something else like defending themselves.  Or I wonder if there's a difference between the AI's 'goal' vs their 'target'?  I haven't looked at the dot code yet -- maybe it will shed some light on the situation.

Whoops, my web site is down!  :sigh: Hmm... ok I'll put it temporarily at http://myhome.spu.edu/calebjackson/FSO/fs2_open_multitarget.exe (http://myhome.spu.edu/calebjackson/FSO/fs2_open_multitarget.exe)
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on June 02, 2006, 12:50:14 am
Well, I'm going on holidays for 2 weeks so I doubt I will be able to test your builds.  :p
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on June 11, 2006, 12:41:58 pm
Oops a double post.

I've been able to make a fast test (just two missions) and all seems to go fine (but F3 bug) with your new build. (Bye, bye till next week).

(It would be great if these features could reach 3.6.9. launch. But, hey, I really can't and I don't complain about your work in any way. Keep on it  :yes:)
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on June 20, 2006, 11:30:01 am
A triple post, sorry (but a week after the last one, I would update this one during the next days if it keeps in the last position).

I've started testing again your last build and I've noticed the next bugs:

1. The previously known F3 bug. (And the enemy orders one, of course).

2. There's a a cross effect in multitargeting cycling between "Target's attackers" and "Your attackers". For example if you target your attackers then "Target's attackers" also cycles through this just-built group instead of selecting the current target's attackers. The complementary one also happens, so "Your attackers" cycles through the just-built "Target's attackers" group.

3. Strange behaviours with "Your attackers":
3.1. Sometimes "Your attackers" works as expected and it multitargets all your enemies even if they're just one (making even a multitarget group of just one ship).

3.2. Sometimes it just select one of your attackers WITHOUT making a multitarget group (it seems to work just as r key).

3.3. Sometimes the first time you press it, it multitargets all your attackers BUT the closest one, which is only targeted. Then the following pressings cycle through this group but you are missing your closest attacker. The best example of this can be found in FS Port's "The darkness and the light". If you get very close to the Satis transports so they become your attackers. Then the nearest one is not multitargeted. (I allways command my wing to engage the Aten cruiser so they do not interfere with my attackers).
(I will try narrowing this behaviour).


(OTOH, excuse me if I'm really dull about it, but I DO think that the multitarget HUD distance and aiming point additions and the new 'Multitarget target's wing' action would be really nice in 3.6.9. The other two new actions are still too buggy).
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: taylor on June 20, 2006, 02:03:56 pm
(OTOH, excuse me if I'm really dull about it, but I DO think that the multitarget HUD distance and aiming point additions and the new 'Multitarget target's wing' action would be really nice in 3.6.9. The other two new actions are still too buggy).
Not for 3.6.9, it's far too late for that at this point.  If it's not a bug fix then it doesn't get in.  But I'm sure that the unstable branch is hungry for some more code. :)
Title: Re: Suggestion for a new feature (HUD distance info in Multitargets)
Post by: ARSPR on July 01, 2006, 01:35:40 pm
*bump*

Anything new on this Backslash?

And just another thing. While testing 3.6.9. RC3 with Derelict I think there are strange enemy fighter behaviours. So I think it could be a good idea to add to all SCP releases the "showing enemy orders" feature triggered by a flag in Dev Tool section of Launcher.