Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Nuke on April 30, 2008, 02:54:19 am

Title: I found a new use for the track ir...turret control!
Post by: Nuke on April 30, 2008, 02:54:19 am
il just let the video do the talking.
http://www.youtube.com/watch?v=rlo2hHlNIZk
Title: Re: I found a new use for the track ir...turret control!
Post by: Titan on April 30, 2008, 06:58:39 am
So... it's the reticle moving around the screen? i don't get it.  :confused:
Title: Re: I found a new use for the track ir...turret control!
Post by: boewolf on April 30, 2008, 11:06:29 am
It just looks strange to me...  why would you want the reticle moving like that?
Title: Re: I found a new use for the track ir...turret control!
Post by: Alan Bolte on April 30, 2008, 11:53:54 am
Looks like the HUD stays with the direction the ship is pointing, while a separate targeting reticule remains in the center of the screen. That does seem a bit awkward. Perhaps it would be better to leave a reticule for the fixed guns, and keep the rest of the HUD in the center of the screen. It's a cool use for track ir though.
Title: Re: I found a new use for the track ir...turret control!
Post by: Nuke on April 30, 2008, 01:41:43 pm
the point is you can fire where you look.

the turret reticle could use some work though. as you look around the position of the turret gons move in relation to the view. the turrets follow a point in space projected through the screen center out to the range of the target or 10000 meters, if no target is selected. i then use a blank weapon that has the same properties as the one on the turrets, minus the life time and damage values. if the script finds a weapon belonging to you that is of the right name, then it calls fireWeapon() on that turret.
Title: Re: I found a new use for the track ir...turret control!
Post by: achtung on April 30, 2008, 01:56:22 pm
Very neat.
Title: Re: I found a new use for the track ir...turret control!
Post by: Titan on April 30, 2008, 02:11:51 pm
neat-o... but how can this be used?
Title: Re: I found a new use for the track ir...turret control!
Post by: DarthWang on April 30, 2008, 03:50:53 pm
Would it be possible to make a multiplayer mode where one player controls the turret and another player controls the ship?

Title: Re: I found a new use for the track ir...turret control!
Post by: Titan on April 30, 2008, 05:17:57 pm
does anyone even play multiplayer anymore?
Title: Re: I found a new use for the track ir...turret control!
Post by: Droid803 on April 30, 2008, 05:20:54 pm
Yes, apparently. Check the multiplayer forum.
Coop play with this (or capship control) would be amazing. Multiple players pile onto a Deimos, and go on a shooting spree, each player getting a turret or two (since manning a Piranha turret is no fun).
Title: Re: I found a new use for the track ir...turret control!
Post by: Titan on April 30, 2008, 05:34:14 pm
And the pilot can occasionally call a broadside (like in that stupid pirates online game) that shorts out the engines for a min, but unleashes every turret's fire power on the nearest enemy cap ship.
Title: Re: I found a new use for the track ir...turret control!
Post by: colecampbell666 on April 30, 2008, 07:10:41 pm
(like in that stupid pirates online game)
You mean this (http://www.hard-light.net/forums/index.php/topic,51972.0.html) stupid pirates online game?
Title: Re: I found a new use for the track ir...turret control!
Post by: Nuke on April 30, 2008, 07:44:37 pm
its amazing how a good idea can fly over so many heads
Title: Re: I found a new use for the track ir...turret control!
Post by: colecampbell666 on April 30, 2008, 08:07:22 pm
Oh I think it's cool, myself.
Title: Re: I found a new use for the track ir...turret control!
Post by: Jake2447 on May 01, 2008, 09:02:41 pm
im not sure i understand
does it act as a simulation for semi-newtonian physics?
Title: Re: I found a new use for the track ir...turret control!
Post by: --Steve-O-- on May 02, 2008, 09:14:50 am
this would be awsome for like a chin mounted turret on a fighter, or tail gun. i do miss that little feature from the WC series. but yeah, chin gun. i like how that looks in my head (honestly for a second i pictured Peter Griffin with a machine gun hanging off his chin...dear god im loosing it), nice way to bolster fire power and not have to rely on ai control of turrets all the time. yeah...this can be fun.
Title: Re: I found a new use for the track ir...turret control!
Post by: Nuke on May 02, 2008, 12:11:52 pm
im not sure i understand
does it act as a simulation for semi-newtonian physics?

*wooosh!"
:D

im essentially killing shivans by looking at them
Title: Re: I found a new use for the track ir...turret control!
Post by: colecampbell666 on May 02, 2008, 12:38:17 pm
How can't people see that? I got it from the thread title, even.
Title: Re: I found a new use for the track ir...turret control!
Post by: Nuke on May 02, 2008, 12:47:27 pm
i know, i've been really disappointed with the modding board lately.
Title: Re: I found a new use for the track ir...turret control!
Post by: Flaser on May 02, 2008, 08:05:32 pm
Excellent work! This will be really useful for finally creating that elusive gunship class.

I got an couple of ideas on improving the user interface:

The basic idea is look-and-shoot. The turrets aim where you look. The problem is, where you look is actual a point in space, and this could be anywhere from the tip of your nose to the next galaxy.

So we need to tell the guns the range of where you look and vice-versa tell the player where the guns aim.

(Your "ghostgun" does a very clever range calculation.  However I have a feeling this data would be also available from the targeting code that generates the shooting reticle, so a code modification - or hook just for your script - would be more than justified in this case).

What we need is a visual cue. The set of cross-hairs should be scaled according to the range (from the ship) the guns bear on. If this crosshair is the size of the average target (fighter for instance) then when you slew your view onto a target you will be assured a hit when it "boxes" the bogey.

If we want to simulate an actual "lock-up" (which would also be handy as it leaves us time to do a ghost-shot) a different reticle should be displayed while calculating range. So we have a reticle scaled to infinity without a target, a lock-up reticle, and finally an appropriately scaled reticle. This creates a "flashlight" effect, so the player will immediately feel when he has something in his sights.

To simulate turrets without infinite tracking speed a different set of cross-hairs could be actually rendered for the guns themselves. This set of cross-hairs should always point at the point where the guns are actually aiming. So by waiting until the second set catches up you can tell the player whether the guns are locked up or not.

If you're firing ballistic (ergo not hitscan) ammunition, the same code could be used to generate a set of similar crosshairs for a set of ranges so they would give the player a bullet trajectory. This could also be done on a per turret basis, so widely spaced turrets could also be visualized.

Finally the code could be combined with the convergence code - as far as I see it already is in a matter of speaking, since the turrets "auto converge". In a primitive setting - or at a CIC type gamplay - one could set the conversion or target range. By doing so with the mouswheel and with the above visual cues we have a fast and entertaining gameplay.
Title: Re: I found a new use for the track ir...turret control!
Post by: colecampbell666 on May 02, 2008, 08:25:24 pm
I assume that the guns work like flak. Flak is designed to blow at a certain range, which is the range at which the ship is at. The guns probably converge at that range.
Title: Re: I found a new use for the track ir...turret control!
Post by: Stormkeeper on May 02, 2008, 09:09:05 pm
This could be used as a part of a mission where the player has to man a turret on a capship. Its pretty funky stuff.


By the way, what weapon is that? I've never seen it before.
Title: Re: I found a new use for the track ir...turret control!
Post by: colecampbell666 on May 02, 2008, 09:12:38 pm
http://www.hard-light.net/forums/index.php/topic,53587.0.ht
This could be a good multi thing, have several people in a bomber, each gets a turret/pilot/bombardier.
Title: Re: I found a new use for the track ir...turret control!
Post by: Nuke on May 03, 2008, 05:24:39 am
Excellent work! This will be really useful for finally creating that elusive gunship class.
thanks, this is one of the reasons im making this script. The GvAf Apis is in essence a mini-gunship. its dual gatling turrets were meant to be aimed. seeing as the ship goes back to retail, im happy to finally give the turrets their proper functionality. but i also plan to use it for other ships like the maelstrom and some bombers too.

Quote
The basic idea is look-and-shoot. The turrets aim where you look. The problem is, where you look is actual a point in space, and this could be anywhere from the tip of your nose to the next galaxy.

So we need to tell the guns the range of where you look and vice-versa tell the player where the guns aim.

thats pretty much how it works now. range is calculated with (enemypos - playerpos):getMagnitude(), before any of the lead calculation is done. this is dependent that a ship is targeted. freelancer seems to make the guns fire in parallel unless a target dot is moused over. i am converging on the target or on a point 10000 meters out. this is sorta accurate. but im still dependant that all the turrets are aligned along the main axes through the turret's center. so to test it on ships like the aeolus, i had to go in and edit all the turrets in the model. well set up turrets are the key to making those aim properly, so not every model works well with it. i could probably improve it by getting the range to the lead position rather than the ship, which im calculating in my own lead function. its not as accurate as the build in freespace lead indicator but its close enough.

Quote
(Your "ghostgun" does a very clever range calculation.  However I have a feeling this data would be also available from the targeting code that generates the shooting reticle, so a code modification - or hook just for your script - would be more than justified in this case).
id love a built in lead function in lua. that would be awesome.

Quote
What we need is a visual cue. The set of cross-hairs should be scaled according to the range (from the ship) the guns bear on. If this crosshair is the size of the average target (fighter for instance) then when you slew your view onto a target you will be assured a hit when it "boxes" the bogey.

i did a lead indicator like that, but it was based on 2d concepts. i figured that the distance between the ship and where the lead indicator would be drawn could be added or subtracted from the screen center and a reticle be drawn there. so that if the reticle is placed directly on the ship, it would be the same as if a fixed reticle was centered on the target's lead. i really haven't a clue if this would work when you're not looking straight forward. i can try but no promises. since i now have bounding box info i can determine how big a ship should appear on screen, and draw brackets accordingly. i could vary the size/color/ect of those depending on hit probability.

Quote
If we want to simulate an actual "lock-up" (which would also be handy as it leaves us time to do a ghost-shot) a different reticle should be displayed while calculating range. So we have a reticle scaled to infinity without a target, a lock-up reticle, and finally an appropriately scaled reticle. This creates a "flashlight" effect, so the player will immediately feel when he has something in his sights.

i thought about a partial blind fire. all you need to do is get the target's lead close to the screen center, and the last 5 or so degrees would auto-lock on for more accurate hits.

Quote
To simulate turrets without infinite tracking speed a different set of cross-hairs could be actually rendered for the guns themselves. This set of cross-hairs should always point at the point where the guns are actually aiming. So by waiting until the second set catches up you can tell the player whether the guns are locked up or not.

thats how the old system worked. im still working out all the bugs, sometimes some turrets don't cooperate (i made left front and side single part turrets work so far). once those are completely squashed i can work on field of fire and track rate. not firing turrets that are not able to go where you're aiming and returning it to ai control when it cant go to where you want it due to field of fire limits.

Quote
If you're firing ballistic (ergo not hitscan) ammunition, the same code could be used to generate a set of similar crosshairs for a set of ranges so they would give the player a bullet trajectory. This could also be done on a per turret basis, so widely spaced turrets could also be visualized.

perhaps. i calculate a different lead indicator per turret because of this. when flying large cap ships, you actually see a string of leads in front of the target. they are partially transparent so when a bunch of them are stacked it sorta highlights the group, marking a sweet spot. auto aim can make each turret line up with its own lead indicator so they all hit accurately.

Quote
Finally the code could be combined with the convergence code - as far as I see it already is in a matter of speaking, since the turrets "auto converge". In a primitive setting - or at a CIC type gamplay - one could set the conversion or target range. By doing so with the mouse wheel and with the above visual cues we have a fast and entertaining gameplay.

manual control of flak range would be a good idea, right now it just sets to the range of the target, and this does not work (should mantis it). we still have very little input however. so for now this is just an idea. i could probably code up some over elaborate auto targeting system, where any ship that finds its way into my crosshair will be auto targeted and range settings applied to convergence and flaks.
Title: Re: I found a new use for the track ir...turret control!
Post by: Jake2447 on May 03, 2008, 08:14:26 am
ok, i get it now
i was pretty stupid earlier
yeah this sounds cool
and a gunship would be cool with this
Title: Re: I found a new use for the track ir...turret control!
Post by: Azhren on May 11, 2008, 08:00:37 am
Maybe it could be used in a PSI Cops campaign where you could be a P14 rated PSI Cop (one with strong 'active' abilities) and 'control' your fire onto your target (even make it a 'feature', as in Dark Children).