Author Topic: Turret recoil  (Read 14728 times)

0 Members and 1 Guest are viewing this topic.

Offline LAW ENFORCER

  • Turret Fiend
  • 210
    • http://www.armouredstar.com
I was wondering (and I havent heard this anywhere esle yet) (and if you did happen to have a disscusion about it and come in here and accusingly tell me that its already been done, I will say "yeah, whatever!")
err... lost track a bit there... emm..
I was wondering about turrent barrels, and if they could be set to recoil from shots? you could set up some cool AAA style guns or just cool ones!!;7

so who wants to tell me how terribly hard this would be and complete it the next day?:nervous:
Conflict GRDLA:
Operation Return To Riker
www.ARMOUREDSTAR.com - the latest site is not finished yet!
[What we have here is the source to the Freespace ENGINE, not the Freespace GAME. By allowing the ENGINE to support all kinds of cool stuff, we're allowing the creation of all new GAMES] - TurboNed

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
A turrent doesn't have barrels.

A turret does however.  And probably not without overhauling the entire system.  The only animations on FS ships are the rotations...no other model animations as far as I know.
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline Stryke 9

  • Village Person
    Reset count: 4
  • 211
Well, judging from the pathing plasma and missile launches use out of turrets, you could do something with the turret axis there possibly, but I'll defer to IceFire on whether that's too much work to be worth it or not...

 

Offline Anaz

  • 210
Doesn't seem like it would be too hard, because the rotated turret already has its normal pointed in the right direction, it would just be a matter of moving it along that axis.
Arrr. I'm a pirate.

AotD, DatDB, TVWP, LM. Ph34r.

You WILL go to warpstorm...

 

Offline IceFire

  • GTVI Section 3
  • 212
    • http://www.3dap.com/hlp/hosted/ce
Quote
Originally posted by Analazon
Doesn't seem like it would be too hard, because the rotated turret already has its normal pointed in the right direction, it would just be a matter of moving it along that axis.

True...its just that I was told that it would be very difficult.  But hey....if its possible, cool :D
- IceFire
BlackWater Ops, Cold Element
"Burn the land, boil the sea, you can't take the sky from me..."

 

Offline Mr. Vega

  • Your Node Is Mine
  • 28
  • The ticket to the future is always blank
I smell newtonian physics.
Words ought to be a little wild, for they are the assaults of thoughts on the unthinking.
-John Maynard Keynes

 

Offline Sesquipedalian

  • Atankharz'ythi
  • 211
This sounds like an awful lot of work for a teeny tiny little effect.
Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

The Scroll of Atankharzim | FS2 syntax highlighting

 

Offline Petrarch of the VBB

  • Koala-monkey
  • 211
It might be small, but will look good. Think of the turrets in HomeWorld.

 

Offline TrashMan

  • T-tower Avenger. srsly.
  • 213
  • God-Emperor of your kind!
    • Minecraft
    • FLAMES OF WAR
Hell, yeah!
Beam cannons? - nice
Gimme turrets!
Nobody dies as a virgin - the life ****s us all!

You're a wrongularity from which no right can escape!

 

Offline Petrarch of the VBB

  • Koala-monkey
  • 211
Beams woldn't have recoil.

 

Offline Nico

  • Venom
    Parlez-vous Model Magician?
  • 212
Quote
Originally posted by Analazon
Doesn't seem like it would be too hard, because the rotated turret already has its normal pointed in the right direction, it would just be a matter of moving it along that axis.

one would think that it's the "moving it along that axis" part which might be difficult, no?
SCREW CANON!

 

Offline KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
stupid thing: imagine the xwing sfoils
the movement can be described as part of a rotation, with the center point of the rotation at the base of the wings.
wouldn't be possible to set two parameters,
1 to limit the rotation angle from a starting point
2 to make it continuous or by keypress/sexp ?

 

Offline LAW ENFORCER

  • Turret Fiend
  • 210
    • http://www.armouredstar.com
Quote
Originally posted by Sesquipedalian
This sounds like an awful lot of work for a teeny tiny little effect.


So was your name! :drevil:


It is seriuosly cool when you see huge guns firing - its a bit of an improment instead of a slow green thingy just apperaring....:blah:
Conflict GRDLA:
Operation Return To Riker
www.ARMOUREDSTAR.com - the latest site is not finished yet!
[What we have here is the source to the Freespace ENGINE, not the Freespace GAME. By allowing the ENGINE to support all kinds of cool stuff, we're allowing the creation of all new GAMES] - TurboNed

 

Offline Anaz

  • 210
Quote
Originally posted by venom2506

one would think that it's the "moving it along that axis" part which might be difficult, no?


erm...alright..I'll try to explain it a bit more...

The turret is on a line which is formed by the two points (The axis of the turret, which is in this case the center of the turret for barreled turrets, and the turret's fireing point). All that you need to do is make something that updates the position of the turret based on how much time the effect takes, much like how keyframes work. I.E. you know that the turret needs to be at point "a" at time 100. At time 5, it is 5% along that transition, so you can move the position of the turret 5% down the line.


(hmm...now that I think about it, it seems to me that this might cause funny rotation if the axis is moved...because the axis is non-centered on the actual polymodel for the turret arm...I am by no means an expert on the source tho, and that might not be the way it is done)
Arrr. I'm a pirate.

AotD, DatDB, TVWP, LM. Ph34r.

You WILL go to warpstorm...

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
it's not really a lot of work - you just specify a recoil magnitude (m) - the recoil barrel speed will be something like 1/2 or 1/4 the projects velocity - you then take the barrels current normal (n)- invert the vector (n') (so n(1,1,1) would become n'(-1,-1,-1))

then figure out  [RC =] OC + (n' * m) and translate the barrel down by correct fractions of RC-OC to produce the velocity
(OC = Object Center)
(RC = Recoiled Object Center)

and then there would be a "return velocity"

while it's translating the turrets rotation would probably have to be locked for simplicities sake

================

or for  complexities sake -- this one makes it so you dont have to lock the position - you just have to perofmr a quick recalculation of your offset each frame [execution cost: 1 comparison, maximum of 3 mulitplications and 2 additions]

take
{ Scalar} Recoil Magnitude (m)
{ Scalar} Recoil Velocity (Vr)
{ Scalar} Return Velocity (Vc) [speed to return to normal from recoil position]
{vector} Current Normal (n) (may change) [and it's inverse n']
{ Scalar} Time since recoil event start (T)
{vector} Object Center (OC)

{ Scalar} Calculate Recoil Time (Rt = m/Vr)

{vector} Based upon T calculate Current Object Position (Position)

Code: [Select]

if (T < Rt)
       Position = OC + n' * T
else
      Position = (OC + n' * m) + n * (Vc * T-Rt);



=======
edit - the adititional translation can be performed by the internal T&L engine
« Last Edit: April 02, 2003, 05:06:43 pm by 30 »
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
Quote
Originally posted by Analazon

(hmm...now that I think about it, it seems to me that this might cause funny rotation if the axis is moved...because the axis is non-centered on the actual polymodel for the turret arm...I am by no means an expert on the source tho, and that might not be the way it is done)


fortunately rotating parts don't work correctly if the axis is in the wrong spot - because it rotates along the axis
« Last Edit: April 02, 2003, 05:05:03 pm by 30 »
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline Thorn

  • Drunk on the east coast.
  • 210
  • What is this? I don't even...
That was one of the things that got me with Homeworld...
When that heavy cruiser fires its guns, you can tell theyre big..
They kick and make a loud nose..
Converted to freespace, it looks pretty weak... sounds fine.. but its just not the same without the kick....

 

Offline Kazan

  • PCS2 Wizard
  • 212
  • Soul lives in the Mountains
    • http://alliance.sourceforge.net
you could specify

Quote

{ Scalar} Recoil Magnitude (m)
{ Scalar} Recoil Velocity (Vr)
{ Scalar} Return Velocity (Vc)


in the subojbect properties

Code: [Select]

$recoil_mag=10
$recoil_velocity=200
$recoil_return=50


recoil mag being in game units (meters)
the other two being in game units per second (meters/sec)
PCS2 2.0.3 | POF CS2 wiki page | Important PCS2 Threads | PCS2 Mantis

"The Mountains are calling, and I must go" - John Muir

 

Offline diamondgeezer

Quote
Originally posted by LAW ENFORCER
I was wondering about turrent barrels


:drevil:

 

Offline J.F.K.

  • 29
The only thing I think it would really be useful for is in-engine cutscenes. Presumably a capship would only be firing turrets in combat, and in combat, who stays still long enough to notice turrets recoiling? Nice idea, but I don't think it's appropriate for ordinary gameplay.
.
[font="SerpentineDBol"]. . . . W H O . I S . T H E . M A N , . W H O . I S . T H E . M Y T H ?[/font]