Triangle API
Aug0
One of the changes to the client .dll code has been the addition of a basic triangle API through which MOD authors can generate and render textured triangles from the client .dll.
The relevant functionality can be found in the cl_dll/tri.cpp file. The only segregation of triangles occurs between triangles that require transparency and opaque triangles. A sample of drawing and texturing a couple of simple triangles exists in the #ifdef’d code in tri.cpp.
The triangle API is defined in common\triangleapi.h and is accessed in the client .dll by calling into gEngfuncs.pTriAPI->.
The triangle API supports setting the rendering mode for the triangle, framing the rendering with Begin and End calls, Setting the color of the polygon, if untextured, specifying vertex and texture coordinate values, specifying a brightness value, setting the face culling state, and loading a sprite ( .spr file ) as a texture for the triangles. The following parameters can be passed to the Begin function:
TRI_TRIANGLES
TRI_TRIANGLE_FAN
TRI_QUADS
TRI_POLYGON
TRI_LINES
TRI_TRIANGLE_STRIP
TRI_QUAD_STRIP
These APIs are supported in both the software and hardware renderer.
Half-Life Professional SDK 2.0 info
Aug0
Documentation:
PortingTips.doc contains guidelines and descriptions of file differences between version 1.0 and version 2.0 of the SDK
Events.doc contains documentation on the event system.
How to make a mod.doc contains documentation on how to set up the liblist.gam file and how to change the launcher UI for your mod.
Input.doc contains documentation on the mouse, keyboard and joystick handling system of the client.dll
Netgraph.doc explains how to read the new netgraph.
NetworkEntity.doc explains how to use the new entity filtering/handling functions of the game and client dlls.
PlayerPhysics.doc explains how to manipulate shared player physics code so your MOD can have modified physics and still predict correctly.
Triangle.doc explains how to use the triangle API from the client.dll
View.doc explains how to set up the render origin, etc. from the client .dll
In addition, the Launcher Strings subdirectory contains documentation to allow you to alter launcher text strings by overriding the values in the default string .dll ( hl_res.dll ).
OldSourceCode:
The source code directory that existed as of version 1.0 of the SDK. See “PortingTips.doc” for how to merge your code with this version of the SDK.
SourceCode:
The directory containing all the code to the game DLL required to rebuild hl.dll. Also included is the source code to all the compiling utilities for the various elements of Half-Life.
Server Info:
Server protocol.txt contains all the information folks should need if they wish to write a separate net game launcher.
Models:
The models provided should give a good example of the possibilities for building characters for use with Half-Life. Examples are provided of characters and weapons that appear in the game, to allow modellers to familiarize themselves with the character building process.
PlayerModels: animations, textures, and .qc scripts for the Player Models (all shipped versions).
MonsterModels: all available resources for all monsters partially or fully developed for Half-Life that were not included in the final game, plus source files for Barney, Human Grunt, and the Tentacle monster that did make it into the game (these were chosen as they best represent the various facets of monster development for Half-Life).
WeaponModels: world model and view model with animations of the Assault Rifle and Gluon Gun.
Maps:
Two of the opening maps from Half-Life, with their lighting radiosity files, are provided as they contain good examples of some of the most complicated entity scripting to be found within the game. They should serve as a good source for learning how to use the more powerful HL entities like multisource, multimanager, scipted_sequence, AIscripted_sequence, and scripted_sentence. A third map, env_beam, is a demo map of various beam effects that can be achieved with the env_beam entity.
C1a0.rmf and C1a0.rad
C1a0d.rmf and C1a0d.rad
Env_beam.rmf
SpriteTools:
Tutorial, samples, and support files for creating sprites for Half-Life.
TextureTools:
Tutorial, samples, and support files for creating texture WADs for Half-Life.
As part of the SDK 2.0
Aug0
As part of the SDK 2.0, we’ve included the “old” source code for the original SDK in order to allow you to compare the old and new directories to see what has changed. You should, for each directory in the old SDK sources ( OldSourceCode ), do a directory compare against the files in the new SDK sources.
Most of the changes are isolated or relatively minor, so hand-merging the SDK changes should go relatively quickly. In many cases, the changes are included in new source files, so you’ll just have to copy in those source files.
For files with substantive changes, brief descriptions have been provided to orient you when looking at the code.
Note: Make sure, if you don’t use the .mak and .dsp/.dsw files we’ve provided with the new SDK, that you have added all of the necessary files to your build and that your include directory search path includes the common/ and pm_shared/ subdirectories. Also, there are a couple of files ( const.h and cvardef.h ) that were moved from engine/ to common/. You must delete the copy in engine ( if you edited either file, you need to merge your changes into the new version ) and use the new version in the common/ directory. Leaving the old files around will almost certainly cause compile problems.
Changing the interface
Aug0
A Mod can change all the graphics of the Half-Life interface to give the entire game a new look that fits with the theme of the modified game.
The main logo can be changed by creating a new “logo.avi” and placing it in your custom game directory in a media\ subdirectory. It can be a single frame AVI if you wanta non-animating logo, or a standard AVI of any length you desire.
The graphics for the various elements of the interface are BMP files, and would go into a gfx\Shell\ subdirectory of your custom game directory. The individual elements can be obtained from either SDK, in the Shell\ directory.
The “logo.bmp” is the image that is used to create the console background, which gets compiled into the “cached.wad” file that resides in your custom game directory. A sample LS file to compile the cached.wad is in the Shell\ directory of the SDK.
Another aspect of changing the interface is customizing the key bindings menu. Many mods have new actions that Half-Life does not have, like “drop the flag” or “feign death”. These actions can be inserted into the interface for easy key binding by editing the kb_act.lst and kb_def.lst files, found within the Shell\ directory.
This covers the basics of making mods functional within the Half-Life interface. As always, the best resoureces for information are talking to other mod authors.
In addition, with the release of version 2.0 of the Half-Life SDK, mod authors may not modify the strings shown in the Half-Life launcher. Care should be taken, of course, to consider localization/translation issues when overriding strings ( perhaps offering multiple versions of the strings.lst file ). Exact details may be found in the documents in the Launcher Strings subdirectory of the SDK.
In addition, the color of the help text in the launcher may be modified be editing gfx/shell/colors.lst. Finally, additional launcher graphic content has been moved to the gfx/shell directory ( scroll bar thumbs, close and minimize boxes, etc. ).
Fields of the file liblist.gam
Aug0
game: The name of the mod
url_info: The mod’s informational web site
url_dl: The ftp site from where the mod can be downloaded
version: The mod’s version number
size: The size, in bytes, of the mod
svonly: “1” if the mod is a server only mod ( no client side content or code ), “0” otherwise
cldll: 1 if the mod requires a matching client.dll
type: If this mod is “multiplayer_only”, then the single player buttons ( New Game/Hazard Course/Load game etc.) are disabled in the Half-Life launcher
hlversion: The version of Half-Life for which the mod was generated. Revisions to Half-Life will require updates by mod authors.
nomodels: Set to “1” if model bitmaps should not be shown in the Multiplayer | Customize menu of the Half-Life launcher
mpentity: When a user chooses to create a listen server from the interface, each BSP file in the maps\ folder for the mod is searched. The entity data for the BSP is scanned for the presence of the string identified by mpentity. For insance, in Half-Life, the string is “info_player_deathmatch” ( which is also the default if no string is specified )
gamedll: The game DLL to load for running a server for this mod.
startmap: When a user chooses “New Game” for a single player mod, this is the map that is loaded.
trainingmap: When a user chooses “Hazard Course” for a single player mod, this is the map that is loaded.