Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Backslash on April 06, 2008, 02:16:06 pm

Title: Cool new features, already implemented!
Post by: Backslash on April 06, 2008, 02:16:06 pm
I thought I'd make a thread in which I pointed out some neat changes and features that have been implemented over the last few months, that I think may have escaped some people's notice.

Multipart turrets now work on ship sides and angles, not just top and bottom.  This is awesome and needs to be used more!  Big thanks to KeldorKatarn.

Ships.tbl has a new entry, $Autoaim FOV (http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Autoaim_FOV:).  This is a neat feature -- within that FOV, guns will autoaim.  This can be used to make Starlancer style blindfire.  I would guess that very small values could be used to simulate something like autoconvergence; worth a try.  Also thanks to KeldorKatarn.

Set-object-speed-z (and x and y) sexps work properly for both objective and subjective directions now.  Because of the way the default physics works, the subjective Z direction doesn't work (or rather, works but instantly goes back to 0) unless you set the use_newtonian_dampening (http://www.hard-light.net/wiki/index.php/Ai_profiles.tbl#.24use_newtonian_dampening:) ai_profiles flag.  Lots of interesting things can be simulated with these sexps, like carrier catapult launches, and all sorts of crazy cutscene effects. :)

The lead indicator now works for slower dumbfire secondaries.  It also works with the use_additive_weapon_velocity (http://www.hard-light.net/wiki/index.php/Ai_profiles.tbl#.24use_additive_weapon_velocity:) ai_profiles flag, which looks really cool.  Before, it was only using the speed of your selected primary no matter what.  (I implemented this one early April so you'll need a build made after that.)

And that's just off the top of my head!  Granted, this is just still I've been involved with.  There's been lots of other things, and fixes and optimizations too, of course.  Other developers are welcome to chime in here to highlight other changes they think people should be 'reminded' about :D
Title: Re: Cool new features, already implemented!
Post by: Grizzly on April 07, 2008, 04:16:58 am
use_newtonian_dampening (http://www.hard-light.net/wiki/index.php/Ai_profiles.tbl#.24use_newtonian_dampening:) ai_profiles flag.

Why do I always miss the useful stuff when making my mods? (*snif*)
Title: Re: Cool new features, already implemented!
Post by: Galemp on April 07, 2008, 10:08:56 am
Multipart turrets now work on ship sides and angles, not just top and bottom.  This is awesome and needs to be used more!  Big thanks to KeldorKatarn.

Do these need to be facing forwards, like topside turrets, or backward, like bottom turrets? And is there anything in particular that has to be done to them other than the normal data multipart turrets get?

Quote
Ships.tbl has a new entry, $Autoaim FOV (http://www.hard-light.net/wiki/index.php/Ships.tbl#.24Autoaim_FOV:).  This is a neat feature -- within that FOV, guns will autoaim.  This can be used to make Starlancer style blindfire.  I would guess that very small values could be used to simulate something like autoconvergence; worth a try.  Also thanks to KeldorKatarn.

So these are homing primaries on a per-ship basis? Cool. A per-weapon option would be nice, though, for people who want only some weapons to have a homing ability; perhaps a 'no autoaim' flag for weapons would be useful. Then each ship can have an autoaim entry and all dumbfire primaries would have the 'no autoaim' flag. Obviously this wouldn't apply to turrets, as they can already have their FOV set by the turret normal.

Alternately have the game use a default autoaim of, say, 30 degrees on all ships, but have autoaiming off by default and only activate it with an 'autoaim' flag in the table. Then all that's needed to use the feature is a single flag on that weapon. If the creator wants to tweak specific autoaim for a ship, they can add the 'autoaim FOV' flag and set it to something other than the default.
Title: Re: Cool new features, already implemented!
Post by: Backslash on April 07, 2008, 01:13:13 pm
Do these need to be facing forwards, like topside turrets, or backward, like bottom turrets? And is there anything in particular that has to be done to them other than the normal data multipart turrets get?
Frell if I know, sorry.  I only saw it in the commit log :D  It's being discussed in this thread (http://www.hard-light.net/forums/index.php/topic,53168.0.html)...

Good ideas about the autoaim stuff.  I like the second option.  I'll try them if I have time.
Title: Re: Cool new features, already implemented!
Post by: Nuke on April 08, 2008, 10:28:53 am
i think when i was messing with bobs version the turret had to be pointed at its up (long its base axis). and then uvec, svec,and fvec vaules have to be entered to specify the axes (for both parts i think).
Title: Re: Cool new features, already implemented!
Post by: asyikarea51 on April 08, 2008, 11:07:23 am
That autoaim feature looks useful with the Claymore 2 in INFR1.

The gun positioning was :shaking:

Random banter...
Title: Re: Cool new features, already implemented!
Post by: chief1983 on April 08, 2008, 02:52:22 pm
Wanderer managed to dig up the link and post it on IRC for me, thought anyone else stumbling across this might be looking for it too:

Bobboau's original off axis turret release thread (http://www.hard-light.net/forums/index.php/topic,43271.0.html)

Edit:  Wanderer took a look at using that old model with the new builds, it doesn't seem to be acting as it used to.  Seems we really could use some better explanation of how to use it.
Title: Re: Cool new features, already implemented!
Post by: Nuke on April 09, 2008, 03:53:50 am
i should look at it but i think i tossed my test turrets on mistake. maybe i have the source model or a copy in a backup somewhere. but when i find them il test it out.
Title: Re: Cool new features, already implemented!
Post by: Tolwyn on April 09, 2008, 04:43:15 am
The pof needs to contain two normals in submodel properties field that had to written by modeller just like any subsystem entry (for each turret).

Code: [Select]
$uvec: 1, -1, 0
$fvec: 1, 0, 0

How you get the necessary normals I don't know.. but I'd guess there is SOME way of getting them in SOME of the 3d programs.
Title: Re: Cool new features, already implemented!
Post by: Wanderer on April 09, 2008, 05:12:20 am
Yeah.. except in this new system it doesn't follow the same logic as in the one bobboau released. That is IIRC the old system worked with bobs models but new one doesn't. So please - whom ever it may concern - please release exact instructions on how this feature should be used with for example - like bobboau - with fully functional example of side or at angle mounted turret

EDIT: For example testing with retail triton's top turret...
Code: [Select]
$uvec: 0,1,0
$fvec: 0,0,1
This works.. however it is the very same as the retail turret.. so not very useful

However...
Code: [Select]
$uvec: 0,1,0
$fvec: 0,0,-1
This causes turret to keep the newly defined 'front' aligned at the target it is following, even shoots from proper place.. assuming the barrels which rotate on the opposite side of the target would actual point at the target. So barrels point at wrong direction sorta as mirrored along the turrets 'front/back' plane. Same goes with setting the $fvec: 1,0,0 as then turret 'tracks the target' with its side. Barrel elevation is good exact they still point at the 'retail direction' ie. 90 degreed of target in this case - but then again firingpoints do rotate properly.
Title: Re: Cool new features, already implemented!
Post by: Backslash on April 09, 2008, 03:36:22 pm
Working on tracking down the guy to post in here.

From the very short conversation I had with him, he says the behavior you describe of changing the top turret is as expected.  You don't want or need to change the vectors of the top turret if it is still on the top.

He says the easiest thing for everyone would be to make a cube with one turret on each side.  There are only 6 combinations possible for the vectors (and we already know the top) so it should be easy to figure out.  Problem is I don't know the first thing about modelling or adding turrets to a cube :nervous:

Meanwhile I'll go test out bob's model.
Title: Re: Cool new features, already implemented!
Post by: Wanderer on April 09, 2008, 03:48:32 pm
So it is not possible to make turrets at other than straight 90 degree angles? I mean in other than perfectly aligned top, bottom, fore, aft, left and right sides.
Title: Re: Cool new features, already implemented!
Post by: Galemp on April 09, 2008, 03:51:13 pm
I'll see if I can make one tonight. I'll even do one better... after I've done the normal cube, I will rotate it 45 degrees along one axis so you can test sloped turrets. :)

scratch that, I'm too tired. Someone else do it, or wait for me to rest.
Title: Re: Cool new features, already implemented!
Post by: Backslash on April 09, 2008, 04:16:10 pm
So it is not possible to make turrets at other than straight 90 degree angles? I mean in other than perfectly aligned top, bottom, fore, aft, left and right sides.
I'm sure it's possible, it'd just be more complicated to test.  When I said there are only 6 combinations I meant only for that cube.  Galemp's idea sounds like a great next step.
Title: Re: Cool new features, already implemented!
Post by: Nuke on April 09, 2008, 04:55:02 pm
i found the original max files for my test turrets, but they dont seem to be working in game, which is quite odd. theyre the same ones i used to test bobs version.
Title: Re: Cool new features, already implemented!
Post by: chief1983 on April 09, 2008, 05:30:46 pm
Neither did Bob's test model, like I mentioned.  So I have a feeling there's a difference between Bob's old build and this one.  Hopefully we can get a hold of this guy for some help.
Title: Re: Cool new features, already implemented!
Post by: Backslash on April 16, 2008, 11:56:51 pm
Ok, after going over the code again it looks like a hunk was left out.  So I have now committed it and it works with at least two of Bobboau's test models.  The disc-like one works but the barrels go through the bottom... I'm testing to see if that's just an error with the model's data.

Meanwhile, there's been other cool changes.  Weapons can now spawn more than one type of child weapon at a time (phreak).  There's a "check hull" subsystem flag (Bobboau).  There's a "is-player" SEXP (karajorma).  Not to mention lots of other fixes and improvements by taylor and Goober.  Also, ships can now be named with a # in the name and everything after the # will not be shown -- great for simulating nanojumps and whatever with 'duplicate' ships.  No longer is the high-Ascii character hacky method necessary.
Title: Re: Cool new features, already implemented!
Post by: Wanderer on April 17, 2008, 04:08:04 am
Nice.. Yeah, now the turrets seems to work pretty nicely.. Though people should remember that barrel rotation is just cosmetics that is unless tables are 'hacked' game will shoot at the enemies regardless where the barrel happens to points to.
Title: Re: Cool new features, already implemented!
Post by: chief1983 on April 17, 2008, 09:06:51 am
Ok, after going over the code again it looks like a hunk was left out.

Lulz.  But seriously, I was just about to ask about check hull, that's awesome news.