Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: aldo_14 on October 12, 2003, 01:11:04 pm

Title: Cockpit?
Post by: aldo_14 on October 12, 2003, 01:11:04 pm
Just a thought..... FS2 zbuffers both the game engine and the cockpit hud anis together, doesn't it?  

Would it be possible to insert a seperate 'layer' (such as it is) to show a cokpit bitmap or even model, inbetween the hud polygons & actual space 'scene' layers?
Title: Cockpit?
Post by: Unknown Target on October 12, 2003, 01:28:09 pm
Please oh please oh please oh please....
Title: Cockpit?
Post by: aldo_14 on October 12, 2003, 01:37:02 pm
?
Title: Cockpit?
Post by: Fineus on October 12, 2003, 01:59:20 pm
I think he either likes the idea (I'm with that) or he doesn't think it's possible.
Title: Cockpit?
Post by: aldo_14 on October 12, 2003, 02:00:57 pm
It's the latter i'm concerned about.  As in 'oh please, how could you be so bloody daft!?'

:nod:
Title: Cockpit?
Post by: kasperl on October 12, 2003, 02:01:01 pm
well, you could try to just model it and place the viewpoint of the player somewhere funny. not sure if it would work though
Title: Cockpit?
Post by: aldo_14 on October 12, 2003, 02:10:55 pm
Nah - that's not what i mean.  what i mean, is somewhat akin to the way the game renders the hud ani's - AFAIK, they''re actually a flat, fully lit polygon which would be on the bottom of the zbuffer stack.  What I'm thinking, is whether you could create a layer just before that, to place some form of cockpit bitmap or animation there (but which is not visible from external cameras, etc)... um, it's sort of tough to describe, actually.  

I guess the basic summary is - creating a special layer in the z-buffer which fits inbetween the last 'external' buffer (the closest polys 'outside' the ship), but before the stack layer with the hud ani's.  Thogh, now i think of it, would you have to z-buffer the cockpit model if you did?  i mean, there wouldn;t be any overlapping polys, but I guess the projection could throw up some anomlies..... damn, I really need to try this out for myself somehow......
Title: Cockpit?
Post by: kasperl on October 12, 2003, 02:13:01 pm
i think that i get what you mean, but really, what is the problem with doing it all with the model itself?
Title: Cockpit?
Post by: aldo_14 on October 12, 2003, 02:18:26 pm
It'd be wierd..... i mean, if I understand you right, you're suggesting treating it as an ingame model(?) - the only way I can think of, would be to make it for use in chase cam.  But i'm not sure that could work, because IIRC the chase camera isn;t tightly looked to the rear of the ship and soforth.

Plus this sort of thing is more naturally a programming problem, IMO.
Title: Cockpit?
Post by: kasperl on October 12, 2003, 02:21:01 pm
what i mean is doing this:

make the ship, and have the cockpit normally covered with a one sided texture, and put your cockpit thingy's inside that. so thatfrom the outside it looks black, and from the inside you se all the things from the cockpit. and then you put the viewpoint for the player in the right place.
now, i am thinking this up as i write, and i only used modelview to look at pof's, so i might be very wrong abouy how FS2 handles viewpoints and one sided textures.
Title: Cockpit?
Post by: aldo_14 on October 12, 2003, 02:58:49 pm
That's been mooted before, but the problem is that FS doesn;t render any of the player ship when you're inside it, regardless of which way the poly's face.
Title: Cockpit?
Post by: kasperl on October 12, 2003, 03:00:24 pm
a, that explains.
Title: Cockpit?
Post by: Sticks on October 12, 2003, 08:53:42 pm
I was actually thinking about doing this. It really shouldn't be that hard at all, at least in a basic implementation.
Title: Cockpit?
Post by: Falcon on October 12, 2003, 08:59:25 pm
It can work two ways, view the cockpit zoom out view the ship.
Just a thought.
Title: Cockpit?
Post by: aldo_14 on October 13, 2003, 03:24:36 am
Quote
Originally posted by Sticks
I was actually thinking about doing this. It really shouldn't be that hard at all, at least in a basic implementation.


I'd like to, just to make a point of trying to get my arse in gear and actually learn some code.  Problem is that I'm still waiting on the yoonie releasing the VStudio cds..........incidentally, the idea came from how you described that 'overburn' effect working.  Made me think a bit about how the zbuffer could be exploited.

Maybe you could sort of create a seperate module / object responsible handling the cockpit code, so you could easily partition it (i.e. to start with a simple bitmap then move to an actual model with refinements or direct inheritance/extension), or even just to make it simple to turn on & off.  IMO the main problem *could* be the free look thing (shift + '.' I think).  

Wonder if the pof-viewing code for the actual hud could be utuilkised in some way?
Title: Cockpit?
Post by: Lightspeed on October 15, 2003, 09:38:50 am
dont do it as a model. bitmaps can be VERY detailed and dont slow the game down. If you could rearrange things (radar, targetting box) via table entries you could even specify different cockpits for ship classes and give them that "unique" touch :)
Title: Cockpit?
Post by: Kazan on October 15, 2003, 09:50:44 am
it would be much easier to to it as a bitmap than as a model - and the game performance hit would be less - and it would be easier to "turn the cockpit off"
Title: Cockpit?
Post by: J3Vr6 on October 15, 2003, 11:06:46 am
Sounds like a good idea, I like it.  I especially like Lightspeed's idea on it, with different ships being able to have different inside-cockpits.  I'm not sure if you guys can move the actual "guages" cuz I thought they were hard-coded, but having different setups for different ships would rock.
Title: Cockpit?
Post by: Drew on October 15, 2003, 12:10:14 pm
so itl be kinda like the cockpit veiw in rouge squadron?
das schweet
Title: Cockpit?
Post by: Sticks on October 15, 2003, 12:35:04 pm
lol

Rouge Squadron
Title: Cockpit?
Post by: JC Denton on October 15, 2003, 02:28:33 pm
Sounds closer to the way the cockpits are done in X-Wing vs. TIE Fighter to me.
Title: Cockpit?
Post by: Kazan on October 15, 2003, 02:50:58 pm
things can be de-hardcoded
Title: Cockpit?
Post by: aldo_14 on October 15, 2003, 03:10:27 pm
I had a wee look at the code (though i've got to be honest and say 90% of it is well over my head), and it seems that all the hud gauges are specified simply by their co-ordinates - i.e. just numbers.  So i'd guess you could just modify those by using a variable instead, and defining it somehow (maybe in a table).

I was thinking a model might be a lot more visually impressive, and could maybe (?) have some basic form of lighting - basically there's already some pof viewing support for the target box, so how much of a hit would it be to add an extra 800-ish pof-based cockpit model?    Personally, I'd think a bitmap would be easier, but it is a bit more crude IMO.
Title: Cockpit?
Post by: Lightspeed on October 15, 2003, 04:51:17 pm
Quote
Originally posted by aldo_14

I was thinking a model might be a lot more visually impressive, and could maybe (?) have some basic form of lighting - basically there's already some pof viewing support for the target box, so how much of a hit would it be to add an extra 800-ish pof-based cockpit model?    Personally, I'd think a bitmap would be easier, but it is a bit more crude IMO.


nah a model is not very visually impressive. It's just gonna look like some ugly shaped bad textured thin line thingies. Getting an object which is almost directly in front of the point of view to look good & clean you'd need to add tons of detail, so it would a) be a pain to create and texture, and b) look worse than if you'd just put a bitmap in which will prolly take less than 30 mins to create :)

Bitmap cockpits 0wn. :D
Title: Cockpit?
Post by: StratComm on October 15, 2003, 05:50:01 pm
Lighting is the true advantage of a cockpit model IMHO... you fly around with respect to the sun and different panels light up and fade darker as you adjust your fighter's orientation.  A little detail perhaps, but something that bitmaps can't do.

While I'm at it, let me make a little bump on something else.  Would it be possible to have parts of the player's ship render?  I had a couple of ideas about fighters with parts sticking out past the cockpit, but they wouldn't show up in game so it seems sort of pointless.  Also, it would allow "viewing from XXXX" to be much more meaningful; imagine looking out from the bridge of an orion (which presumably is underneath) and seeing parts of the deck as you should.  It would let you stick the eyepoint somewhere and have it mean something.
Title: Cockpit?
Post by: Drew on October 15, 2003, 06:27:33 pm
yes that would be kewl....
responding to the original topic tho...
Lightspeed, do you think you could post some screens illustrating what ur talkin bout? id make it easier for all of us to understand....

but i happen to agree with the model cockpit Rouge Squadron style because it CAN be higly detalied, ligted, and you can see stuff outside the ship (like was StratComm was sayin)
Title: Cockpit?
Post by: Sticks on October 15, 2003, 06:43:35 pm
If anyone want to give me a good 1024x768 cockpit bitmap, you have my promise of implementation of this feature.

Fair trade?

Edit: Well in D3D, at least.:p
Title: Cockpit?
Post by: Rictor on October 15, 2003, 11:21:33 pm
Sounds very fair to me. I'm no good at doing 3D stuff, but there are plently of people on here who are. The thing is, the cockpit would have to have panels which match up with the existing displays, while not blocking your view too much. Seems like more of a design problem than a technical one.

Anyways, here are some images for you to work with during the text phase, straight from V's animation department.

http://www.descent-freespace.com/goodies/gallery/cockpit/cok19.jpg
http://www.descent-freespace.com/goodies/gallery/cockpit/gtf0123.jpg

More can be found here (http://www.descent-freespace.com/goodies/gallery/cockpit/)

If you are planning on using those, and need them straightened out, I could do that.
Title: Cockpit?
Post by: aldo_14 on October 16, 2003, 06:55:51 am
Quote
Originally posted by Sticks
If anyone want to give me a good 1024x768 cockpit bitmap, you have my promise of implementation of this feature.

Fair trade?

Edit: Well in D3D, at least.:p


I can do it - can I assume we'd be using true green to indicate the transparent region?

But if you do do it, I'd like to see the code changes, for for the sake of trying to understand how it all works :)
Title: Cockpit?
Post by: Drew on October 16, 2003, 07:40:16 am
here, ill get some screens of MS virtual cockpit in MS CFS 2
and the bitmap one

while ingame the 3d virtual cockpuit is way kewler it lacks high res detail
with the bitmap you can display any number of dials/guages at high res.. but it is ugly and lacks kewlness
Title: Cockpit?
Post by: Nico on October 16, 2003, 07:48:19 am
Quote
Originally posted by Lightspeed


nah a model is not very visually impressive. It's just gonna look like some ugly shaped bad textured thin line thingies. Getting an object which is almost directly in front of the point of view to look good & clean you'd need to add tons of detail, so it would a) be a pain to create and texture, and b) look worse than if you'd just put a bitmap in which will prolly take less than 30 mins to create :)

Bitmap cockpits 0wn. :D


then again that's assuming anybody here can make a cool looking bitmap cockpit? now I doubt that much...
a 3D cockpit can look very cool if you make a cool model with cool maps. plus you could ( I suppose ) just map the various HUD anis on it as regular maps, and that would even allow you to have a padlock view.
Title: Cockpit?
Post by: Drew on October 16, 2003, 08:18:58 am
Virtual 3d cockpit


(http://mywebpages.comcast.net/ksickafoose/avatars/simpic1.jpg) (http://mywebpages.comcast.net/ksickafoose/avatars/simpic2.jpg) (http://mywebpages.comcast.net/ksickafoose/avatars/simpic3.jpg)


2d "bitmap" cockpit
(http://mywebpages.comcast.net/ksickafoose/avatars/simpic4.jpg)

as you can see, the bitmap is highly detailed but you only have one view, straight ahead (sorta like the current hud view in fs2)

but the virtual cockpit is totaly a 3d model viewed from inside the fighter. It allows you move the view 360 degrees horizontaly/vertiacaly and you can view stuff on the outside of your fighter so you can actually inspect your plane for damages (BTW i happend to be flying a corsair)

EDIT: sry 56krs ;P
Title: Cockpit?
Post by: Ypoknons on October 16, 2003, 08:21:32 am
Yeah, XWA (some others as well, even Freelancer actually) had that too and well, it's a trade off between what the modders are willing to do and not - 3D cockpits need time to be modelled and probably take longer to implement.

I would never argue against having both :)
Title: Cockpit?
Post by: Flipside on October 16, 2003, 08:29:32 am
While 3D cockpits would be good, this would also mean re-programming the Joystick-Hat code to allow 'roll' rotation instead of 'switch' rotation, which might be a nice feature anyway, but my problem is that if you are talking about cockpit views for all ships, that's quite a lot of modelling really, and a lot of Modders wouldn't bother. The coders have done really well trying to remove the stress of adding thrusters to models, I'd rather not see it replaced with another submodel you have to make for your ships :(

Flipside :D
Title: Cockpit?
Post by: Nico on October 16, 2003, 09:31:19 am
really, have you even worked on 2D art for games? making a cool looking 2D cockpit is an AWFUL amount of time, don't you realize? don't believe me? go on a flight simulator modding forum and ask around.
Does ANYONE HERE think he has the skills to do something like the 2d cokpit shown above? I sure don't, at least. Many people can do models, but cool looking 2D stuff? Don't think so.
Title: Cockpit?
Post by: Flipside on October 16, 2003, 09:53:28 am
I wasn't suggesting you added a 2D cockpit either, most military research facilities are pouring millions of pounds into research to give the pilot exactly the view you have in Freespace 2, with no blind spots etc, by mounting cameras on the skin of the aircraft :)

Flipside :D
Title: Cockpit?
Post by: Nico on October 16, 2003, 10:16:03 am
well then, this whole thread would have no point :p
Title: Cockpit?
Post by: Lightspeed on October 16, 2003, 10:26:50 am
Quote
Originally posted by StratComm
Lighting is the true advantage of a cockpit model IMHO... you fly around with respect to the sun and different panels light up and fade darker as you adjust your fighter's orientation.  A little detail perhaps, but something that bitmaps can't do.
 


you can add some lighting simulation to the cockpit bitmap by blending it with the current brightness / hue :)
Title: Cockpit?
Post by: Lightspeed on October 16, 2003, 10:32:28 am
Quote
Originally posted by Venom
really, have you even worked on 2D art for games? making a cool looking 2D cockpit is an AWFUL amount of time, don't you realize? don't believe me? go on a flight simulator modding forum and ask around.
Does ANYONE HERE think he has the skills to do something like the 2d cokpit shown above? I sure don't, at least. Many people can do models, but cool looking 2D stuff? Don't think so.


Then just make your 3d model, render it, and import the bitmap... That way you can retexture things easily and you could even add some minor details with simple image editing :)

the 2D Cockpit up there looks really flat, but you _can_ implement some cockpits with depth without a need to render it (making it look ugly and edgey like the 3D cockpit up there)
Title: Cockpit?
Post by: Flipside on October 16, 2003, 10:35:27 am
It wouldn't look as good though. I suppose if it HAD to be done, I would recommend the model version to be honest, but there are a few problems to overcome...., not only would you have to create  the cockpit, if you were doing it correctly, you'd need to make space for instrument panels to be mapped onto predefined polys on the Cockpit Model, which would then have to be tested to make sure they were visible in-game, you'd have to make sure the cockpit model wasn't going to 'overlap' the front of the ship, even if the cockpit isn't drawn in game, it would look odd to see ships hulls start being drawn inside your cockpit if you get too close. Using glowmaps, you could get a good model, but I suppose the best idea is to have a 'default' cockpit the game uses if none is specified for the ship? :)

Anyway, that's my thoughts :)
Title: Cockpit?
Post by: Nico on October 16, 2003, 12:05:43 pm
Quote
Originally posted by Lightspeed


Then just make your 3d model, render it, and import the bitmap... That way you can retexture things easily and you could even add some minor details with simple image editing :)

the 2D Cockpit up there looks really flat, but you _can_ implement some cockpits with depth without a need to render it (making it look ugly and edgey like the 3D cockpit up there)


so to make a 2D cockpit, you have to make a 3D one? isn't this a bit flawed? :p
Btw, the 3D cockpit above isn't looking good, but just look at the ones from Xwing Alliance, for exemple. really, trust me, I can make a good looking cockpit. I can't make a 2D good cockpit unless I render the 3D one, which is pointless, you lose the advantages of both versions that way.

As for the HUD... look at, say, Wing Commander Prophecy, Xwing Alliance, Iwar2, etc. they all feature 3D cockpits, but their HUD is like in Freespace2. it's just cosmetics, there's no information on the cockpit itself, but the cockpit mesh is made so for exemple the HUD part for communications will be over a modeled screen of the mesh hull. simple, elegant and effective.
Title: Cockpit?
Post by: Sticks on October 16, 2003, 01:26:41 pm
This whole thing is getting a bit rediculous.

It's going to be about 20 times easier to do a bitmap cockpit than a true 3d one, hands down. I always thought 3d cockpits really sucked big time. I'll tell you why.

1. Blocky. Unless someone can get me a georgeous mesh with beautiful textures, it will look far worse than a nicely rendered bitmap cockpit. I'm talking tons of triangles. 5 - 20k would be good.

2. Transformations. I don't even want to think about the sh*t-tastic vector transforms I'm going to have to jump hoops through just to get the thing to render properly at the same spot every frame.

3. Slow. A 3D cockpit will suck resources, for sure. And especially in software T&L, we don't really have any more to spare.

I'd say point number one is my biggest problem. My other problem is implementation, and that is to say that I really don't know how I would implement the 3D version. And you can count out hat-switch panning.

Venom, you're sure making a lot of noise for someone who gave up posting here.
Title: Cockpit?
Post by: Nico on October 16, 2003, 01:41:02 pm
Quote
Originally posted by Sticks
This whole thing is getting a bit rediculous.

It's going to be about 20 times easier to do a bitmap cockpit than a true 3d one, hands down. I always thought 3d cockpits really sucked big time. I'll tell you why.

1. Blocky. Unless someone can get me a georgeous mesh with beautiful textures, it will look far worse than a nicely rendered bitmap cockpit. I'm talking tons of triangles. 5 - 20k would be good.

2. Transformations. I don't even want to think about the sh*t-tastic vector transforms I'm going to have to jump hoops through just to get the thing to render properly at the same spot every frame.

3. Slow. A 3D cockpit will suck resources, for sure. And especially in software T&L, we don't really have any more to spare.

I'd say point number one is my biggest problem. My other problem is implementation, and that is to say that I really don't know how I would implement the 3D version. And you can count out hat-switch panning.

Venom, you're sure making a lot of noise for someone who gave up posting here.


I gave up posting requests, give me a rest. But maybe you want to force me to shut up? Big boy :rolleyes:
And about making 2D stuff like that, have you ever tried? Coz I did. I know what I'm talking about, I wonder about you.
Title: Cockpit?
Post by: kasperl on October 16, 2003, 01:52:56 pm
Venom, he is saying that doing the cockpit in 3D in game is impossible, so from his POV, it is indeed easier to make a 2D one.

also, i regarded is last line as a joke. please, do the same, or ignore it. i know that if you're not in your best moods you might not see every joke as one, but please, ignore it then, no reason to start annoying eachother, let's just annoy n00bs instead. (j/k)
Title: Cockpit?
Post by: Nico on October 16, 2003, 02:02:27 pm
ok ok, sorry about that.
Title: Cockpit?
Post by: Sticks on October 16, 2003, 02:25:35 pm
Ok, that was way out of line Venom. I haven't been here as long as you, but it would be nice to see some respect for my contributions.

That line was a sarcastic jab, not meant seriously. And for your information, I have done a ton of 2d stuff, for a living I might add. Please keep you temper under control.

I'm sorry you took it the wrong way.
Title: Cockpit?
Post by: Nico on October 16, 2003, 02:31:32 pm
Ok, I said I was sorry, let's go over that, please, since I haven't even criticized anything you've done.
Besides, how long you've been on HLP is completly irelevant to me, a guy could register tomorrow and be better than you or me in our own fields, what matters is the skills, not a register date :)
Title: Cockpit?
Post by: aldo_14 on October 16, 2003, 03:47:40 pm
Sigh.  

I'll make the bloody cockpit bitmap, right? - i'll do it this weekend if time permits, by the end of the week in all likelihood.  it may be simple and relatively plain (no point cutting out half the view with an unused bitmap), but it'll be a usable test if Sticks decided to do this coding.  And if he does, and you don't like the idea, then i'm sure it'll be disable.  

And on the whole 2d vs 3d thing - i'm sure it'd be possible to alter from a 2D to 3D cokpit once technology makes it more feasible - I'd imagine the code would be modular enough to allow later extension, especially if the stuff is niocely encapsulated and toggle-able.