Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Dragon on March 10, 2011, 10:32:57 am

Title: Countermeasure improvements
Post by: Dragon on March 10, 2011, 10:32:57 am
I've noticed that CM system in FS is very limited, despite the introduction of CM type, it's still not very flexible.
For example, I'd like to see $Swarm and $Substitute working on CMs, which would allow F-16 style CM bursts (chaff and flares are mixed in most F-16 CM programs).
Also, would that be possible to introduce $Countermeasure Spawn Offset (per ship)? Right now, CMs spawn at the center of a ship, which may not look good on some designs. Allowing controll over that would cetrainly be usefull for some ships, especially those with a modelled dispenser.
Title: Re: Countermeasure improvements
Post by: Reprobator on March 10, 2011, 01:48:15 pm
Yeah , i wanted to do something like swarm flare like this http://www.youtube.com/watch?v=TcJTISrVEFo&feature=related but no way to do it yet.
Title: Re: Countermeasure improvements
Post by: Dragon on March 10, 2011, 01:58:02 pm
That's why I posted here, I hope that it won't be that difficult to implement and somebody will do it someday.  :)
Title: Re: Countermeasure improvements
Post by: General Battuta on March 10, 2011, 02:20:15 pm
We've done swarm flares like that in BP but you can't set them up directly as countermeasures.
Title: Re: Countermeasure improvements
Post by: Dragon on March 10, 2011, 03:15:19 pm
Which is exactly what I'm asking for.
The main CM system is inflexible and lacks a lot of important functionality. Swarm flares in BP have nothing to do with the request, because they're just weapons with a few additional parameters.
Title: Re: Countermeasure improvements
Post by: Fury on March 11, 2011, 12:06:04 am
Uh?

You do realize that you can use those weapons as regular countermeasures? In other words, you can consider the old countermeasure system deprecated. If you want to create a custom cm, you create a weapon with cm properties in it and then assign it as default cm in ships.tbl or tbm. Then it is used as countermeasure in-game as normal.

I would imagine doing a weapon that has swarm and cm flags should work. Offset can be used via $Substitute and $Pspew. This should be quite doable with recent nightlies, the bigger problem is actually creation of decent looking effect.
Title: Re: Countermeasure improvements
Post by: Reprobator on March 11, 2011, 02:30:21 am
Well that's strange, i tryed that already and it didn't worked (with last week's nighties)
Title: Re: Countermeasure improvements
Post by: Fury on March 11, 2011, 02:53:51 am
Either that's a bug or the weapons-as-cm's isn't as feature complete as I assumed. You should post tbl entry here and let coders have a peek.
Title: Re: Countermeasure improvements
Post by: Reprobator on March 11, 2011, 07:16:57 am
Ohh i gave up about this and did somthing else , so i have no more tbm entry for it, but i'll give it a retry
Title: Re: Countermeasure improvements
Post by: Dragon on March 11, 2011, 08:38:19 pm
You do realize that you can use those weapons as regular countermeasures?
Doesn't matter.
When I do that, $Swarm does not work. I don't know if $Substitute does, but it already has issues with working on turrets.
As for effects, BP has it handled already (and chaff isn't very visible).
That's what I'm saying, CM dispenser can't handle many features of normal weapons and I'm asking for that to be changed.
Title: Re: Countermeasure improvements
Post by: Iss Mneur on March 13, 2011, 10:52:08 pm
I doubt that $substitute: will work for counter measures for the same reason that it doesn't work for turrets or when spawned by a script. Was the implemenation of the feature short sighted? Yes, but I am not going to write code for features that no one will use, lest the feature becomes like autopilot flyby, many options, 90% of them are totaly buggy or undocumented because nobody uses them. 

Thus the feature was not made more general because there was no interest at the time the feature was implemented for other weapons other than ones that a fired by the primary banks.  I forced people to test secondaries because of the way that the weapon spawning system works, adding something for the primaries only is actually harder than for both.

In order for a more comprehensive substitution system, one that supports weapons fired from any source, will require a minor rewrite of how weapons are spawned by the engine.  Unfortunately because of the work involved and the fundamental nature of the code involved, I don't want to rush into it.

Honestly, $Swarm probably doesn't work for the similar reasons that $substitute doesn't. $Swarm: requires more data about the weapon that weapon_create is not passed except from certain locations.
Title: Re: Countermeasure improvements
Post by: Spoon on March 14, 2011, 05:48:20 am
Quote from: Iss Mneur
Yes, but I am not going to write code for features that no one will use, lest the feature becomes like autopilot flyby, many options, 90% of them are totaly buggy or undocumented because nobody uses them. 
Sorry for going on a slightly offtopic rant here, but every time I see a coder say something like this, I cringe a little and wonder why we keep having this 'rift' between coders and modders. I've requested a bunch of stuff that will have a 100% guaranteed chance of getting used but they've all pretty much been ignored by coders. Instead some requests are picked up, requested by members who don't really work on a project and think that this feature 'would be cool to have'. Resulting in disgrunted coders who've put time and effort into making said feature and then find out that 'nobody uses them'...

A lot of the time I can't really say I know what the SCP is doing, and from the looks of it, the SCP doesn't really know what the modders are doing either. Left hand can't tell what the right hand is doing etc etc.
Title: Re: Countermeasure improvements
Post by: karajorma on March 14, 2011, 07:53:57 am
Bear in mind that coders can't necessarily implement what you want easily or quickly all the time.

I remember I bugged Goober for the team loadout feature I wanted a few times, finally got bored and decided to learn C++ to do it myself. Once I did I found it was over a month's worth of work for me and even thought it would have been less for someone familiar with the FS2 code it was still a massive amount of work.
Title: Re: Countermeasure improvements
Post by: Darius on March 14, 2011, 08:08:23 am
Currently weapon-create sexp uses absolute coordinates for weapon vectors, but I believe adding relative coordinates/vectors could allow for an Angel Wing flare effect (more so if the gravity script could be expanded to include weapon shots).

EDIT: I've been advised that get-object-x/y/z would work just as well for relative coordinates.
Title: Re: Countermeasure improvements
Post by: Dragon on March 14, 2011, 09:45:48 am
Well, maybe, but that would require SEXPs.
What I want are improvements to CM dispenser (the one fired by "x" key).
This would come in handy for any mods that use custom CMs, or even modellers who don't want their models to spawn CMs from the center and from a modelled dispenser instead (I guess that even a few Mediavps models could use this).
I think that if $Swarm is too difficult to make work on CMs, then maybe a new field could be a good idea ($CMBurst: , for example), which would do the same thing as swarm, only in CM dispenser-friendly way. Or perhaps a new burst flag (though I don't know if $Burst Shots work on CMs either), "Force Burst", which would make a weapon always fire a full burst (in fact, this flag could be fun for many other reasons, but that's irrevalant).
As for AP flyby, it was, IIRC, implemented by WCS team for WCS and it's most likely still used by them.
Title: Re: Countermeasure improvements
Post by: Iss Mneur on March 15, 2011, 12:09:30 am
Quote from: Iss Mneur
Yes, but I am not going to write code for features that no one will use, lest the feature becomes like autopilot flyby, many options, 90% of them are totaly buggy or undocumented because nobody uses them. 
Sorry for going on a slightly offtopic rant here, but every time I see a coder say something like this, I cringe a little and wonder why we keep having this 'rift' between coders and modders. I've requested a bunch of stuff that will have a 100% guaranteed chance of getting used but they've all pretty much been ignored by coders. Instead some requests are picked up, requested by members who don't really work on a project and think that this feature 'would be cool to have'. Resulting in disgrunted coders who've put time and effort into making said feature and then find out that 'nobody uses them'...
I realize that this was not specifically directed at me, but I think I should respond to it anyway.

To be clear, I am not a disgruntled coder (at least I don't think I am).  That is, the "mini rant" of mine was more directed at other (mostly former) coders who wrote the buggy mess of features, rather than any interaction I have had with any modders (which have been positive, if weird at times).  The "mini rant" was also the reason that the feature was not implemented to the level that is now being requested. Honestly, I have found working with modders to be almost the same as working with artists, I honestly have never been able to figure out what they are going to ask for next, so I don't bother to try.

A lot of the time I can't really say I know what the SCP is doing, and from the looks of it, the SCP doesn't really know what the modders are doing either. Left hand can't tell what the right hand is doing etc etc.
You are assuming that any one SCP member knows what the others are doing at any particular time.

Also, we have the Hosted Project Collaboration Forum for these types of things.

Bear in mind that coders can't necessarily implement what you want easily or quickly all the time.
Yep and $Subsitute: is one of those things. The initial version was pretty simple, these expansions will require a bit more work and the extra work has a much stronger chance of breaking the engine.

As for AP flyby, it was, IIRC, implemented by WCS team for WCS and it's most likely still used by them.
Yes it was and probably still is, but it that doesn't change the fact that it has a bunch of (mostly disabled) features that are completely useless because bugs that have either crept in over time or were never actually working correctly at original implementation.