Talk:Porting GoldSrc content (maps, models, etc.) to Source

From Valve Developer Community
Jump to: navigation, search
Icon-message-48px.png
This is the discussion page of Porting GoldSrc content (maps, models, etc.) to Source. To add a comment, use the Edit button near the headline of the appropriate section. To create a new section, you can use the Add topic button at the top of this page.
Comments on talk pages should be signed with "~~~~", which will be converted into your signature and a timestamp.

Article scope

I noticed you added some info about a bunch of other engines and whatnot. I think it's better to have separate pages for separate engines and major engine revisions. This page should stick to just its namesake: porting GoldSus content to Sorse. The other information is beneficial to have on this wiki, but should be on separate pages, such as User:SirYodaJedi/Porting IdTech 3 maps to Source for Quake III (Nightfire should probs also be a separate page; it's basically unrecognizable from the Half-Life engine).
SirYodaJedi (talk) 14:38, 22 June 2023 (PDT)

I think you’re right, my goal was to simply combine many porting guides and try to make it suitable for everyone. Also, I have ported NightFire maps and actually this process has many differences (For example, converting not .wad but .png files, renaming outdated entities (they have other names)). but still has some similarities. However, I am still working on this article (some details may be cut later), and I will attach your guide as more specific for porting Quake content. --User:NOUG4AT 11:34, 23 June 2023 (PDT)

Detail textures

Detail textures use the same scale in Sorse as they do in GoldSus, even if they've been resized to a power of two (scale is based on how many times the detail texture repeats; see Detail textures (GoldSrc) and $detail. I converted the detail textures from Day of Defeat Day of Defeat (also in Counter-Strike: Condition Zero and Counter-Strike (Xbox)) to the optimal VTF formats for each given texture (I8 for greyscale, BGR888 for color); I'll try to remember to upload them to GameBanana and Archive.org sometime within the next month.
SirYodaJedi (talk) 05:07, 25 June 2023 (PDT)

Here it is; I've also included versions for Strata Source Strata Source, which use ATI1N and BC7 instead, to save GPU memory without any noticeable quality loss.
SirYodaJedi (talk) 09:25, 24 July 2023 (PDT)
Hey thanks. This will be helpful for porters.
NOUG4AT (talk) 11:08, 25 July 2023 (PDT)
Usage is pretty simple; if the detail.txt entry in GoldSus says foo detail/bar 4.0 3.0, then you put $detail "detail/bar" and $detailscale "[ 4.0 3.0 ]" in 🖿foo.vmt, assuming you put the detail texture in 🖿materials/detail.
SirYodaJedi (talk) 14:09, 29 July 2023 (PDT)
That's good! It's helpful to point this out in the article. Thanks also for your edits. It is problematic for me to edit due to cloudflare ban.
Noug4at (Talk) 15:11, 29 July 2023 (PDT)
Yeah, I get the cloudfare block if I try to edit the entire page, as well; I have to edit individual sections.
SirYodaJedi (talk) 16:17, 29 July 2023 (PDT)

Alpha channel abuse by xwad

Todo: Xwad creates an alpha channel for all WAD textures, regardless of if they have a { character designating that they should….

I discuss this briefly on the xwad page, but it could use some video explanation. Only the { textures from a WAD need to be transparent.
SirYodaJedi (talk) 05:07, 25 June 2023 (PDT)

I converted They Hunger They Hunger textures, and was unpleasantly surprised that almost all of the "wall" (materials) that shouldn't have an alpha channel, have one.
Noug4at (Talk) 15:16, 29 July 2023 (PDT)

Making Additive glass translucent without glowing

Oftentimes in GoldSrc, glass is made translucent by giving it the Additive rendermode. This unfortunately has the side effect of causing the glass to be fullbright and "glow" (in fact, goldsrc translucency can't be lightmapped, unlike Source). Glass surfaces can be made much more realistic when porting to Source by pre-generating an alpha channel from the RGB data instead of using $additive. I'll write a proper tutorial if I can remember, but the gist (using GIMP) is this:

  1. Import the image into GIMP.
  2. Change the color space to RGB.
  3. Colors>Components>Decompose[1]. Make sure "decompose to layers" is selected, and color model is "RGB", then click okay.
  4. In the new image, change all layers' blend modes to "Lighten only".
  5. Flatten the image.
  6. Copy the flattened result to your clipboard, then close the tab (returning to the original image).
  7. In the original image (which should still be RGB), right-click the layer, and add an alpha channel.
  8. Decompose again, this time with the color model set to "RGBA".
  9. Select the alpha layer, and paste the clipboard, then hit the button that applies it to the original alpha layer.
  10. Colors>Components>Recompose
  11. Export the original image (which now has translucency) as TGA, then convert to VTF (DXT5 or BGRA8888).
  12. Put $translucent 1 in the VMT. For reflective glass, also add $envmap "env_cubemap" and $basealphaenvmapmask 1.

I personally manually flip the alpha channel I created and use that as an I8 $envmapmask, since some branches (like Counter-Strike: Global Offensive) don't like using $basealphaenvmapmask with $translucent, and $basealphaenvmapmask isn't flipped on models in CS:GO engine branchSource 2007, but this does take up more space.

Came up with this method while porting almost all the assets from Day of Defeat to Day of Defeat: Source (still a long ways to go).
SirYodaJedi (talk) 16:01, 31 January 2024 (PST)

Hey, Thank you so much for sharing your methods! You are one of the main contributors to this guide, if you also know more... info from your side will be useful! Thanks, I'll try your method when I port the maps (glass).
NOUG4AT (talk) 21:50, 31 January 2024 (PST)