This article describes the subtleties that you should be aware of when creating levels for the game
Alien Swarm . This article is suitable for those who already know how to create maps using the Hammer from the Source SDK or have an idea of ​​how to create primitive objects in this editor.
Alien Swarm SDK is available for free download through Steam in the Library -> Tools menu. After downloading and installation, you can launch Hammer World Editor and get started.
The SDK is installed in the following way:
C: \ Program Files (x86) \ Steam \ SteamApps \ common \ alien swarm \
All subsequent paths will be relative to this folder or the common folder.
')
Where to find examples of maps?
- A few examples come with the SDK: alien swarm \ sdk_content \ mapsrc
Attention! In the source code of official ASI-Jac1-LandingBay_01 maps, etc. You will not see all the entities, since some of these entities are in separate VMF files in the instances folder.
- Using the GCFScape and BSPSource programs, decompile any map you like. And see how things are done there.
- I recommend to decompile the official campaign and study it first. Also very useful are the custom campaigns Lana's Escape, Tears of Tarnor, City17, Paranoia, Reduction, Extermination.
How to set up the environment for convenient work?
For your addon \ campaign \ maps you will need a separate folder on the disk. Let's say your campaign you called Bug Hunt.
- Create a folder D: \ BugHunt
- Create the basic structure of subfolders and files: maps, materials, resource ... see "alien swarm \ swarm \ addons \ ExampleAddon"
Attention! Do not use the default file and folder names CustomCampaignCredits.txt, ExampleCampaign.txt, example_map_1.txt otherwise there will be conflicts. Immediately rename these files to your BughuntCredits.txt, resource \ campaigns \ bughunt.txt, resource \ overviews \ bughut01.txt, etc. addoninfo.txt do not rename.
- Open the alien swarm \ swarm \ gameinfo.txt file and add the path to your folder:
"SearchPaths" { "Game" "|gameinfo_path|." "Game" "swarm_base" "Game" "platform" "Game" "D:\BugHunt" }
After you have added your path to the end of the list, all subfolders and files of your path seem to be mounted in the “alien swarm \ swarm” folder. Your campaign is visible in the game, your textures and sounds are visible in the Hammer and in the game. Now you do not need to create VPK every time if you want to test your campaign. You no longer need to pollute the game folder with user files, textures, models, scripts. You all keep separate, in your folder.
What is a VMF file?
Hammer (Hammer) stores the source of the maps in VMF format. This is a text file with a description of all entities, brushes, etc. in your map.
How to name VMF and BSP files?
In Alien Swarm, everything counts as campaigns. Even if you have one card - this is a campaign. Think of your campaign name, for example, Extermination. Name the VMF file something like “extermination01road” or simply “extermination01”. You can add underscore "_" in the file name if you are so comfortable. This name allows players who know how to use Google or Yandex search engine to find your campaign on the Internet and download it. The fact is that when a player looks at a list of dedicated servers, he sees only the names of BSP files, not campaigns. And if there is something like myfirrstlevel.bsp, then he is unlikely to find such a campaign on the Internet. And the search for "alien swarm extermination campaign" is most likely to find. It is also advised to add the words moddb swarmarmory fpsbanana to the search engine as these are the 3 sites on which they add addons for Svorm.
Attention! After compilation, do not rename the BSP file, the file will not be valid.
How to create the easiest level \ card?
You need:
- Create brushes with visible texture. This will be the "land" on which the player walks.
- Create the info_player_start entity from the top of the brush. Wiki advises to put on 8 such entities on each card. Although the players in the game can be a maximum of 5.
- Create a brush with a nolight texture which is much larger than the entire map in all sizes. He envelops the map and does not allow the light to go beyond the world.
- Make this brush empty: right-click on any 2D window - Make Hollow, the value 32 can be left as default.
- Ctrl + T or right click Tie to Entity, enter func_brush in the field for the class name and Enter. We changed our brush class to func_brush.
- Now we give it a name in the Name field: structure_seal and Enter.
After completing these steps, you can compile your map with F9 and run it in the game. If there are no light sources in the map, then everything in it will be 100% lit, fullbright.
What should be present in any map for Alien Swarm?
Two entities: logic_auto and env_tonemap_controller. I advise you to copy them from ready-made maps or sample levels that come with the SDK. You can play with the parameters. They affect the amount of bloom. If these entities are not in your map, the colors will be very bright, cutting eyes.
How to compile?
To compile maps, I advise you to immediately switch from Normal mode to Expert mode by clicking on the corresponding button.
Here you have more options and options. You avoid strange behavior in which the map cannot automatically open in the game after compilation. During the development of the map, I use the Fast option and only when I need to look at the shadows and how beautiful the light goes is I use Full. To release a card, of course, you need to use the Full option.
How to prepare a map for release?
- Compile it with the Full settings and open it in the game
- Open the console and register
stringabledictionary
buildcubemaps
nav_generate
After buildcubemaps, the game will reload the level, as well as after nav_generate. buildcubemaps creates technical files and writes them to a BSP file in the swarm / maps folder. nav_generate creates the navigation mesh and creates a NAV file near the BSP. It is advisable to include the NAV file in the delivery of your card (VPK), so that after half a year the craftsmen would not deliver it separately in the NavMesh.vpk addon.
- Run through the level with
sv_cheats 1
asw_god 1
asw_marine_speedscale_hard 6
and check that everything works and you can give it to people.
- Everything is ready, you can proceed to packing your card. Your result is in the folder swarm \ maps
Attention! After compilation, do not rename the BSP file, the file will not be valid.
What is VPK and how to handle it?
VPK is a file format created by Valve. User-created add-ons for Left 4 Dead, Alien Swarm, etc. distributed files in this format. Valve itself uses it to store the media data of its games: textures and materials, scripts, etc.
Think of VPK as an archive with files and folders inside. Think that during the launch of the game, it removes all the files from the VPK files in the alien swarm \ swarm folder and overwrites everything in it. Thus, if you put some file that already exists in the swarm folder into your VPK, then the game will use your file, not the original one. Thus, you can change all the game files using the VPK file.
How to open VPK file?
Using the program GCFScape.
How to create a VPK file?
You can create this file by dragging the folder to the shortcut for VPK.EXE. Create a shortcut to the file "alien swarm \ bin \ vpk.exe". Drag a folder onto this shortcut and your VPK file will appear next to the folder you are dragging.
How to set up TXT campaign files?
- With each public release of your campaign, you should change the version in the files addoninfo.txt, resource \ overviews \ bughunt01.txt. It is also important that these files contain a working and permanent link to a web page from where you can download your map. These are the addonversion and addonURL0 fields in the addoninfo.txt, version and website file in the bughunt01.txt file. I advise you to use sites.google.com, to create there your page for a stable link to your map.
How to release a new version of the card?
So, you have compiled your map and you now have 3 files: in swarm \ maps: BSP, NAV. In the swarm \ maps \ graphs: AIN folder.
- Move these files to your D: \ BugHunt directory given paths.
- Change the version of addoninfo.txt and in all the descriptions of your maps in the resource \ overviews folder
- Create VPK
- Archive VPK using 7z
- Download the archive in the permanent storage. I
recommend drive.google.com,
www.moddb.com/games/alien-swarm/addons , gamebanana.com. Swarmarmory.com unfortunately increasingly offline.
- Post this news on the
game forums , in the
game hub , in the
Steam group of mods and campaignsA few farewell
First, if you want to play often on your map - do not make a survival card. A lot of them. Nobody plays them. Make a simple, but a map for the passage.
Second, do not try to “invent the wheel”; you can spend a lot of time. Use ready-made solutions as often as possible, by looking at them in other people's cards and especially in official maps. To open someone else's card in the Hammer editor (Hammer) you need two programs to decompile GCFScape and BSPSource, later you also need pakrat to add or extract files from BSP files. GCFScape opens VPK files, as well as GCF, NCF, BSP, etc. The BSPSource program is capable of almost perfectly decompiling any map for Svorm, so that you get the source code of any map and you can see how the things you need are done.
useful links
developer.valvesoftware.com/wiki/Alien_Swarm_Level_Creationdeveloper.valvesoftware.com/wiki/GCFScapedeveloper.valvesoftware.com/wiki/Pakratdeveloper.valvesoftware.com/wiki/BSPSource