Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: IPAndrews on November 15, 2002, 03:12:21 am

Title: substitutable textures
Post by: IPAndrews on November 15, 2002, 03:12:21 am
Something I just mentioned in the TBP internal forum inspired by Bobboau's comment that INSG aren't lit correctly and (as it sounds) are treated like a bit of a hack. How about having certain texture names which can be assigned to a .pof (say "changable1","changable2",etc...) which are substituted with a texture name assigned to the ship via FRED, or use a default texture name taken from ships.tbl

These changable textures could be used to give name plates to capital ships, or use the same .pof with different texture sets to create different ship classes.

Just a though, and as usual, probably total waffle. If it is then please refrain from executing me. I've been around the FS2 community for a while and as such should be immune from the execution thing. As you may be able to tell, you lot scare me :)
Title: substitutable textures
Post by: Nico on November 15, 2002, 04:05:46 am
would be nice for freders who have a lot of time on their hand:
alpha01 to 04, they have alternative maps with their own numbers written on the ship, for exemple :) or different camos for a single pof, stuff like that...
Title: substitutable textures
Post by: IPAndrews on November 15, 2002, 05:53:01 am
Would give TBP the opportunity to use different wingart for Star Furies (by assigning different textures in FRED). Or have different classes of Star Fury in the ships.tbl with different capabilities and default textures (ie: Black Omega) whilst using the same .pof.
Title: substitutable textures
Post by: Fury on November 15, 2002, 07:21:57 am
Quote
Originally posted by IPAndrews
Would give TBP the opportunity to use different wingart for Star Furies (by assigning different textures in FRED). Or have different classes of Star Fury in the ships.tbl with different capabilities and default textures (ie: Black Omega) whilst using the same .pof.


That is already possible. Just open up FRED2 and go to Editors --> Mission specs and there is Squadron Reassign where you can give a new name for your squadron AND new squadron logo.

Logo is then showing up ingame in proper place, depending on ship. Didn't you notice in FS2 main campaign that your squadron logos changed sometimes?

Or did you again mean something else?
Title: substitutable textures
Post by: Nico on November 15, 2002, 07:31:59 am
Quote
Originally posted by Mr. Fury


That is already possible. Just open up FRED2 and go to Editors --> Mission specs and there is Squadron Reassign where you can give a new name for your squadron AND new squadron logo.

Logo is then showing up ingame in proper place, depending on ship. Didn't you notice in FS2 main campaign that your squadron logos changed sometimes?

Or did you again mean something else?

I guess those B5 ships have completly different larkings, ala starwars: gold squadron fighters have yellow strips, etc.
Title: substitutable textures
Post by: IPAndrews on November 15, 2002, 07:41:43 am
Quote
Originally posted by Mr. Fury
Or did you again mean something else?


Those are INSG, they aren't lit correctly, they hover over a ship's surface in a slightly odd decalish fashion, and are generally quite a bit naffer than what I'm suggesting. Technically.
Title: substitutable textures
Post by: Fury on November 15, 2002, 07:43:39 am
I see, nevermind then. :)
Title: substitutable textures
Post by: tomcat on November 15, 2002, 08:35:36 am
Or USE GD ti write onto a texture file:D
Title: substitutable textures
Post by: Bobboau on November 15, 2002, 09:51:42 am
I might be able to make it so a subobject with "decal" in it's name is rendered with what ever texture is desired
Title: substitutable textures
Post by: IPAndrews on November 15, 2002, 10:50:33 am
Not quite what I had in mind, although you probably know that. Surely the bit about picking up texture names from the ships.tbl should be simple. Before loading a .pof's texture, check to see if the name is "changableXX", if so substitute it's name with texture XX from the ships.tbl. No changes needed to the rendering engine or anything.

Assigning textures on a ship by ship basis in FRED2? Not sure how that would work. That probably would mean render engine changes to use the correct texture when rendering a ship.
Title: substitutable textures
Post by: Bobboau on November 15, 2002, 01:43:55 pm
it's wouldn't be that hard
Title: substitutable textures
Post by: EdrickV on November 16, 2002, 02:25:21 am
Special case textures are possible, and are used both for thrusters and "invisible" faces. Exactly how to handle a case where 1 POF has several different "skins" is an entirely different matter and could be pretty complex. (AFAIK, a model file is only read once and that data is used for all ships using that model, with the exception of insignia and thruster data.)
Title: substitutable textures
Post by: IceFire on November 17, 2002, 04:08:01 pm
In another case...the Omega nameplate could be changed by selecting a texture from a dropdown list (like all of these other possibilities).  If there was no custom texture assigned, the default texture would be assigned for that ship.
Title: substitutable textures
Post by: EdrickV on November 17, 2002, 08:00:52 pm
The hard part about swapping textures is not the interface. That's a relatively easy thing to do. The problem is that, as I understand it, if you made simple code to replace a given texture with a user specified texture, you would be changing the texture for every ship that uses that POF file. (In otherwords, if you changed a nameplate texture for Alpha 1, it would change it for Alpha 2, 3, 4, etc. if they are all the same ship type.) That could be useful for cap ships with specific nameplates, but you can do the same basic thing without source code modifications the way they did the Bastion. There is, as far as I know, only one instance of the POF data (including textures) for any ship type in memory at any one time. Some things that are expected to be dynamic, like subsystem data, are copied to a seperate structure which has one entry per ship in the mission. Textures are not intended to be dynamic and stuffing more info into the regular ship structure would likely break network play and who knows what else.
Title: forget me if i'm wrong
Post by: kasperl on November 18, 2002, 01:38:26 pm
what about the squadron logo`s? can't you simplymake them as big as the entire area you want to cover?

(plz forgive me if i'm wrong, i'm not a godd programmer)
Title: substitutable textures
Post by: Bobboau on November 18, 2002, 01:47:24 pm
that's what I did but they arn't lit so it wasn't good enough, so now I'v gotten some keywords in subobjects to render them with the nameplate texture
Title: substitutable textures
Post by: Slasher on November 23, 2002, 06:03:20 pm
Quote
Originally posted by Mr. Fury


That is already possible. Just open up FRED2 and go to Editors --> Mission specs and there is Squadron Reassign where you can give a new name for your squadron AND new squadron logo.



One of the biggest problems with this default feature, in conjunction with TBP missions, is that the selected decal is applied to all friendly fighters in the mission without exception.  You can't diversify; if one fighter has a hammerhead on top, all friendlies will.

As we saw in Babylon 5, this wasn't always the case.  We often saw fighters/pilots with their own individual, unique decals.  Sheridan had is own, Lochley had her own, Ivanava had her own, etc.  It could be a privlege reserved for senior officers, but I have a feeling it's available to all Starfury pilots (see the Line in ItB; Mitchell and Sinclair's fighters). :)
Title: substitutable textures
Post by: IPAndrews on December 10, 2002, 08:35:55 am
Quote
Originally posted by Slasher

We often saw fighters/pilots with their own individual, unique decals.  Sheridan had is own, Lochley had her own, Ivanava had her own,


These patterns change the whole look of the Star Fury. It's not just a simple decal pasted on a wing. A whole new texture set is needed. Perhaps with polys having to be sorted by texture anyway for HT&L this will make it easier to implement substitutable textures.
Title: substitutable textures
Post by: Bobboau on December 10, 2002, 10:30:20 am
ok how's this

+alternate_texture:
   1, new_texture
   5, another_texture
the number refers to the texture index on the model, the string is a new texture.
Title: substitutable textures
Post by: Scuddie on December 11, 2002, 06:20:42 am
Well, let me give my thoughts on this.  I think that FRED should be able to recognise all the images in the maps folder.  That way, it wouldn't require the user/creator to modify the tbl file every time a custom skin was created.  I think it should look like this for a custom Ulysses.  I don't know the exact name, so forgive me if I'm wrong.

fighter01-03a.pcx
fighter01-03a-Blue.pcx
fighter01-03a-Rusty.pcx
fighter01-03a-Pink.pcx

If you can see what I mean by that, well, good for you.  There should be a dropdown menu displaying all the available images, etc.  I'll let you figure out the rest, cause I'm tired and I'm going to sleep now.  Staying up until 4:15 AM = Bad.
Title: substitutable textures
Post by: tomcat on December 12, 2002, 03:32:51 am
dooh ...the simple way to put it is ..We want to have skinable models:)
Title: substitutable textures
Post by: IPAndrews on December 12, 2002, 03:36:54 am
Bobboau. When you refer to the "texture index on the model". What exactly do you mean? It doesn't sound like something which would be easy to obtain or keep track of. Would a straight text search and replace not work better?

+alternate_texture:
old_texture, new_texture

ala (at ship class data read time):

for all textures {
for all old textures {
if (texture = old texture) texture = new texture
}
}

What are the difficulties involved with this?
Title: substitutable textures
Post by: IPAndrews on December 12, 2002, 03:53:41 am
Alright. Tomcat has told me over ICQ that we want SKINS. He also mentioned that if I say SKINS people will understand what I'm talking about. Pardon me for my ignorance. I don't know what I'd do without Tomcat. Probably get on with my life without worrying about frickin' SEMANTICS.
Title: substitutable textures
Post by: Fury on December 12, 2002, 05:46:00 am
Hey IP, don't forget what general Lefcourt said to Londo "In the Beginning". ;) (about minbari warrior caste)

Hehehehehe...

Well anyway, idea is good. Let's wait what coders says. :)
Title: substitutable textures
Post by: Bobboau on December 12, 2002, 08:31:41 am
I'm talking about the section of the pof data that holds the textures being used, every texture is geven a name and a number, once in game it only has the number wich is an index to another number wich is the texture number (another index, so it's an index to an index)

the thing is I don't think the name of the texture is held past the inital loading of the texture, and I already have it nearly set up to work this way, but if you know the name of the texture you want to change you also probly know it's texture number

so you give a texture number (the number in the model of the texture you want to change) and the name of the texture you want it to replace
Title: substitutable textures
Post by: Goober5000 on December 13, 2002, 03:56:19 pm
In the same vein, this would probably allow cloaked ships to be implemented.  The cloak-ship sexp would cause every texture on the ship to be replaced with "invisible", and the decloak-ship sexp would restore the original textures. ;7
Title: substitutable textures
Post by: Bobboau on December 13, 2002, 07:52:20 pm
I'd rather have some sort of cool looking efect rather than just "POOF!" gone
Title: substitutable textures
Post by: Goober5000 on December 13, 2002, 08:10:11 pm
Yeah, me too.  But effects aside, the final effect will be the same.  We can work on the cloaking effect after we get the actual cloak working.  (Implementing the cloaking effect might be as easy as adding another shield .ani.)

Perhaps an alternative method would be to swap the ship class (and thus the POF) in-mission... e.g. from Pegasus to Pegasus-cloaked.
Title: substitutable textures
Post by: Bobboau on December 13, 2002, 08:13:35 pm
I think it would look better and be easier if we just lowered the alpha level of the textures being rendered over the corse of a few seconds untill they were fully transparent, then just flag the ship not to be rendered
Title: substitutable textures
Post by: Goober5000 on December 13, 2002, 08:14:59 pm
Hmm.  I'm not familar with alphas and stuff, but that sounds a lot simpler.  If it works,  then :yes:.
Title: substitutable textures
Post by: Bobboau on December 13, 2002, 08:43:44 pm
I have implemented transperency in textures quite a while ago, thugh this sort of thing is the only thing it would likely be good for
Title: substitutable textures
Post by: Scuddie on December 14, 2002, 03:18:33 am
May I have your attention please...  This thread is now officially
HIJACKED!!

;)


But I have an idea...  Maybe Bobboau can make flags for shipmodels to have custom skins...  Kinda like the glowpoints, but make it look for fighter01-03a-alt1 or something, and a bitflag can determine which skinset is loaded??