Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: actual_glue on June 15, 2010, 02:00:28 am

Title: Towards A Better Cockpit
Post by: actual_glue on June 15, 2010, 02:00:28 am
Hello, friends!  I'm in the midst of designing (another) ship, and in the interest of making it as capable and flexible a model as possible, I'm designing it with the possibility of a cockpit view.  (As the cockpit view project is updated, so too will be my releases of this model.)  But here's my question:  I assume the show-ship tag only shows the cockpit .pof?  The reason I ask is that several external parts of the ship are visible from the cockpit, including some thrust nozzles and guns.  Of course in my ideal world, once the cockpit thing is fully functional, a player using cockpit view would be able to see the guns and nozzles firing.

So I guess the question is in two parts.  First of all, will be necessary to include those external components visible from the cockpit in the cockpit .pof to see them from cockpit view?  Second, if so--and this one is a stretch, I know--can anyone conceive of a way to make those guns and nozzles work visibly from inside the cockpit?

Thanks in advance.
Title: Re: Towards A Better Cockpit
Post by: Spoon on June 15, 2010, 04:07:52 am
Not a expert in cockpits but as far as I know, the show ship flag does just that. It makes the player's ship model visible. So that includes guns, wings and all that jizz.
Title: Re: Towards A Better Cockpit
Post by: The E on June 15, 2010, 05:12:20 am
Yes, show-ship shows the entire ship. If the eyepoint is inside the cockpit, you'll get to see everything the pilot sees. See this vid (http://www.moddb.com/mods/blue-planet-war-in-heaven/videos/wih-gameplay-snippet-1#imagebox) for a demonstration.
Title: Re: Towards A Better Cockpit
Post by: Nuke on June 15, 2010, 08:12:48 am
its why i prefer show ship over having a cockpit model. it allows you to see whats going on with your ship. it does slightly impede performance however since the full detail cockpit model would be externally visible. you can get around this by doing a big drop in detail from cockpit lod0 to lod1 and using a short er detail distance for the ships lod1. i kinda wish subobjects would use different detail distances and different distance calculations than the hull, so you can do this without effecting the loding of the ship hull.
Title: Re: Towards A Better Cockpit
Post by: Dragon on June 15, 2010, 09:51:15 am
i kinda wish subobjects would use different detail distances and different distance calculations than the hull, so you can do this without effecting the loding of the ship hull.
Ever heard about detail boxes?
Title: Re: Towards A Better Cockpit
Post by: Aardwolf on June 15, 2010, 03:58:54 pm
i kinda wish subobjects would use different detail distances and different distance calculations than the hull, so you can do this without effecting the loding of the ship hull.
Ever heard about detail boxes?

No, he's talking about subsystem LODs. Which are possibly anyway, I think. There was a discussion about it recently, anyway.
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 15, 2010, 04:23:58 pm
Hello, friends!  I'm in the midst of designing (another) ship, and in the interest of making it as capable and flexible a model as possible, I'm designing it with the possibility of a cockpit view.  (As the cockpit view project is updated, so too will be my releases of this model.)  But here's my question:  I assume the show-ship tag only shows the cockpit .pof?  The reason I ask is that several external parts of the ship are visible from the cockpit, including some thrust nozzles and guns.  Of course in my ideal world, once the cockpit thing is fully functional, a player using cockpit view would be able to see the guns and nozzles firing.

So I guess the question is in two parts.  First of all, will be necessary to include those external components visible from the cockpit in the cockpit .pof to see them from cockpit view?  Second, if so--and this one is a stretch, I know--can anyone conceive of a way to make those guns and nozzles work visibly from inside the cockpit?

Thanks in advance.

As said... Show Ship shows the player ship.  This is where you place your cockpit inside the actual ship.  The cockpit .pof you're referring to is the second way of displaying a cockpit, unfortunately it's not working correctly yet. (unless it's been fixed and i've noticed)
(http://img.photobucket.com/albums/v356/Shodan_AI/troubles2.jpg)
(http://img.photobucket.com/albums/v356/Shodan_AI/moreproblems.jpg)
Title: Re: Towards A Better Cockpit
Post by: Dragon on June 15, 2010, 05:12:13 pm
Separate cockpit model worked for me, but I didn't used along with "Show Ship" flag.
Setting both on one ship may cause it to look weird.
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 15, 2010, 05:36:51 pm
Separate cockpit model worked for me, but I didn't used along with "Show Ship" flag.
Setting both on one ship may cause it to look weird.

Can you send me the max file, pof and table for the model?  Maybe then I can figure out what's wrong.
Title: Re: Towards A Better Cockpit
Post by: Reprobator on June 16, 2010, 04:36:28 am
The external cockpit pof worked for me two, even if i use to experiment scoobydoo's problem one time (i ve remodeled the cockpit and had no more problem)

The only problem with the externe cockpit pof is that if you choose to switch for another ship who has cockpit view too in a mission, the cockpit won't be displayed anymore...
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 16, 2010, 06:33:09 am
I've taken the entire cockpit out of the model and it's still messed up.

BTW what does your model look like?  Is it built from one object or several subobjects?
Title: Re: Towards A Better Cockpit
Post by: Reprobator on June 16, 2010, 06:39:37 am
Two object in fact,
The cockpit and the "viewable hull"
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 16, 2010, 03:46:22 pm
Nope, that didn't help... I though you meant every polygon was attached to each other (i.e. when you select subsystem in Max everything gets selected).
Title: Re: Towards A Better Cockpit
Post by: Dragon on June 16, 2010, 04:02:45 pm
I've use Mediavps ships with glass changed to invisible texture, set them as cockpit models for "real" ships (that was to avoid the problem with things reflecting inside glass, it's annoying, happens on latest builds and should be fixed) and it worked flawlessly (aside from being an ugly hack, that is).
Note that I also removed "show ship" flag from them.
Title: Re: Towards A Better Cockpit
Post by: actual_glue on June 16, 2010, 11:35:06 pm
So what I'm thinking is this:  Use show-ship, construct the ship as normal, and (in Blender) parent the cockpit model to the main hull in detail0.  I will actually have two cockpit models, one the hyper-detailed cockpit as viewed from inside, and the other the less-detailed cockpit with visible pilot.  Detail box the cockpit models so that you see the detailed, internal version if you're inside like... five meters or something, and use the same settings for the external cockpit model, except set $detail_box: -1 so that you see it if you're outside the ship--in other words, if you're not the pilot.  In that way, I'll be using it as a sort of selective LOD.

In my overly active imagination, this would show the cockpit model if you're controlling a ship, since your distance from it would ideally be 0.  If you're not controlling the ship, unless you get a clipping error and somehow manage to lodge your ship inside my model, you'll never see the detailed cockpit, and that's just as well because a) you don't need to and b) there's no pilot in that model, so it would just be an empty cockpit.  But whether or not you're actually piloting the ship, if you're within range of the detail0 LOD, you'll see the same hull, so you'll still see working firepoints and maneuvering jets when you look out the window of the ship.

In fact I got a little fancier than that and made more detailed models of some of the parts of the ship that you can see from inside the cockpit, since they, like the cockpit, will be something that you have to look at up close the entire time you play.  They're not even separate objects in the model, though--they're part of the mesh of the different cockpit models, just not connected at any vertices and placed in the exact right relative positions.

Sooooo does anyone see any hole in my logic here, using 3.6.12 Inferno and 3.6.10 Inferno?

And if anyone (especially Scooby--hot damn, dude) has any hot tips about texturing with GIMP beyond the tutorials... you know, feel free to share.  I freely admit that I've been extracting models and texture maps from other people's .vp's, trying to learn a thing or two from their work.

Oh and one more thing, off-topic.  I'm actually making two versions of the model, one contemporary to FS2 and another one based on near-future projections of space flight technology.  It would be a museum piece in the FreeSpace universe.  I've designed it with (to a certain extent) real life physics in mind, so I have considerations for center of gravity, g-forces on the pilot and hull, energy conservation and so on.  In my mind, it's from a conflict from before humanity left the Sol system and one of the first ever dedicated space fighters designed, in some sort of interplanetary conflict.  Has there been any interest in this sort of modding?  I know there's a campaign about the origins of the 103rd, but I'm ashamed to admit that I haven't played it yet, so I'm not sure where it happens in the FreeSpace timeline.  If you're into this kind of stuff, let me know and we'll do some brainstorming.  I'll be releasing both versions of this model as soon as I can get it textured and struggle my way through PCS1 and ModelView32.  (My onboard laptop graphics card is one of those friggin Intel cards, with a custom driver for this laptop no less, just to make good and sure that I can't update it.  It doesn't support all the OpenGL that PCS2 needs.  If anyone has found a way around this, I would love to join the PCS2 party.)

Thanks a lot, guys!  You've been really helpful, and I'm glad this discussion is happening.
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 16, 2010, 11:48:53 pm
I think I solved my problem finally (at least for the bearcat)

I created a simple box and name it detail0.
I link both the cockpit AND what's viewable of the ships hull to that.

Edit: Does anyone remember how to pan around with your joystick?

Title: Re: Towards A Better Cockpit
Post by: Reprobator on June 17, 2010, 07:36:42 am
This has desapeared with the track ir stuff, but you can target a ship and use the track view (not sure about the name)
Title: Re: Towards A Better Cockpit
Post by: Swifty on June 17, 2010, 09:01:14 pm
It's called "Target Padlock View" in the Misc options of the Controls Config. Select a target and toggle it on to fix your viewpoint in the direction of your target.
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 17, 2010, 09:51:36 pm
It's called "Target Padlock View" in the Misc options of the Controls Config. Select a target and toggle it on to fix your viewpoint in the direction of your target.

That's the target padlock view, what I was looking for was the free padlock view where you could use the joystick's tophat to look round anywheres.

Edit: It works good enough for now I guess...

(http://img.photobucket.com/albums/v356/Shodan_AI/cockpit.jpg)
Title: Re: Towards A Better Cockpit
Post by: Dragon on June 18, 2010, 11:02:37 am
Looks great.
Title: Re: Towards A Better Cockpit
Post by: Commander Zane on June 18, 2010, 12:07:21 pm
That looks outstanding!
Title: Re: Towards A Better Cockpit
Post by: Thaeris on June 18, 2010, 12:14:29 pm
Flight by lefties?

NOOOOOOOOooooo!!!

 :lol:
Title: Re: Towards A Better Cockpit
Post by: SpardaSon21 on June 18, 2010, 12:46:56 pm
Yeah Scoob, when do we get that awesome cockpit and new HUD?
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 18, 2010, 09:47:40 pm
On helmet HUD is saga's, they are fine tuning it.
The console display is currently unavailable (i.e. it hasn't been programmed into the game).

The cockpit itself I'm doing some fine tuning, making it look even better.

I do have one question.  How would you implement glass without it looking empty or being in the way? 
Title: Re: Towards A Better Cockpit
Post by: SpardaSon21 on June 19, 2010, 12:16:32 am
Really, really slight environment mapping and mirroring, just enough so people realize there is glass or a glass-like material in front of them.  Nowhere near what that post-GW Sol mod that failed epically (no, not INF:A, the other one) did.
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 19, 2010, 02:38:45 am
That's kinda what I was thinking of...
Title: Re: Towards A Better Cockpit
Post by: Reprobator on June 19, 2010, 06:06:03 am
i don't use glass in cockpits for now, the value for the alpha was so low that toshop refused to export the alpha in the dds and so i had to much mirroring, that made the game unplayable cause of skybox reflexion!
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 19, 2010, 11:37:58 pm
I don't seem to have a problem with transparency, I think.  However what controls the amount of reflection the shinemap?
Title: Re: Towards A Better Cockpit
Post by: FreeSpaceFreak on June 20, 2010, 12:41:09 am
The alpha channel of the shinemap controls the "mirror" reflection, IIRC.
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 20, 2010, 01:23:12 am
i don't use glass in cockpits for now, the value for the alpha was so low that toshop refused to export the alpha in the dds and so i had to much mirroring, that made the game unplayable cause of skybox reflexion!


Alright got it working, but ya I see what you mean.  It wasn't the mirroring it was screwed up backgrounds.



Another idea, it would be nice to have a subsystem that is a child of the eye (i.e. it follows the eye/it's angle is the same as that as the eye is looking at)  That could be useful for helmets...

(http://img.photobucket.com/albums/v356/Shodan_AI/centaur-cockpit.jpg)
Title: Re: Towards A Better Cockpit
Post by: Nuke on June 20, 2010, 12:28:53 pm
you could probibly fake it by rendering a model with scripting.
Title: Re: Towards A Better Cockpit
Post by: Bob-san on June 20, 2010, 03:59:02 pm
Hm; can we do something about the shield indicators? Perhaps, setting an absolute value for each quadrent? That way, we can more accurately tell how strong the shields are and how many shots to go.
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 20, 2010, 07:53:35 pm
Hm; can we do something about the shield indicators? Perhaps, setting an absolute value for each quadrent? That way, we can more accurately tell how strong the shields are and how many shots to go.
I imagine that would be part of the hud artwork.
Title: Re: Towards A Better Cockpit
Post by: Wanderer on June 21, 2010, 09:02:35 am
You could just use some other draw method like scripting to get those helmets and like rendered.
Title: Re: Towards A Better Cockpit
Post by: Dragon on June 21, 2010, 04:52:32 pm
Really, really slight environment mapping and mirroring, just enough so people realize there is glass or a glass-like material in front of them.  Nowhere near what that post-GW Sol mod that failed epically (no, not INF:A, the other one) did.
Cockpit glass is broken in FSO, it should be completely transparent on the inside, like on FSU models.
The problem is that, even if inside of the glass is untextured, it shows up anyway.
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 22, 2010, 04:33:57 am
Really, really slight environment mapping and mirroring, just enough so people realize there is glass or a glass-like material in front of them.  Nowhere near what that post-GW Sol mod that failed epically (no, not INF:A, the other one) did.
Cockpit glass is broken in FSO, it should be completely transparent on the inside, like on FSU models.
The problem is that, even if inside of the glass is untextured, it shows up anyway.

I seemed to get cockpit glass to work.  You have to add an alpha channel (pure black being 100% transparent) and save as DTX5.  Now unforunately the reflection isn't going to be what you think it is, unforunately no cockpit/ship gets reflected onto the glass  :blah:
Title: Re: Towards A Better Cockpit
Post by: ssmit132 on June 23, 2010, 03:01:27 am
Hm; can we do something about the shield indicators? Perhaps, setting an absolute value for each quadrent? That way, we can more accurately tell how strong the shields are and how many shots to go.
I imagine that would be part of the hud artwork.
They had a very similar feature to this in FreeSpace Alpha.
(http://www.hard-light.net/wiki/images/Alpha_hud.jpg)
Title: Re: Towards A Better Cockpit
Post by: Bob-san on June 23, 2010, 10:22:53 am
Hm; can we do something about the shield indicators? Perhaps, setting an absolute value for each quadrent? That way, we can more accurately tell how strong the shields are and how many shots to go.
I imagine that would be part of the hud artwork.
They had a very similar feature to this in FreeSpace Alpha.
(http://www.hard-light.net/wiki/images/Alpha_hud.jpg)
Not the same idea; more exact but it still won't tell players how much shield energy is still remaining in each quadrant. What I mean is that heavier-shielded ships have thicker and brighter quadrants on the HUD than weaker-shielded ships. That way, an SB Nephilim or Seraphim (1600 shield HP) won't look the same as a GTF Hercules (600 shield HP) or a GTF Ulysses (380 shield HP). That'll tell newbies that the big old Shivan Bombers are going to be tougher to break through than something like the Ulysses.

Also perhaps to have a pseudo-canon classification for threat level of each ship; I don't know if it'd be possible to animate, but a blinking red v. yellow light to indicate if the targeted ship is a high threat.
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 26, 2010, 03:31:51 pm
(http://img.photobucket.com/albums/v356/Shodan_AI/Crossbow-1.jpg)

(http://img.photobucket.com/albums/v356/Shodan_AI/demon1.jpg)
(http://img.photobucket.com/albums/v356/Shodan_AI/Demon-1.jpg)

Title: Re: Towards A Better Cockpit
Post by: actual_glue on June 26, 2010, 05:59:28 pm
What is this?  Is this using cockpit.pof?  How would a modeler eventually make this beautiful idea work?
Title: Re: Towards A Better Cockpit
Post by: Mobius on June 26, 2010, 06:11:32 pm
Almost unbelievable, wow... :eek:
Title: Re: Towards A Better Cockpit
Post by: The E on June 26, 2010, 06:24:14 pm
Only needs a bit of new HUD code love, and you'll have a working cockpit in no time.





Before you ask where it is and why this wasn't done already, it's because the new HUD code is not 100% complete yet. It does, however, offer the ability to do real render-to-texture cockpit elements.
Title: Re: Towards A Better Cockpit
Post by: Scooby_Doo on June 26, 2010, 06:35:40 pm
What is this?  Is this using cockpit.pof?  How would a modeler eventually make this beautiful idea work?

Yup this is done via cockpit.pof  (each ship class gets it's own cockpit.pof file  (crossbow-cockpit.pof, demon-cockpit.pof...etc)

Only needs a bit of new HUD code love, and you'll have a working cockpit in no time.





Before you ask where it is and why this wasn't done already, it's because the new HUD code is not 100% complete yet. It does, however, offer the ability to do real render-to-texture cockpit elements.

Ya that was talked about several months ago.  I think we got to the point of how the hud texture would be laid out.   Also I'm now thinking we should have both a cockpit displays AND a helmet mounted HUD.  (or at least have each one toggleable). 
Title: Re: Towards A Better Cockpit
Post by: The E on June 26, 2010, 07:09:09 pm
Yeah, but now that swifty posted his test build, not to mention committed the code to a public repository, we can finally see some movement on this issue.
Title: Re: Towards A Better Cockpit
Post by: chief1983 on June 27, 2010, 01:01:23 am
So is there any comment from him on how much closer we are to this being possible?
Title: Re: Towards A Better Cockpit
Post by: Nuke on June 27, 2010, 11:18:35 pm
its possible if you dont mind raping your framerate, and then it would take some work.
Title: Re: Towards A Better Cockpit
Post by: chief1983 on June 28, 2010, 12:48:13 am
I meant using the new HUD code :P
Title: Re: Towards A Better Cockpit
Post by: Nuke on June 28, 2010, 05:42:42 am
my point was that you could do it now. without needing new code. but the new hud code will be awsome.
Title: Re: Towards A Better Cockpit
Post by: asyikarea51 on June 28, 2010, 06:34:22 am
Helmet mounted HUD with Ace Combat-ish multi-lock missiles with multiple super-fast targeting icons that dart across the screen in an instant seems awesome, but that'll be a loooooong way away even if it did happen...

Meh, "rule of cool" feeling (for lack of a better phrase) while there's some of it at the moment. XD


what fish eyes :wtf:
Title: Re: Towards A Better Cockpit
Post by: chief1983 on June 28, 2010, 10:26:51 am
Right Nuke, but I'm still looking for an answer to my question, how much closer are we to being able to do it without raping our framerates, with native support.
Title: Re: Towards A Better Cockpit
Post by: The E on June 28, 2010, 10:31:04 am
Ask Swifty?
Title: Re: Towards A Better Cockpit
Post by: karajorma on June 28, 2010, 08:39:31 pm
As an aside can we rename this thread please? Seeing "Towards a better cock...." on the main page whenever this thread is top of the pile is rather worrying. :p
Title: Re: Towards A Better Cockpit
Post by: Iss Mneur on June 28, 2010, 09:03:07 pm
As an aside can we rename this thread please? Seeing "Towards a better cock...." on the main page whenever this thread is top of the pile is rather worrying. :p
What has a cock (http://en.wikipedia.org/wiki/Rooster) ever done to you? :D

But on topic, this looks really cool.  Though I am generally rather bad with 3D cockpits.
Title: Re: Towards A Better Cockpit
Post by: Swifty on June 29, 2010, 11:59:38 pm
Helmet mounted HUD with Ace Combat-ish multi-lock missiles with multiple super-fast targeting icons that dart across the screen in an instant seems awesome, but that'll be a loooooong way away even if it did happen...
When I was implementing TrackIR about two years ago, missile locks were tied to player eye vectors, not forward ship vectors. A subsequent side effect was that TrackIR players could instantly lock up targets by just moving the lock indicator over them with their heads.

It was a feature, not a bug. :P
Title: Re: Towards A Better Cockpit
Post by: lostllama on June 30, 2010, 02:33:28 am
That sounds cool! Sort of like the helmet-mounted sight thing I sometimes use when flying the MiG-29 and Su-27 in LOMAC.
Title: Re: Towards A Better Cockpit
Post by: actual_glue on June 30, 2010, 03:21:08 am
As an aside can we rename this thread please? Seeing "Towards a better cock...." on the main page whenever this thread is top of the pile is rather worrying. :p

Uhhhh... I can only offer my sincerest apologies.

Henceforth I will be counting characters before I title posts.
Title: Re: Towards A Better Cockpit
Post by: Nuke on June 30, 2010, 04:40:26 am
That sounds cool! Sort of like the helmet-mounted sight thing I sometimes use when flying the MiG-29 and Su-27 in LOMAC.

the advanced cockpit script (should start callingh it advanced nukemod features, because thats technically what they are) lets you kinda do that. you can aim a laser designator for lgbs my looking around. a couple lines of code would let you do the same with the multilock system.