Update Documentation/Materials/MatGoldSrc.md, add some example images while we're at it...

This commit is contained in:
Marco Cawthorne 2022-10-17 12:41:14 -07:00
parent dcfdf531ce
commit f61c093942
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
11 changed files with 130 additions and 80 deletions

View File

@ -1,21 +1,23 @@
# Building
## Building the Engine {#engine}
The **build_engine.sh** will do that for you. It will still ask you to have at least
a certain amount of dependencies installed (such as the **GCC**, **GNU make** and the **X11/SDL**
headers for your platform.
### Dependencies
* subversion
* gmake
* gcc
* mesa-libGL-devel
* libgnutls-devel
* libopenal-devel
* libX11-devel
* libXcursor-devel
* libXrandr-devel
* libSDL2-devel (only if you pass BUILD_SDL2=1 in build.cfg)
- subversion
- gmake
- gcc
- mesa-libGL-devel
- libgnutls-devel
- libopenal-devel
- libX11-devel
- libXcursor-devel
- libXrandr-devel
- libSDL2-devel (only if you pass BUILD_SDL2=1 in build.cfg)
### Optional: Building release binaries
@ -38,17 +40,20 @@ The resulting binary can be found inside the `src/engine/engine/release` directo
**Note**: The **SDL2** target will require you to set the **ARCH** environment to the target of your choosing.
## Building the Level Editor {#editor}
Handled by **build_editor.sh**.
### Dependencies
* gcc-c++
* gtk2-devel
* gtkglext-devel
* libxml2-devel
* libjpeg8-devel
* minizip-devel
- gcc-c++
- gtk2-devel
- gtkglext-devel
- libxml2-devel
- libjpeg8-devel
- minizip-devel
## Building Game-Logic {#game}
You can build the game source tree with **build_game.sh**.
The script also takes a parameter. If you specify:
@ -65,6 +70,7 @@ Some distributions may carry the **fteqcc** compiler, but it usually is a very a
that's probably not going to build any of this.
## Custom Configuration {#config}
There's a **build.cfg** file with which you can tweak build parameters of the various **build_** scripts.
For example, this is where you select between X11 and SDL2 builds. There you can specify which engine revision
you want to build and also which plugins you want to build along with it.
@ -72,6 +78,7 @@ It's well commented, so I encourage you to check it out. However on some platfor
might introduce additional setup/dependency steps.
## Additional Information {#notes}
The game-logic is written in QuakeC, it is thus platform and architecture independent.
You do not need to rebuild the logic for each and every platform.

View File

@ -8,13 +8,13 @@ There's just 2 very short requirements.
The code must be yours.
It's simple:
* Do not take code that is by anyone else that is not you.
- Do not take code that is by anyone else that is not you.
## Rule #2
No submission or decompilation of third-party code. This is important if you want to recreate behaviour from another game.
* We do not decompile - we reverse-engineer by trial and error.
- We do not decompile - we reverse-engineer by trial and error.
This is generally referred to as 'clean-room engineering'.
Most of the behaviour is rather predictable, other is not.

View File

@ -23,7 +23,7 @@ $ ./nuclide -game first_mod -game second_mod -game third_mod
And it'll load those directories in order, on top of `base/`.
However, we advise you only do this for development. If you want proper multiplayer compatibility (slightly different filesystem mount setups can confuse client <> server negotation) please use the built-in **Custom game** menu to ensure maximum compatibility to other clients.
However, we advise you only do this for development. If you want proper multiplayer compatibility (slightly different filesystem mount setups can confuse client-server negotation) please use the built-in **Custom game** menu to ensure maximum compatibility to other clients.
## For release...

View File

@ -1,69 +1,73 @@
# Materials: GoldSrc
Material definitions handle what footsteps and what impact effects are played against each texture in the game-world.
So when you walk on dirt, you can hear the difference; or when you shoot wood with a gun it will have splinters spawn instead of black bits and smoke.
# "Materials" in GoldSrc
In the GoldSrc games "Material" definitions handle what footsteps and what impact sounds are played against each texture in the game-world.
*Note:* While Nuclide supports this for legacy BSP files, you are encouraged to define the material of a texture via the [surfaceparm](MatCommands.md) command in a **Material** instead.
![Generic bullet impact effect in Half-Life](hl_impact.jpg)
So when you walk on dirt, you can hear the difference; or when you shoot wood with a gun it will sound like wood.
*Note:* While Nuclide supports this for legacy BSP files, please define the surface properties inside your [material](Documentation/Materials/MatOverview.md) using the **surfaceprop** command.
## Details
Usually, a game in the GoldSrc engine would provide a `sound/materials.txt` file, where each line defines the properties for a single (or a series of) textures.
For example:
```
C CONCRETEWALL
```
`C CONCRETEWALL`
Will make any surface **concrete** that starts with the name `CONCRETEWALL`. In vanilla Half-Life, the second argument (name) can only be 12 characters long.
Will make any surface the type **concrete** that starts with the name `CONCRETEWALL`. In vanilla Half-Life, the second argument (name) can only be 12 characters long.
It will also only compare the length of characters of the name above. So for example if you were to define:
```
C CONC
```
`C CONC`
Then `CONCRETEWALL` would still be marked as concrete, and any other texture that starts with `CONC[...]`.
## Community Changes and Additions
When you then walk around your level, the footstep will be aware of you being on a texture marked with the **concrete** attribute and play a different step sound. In theory.
In stock GoldSrc, the **materials.txt** can be overwritten by a modification, and users could customize the file on the client-side only for themselves. This means there was no map specific materials, and mods could not inherit Half-Life's materials, so mods would always have to manage a nearly duplicate file if they desired custom texture sounds.
There's many other types available in games such as Half-Life, a few of them conflict two so porting levels can sometimes be a bit more work than it first appears to be at first glance.
## Later Enhancements
### Community additions
In stock GoldSrc games, the **materials.txt** can be overwritten by a modification, and users could customize the file on the client-side only for themselves. This means there was no map specific materials, and mods could not inherit Half-Life's materials, so mods would always have to manage a nearly duplicate file if they desired custom texture sounds.
A few mods tried to remedy this problem, the following below is methods
documented so far:
* maps/MAPNAME.mat
> Introduced in The Wastes (2003)
maps/MAPNAME.mat
: Introduced in The Wastes (2003)
* maps/MAPNAME_materials.txt
> Convention by Andrew Lucas, creator of Trinity SDK, modeled after
> MAPNAME_details.txt
maps/MAPNAME_materials.txt
: Convention by Andrew Lucas, creator of Trinity SDK, modeled after MAPNAME_details.txt
* materials_file `PATH/FILE.txt` via the `worldspawn` entity
> Introduced in Sven Co-op 5.0
worldspawn entity key named 'materials_file' with the value `PATH_TO/FILE.txt`
: Introduced in Sven Co-op 5.0
All these methods are supported by Nuclide, as one goal is to implement
**All these methods are supported by Nuclide**, as one goal is to implement
conventions by not only Valve but the community as well.
In addition Nuclide has also implemented a way of giving modifications
their own inheritable materials file:
### Nuclide additions
```
sounds/materials_UNIQUENAME.txt
```
In addition Nuclide has also implemented a way of giving modifications
their own *inheritable* materials file:
`sounds/materials_UNIQUENAME.txt`
The idea here is that any mod or even map pack can include ONLY the textures
used, and no longer will anyone have to manage a near-clone of materials.txt
For repackaging or modding purposes, if you desire to give your map custom
sound definitions, we recommend **The Wastes** its method for individual maps, while
the Nuclide method should be used for Mods or Map Packs. We find these to be
the most clean and efficient way.
material property definitions, we recommend **The Wastes** its method for individual maps,
while the Nuclide method should be used for Mods or Map Packs. We find these to be
the most clean and efficient way!
**NOTE**: We recommend only using materials text files for GoldSrc related modding
purposes. It is inefficient for modern projects as there are much better
standards already supported in Nuclide. Keep in mind, it takes memory to load
big text files, and lots of text files adds up over play sessions.
standards already supported in Nuclide. You'll save a bit of memory that way too.
# Material List
In Nuclide, this is the currently supported list of material IDs:
| Material ID | Material Name |
@ -85,15 +89,22 @@ In Nuclide, this is the currently supported list of material IDs:
| W | Wood |
| Y | Glass |
## Game differences
Different games/mods can ship with different material properties.
To make your life easier, you can edit **scripts/surfaceproperties.txt** and define
which Material ID character maps to which [surfaceproperty](Documentation/Surf_data.md) entry.
This way you can add new materials to existing legacy maps without writing a line of code.
Listed below are definitions for various games and mods. Only the changes and additions are listed since the rest are identical.
The * indicates these definitions are not implemented in Nuclide
The "*" indicates these definitions are not implemented in Nuclide
## GoldSrc Games/Mods
## GoldSrc
### Arrangement
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| B | Blue Texture |
| N | Snow |
@ -103,14 +114,17 @@ The * indicates these definitions are not implemented in Nuclide
| Z | Black Texture |
### Counter-Strike
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| N | Snow |
| X | Grass |
*Afraid of Monsters: DC, Natural Selection, and Snow War uses the same definitions.*
### Cry of Fear
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| B | Random Twig Snap |
| H | Paper |
@ -123,7 +137,8 @@ The * indicates these definitions are not implemented in Nuclide
| Z | Carpet |
### Gunman Chronicles
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| G | Wood |
| T | Rock |
@ -131,19 +146,22 @@ The * indicates these definitions are not implemented in Nuclide
| W | Unknown/Unused? |
### Firearms
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|-----------------------------------------|
| B | Sandbag |
| N | Snow |
| U | No impact or decals, just smoke effects |
### Heart of Evil
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| U | Mud |
### Hostile Intent
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| A | Sand |
| E | Foliage |
@ -153,53 +171,71 @@ The * indicates these definitions are not implemented in Nuclide
| Z | Grass |
### Household DEATH!
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| H | Wood (Creaky) |
| I | Grass |
### Night at the Office
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| T | Carpet |
### Opposing Force
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| O | Snow |
*Science and Industry uses the same definitions as Opposing Force.*
### Poke646
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| M | Metal/Grate |
| T | Wood/Tile |
| G | Carpet/Grass |
### Wasteland Half-Life
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| B | Barrel |
| I | Sand |
| N | Tinroof |
| R | Rust |
| U | Drywall |
*The Wastes uses the same definitions.*
## Source
While Source has materials describing a surface with its **$surfaceprop** command, the GoldSrc way of describing materials with a 1-character symbol is still used to define which impact effect to use.
## Source Engine Games/Mods
So be aware that a Source engine game may actually have more surface materials than this, these are solely the IDs associated with impact effects.
While Source has materials describing a surface with its own **$surfaceprop** command, the GoldSrc way of describing materials with a 1-character symbol is still used to define which **impact effect** to use.
The **Material ID** is used via the `gamematerial` command inside **scripts/surfaceproperties.txt** entries. In Nuclide that's used for compatibility with the GoldSrc system instead.
![Bullet impact on Plaster](source_plaster.jpg)
![Bullet impact on Wood](source_wood.jpg)
![Bullet impact on Metal](source_metal.jpg)
Be aware that a Source engine game may actually have more surface materials than this, these are *solely the IDs associated with impact effects*.
In Nuclide,
### Alien Swarm
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| 11 | Steam Pipe |
Alien Swarm: Reactive Drop uses the same definitions.
### Counter-Strike: Global Offensive
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------------|
| 11 | Mud |
| 12 | Sand Barrel |
@ -207,7 +243,8 @@ Alien Swarm: Reactive Drop uses the same definitions.
| 14 | Metal Shield |
### Half-Life 2
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| A | Antlion |
| B | Flesh (Bloody) |
@ -221,20 +258,23 @@ Alien Swarm: Reactive Drop uses the same definitions.
| - | No Decal |
### Half-Life 2: Episode 2
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| E | Antlion Egg Sacks |
| Z | Adviser Shield |
### Insurgency
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| A | Fruit |
*Day of Infamy uses the same definitions.*
### Left 4 Dead
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| J | Grass |
| K | Mud |
@ -253,6 +293,7 @@ Alien Swarm: Reactive Drop uses the same definitions.
| 10 | Puddle |
### Portal 2
| **Material ID** | **Material Name** |
| Material ID | Material Name |
|-------------------|---------------------|
| R | Reflective |

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -75,5 +75,4 @@ models/weapons/v_winchester.vvm*
## External links {#external_links}
[<https://github.com/VeraVisions/vvmtool> vvmtool on
GitHub](https://github.com/VeraVisions/vvmtool)
[vvmtool on GitHub](https://github.com/VeraVisions/vvmtool)

View File

@ -32,6 +32,7 @@ internal, modeling program specific exporter for VVM.
Here's an EXCERPT of a control file from **The Wastes*:
```
output tommygun.vvm
materialprefix models/weapons/tommygun/
@ -75,7 +76,7 @@ Here's an EXCERPT of a control file from **The Wastes*:
event 0 1005 "33 1"
scene seq/shoot.smd fps 30.0
scene seq/shoot_last.smd fps 30.0
...
```
That's a really complicated control file, but it highlights a few
things:
@ -92,10 +93,12 @@ things:
However, a model control file doesn't need to be this complicated:
```
output terminal01.vvm
materialprefix models/props/computers/
rotate 0 -90 0
scene ref/terminal01.smd
```
This is `models/props/computers/terminal01.qc` from The Wastes.

View File

@ -1,7 +1,7 @@
# Surface Properties
**Surfaces** are being abstracted into one API with the help of **Surf
Data** helper functions and large parts of NSSurfacePropEntity.
**Surfaces** are being abstracted into one API with the help of **SurfData**
helper functions and large parts of NSSurfacePropEntity.
# Preface {#preface}