Garry's Mod

Garry's Mod

Not enough ratings
How to port Goldsource content (Maps, Models, etc) to Source
By NOUG4AT
Porting goldsource content to source - in text only.
   
Award
Favorite
Favorited
Unfavorite
Preparing for Porting
=== Map selection and analysis ===
I will use "ts_constryard" as a map for decompilation. This map was designed for The Specialists, a Half-Life mod. I decided to use this map because it is indicative for porting (due to the presence of embedded content).

==== The map uses the following content: ====
Kit (.WAD) : Consisting of 68 .bmp materials
Модели (.MDL): «bank, water box, water box2, truck, fire hydrant, jeep, pa»
Skybox (.TGA): «ts_constryup, ts_constrylf, ts_constryft, ts_constrybk, ts_constryrt, ts_constrydn»
Soundtrack (.WAV): "passaros, techno"

==== List of files to be converted: ====
From .TGA (Old Format) to .VMT and .VTF (New Format)
From .SPR to .VMT and .VTF

==== Getting sources ====
Map decompilers sound like absolute magic at first. Usually when you compile something, you turn it from something beautiful and readable to absolute gibberish. GoldSrc maps do not store the original brush data inside the compiled level. HLCSG takes the brush and breaks it into six faces before removing the ones you can't see in the game. (When brushes touch each other, the surviving faces often separate even more.) As a result, decompilers have to recreate the brush from scratch. There are notable differences between the outputs of both.

==== Choosing a tool for decompiling a map ====
We can conclude that WinBSPC parses maps better than BSPtwoMAP. However, the disadvantage of this decompiler is that the limit for .bsp files is ~ 4 MB. Therefore, I will choose MBSPC as a decompiler (which does not have this limit, and the decompilation results are similar to WinBSPC).
Porting Process
=== Material porting ===
In order to get the map textures, I will use Wintextract. It is necessary to highlightbsp file and then specify the folder [output] and get the textures (in the format WAD).
After doing this, I got WAD this map file. As a conversion tool I will use XWAD. (Official SOURCE SDK, in order to convert the old texture format to the new one) Please note that the steps are performed with the pre-installed Source SDK (downloaded via Steam) on Windows 7.
# Start button
# Click Run
# Type "cmd" and press Enter.
# Specify the location of xwad.exe (for example, cd“\SourceSDK\bin\ep1\bin\xwad.exe”)

==== Commands to be used: ====
-basedir [Output] -wadfile [Files Directory\*.wad]
After this operation, the "Materials" and "Materialsrc" directories will be created in the specified [Output] folder. The [/materials] folder will contain the VMT files. The [/materialsrc] will contain the TGA files that need to be converted to VTF.

==== To convert TGA to VTF I will use VTFEdit ====
Tools🡪 Convert Folder 🡪 specify folder [input] and [output] 🡪 Convert
Input (Location of files to be converted).
Output (Output of converted files)
==== With settings: ====
normal format
BGR888 //For better texture quality, alpha format
DXT5 // Interpolated alpha channel (recommended)
To VTF .tga //To work with the required format.


After the conversion, I received VTF files that are ready for use.
In theory, it was possible to unpack the wad file and then get the bmp textures and convert them using VTFEdit. But this is not the correct way, as some of the textures used in Goldsource have non-standard values, or unequal powers of two. For example, a 96x96 old format texture will be stretched. XWAD automatically creates an additional texture_name.resizeinfo file (which scales the material to the desired size)
A similar operation with VTFEdit must be performed with sky textures. Be sure to use the “Create VMT Files” function, which will create files containing information about the type of material. The output folder must be named materials\ (since the game will look for files in a directory with that name). After the conversion, you need to change the parameters of the VMT files so that they work as sky textures. Using the same program, change the values from LightmappedGeneric (brush shader) to sky (sky shader), and add the line “$ignorez 1” It should look like this (using ts_constrybk as an example):

sky { $ignorez 1 // this is a boolean setting. Mainly used for UI materials, which will always be ahead of the 3D world, and skybox materials, which will always be behind. "$basetexture" "skybox/ts_constrybk" //texture directory (Finding the sky texture is strictly in the “skybox/” directory) }

You also need to convert spr files to a new format. Using XWAD, we convert spr files with the command -basedir [Output] -sprfile [Location of files\*.spr]. After that, we get tga files, which we convert to vtf using VTFEdit without the “Create VMT Files” parameter
You need to set them up so that they work like sprites in the game. To do this, I'll change the value of the first line from "LightmappedGeneric" to "Sprite" (it's a rendered world object with very special geometry.)
You need to add new lines with the following values:

"$spriteorientation" "vp_parallel" //sprite orientation. vp_parallel - sprite is always facing the player "$spriteorigin" "[ 0.50 0.50 ]" // Sprite center, location


It should look like this (using folhas1 as an example):
Sprite { "$spriteorientation" "vp_parallel" "$spriteorigin" "[ 0.50 0.50 ]" "$basetexture" "sprites/folhas1" //Texture Directory }


After all the textures of the map have been converted, you need to configure them (VMT).
Since Goldsource is an old engine, many textures today do not look the best, so that they are better, I will add the following commands to each texture:

"$detail" "detail/detail_noise1" //This texture is found in Half-Life 1: Source VPK files, very effective for increasing the apparent texture resolution "$detailscale" 10.0

To get this texture you need to download Half-Life 1: Source, go to the directory “…/Half-Life 2/hl1/” and open the file “hl1_pak_dir.vpk” with GCFScape. Go to the directory “root/materials/detail/” and find the file “detail_noise1”

Archive it, and send it to the “…materials/detail/” directory with the ported textures. We go to the location of the textures, and delete the following vmt and vtf materials with the names: “{invisible”, “sky”, “skip”, “{blue”, “clip”, “hint”, “null” (They are already built in by standard in the Source Engine, and before they had to be built into the map, change on the map to other similar textures)
Now each texture will need to be configured by adding a command to them
$surfaceprop "which object's physical properties will be applied"

The $surfaceprop command associates the surface of a material or model with a set of physical properties, including:
What sounds are made during collisions
What effects are emitted when a surface is shot
Mass, buoyancy, elasticity...
Influence of the surface on nearby sounds (reverb, echo, absorption...)
Material Surface Properties
This is a list of the physical surface types that Source recognizes, as specified in the files referenced in '\scripts\surfaceproperties_manifest.txt'

In order to understand what physical properties should be applied to a particular material, you need to drag the BSP map file into the directory with “Half-Life/valve/maps/” and start Half-Life 1.
When the menu loaded. Click on “Create Server” 🡪 Map (Choose ts_constryard) 🡪 and click “Start”. Then you will be loaded into this level.

This method is needed in order to determine the physical properties of objects. (This is not mandatory, but serves to improve the quality).
(in this case, when shooting at them and dealing damage to the necessary textures, decals of a specific material will fly out from them). But even if during the gameplay, it is not clear what material to assign to the texture. You can do it by eye (or by the name of the texture, for example the texture is called "grass" therefore you need to assign the physical properties of "grass" (grass)). Example texture setting “{gate.vmt”:

"LightmappedGeneric" { "$basetexture" "tsconstr\{gate" "$alphatest" "1" //It specifies the mask used to determine the binary opacity. "$ALPHATESTREFERENCE" "0.5" //Specifies the minimum alpha color value at which the effect is rounded up to 255. "%compilepassbullets" 1 //Makes the brush behave like a lattice, passing bullets but blocking other objects. Useful for foliage or metal trellises. "$detail" "detail/detail_noise1" "$detailscale" 10.0 "$surfaceprop" "metal" //In this case, the physical properties of the metal are applied. }

A glowing texture is one that doesn't require another form of light to be illuminated. It can create its own light map, independent of all light sources, and can even create light itself. This does not mean that the surface will appear pure white, just that the face will ignore any light it receives. This is a key feature as "luminous" black stays black and doesn't get brighter. The face reaches what is called full brightness when the texture pixels look exactly the same color as they were saved. There are several different ways to create this effect in the Source engine. For glowing textures on models or brushes.
There will also be textures that will need to add an alpha channel (transparency effect), for example '+a~tnnl_lgt3' in order for this texture to have a glow effect (of a specific area):

$selfillum //parameter whose value can be 1 (enabled) or 0 (disabled), specified in the material's VMT. - Use this for most purposes not compatible with transparency. (Alpha channel is optional)
Porting Process #2
I will add an alpha channel using Adobe Photoshop CS6 with the pre-installed VTF plugin. (The Adobe Photoshop VTF plugin allows you to open and save single-frame, one-sided 2D textures directly from Photoshop without having to convert them to an intermediate format such as a TGA file. Multi-frame/polyface/3D textures can also be opened, however only the first frame/ face/layer - The plugin is built on VTFLib and does not support all the advanced features found in VTFEdit .)

Adobe Photoshop is a multifunctional graphics editor developed and distributed by Adobe Systems.
==== Plugin installation: ====
Adobe Photoshop
Close Photoshop.
Extract VTFLib.dll to ..\Photoshop\ folder.
Extract the VTF.8bi file to ..\Photoshop\Plug-Ins\File Formats\ folder.
Launch Photoshop.

It is necessary to leave those objects that will be part of the alpha channel (in this case, the middle of the lamp should remain, and the edges should be deleted).
Press CTRL+C 🡪 then DELETE 🡪 CTRL + S (save as VTF, DXT5 format). After saving, close this texture, and open it again (and paste the copied object with the CTRL + V combination, we got two separate layers. Now again save as VTF)

In this case, everything turned out correctly, to check if the alpha channel works, open the texture using VTFEdit. Find View 🡪 Turn on Mask.
We do a similar operation with similar textures of fixtures. Their VMT file must be modified as follows:

"LightmappedGeneric" { "$basetexture" "tsconstr\+0~tnnl_lgt3" "$detail" "detail/detail_noise1" "$detailscale" 10.0 "$surfaceprop" "glass" "$selfillum" 1 // Texture Luminosity (alpha channel) "proxies" { "ToggleTexture" { "toggletexturevar" "$basetexture" "toggletextureframenumvar" "$frame" } } }

“ToogleTexture” You will now be able to use the signage file in Hammer. Apply it to the brush and use env_texturetoggle and logic_relay to animate (This is optional in this case).
Sometimes you have to make an animated texture (of several).
For example, when you call the elevator. The button lights up 🡪 then goes out. (We add the alpha channel of each of these textures in advance, as in the previous steps). In this case, I need to concatenate "+0~drkmtls3" and "+a~drkmtls3". Open VTFEdit 🡪 File 🡪 Import (We use “All formats”) 🡪 When everything is selected, click “Open”. Import textures with the following values (Required Texture Type, in this case it is an animated texture, it must be played in the off (+a~drkmtls3)-on (+0~drkmtls3) format. If suddenly it is saved in the on-off format. Rename the disabled texture to 0 and enabled to 1.

After the performed operations, we received an animated material to test it. In the Image 🡪 Play item (press and see the switch).
After you have verified that it works, you can save the file. File 🡪 Save As… 🡪 to VTF format and save as ‘+0~drkmtls3' (because such a texture is already assigned on the map). We also change the VMT file of this texture, the final version should look like this:

"LightmappedGeneric" { "$basetexture" "tsconstr\+0~drkmtls3" "$detail" "detail/detail_noise1" "$detailscale" 10.0 "$surfaceprop" "computer" "$selfillum" 1 //Luminance "proxies" { "ToggleTexture" { "toggletexturevar" "$basetexture" "toggletextureframenumvar" "$frame" } } }

In this case, "ToggleTexture" is required because this material will change. (For example, when a button is pressed, it lights up). We do similar operations with similar textures.

=== Porting models and their textures.===
As a tool for working with models, I will use Crowbar. For Crowbar to work, you need to have Half-Life 1 (for decompilation) and Half-Life 2 (for compilation) pre-installed. Before starting the decompilation process, I will create a separate folder for each mdl file in accordance with the name (Sometimes after decompiling the smd reference models may be the same, this leads to confusion, the model collision will be incorrect)

To start working with this tool, you need to go to the Set Up Games item 🡪 Specify the directory of the Steam library with pre-installed Half-Life 1 and Half-Life 2. After setting.
To decompile, go to the Decompile 🡪 item and use the Decompile button. where MDL input (Folder and subfolders) is the location of the models to be decompiled. And Output to (Work folder) output of source files after decompilation.

After the operation, folders will appear (in the specified directory) that will contain the source files of the models. They cannot currently be compiled on the Source Engine. Since they contain obsolete values (which will cause errors), in order to fix this incident, you need to edit the .qc of each model. I will show on the example of the banco model:

// Created by Crowbar 0.71 // Stored modelname (without quotes): "D:\3D Studio Max Models\Devastation\Bench3\bench3.mdl" $modelname "banco.mdl" $cd "." $cdtexture "." //converts clipart to textures $cliptotextures //tells the compiler to convert .bmp to textures. $scale 1.0 $bodygroup "body" { studio "bench3" } $flags 0 //(parameter that controls the visualization of materials) $cbox 0 0 0 0 0 0 $bbox 0 0 0 0 0 0 $hbox 0 "joint1" -14.22 0 -39.560001 17.540001 46.57 50.919998 $sequence "idle" { "banco_anims\idle" ACT_IDLE 1 fps 30 loop }

Red marks obsolete lines that no longer work.
You need to remove these commands and replace with the following:
“$flags 0” 🡪 “cdmaterials” [model texture directory\].

$cdmaterials (Specifies the folders in which the game will look for the materials of the model (subfolders are not searched. Each path is associated with <game>\materials\.)

An interesting feature of the Goldsource engine, textures are built into the model. In the Source Engine, textures are separate from the model.
It is also necessary to add the following values in order for the model to have a collision:

$collisionmodel "[reference name].smd" { $automass // Calculates the mass of the model based on the volume of the collision model and the material. $concave //Smooth out shell shading }


Such an operation must be done with each QC file of the source code of the model. (Final version using banco.mdl as an example):

// Created by Crowbar 0.71 // Stored modelname (without quotes): "D:\3D Studio Max Models\Devastation\Bench3\bench3.mdl" $modelname "constryard\banco.mdl" $cd "." $scale 1.0 $bodygroup "body" { studio "bench3" } $cdmaterials "models\banco\" $collisionmodel "tree_deciduous_01a_physbox.smd" { $automass $concave } $cbox 0 0 0 0 0 0 $bbox 0 0 0 0 0 0 $hbox 0 "joint1" -14.22 0 -39.560001 17.540001 46.57 50.919998 $sequence "idle" { "banco_anims\idle" ACT_IDLE 1 fps 30 loop }

I will compile models with the same tool, go to Compile 🡪 point “Game that has the model compiler” and specify Half-Life 2. Selecting directories. Click on the Compile button.
In the specified [Output to] folder, check if mdl files have appeared according to the number of QC files. In my case there are 7 of them.

After decompiling the models, images of the bmp format appeared in their source files, you need to convert them using XWAD to the texture format.
Similarly as in the previous step, but with the help of the command:
-BaseDir [Output] -BmpFile [Location of files\*.bmp]
Each texture must have its own directory under $cdmaterials (during compilation, the game will look for materials for the model in the specified / directory).
After converting from bmp to tga, use VTFEdit to convert from tga to vtf without the "Create VMT Files" option.
You need to edit the vmt files generated by XWAD.
The files should be changed like this (for example, banco.mdl, bench1a.vmt):

"VertexLitGeneric" //Model Shader { "$basetexture" "models\banco\BENCH1A" //location of textures, according to .qc $cdmaterials. }

64
Map porting
== Map Porting ==
As a program for decompiling, I will use MBSPC.
Start button
Click Run
Type "cmd" and press Enter.
Specify Location [mbspc.exe]

With the following commands:
--cluster //compute level clusters
-optimize //optimize
-capsule //use spherical collision model
-bsp2map220 //convert BSP to Valve's MAP 220 format

To decompile, just open the .bsp file with mbspc.exe

To open the converted MAP file, you need to convert it to RMF format, for this I will use J.A.C.K.
Hammer Editor can open files with the MAP extension, but in this case it cannot be done. Opening will result in an error:

With J.A.C.K. save the MAP file with the RMF extension.
For J.A.C.K to work, you must have Half-Life 1 pre-installed. And specify the Half-Life 1 SDK directories. You need to go to Tools 🡪 Settings 🡪 Game Profiles. Where it will be necessary to specify directories in some paragraphs.

After this operation, the resulting file can be opened in the Hammer Editor.
As a program for editing the map, I will use the Valve Hammer Editor located in the Source SDK directory [/bin/hammer.exe]
Hammer is already configured according to the standard. But if you have problems, go to Tools 🡪 Options 🡪 Game Configurations and set up directories.

At the top left in the corner we find File 🡪 Open 🡪 select the .rmf format and open the decompiled file.

Opening the map you can see that it has no textures.
They need to be applied. Going to “File 🡪 Convert WAD to VMT…”
The “Convert WAD to VMT…” tool will apply the textures that I have already converted.
If something is done wrong, then instead of this message, lines will appear stating that some textures are missing.
Next, find errors related to the texture axis, for this you need Crafty (Object Viewer). Program for viewing bsp and bsp, .gcf, .ncf, .pak, .vpk, .wad, .xzp files. It is necessary to compare the original version that turned out and the original work.
The textures are incorrectly placed, this needs to be manually corrected. Select the surfaces using the "Toogle Texture Application" tool. Selecting the Toggle Texture Application tool brings up the Face Edit Sheet dialog box.

Problems - Rotation.
Change the “Rotation” value from 180 to 0.
Some textures may not be rotated correctly. You need to change the Align value from World to Face.
These flags allow you to set the texture layout style for selected faces. If the World flag is activated, then the texture will be relative to the coordinate system of the world. If the Face flag is selected, then the texture is relative to the coordinate system of the selected face. Manually compare the original file and the source. Fixing similar issues. If changing the "Rotation" parameter did not help. You can try using Justify (Alignment) 🡪 Fit (Scale to face size).

It also happens that the decompiler applies the wrong texture to the surface of the entity (should be null).
Use Browse (Opens the Texture Browser)
🡪 look for the nodraw texture (to speed up the process, find the “Filter” tab and enter “toolsnodraw” there). And apply it to similar surfaces.
This is necessary in order to optimize the map, since the player will not see this texture in any way (during the gameplay). If this is not done, then there will be an extra load on the computer.

Sometimes none of the functions can help, in such situations the dimensions must be corrected manually. In this case, I used "Texture shift" and manually set the "X Axis" value.
It also happens that the texture is incorrectly applied to several brushes (two separate surfaces), on the example of buildings:
To fix this, you need to activate "Treat as one". If you have multiple faces selected, you can enable this flag to make Face Edit treat them as one big face. Mainly used in tandem with Fit. Select all surfaces and after pressing “Fit” this ailment will be eliminated.
But if this does not help, you have to set the values \u200b\u200bmanually. You can take values from similar surfaces (to make correction easier) and edit the “X and Y” axis manually.

You can sometimes encounter errors that another texture is superimposed on the brush (instead of woods_wood2, the compensado texture is superimposed):
It's easy to fix. Browse 🡪 find the texture named woods_wood2 and replace the misplaced material)
Checking the map for errors.
Using the ALT + P combination will make Hammer scan your map and notify you of any errors it finds.
Selecting one of the errors will highlight the /solid object (if applicable) and give you three options: Go to error - This button centers the 2D and 3D views on the object that the error refers to. Fix - This button will attempt to fix the currently selected error. Fix all (type) - Using this button will fix all errors of the selected error type.

If you scroll down, you can find “Invalid solid structure” errors that need to be fixed. (The rigid body has an invalid structure, probably as a result of vertex manipulation. This means that the rigid body is not convex in all planes.
You will need to either fix it or, if that is not possible, rebuild it.) You must click “Go to error”. And check what it is. If you press “Fix”, the model may change its shape (but this will mess up the structure in the sense that it will not match the original). It needs to be recreated.

After this operation, the structure deteriorated. There is an option to recreate the structure manually, but I will use another method. I decompile the map with BSPtwoMAP and take this brush from there.
Similar to the previous step, export the part from map to rmf using J.A.C.K. and open the resulting file in the Hammer Editor and apply the textures.
Further, in accordance with the size, insert at the same coordinates (Sometimes the model cannot be placed in the same place due to the fact that the grids are large, this can be fixed using the “Smaller Grid” function, after which we delete the old structure using the DELETE key.
This structure has many problems (related to the texture axis and incorrect structure):

You can simplify the patching process by taking some of these structure brushes from "BSP2MAP".
BSP2MAP did not parse the map in the best way (the brushes inside have space) to optimize the brushes of this structure, you need to replace the textures with –nodraw (these zones should not be drawn, the player will never see them). On the example of brushes:
If nothing happens from pressing “Fix”, delete this brush. It happens that there is a problem “Invalid solid structure” with those brushes that are already on the map (or very similar ones). Simply duplicate another brush, select the desired brush, copy and paste it. And with the help of the grid, insert it at the required coordinates.

We open the dialog box with the ALT + P combination and fix the remaining problems with the “Fix all (of type)” command for each entity. (which are related to the fact that obsolete values are used). If suddenly the error “There is no player start.” Then it will be fixed when we create a spawn location (player). But at the moment we don't need it.
On the map, you could see the following objects that are not something functional:
Deprecated entities usually don't work. Usually what they have done can be done better with something else. In this case, using the Hammer Editor, we find some of them, and remember their name.
Even relatively modest levels can contain hundreds - even thousands - of objects. Hammer offers two ways to keep track of elements in your level: normal grouping and visibility grouping (VisGroups). To quickly detect each obsolete entity, it is enough to use the “VisGroups” 🡪 “Auto” window. And uncheck everything except "Brush Entities"

In this case, it is easier to find obsolete entities, but before deleting them. Move to the File item 🡪 Save As… 🡪 Specify vmf format
Now open the saved vmf file with Notepad++. (Close the Hammer Editor).
Map porting #2
It is necessary to use the combination CTRL + F 🡪 to find the item “Replacement” and in “Find:” enter “ts_model” (Obsolete entity that no longer works). And in “Replace with:” enter “prop_dynamic” (this is a point entity available in all Source games. It is used to add a model to the world that can animate itself. In our case, this is optional). Then click on “Replace All” after which obsolete entities will be replaced. And then find any line, replace “Find:” with “Prop_dynamic” 🡪 Find next. After that, we can see the lines of the models, and there will be their directory. On the example of the model “hidrante.mdl” located on the line 53460.
We also replace info_player_deathmatch with info_player_start in the same way. And Cycler (Used to display the model for test purposes. Once enabled, the model will play available animations.) on prop_dynamic.

Should be changed according to the location of the model. In my case, I replaced "model" "models/ts_constryard/hidrante.mdl" with models/constryard/ hidrante.mdl. To simplify the process, we do it as in the previous step (replacing all the lines with the necessary ones at once). Then use the item File 🡪 Save. And run the resulting VMF file. Models work, example:
Use the VisGroups dialog 🡪 uncheck everything except Brush Entities. We delete all obsolete entities manually, selecting them with the CTRL key 🡪 and deleting them with the Delete button. In our case, we remove all entities with the names “ts_groundweapon” and “ts_powerup” (These are the entities from the modification for which this card was created. In this case, it is a weapon and an ability). After the done operations, we return all objects in “VisGroups”.
After saving the RMF file to VMF. Holes appeared in the structure from BSP2MAP.
This can be fixed by recreating this brush, or an easier way to have a similar brush next to it. Assign it to the same coordinates where it should be.
After compiling the map, holes appear in this structure (which are not visible in Hammer), to fix this problem, we optimize this brush by turning it into a model using the official Propper tool.

Set up sprite entities on the map. Open VMF file with Notepad++. We search through the search for “env_sprite” in order to change the sprite directory (in my case this is required). I change all sentences from "sprites/ts_constryard" to "sprites". Open the map in Hammer Editor. Select all the "env_sprite" entities. Having selected all the entities, we group them with the “CTRL + G” combination. Go to the properties of these objects. And set them up like this:
Render FX/Transparency (0 - 255) (renderamt) <integer>
The transparency value requires a rendering mode other than Normal . 0 is invisible, 255 is fully visible.
Color - Sets the RGB color for the object.
Disable Receiving Shadow - Prevent the entity from receiving shadows on itself.

Now “Env_sprite” looks like this, too much blue… This needs to be corrected using Adobe Photoshop.
Need to open VTF sprite files. Using the Color Range Tool (🡪Selection). Select the entire blue area. And then in “Hue/Saturation” (Image 🡪 Adjustment) lower the brightness so that the color becomes “black”.
After the actions taken, the situation will improve. Add Clips to the map (corresponding to the original, Clip textures are invisible tool textures that restrict movement, usually of the player(s).
Let's optimize the map using the -Nodraw texture, which was discussed earlier. But I remind you that it must be applied to those surfaces. Which the player will never see, in my case I had to fly out of the map. And we can see the cube. It is necessary here to cover all textures with “–Nodraw” (Skybox texture can be left).

We change the old entities. From Func_illusionary (Originally added as a deprecated entity from Half-Life for backwards compatibility) to Func_detail. But some func_illusionary are left the same (the ones that use the “{apoio” texture, instead we add an invisible wall to each pillar).
Now add Cubemaps to the map. (In order for the Source engine to correctly display multiple reflective materials, they must be combined with external data. This data is stored as a cubemap, that is, a cube texture that represents a three-dimensional image of a certain area. To do this, the Source engine uses point entities env_cubemap as references with which to create textures and save them to a ".bsp" file. When processing specular and other ambient materials, it uses cubes to get a more accurate environment. In other words, the cube creates textures that will model a reflective surface .)
Now add Nodes to the map. (Node entities are a type of point entities that, when connected to each other, create a network called a nodegraph . A nodegraph tells NPCs contextual information about their environment, making them more responsive than their natural behavior allows.)
Let's add lighting to the map. In Goldsource, the light source was cast off the textures (comparing the decompiled version and the original). In my case, I had to add a “light” entity (a point entity available in all Source games. It creates an invisible static light source that shines in all directions) on the first floors of this building:

You also need to find light_environment on the map (light_environment point entity is available in all games on the Source and Source2 engine. It casts parallel directional light from the toolsskybox textures, bringing it closer to the light of the Sun or Moon), in my case it is located in the corner of the map. It is necessary to increase its values (From my personal experience, I realized that the low values of Goldsource are equivalent to high values in Source). Go 🡪 Object Properties 🡪 Change the “Brightness and color” value to higher values (But keeping the same palette)
Now we need to work on the "func_train" entities (it's a point object available in all Source Source games. It's a Quake holdover that ping pongs between the start and end of the path_corners series. It was mostly replaced by func_tracktrain in GoldSrc, but still was used to loop the background autoscroll. In Source, the introduction of parenting has made this method obsolete. However, the object still functions.) , “func_button”
(this is a brush available in all Source games. It is intended to be used as a button used by the player. When + is used by the player, it moves to the pressed position).
In this case, it's an elevator. Change the Entity from “func_train” 🡪 to the new entity “func_tracktrain” (This is a brush available in all Source games. It functions as a moving platform that the player can ride on. It follows the path_track entities path).

Map porting #3
(No User Control - No user control, only from the button should be. Fixed Orientation - Corrected orientation, axis)
And add two “path_track” entities (a point entity available in all Source games. It is used to build paths that other objects can follow. Each path_track is a path node, each containing the name of the next path node). We put it in the middle of the elevator, and combine them. Definitely assign a name to these entities. Using the command: Next Stop Target (They must be connected in series, for example path1 (goes to path2) and path2 (back to path1)).
Each such entity must have a name. The “Next Stop Target” should contain the target where the elevator will go. In this case, you need to make a chain (P_BAXIO 🡪 P_CIMA and in a circle). Hint (“Stop” - Stop the train. “SetSpeed” - Set the speed (to stop the elevator). “OnPass” - stop on arrival (otherwise there will be problems, and it will not stop)). Required parameters on the example of my configuration:
Let's move on to the “Func_button” setting, add the “env_texturetoggle” entity next to the button.
In "Target Brush(es)" we put the name "func_button" to which we want to attach the object (In order for the button to have animation when it is interacted with). Open the properties of the button. And add the following values to Outputs:
Flags (Toggles the exclusive functions of the object, its specific number is determined by the combination of added flags) buttons should look like this:
Don’t move (So that after pressing the button does not fly to another place, and remains static). Use Activates - So that the player can call the elevator on the “use (E)” button.
Do this operation with all similar objects. Then you can proceed to the final stage.
Go to the “VisGroups” window, uncheck everything except “Entities” 🡪 Select all entities 🡪 move to properties 🡪 and change the rendercolor value from “0 0 0” to “255 255 255” (Otherwise, all entities will be black, in GoldSource it worked differently). After that, open the Error Checking window and fix the remaining problems.
Preservation
Open the "File" menu, and choose one of the two: "Save" or "Save As...":
After compilation, the game will start. Now you can use the map in the new engine. Also don't forget to build cubemaps and set the lighting to HDR.
After the done actions, we can assume that the porting is completed. The new bsp is now running in Source Engine 24.
Conclusion
In the course of work, I managed to port the old map to the new engine and even upgrade the final map with additional values for textures, the port of the map, models and textures was a success. A comparison was made with the original work, the bsp structure, which is the map format in engines, was described. The mdl format, which is a model file, has been studied. The decompilation of the necessary files was successful, the main focus was on fixing problems after decompilation, which is a recreation, most of the entities were ported. The optimization was successful and many complex geometries were converted to models, and in func_detail, the final map was optimized with --nodraw. Cubemaps and AI nodes have been added. After completing all the steps, I moved on to compiling and the map was ported. This method was developed by me from personal experience, there is not much information on the Internet about porting. I found the best way in my opinion. Now this map can be used in a modern engine, thus the old content becomes relevant.

Thank's for reading!

Version with images:
https://sites.google.com/view/unified-network/guides/porting-goldsource-content-to-source

https://youtu.be/ceYKDC5Z5qo
https://youtu.be/FsPky2YrUeQ
https://youtu.be/QGVeXaze0KM
4 Comments
the testicle tickler Jul 19, 2023 @ 12:44pm 
me when a gmod guide isnt a joke
idiot 3 Jun 23, 2023 @ 5:21pm 
Sega Titan Jun 23, 2023 @ 3:48pm 
i aint readin allat
dsaS Jun 17, 2023 @ 7:50pm