Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Fury on March 29, 2010, 02:45:12 am

Title: Real-time multi-part turret tracking
Post by: Fury on March 29, 2010, 02:45:12 am
It'd be quite awesome if multi-part turrets could track their targets in real-time, instead of moving like they are on cogs. Turret movement animation cannot often keep up with fast targets, resulting them firing to different direction than what they are facing. This can be fixed with "fire down normals" or "fire on target" subsystem flags, but that does not fix slow turret movement animation, making the turret inaccurate against fast moving targets. Any mod that relies a lot on multi-part turrets, like Diaspora would benefit from better turret animation code.
Title: Re: Real-time multi-part turret tracking
Post by: headdie on March 29, 2010, 02:56:45 am
 :yes:

being able to set the tracking speed would be usefull too (not good to see massive anticapital cannons tracking at the same speed as a little anti fighter gun)
Title: Re: Real-time multi-part turret tracking
Post by: Spicious on March 29, 2010, 03:04:21 am
being able to set the tracking speed would be usefull too (not good to see massive anticapital cannons tracking at the same speed as a little anti fighter gun)
You already can. The number after subsystem hp is how long it takes to rotate.
Title: Re: Real-time multi-part turret tracking
Post by: FUBAR-BDHR on March 29, 2010, 03:16:33 am
Never tried it with turrets but you can also set turn time for subsystems via sexp. 

One problem I have encountered (by accident) is that an object rotating too fast will crash FS2.  Once it gets moving so fast the code will try to slow it down but it gets to a point it can't and the recursive calls finally = splat. 
Title: Re: Real-time multi-part turret tracking
Post by: Fury on March 29, 2010, 03:48:27 am
You already can. The number after subsystem hp is how long it takes to rotate.
Uh, no. That value controls how fast it rotates, not how often it rotates. The turret still behaves like it is on cogs and problem as described still persists.
Title: Re: Real-time multi-part turret tracking
Post by: Spicious on March 29, 2010, 04:34:11 am
You already can. The number after subsystem hp is how long it takes to rotate.
Uh, no. That value controls how fast it rotates, not how often it rotates. The turret still behaves like it is on cogs and problem as described still persists.
Since when has rotation time not been inversely proportional to rotation speed?

I don't see what "on cogs" has to do with rotation frequency anyway.
Title: Re: Real-time multi-part turret tracking
Post by: Fury on March 29, 2010, 05:03:24 am
:rolleyes: Maybe someone else will explain it better for you.
Title: Re: Real-time multi-part turret tracking
Post by: Nuke on March 29, 2010, 07:07:14 am
the turret speed in the table is just how fast the sub object can rotate. but turret target re-acquisition works at a set interval.evety time it passes it will update its targeting data. i think the request is to allow modders to set that interval. an interval of zero would make the turret update every frame, -1 would be default, and any other value would be the number of (milli?)seconds between updates.

you could also pull it off with scripting if you were so inclined.
Title: Re: Real-time multi-part turret tracking
Post by: Fury on March 29, 2010, 07:09:13 am
Yes! Finally someone understands. :D