Skip to main content

Making Maps for Counter-Strike 2 with Half-Life: Alyx Workshop Tools

It has just been a week since Valve released beta of Counter-Strike 2, and the workshop tools for Counter-Strike 2 have yet to be released.

Recently, if you want to make a map for Counter-Strike 2, the easiest way is to use the Half-life: Alyx Workshop Tools since both games are based on the Source 2 engine, with HLA Workshop Tools being the latest branch of Source 2 SDK available. 

However, if you make a map in Half-Life Alyx Workshop Tools and run it in CS2 directly, you may crash the game, because your map may contain materials or entities from Half-Life Alyx that is absent in CS2.

This blog assumes that you already know how to use HLA Workshop Tools. If not, you can take a crash cource here

or here.

Counter-Strike 2 Materials

For lighting and materials, I followed a guide from 9yz. I had a lot of trouble trying it out because his instructions were rather casually written. Here's my own experience after working through a few issues.

Shaders used by Counter-Strike 2 materials are not supported by Half-Life Alyx Hammer and you cannot create them with the HLA tool. To get around this, you can use VRF to "Decompile & export" the materials folder from more than one hundred packages indexed by pak01_dir.vpk under the game\csgo folder, which takes a LOOOOONG time. You can then copy these vmats and texture files into your addon's "Half-Life Alyx\content\hlvr_addons\<your addon folder>\materials" directory.

You then need to change the string "csgo_lightmappedgeneric" to "vr_simple" in all of the extracted Counter-Strike Materials vmats. On a linux termial (e.g. Git Bash) you can do this with the command:

find <your extracted vmats folder directory>  -name \*.vmat -exec sed -i "s/csgo_lightmappedgeneric/vr_simple/g" {} \;

Next, open the vpks from the game\csgo folder in VRF again and export the materials folders "AS-IS". These files should go in your "Half-Life Alyx\game\hlvr_addons\<your addon folder>\materials" directory.

Now you can load up the HLA tools to make some CS2 maps with CS2 materials.

The Lighting Dilemma

By default, the lightmap version that HLA compiles to isn't compatible with CS2, so you have to change this in the HLA gameinfo by copying a portion of CS2's csgo_core/gameinfo.gi to hlvr/gameinfo.gi

make Half-Life: Alyx lightmap compatible with Counter-Strike 2

The following two maps can represent two methods of dealing with light and shadow in map making before Valve officially launch the CS2 Tools. 

In the first video the mapper does not use baked light and shadow at all, only real-time rendered shadows can be seen, and there is no beautiful light scattering effect of the Source 2 engine. Also, dynamic shadow disappear when faraway.

The second video shows the de_inferno ported from CS1.6, which has baked lighting. I guess this is achieved by maniplating the gameinfo.gi file in hlvr. In this case, shadow doesn't disappear when faraway.
However, doing this will make all real-time shadows (e.g. shadow of characters) disappear, and I can't figure out why. Although this effect, which make playing on this map more 1.6-ish, fits the theme of this map, this is not always wanted.

The Dual-light Approach

This is an approach to deal with the "lighting dilemma" that I figured out on my own. As shown in the following screenshots:

make both baked and per-pixel shadow visible in counter-strike 2

make both baked and per-pixel shadow visible in counter-strike 2

make both baked and per-pixel shadow visible in counter-strike 2

By using 2 environment light entities, the shadow of objects on the map won't disappear completely when faraway as shown in the following video. This is the classic "fy_iceworld" map I made for CS2 using dual-light method.

You can download and try out the map here.

Make the Map Function as a CS Map

A CS2 map should consist elements including entities where CT and T spawn, buyzones and bomb targets. If you don't have experience making CS maps, check out this tutorial on making maps for CS:GO.

All elements mentioned above are absent in HLA Tools, you can download a game definition file for CS2 from here. As for me, I prefer to make maps using the CS map templates in HLA Hammer, which speeds up my map making. You can download my template vmap here.

When building the map, remember not to leave Entity: env_cubemap_fog in it. From my experiments, this crashes CS2 when loading the map.

And that's it, thanks for reading. I'll keep this blog updated as soon as I come up with new ideas. Goodbye!

Checkout my youtube account!

Comments