Installing Source SDK. Creating your own RPG on the Source engine How to create a game on the source engine

Previous engine in the series GoldSrc Next engine in the series Hardware platform Supported OS Written in language C++ License proprietary, not licensed - internal use only Latest version Source Engine 24/2013 Official site​(English)

Development history

The history of the development of the Source engine dates back to 1998: when the developers were completing work on the first game of their studio, Half-Life, they realized that there were developments that they would like to implement in its engine, but decided not to risk introducing new solutions to an almost finished game, and to split the engine code:

Eric Johnson, Valve developer:
"When we were very close to release Half-Life(about a week before), we realized that there were several projects that we needed to start developing, but we could not risk changing anything in the code of the upcoming version of the game. We decided to split the code in VSS() into $/GoldSrc and /$Src. For several years we have used these terms directly as "GoldSource" and "Source". At least initially, the GoldSrc code branch referred to the source code of the already released version, and Src referred to the future version, with more risky technology, that we were working on. When it's time to show Half-Life 2 for the first time at E3, it was part of our internal communication, refer to Source engine vs engine GoldSource, and the name stuck.”

Thus, the name Source began to be used to describe the new engine, but became the name of the previous generation of technology. It is worth noting that the name literally means “source”, but the word source also used in the phrase source code- source .

The first game on this engine was a multiplayer shooter , released in October 2004, it became a kind of demonstration of the engine (that’s why the name of the technology is inscribed in its name), representing a version of the classic shooter recreated with the latest graphics for that time Counter-Strike.

A sequel was released a little later Half-Life - Half-Life 2, a story-driven sci-fi shooter that went on to win numerous awards and is noted for having some of the most advanced graphics of its time. This game made heavy use of the physics engine, which was based on Havok, licensed by Valve; with its help, numerous puzzles were built based on playing with physical laws (later, a similar topic was greatly developed in another Valve project - Portal(2007), which focuses on the idea of ​​teleportation). In addition to its advanced physics model, Half-Life 2 featured the most advanced facial animation technology of its time. The graphics engine, using DirectX version nine, was also highly optimized and could run on older video card models, lowering its graphics quality and switching to earlier versions of DirectX, up to version six.

Subsequently, Source, whose structure is described by the developers as extremely flexible and modular, was used in most of the company's games, constantly undergoing modifications and improvements. Many modern effects were added, and various engine capabilities were expanded, including, for example, working with large locations (starting from Half-Life 2: Episode Two, ), new platforms have been added to the list of supported ones: Source was initially available on Windows; later added Xbox, Xbox 360, PlayStation 3, and since 2010 - Mac; since 2012 - GNU/Linux (the first game ported to Linux was Team Fortress 2), etc.

Specifications

One of the features of the engine is its character animation system, in particular, facial animation, which contains many tools for creating expressive facial expressions and accurately synchronizing the speech of actors with animation; The engine also features advanced gaming artificial intelligence, which can effectively control the player’s opponents or allies; the graphics engine was one of the first to use complex shader effects; In games on the engine, shader water was actively used, reflecting the surrounding world.

Development Tools

Source SDK is a set of utilities for creating modifications on the Source engine, available free of charge to players via Steam. The set includes: Valve Hammer Editor (map editor), Faceposer (utility for creating facial animation of models), Model Viewer (program for viewing format models .MDL).

In addition to the three main utilities, the set includes a utility for unpacking base files when creating a new modification, as well as source code files for libraries of some Valve games, which allows you to manually create games with changed characteristics without decompiling the engine. However, to compile new files, you need knowledge of the C++ language and a compiler (for example, Visual Studio).

Source engine versions

Below are the various internal versions of the Source engine (version names can be found in some cases from the console or from the SDK, but not in all cases).

  • Early versions (2003) - an early version of the engine was used in the beta version that leaked to the Internet in 2003 Half-Life 2, the game was visually similar to Half-Life on and did not contain a lot of technology. The game was created on a different version of the engine, already close to the one that debuted with Half-Life 2 Vampire: The Masquerade – Bloodlines.
  • Source Engine 2004 (Source Engine 6) - the first release version of the engine, first used in Half-Life 2. Natively supports scaling, upgradeability, shader rendering, facial animation, and dynamic lighting. Until 2005 it was used in: Half-Life 2, Half-Life 2: Deathmatch,. Updated to Source Engine 7.
  • Source Engine 2005 (Source Engine 7) - updated version. Compared to its predecessor, it supports High Dynamic Range Rendering; to demonstrate new lighting technologies, the developers released Half-Life 2: Lost Coast, in essence, this game is a level that did not make it into the final version of Half-Life 2. The engine is considered obsolete, used in: Half-Life 2: Lost Coast; until 2006 it was used in: Half-Life 2: Deathmatch,; until 2010 in Half-Life 2; until 2014 - in .
  • Source Engine 2006 (Source Engine 7: Base Source Engine 2); with development kit: Source SDK Base 2006 - the third version of the engine, on which several games were released. It was also the basis for a number of Valve's multiplayer games until 2010. It has been updated to support updated facial animation, multi-core rendering, and updated HDR. A large number of modifications were released for this version of the engine (in addition, modifications released for earlier versions are compatible with this version), which do not work on later versions, so it is still used by the authors of the modifications. Used in , SiN Episodes: Emergence , Dark Messiah of Might and Magic; until 2009 it was used in ; until 2010 in Half-Life 2: Episode One, Half-Life 2: Deathmatch, Garry's Mod.
  • Source Engine 2007 (Source Engine 14); with development kit: Source SDK Base 2007 - the fourth version of the engine, greatly improved and updated, used for the first time in the Valve games of the collection The Orange Box; shader rendering was updated, dynamic lighting and shading were significantly improved, a soft particle system was also introduced, and cinematic physics was added, a feature that significantly expanded the use of the physics engine. The engine contains significant changes since Source Engine 7, so game modifications released for earlier versions are not compatible with this and later versions. Used in Black Mesa; until 2010 in Half-Life 2: Episode Two, Portal, Team Fortress 2,.
  • Source Engine 2008 (Source Engine 14: Base Source 3) - another version of the engine with improved cinematic physics and some visual effects (for example, depth of field); applied in Left 4 Dead.
  • Source Engine 2009 (Source Engine 15) - the sixth, highly modified version of the engine; All functions have been updated, the particle system, facial animation, scaling and the ability to update have been significantly improved. Released with the game Left 4 Dead 2, earlier Valve games were later updated to this version. Use: Left 4 Dead 2, Zeno Clash, Postal III; since September 2010: , Half-Life 2 , Half-Life 2: Deathmatch , Half-Life 2: Episode One , Half-Life 2: Episode Two , Portal , Team Fortress 2.
  • Source Engine 2010 (Source Engine 17) is the seventh version of the engine. Used in: , Bloody Good Time.
  • Source Engine 2011 - used in Portal 2, Dota 2, Counter-Strike: Global Offensive, The Stanley Parable.
  • Source Engine Multiplayer (Source Engine 19) - a version of the engine adapted for the needs of multiplayer games; before 2010 used: , Team Fortress 2 , Half-Life 2: Deathmatch , Garry's Mod.
  • Source Engine Multiplayer (Source Engine 21) - used until 2012: , Team Fortress 2 , Half-Life 2: Deathmatch , Garry's Mod.
  • Source Engine Multiplayer (Source Engine 23) - improved work with the Big Picture Mode feature on Steam; until 2013 it was used in: , Team Fortress 2 , Half-Life 2: Deathmatch , Garry's Mod.
  • Source Engine 2013 (Source Engine 24); with the Source SDK Base 2013 toolkit - one of the latest versions of the engine to which Valve has transferred most of its games. Among the changes: to optimize the use of disk space, it was decided to abandon the use of bulky .GCF files (archives with game resources), in favor of a file system codenamed SteamPipe. Games on the new engine are now installed in the directory Steam\SteamApps\Common, and the game files are stored in .VPK files. For games , Team Fortress 2 And Half-Life 2: Deathmatch a convenient system for adding user content (modifications) has been created: there is a folder custom, in which a folder with an arbitrary name is created, and the classic folders of modification materials are added to it ( materials, models etc.). Added compatibility with Linux. Since 2013 used in: Half-Life 2, Half-Life 2: Deathmatch, Half-Life 2: Lost Coast, Half-Life 2: Episode One, Half-Life 2: Episode Two, Portal, Team Fortress 2, Dota 2, Garry's Mod, Tactical Intervention, Alien Swarm, Apex Legends

Games using Source

The Source engine has become the technological basis for the development of various games: all games from Valve itself, released between to

Five years to develop a game is a long time. Especially for those who were looking forward to the sequel. And now, finally, it’s happened! In the glare of the spotlights, under the cannonade of a battery of champagne bottles, one of the most anticipated games of the third millennium smoothly and majestically descended from the stocks - Half-Life 2. If the first part worked on the engine from id Software, then now Valve provided its new game with its own engine - Source Engine. It is expected that it will turn out to be the Holy Grail that will give the company immortality, and Half-Life 2 - eternal youth. After all, the engine is an excellent tool for modders and game developers.
If the game had been released, as promised, on September 30 last year - Source Engine would really be out of competition... But today, when it has been on sale for a long time Doom 3, the new Source engine will have to prove its superiority in intense competition. The final balance of power will become clear no earlier than in 3-4 months, when game developers and mod makers take apart the new engine, as they say, piece by piece, but some conclusions can be drawn now. Let's see what the new engine has to offer.

Are games and porn the same thing?
Five years for development is really a long time. During this time, it was possible to introduce a lot of the latest technologies into the engine, investing not only time and money, but also soul into it. Work on HL2 began immediately after the release of the first part. The team had no shortage of ideas. I really wanted to build on the success of the first

games. The first HL was born largely due to the fact that Gabe Newell(Gabe Newell), Valve's founding father, was a big fan Doom. If not for this, it is unlikely that a promising employee of the company’s operating systems department Microsoft would quit a well-paying job in 1996 and start his own gaming company.
That's it for communication with Doom and its creator - John Carmack- not over. For its game, the newly born gaming company licensed id Software engine Quake. However, Gabe could not agree with some of the views of Carmack, who believed that the plot line in an action film was no more important than the plot in a porn film. The player's interaction with the game world should be reduced to the destruction of monsters in colorful scenery. Virtual shooting range concept. The main thing is that there are a lot of monsters, that they are diverse and that the killing process looks as impressive as possible on the monitor screen. Naturally, these ideas were the basis of the id Software game engine - it allowed you to draw the most beautiful picture on the screen at that time and easily processed a dozen 3D models.
Gabe had slightly different ideas about the role of the plot and the interaction of the gamer with the game world. And to implement them on the id Software engine, it took his team 2 years of hard work. But the result was HL, which won more than 50 “Game of the Year” awards and popular love.
Gabe was right. Therefore, it is not surprising that HL2 developed the developments of the first part and made the world even more authentic and interactive. Since id Software hasn't moved one iota away from its previous positions, it became obvious that Valve would need its own engine to solve these problems. Source was developed by two teams at once: HL2 and Team Fortress 2. The same goes for tools. In addition, the Steam team created the user interface and VGUI 2, built into Half-Life 2.

questions. As Gabe said: “ This is an area where we plan to invest a lot of time and effort. We can't wait to see what the modders do with the engine. Source.
According to some reports, the documentation will be much more detailed than for the first HL (and at that time it was very good). Valve, inspired by the activity of the modding community in relation to HL, really wants to repeat this with the second part. Especially for this purpose, the game has many possibilities for modification. For example, the interface is easy to change and has many settings. The game editor has been largely redesigned and improved. In addition to the SDK, many different utilities will be released, including large texture libraries and model templates. “ We hope that mod authors, having received this, will be able to focus more attention on some innovations and gameplay than on the mechanism of creating the mod itself”, says Gabe Newell.
Doctor from the first part of the game
and from the second. Feel it
difference.
The capabilities of the Source engine itself allow modders not only to completely remake HL2, but also to practically make a new game. Compared to the first HL, the size of the maps can be freely increased by 10 times! It has become possible to create huge open spaces and make cities that stretch for many kilometers. In the game editor (this is known to everyone Valve Hammer Editor) a system has appeared for creating or changing any landscapes on the map. Besides, Source has an excellent physical model and can freely operate with a large number of “interactive” objects. That is, objects that the player can somehow use during the game. For example, from tires scattered on the street you can build an obstacle for a chase or a shelter for an ambush. This significantly changes the tactics of passing. So modders will have to think not only about the design of the level itself, but also about the distribution of such objects.
Some features are implemented in the engine, but were not included in Half-Life 2, and some can be significantly transformed. For example, surface deformation can be used in mods, but you won't see it in the game. The same applies to the change of day and night. Weather effects can even be changed beyond recognition.

Beauty saves the world
Valve's new engine takes full advantage DirectX 9- dynamic rendering for drawing open spaces, raised textures for characters, soft shadows, improved anti-aliasing, etc. However, at the moment, since video cards with full DX9 support are expensive, the engine
equivalent effects have been created for DX8. Implemented DX8.1 shaders for water surfaces. According to information from Valve, the next versions of the engine will be based only on the functions of DirectX 9.
Before talking about the graphics capabilities of Source, it should be noted that all modern engines must be scalable. That is, it is normal to work on computers with different hardware. And the wider the range - from minimum to maximum configuration - the better. More people will be able to buy the game and appreciate the efforts of the developers. While the capabilities of the latest generations of graphics cards allow a lot, developers must also think about those who are not so fortunate as to get rid of an outdated graphics adapter. Therefore, the texture budget and the number of polygons per model are often greatly underestimated.
HL2 uses in the vast majority of cases textures measuring 512x512 pixels (versus 128x128 in the first part). However, the engine itself is capable of more. According to Gabe, the maximum possible texture size is 2000x2000. A fair amount of groundwork for the future. As for models, ordinary NPCs contain 3000 polygons. Particularly valuable characters such as Alyx or Gman, already have about 7,500 polygons per capita. For less important figures (like the numerous monsters that appear on the screen in batches) no more than 2000 polygons were allocated per piece. Less significant - not “living” objects - make do with a very small number of triangles.
The toolkit includes a utility FacePoser, designed to control the facial muscles of models. This will allow computer characters to express human emotions - frown, smile from ear to ear, and so on. In addition, FacePoser can phonetically correctly adjust the model’s facial expressions to phrases pre-recorded in a wav audio file. You have already seen something similar in the package Impersonator For Unreal Tournament 2004. However, FacePoser has a more user-friendly graphical interface, and the capabilities of this utility are much wider. This is actually a scene editor. For example, you can use it to create different situations and events, such as moving a character along a given route, and specify the exact moment in time when the NPC should appear in a particular place.
If intelligence is extremely rare in the universe, and even if the most intelligent individuals destroy each other without a twinge of conscience, intelligent life still has plenty of time to fill the galaxy, even moving at sub-light speeds. According to any probabilistic model, we should just be inundated with aliens. So where are these alien civilizations?
I have my own homebrew theory, which I pretentiously call the “Gambeboy Really Really Advanced Theory.” Once any beings reach a level where they are able to build an interstellar spaceship, they are able to build incredibly powerful computers on which to play hyper-realistic video games. The aliens have a choice: either go explore the real Universe (lots of boring trips, where the most interesting question is “How much space dust will we encounter today?”), or explore the virtual universe created on their super-powerful computers. So aliens - they exist... Somewhere out there... They are just too busy playing games and exploring virtual universes much more vast and fascinating than the real one.
This means we've only scratched the surface of what will be possible in video games. And thanks to Moore's Law doubling and the growing sophistication of game developers - whatever the difference between the level of Half-Life 1 and Half-Life 2 - we will see much more significant shifts in the very near future.

* * *
The decision to refuse to license the engine for their game (although Quake 3 was considered), despite all the difficulties, turned out to be correct. Moreover, Gabe Newell seriously expects that Source will be of interest to both modders and professional developers. And all the prerequisites for this exist. Licensing has already begun and, according to Gabe, is “aggressive.” Perhaps this was also due to the very low price compared to the Unreal Engine and the Doom 3 engine, but... It's not just the price. It is quite possible that these titans have a powerful competitor. After all, on Source you can make not only excellent story-driven first-person shooters, but even RPGs!
And Carmack from Doom 3 again made (albeit an excellent) virtual shooting gallery. Apparently, he continues to believe that games and pornography are one and the same thing.

Frequently Asked Questions

  • Q. I wish to distribute a Source Engine Mod through Steam. Should I fill out the paperwork?

    A. Yes, please complete the digital paperwork to get signed up as a Steamworks developers. All information is required, including bank and tax information and app fee even if you intend to distribute your mod for free.
  • Q. Is there a licensing fee for using the Source Engine?

    A. There is no fee for using the Source Engine for your free mod, but there may be licensing fees for included tools if you charge money for your game.
  • Q. Can I sell my Source Engine game on Steam?

    A. Yes, but there are a few requirements:
    • You will need to complete an additional agreement for distributing a paid Source Engine product on Steam.
    • If you are using the RAD tools included with the Source SDK, you will need to contact RAD for information and cost associated with licensing Miles and/or Bink.
    • For any Source Engine game that charges money, Havok needs to be paid a licensing fee of $25,000 for the physics engine. You will need to pay this fee up front before making your game available for sale on Steam.
    • You can only sell your Source Engine game via Steam unless you get a full Source Engine license.
  • Q. I’ve got a Source mod that I want to distribute via Steam. How do I prepare my mod under my app ID?

    A. You"ll need to copy the exe and content from the Valve Source Engine game you have built your mod off and wrap that up as your application.

    While you should include all the necessary Source Engine dlls and content from the base Source game that you need for your mod to run, Source Engine mods must be configured to require ownership of the base game in order to play. This needs to be configured by Valve.

  • Q. I wish to use Steam achievements in my mod. How do I do that?

    A. Use the CAchievementMgr class included in the Source Engine after configuring achievements in your App Admin page on the partner site. For more details, please see the documentation.
  • Q. How does the dedicated server work for my game?

    A. You will need a new dedicated server app ID so that you can create depots that are for a dedicated server. Once you"ve got an app ID for your base game, you can create your own dedicated server app ID. From your app landing page in Steamworks, click "All Associated Packages, DLC, Demos, And Tools" and then click the "Create New Tool" button in the Tools section.
  • Q. Can I use Valve IP in my Source Mod?

    A. Yes. However, please make it clear on your store pages that your mod is a mod and not created by Valve. Commercial games and mods that include Valve IP such as characters and story-lines need prior approval from Valve.

Creating your own RPG using the Source engine

If you want to learn how to develop games, modding existing games is a great place to start to learn design and create prototypes without having to reinvent the wheel. In this article, we'll use Valve's Source Engine (the engine used to power Portal, Left 4 Dead, Half-Life, and Team Fortress 2) to create RPG-like quests in Half-Life 2: Episode 2.

Please note that this article assumes that you have basic knowledge of the Source SDK Hammer Editor and Face Poser, so this is not a project for beginners, but rather for intermediate programmers.

If you don't have these skills, you can learn about game development on our website: for example, creating games or .

To master this material, you should know how to create and compile maps, place entities, and set up triggers before repeating the steps described here. If you want to add your own dialogue, you'll also need to know how to create and save scenes in Face Poser. It's okay if you've never worked with the Source SDK before - the Internet is full of articles describing how to use it. Start with the Valve Developer Wiki, which contains a lot of useful articles on the topic, then go to design3 (I'm one of the project's contributors, by the way) for step-by-step video tutorials on Source Engine. The minimum system requirements to use the tools described above are the same as to run Half Life 2: Episode 2: 1.7 GHz processor, 512 MB RAM, DirectX 8.1 and Windows XP minimum. You will also need a microphone.

Preparation

Before we begin, make sure you have everything you need. First, you need an installed copy of Half-Life 2: Episode 2. We'll be using this game because it's the newest single-player Source engine game that can be modded. If you don't have the second episode, download it from then a simple Half-Life 2 should also work.

If you want to add your own dialogue to this RPG, you'll need an audio processing application. We will use it - it is free, open source and perfect for our purposes.

Illustration 1 - our level in Hammer Editor

Right now our level is just a rough prototype that is completely untextured and undetailed. It’s best to start with this and deal with the details at the very end. So, let's start making our RPG. Don't forget to save on time! Some features in Hammer are not fully supported in Episode 2 and may cause the editor to crash.

Creating the quest structure

In this article we will focus on receiving and completing tasks; building a character development system with experience points is a topic for a separate article. There will be three non-player characters (NPCs) on our level, each giving us two tasks. We can also use them to provide the player with information, attack him, or simply to add a little life to the level.

In order to keep the levels organized, let's use the following convention of names:

Figure 2 - the naming convention we will use

This will help us find our entities much easier, especially while working on assignments. For example, adding the Level prefix to entities that only affect a specific level will automatically place them in the same place in the list, and they will not be confused with the entities of any job.

Before we actually start making quests, we need to break them down into smaller components, namely:

  • Trigger Start: starts the task;
  • Sprite: shows where the quest can be started;
  • Giver: NPC who gives this quest;
  • Scene Start: dialogue describing the task;
  • Sound Start: a sound that notifies the player that a task has been received;
  • Text Start: text describing the task;
  • Relay Content: a layer that runs the processes necessary for the quest (for example, an NPC spawner);
  • : <основное содержимое квеста - после выполнения оно должно запустить Relay Complete>;
  • Relay Complete: a layer that adjusts the level for the subsequent task;
  • Text End: text that describes how to complete the task;
  • Sprite: appears again to indicate which NPC to talk to;
  • Trigger End: trigger that initiates the end of the task;
  • Scene End: final dialogue;
  • Sound End: sound indicating the end of a task;
  • : <если есть следующее задание, оно активируется здесь>.

If you don't understand any of this, don't worry - for now we're just making a list of everything you need. This list is only for one task, so we will need to create a really lot of different entities. In order not to clutter the brain with unnecessary things, we will use VisGroups to separate tasks and hide what is not needed now. VisGroups allows you to define groups of brushes and entities and quickly hide or show them. If a group is hidden at compile time, everything contained in that group will be skipped and will not appear in the game. This is very convenient, because you can selectively view individual groups of objects, focusing on them, and nothing else will interfere with you.

Create a job template

We will use templates (instancing) - a great tool of the Hammer Editor. This will allow our main map to link to others. We will create an instance of the task, which we will later use as a template. Once we've finished it, we can simply copy it out and edit the copy settings a bit so that each job is unique. This way, we won't have to do the same tedious work over and over again. Unfortunately, Episode 2 doesn't fully support this technology, so we'll have to convert instances to levels before compiling (we'll touch on this later).

In order to customize our job template, we need a new map file. In Hammer, select File, then New, save the map as “quest_instance” in the “instances” folder in the same place as your main map.

It is best to place entities as close to the coordinates (0,0,0) as possible. It is also worth placing them above the XY plane so as not to lose them during transfer. For proper placement, you can use the Selection Tool. Our template will automatically add the prefix we choose to all entities within it. Triggers and setting some values ​​will be described later, so don’t worry if you think we missed something.

We will need all the entities mentioned in the list above. Let's start by adding the NPCs. Select the Entity Tool, find npc_citizen in the dropdown list and place it at the origin. This guy will give us a task. Press Alt+Enter to open its settings and name it "giver". Set the Prevent picking up weapons? on Yes. Apply the settings by clicking Apply and go to the Flags panel. Set the Not Commandable flag, otherwise our employer will follow the player everywhere on the map. Also set Don"t drop weapons and Ignore player push (so that he does not give way to the player).

Now we need a trigger that will track whether the player has approached... Let's call him Grisha, because "this guy" or "quest giver" doesn't sound very good. So, to track whether the player has approached Grisha, create a brush with the following dimensions: 64 units high, 32 units wide, 4 units long - and place the object directly in front of Grisha. Assign a nodraw texture to this object so it won't be rendered. To change the texture, select the object, switch to Toggle texture, click the Browse button, use the nodraw filter, double-click it and apply the parameters (Apply button). Then assign a trigger to this entity by pressing Ctrl+T and selecting func_button from the list. Name it "trigger_start" and change the speed to zero. Save your changes again.

Now let's add a sprite that will notify the player that this NPC has a task. Place the env_sprite entity on top of Grisha's head and open the Object Propeties window by pressing Alt+Enter. Name it "Sprite". Now we need to change the rendering mode so that the sprite is displayed correctly in the game. In the same window, find the Render Mode option and select World Space Glow from the drop-down menu. You can change the texture of this sprite using this menu if you wish. Make sure that Start on is checked in the Flags tab.

Let's engage in dialogue. Find logic_choreographed_scene in the list of entities and place it behind Grisha. We'll need at least two of these for each quest - one for the opening dialogue, one for the ending - so copy it and paste the second one on top of the first. Give them the names "scene_start" and "scene_end" respectively. We'll look at adding the actual dialogue a little later.

In addition to all this, we also need sound notifications that the player has received a task and that he has completed it. Create two ambient_generic entities, place them next to the NPC and name them "sound_start" and "sound_end". If you do not have your own suitable sounds, use plats\elevbell1.wav (enter in the Sound Name field). In the flags tab, all three options must be checked.

After this, we need to add text that will describe the task. Create two game_text entities and name them "text_start" and "text_end". Set the Hold Time parameter for both to a high enough level (about 99999) so that the text does not disappear until we destroy it ourselves. We want the text to be on the side of the screen and not interfere with the player, so set the X and Y fields of both entities to 0.1.

We will need several layers to organize the triggers. A relay is an entity that, when activated, launches other entities. One layer usually triggers actions that must be performed at one time and in one place to make them easier to manage. Create two logic_relay entities and place them next to Grisha. Their names are “relay_content” and “relay_complete”. These two layers will run all the entities in the job. Come up with the specifics of a specific task yourself - you need to set a goal for the player like “collect so many such and such items” or “get to such and such a place.” To check that these conditions are met, you can use entities such as math_counter or scope entities like trigger_once . When these entities determine that the task has been completed, they will have to run "relay_complete", which in turn will run everything necessary to mark the end of the task.

Let's add another trigger opposite Grisha. It will be almost identical to the start trigger, so just copy "trigger_start" and rename it "trigger_end". Make sure the Starts locked flag is enabled. Make sure these entities don't overlap each other and that the start trigger is in front of the NPC's hitbox (otherwise the game will get confused whether you're selecting a trigger or a "button") by using top and side views. To locate the hitbox, select Grisha - a yellow frame will appear around him.

Now let's set up the triggers as shown in Illustration 5. You don't have to worry about the triggers in square brackets just yet, we'll add them later. Select the listed entities, open their Object Properties, go to the Outputs tab and configure everything in accordance with the table below. Make sure you save all changes (Apply button)!

Figure 5 - setting up triggers.
Headings: Selected entity \ Activate by... \ Activated entity \ What to activate for an entity

We place templates

Our template is ready, now we can place such templates on the map and customize them in more detail. Place “func_instance” where it is convenient for you, open its Object Properties and under VMF Filename find your “quest_instance” file. Please note that the search is somewhat buggy, so you may need to enter the file path manually. Now you can copy this template across the map: create as many tasks as you want.

Select the first task and let it import all the necessary entities (click Instancing, Collapse, Selection). Hammer will give all entities a prefix, defaulting to "AutoInstance-". Everything imported will be highlighted, all we have to do is add them to one group via VisGroups. Open Object Properties and select the VisGroups tab there. You will see something like this:

"Sewer" and "Main level" are groups I've created before, so it's okay if you don't have them. Click on "Edit Groups" and you will see the following:

Here you can create new groups that you will use later. Click "New group" and you will see a new item in the list. Rename it to "Quest_n", where n is the task number. Once you are done with this, click “Close”, you will see your group in the main list. Check the checkboxes to add entities to the group, click “Apply”, then “Close” again. You can now hide or view groups using the VisGroup control panel as shown below. Do this with every task you complete.

Adding your own audio files

Our RPG would be extremely boring without dialogue to tell the story, so we'll record it using Audacity. First, you must have a microphone. Because of the way Face Poser works, you should write down one sentence at a time. With Audacity it's simple - set up your microphone, press the red button, say something, stop recording and save the file as a .wav file. If you have any problems, feel free to use the built-in help, it is very well done. When you're done, create a folder called "RPG" and place all the files in it. Move this folder to C:/Program Files/Steam/steamapps/half-life episode two/ep2/sounds/. Saving all files in a folder one level above “sounds” is important - otherwise the engine simply won’t see them.

Go ahead. Create a "sound_script" file so that the engine can associate our sounds in the editor with the game. Launch GCFScape, go to File->Open, navigate to your "steamapps" folder and open the file "episode two content.gcf". After GCFScape has loaded it, you will need to find the file “game_sounds_manifest.txt”, which is located in “/steamapps/ep2/scripts”. Right click on it and select "Extract" and place this manifest in "/steamapps/half-life 2 episode two/ep2/scripts". We're done with GCFScape, you can close it.

Now go to your scripts folder and open the “game_sounds_manifest.txt” that we just extracted. This file contains all the sound scripts that the game will use, and we need to add our recordings there. Under the last line of code, in the last parentheses, write exactly the following:

The manifest file can now be closed. Let's create a file "rpg_sounds.txt" to which we refer and write the following into it:

The first line is the name of the sound that will be displayed in Face Poser: “rpg_sounds” is the prefix, and the second part is the name itself. You can change them as you please. The next four lines tell the engine what to do with these sounds, just take them for granted. The last line is . wav file that will be downloaded, and the relative path from the folder “/steamapps/half-life 2 episode two/ep2/sound/”. All you need to do is place all your audio files in this folder and make sure that their names and extensions match those specified in the script file.

If you have Windows Vista or Windows 7, we'll have to help Face Poser a little. As stated above, you will need the Phoneme Extractor patch for this. It's worth mentioning here that the Source SDK updates itself every time you run it, so the patch needs to be installed every time you open the Source SDK. Yes, it's tedious, but it's the easiest way, believe me.

With Face Poser open, we'll start creating a new scene. Under the Choreography menu, click New. I recommend that you save it immediately. Choose the name yourself, and the save folder is “/steamapps/half-life episode two/ep2/Scenes/RPG_MOD/”. It will be much easier to find later if you give it some kind of prefix, for example, “RPG_”. Now Face Poser will ask you to name the main actor (Actor). Call it “!_targetN”, where N is a number from 1 to 8, because we will have up to eight NPCs in each scene. Hammer will use the NPC you specify. We only have Grisha for now, so let’s call the actor “!_target1”. Right-click on the actor's name that appears in the Choreography menu, then go to New->Channel->Create Channel box. Name this channel "Audio". Now create another channel and name it “Anim” (for animation).

Now we need to sort our audio recordings. In the list of tabs at the bottom of the Face Poser screen, double-tap Phoneme Editor. In the window that opens, click "Load" and select the .wav file you want to add. Then click on "Re-extract" and Face Poser will prompt you to write the contents of the audio file as text. Write it in. Now, if you press the play button, you will be shown the face of the actor, whose lips will move. You can save everything and close this window. These steps must be repeated for each audio file.

If you want to add gestures, facial expressions, or other animations, you should do so now. I won't tell you how to do this in this article, you can read about it elsewhere. Next, save your scene (Choreography->Save). Now all that remains is to apply this scene to our NPC.

Adding third party audio to NPCs

Now we need to set up the dialog. We need to add the scenes we created to the "scene_start" and "scene_end" we created earlier. To do this, press Alt+Enter to open Object Properties, there find the “Scene file” option. Assign it to the newly created scene and save the changes. Do the same for "scene_end".

Event activation

In general, you can already create triggers yourself that will do anything, but I will give an example of what task you can do and how to implement it.

The player needs to kill five enemies. Each time an enemy dies, math_counter increases by one. When the counter reaches five, math_counter calls logic_relay. In turn, logic_relay stops mob spawning, activates NPCs and “relay_complete”.

Setting up autosave

Nobody likes it when one random crash ruins the results of many hours of play. Therefore, you should add a logic_autosave entity and call it every time the task is completed (you already know how to do this).

End of the game

The game will have to end at some point, and it won't be good if it just crashes to the main menu, so it's worth creating credits. To do this, simply place the following entities somewhere on the map:

Conclusion

I told everything I wanted. Now you can create any types of tasks, you know how to work with triggers and, in general, you can start writing your own simple mods for games. Good luck!

Source is the most popular game engine: at the moment when you read this article, more than a million people can play games written on it:

And this is not surprising: the engine was developed by Valve, which owns the largest gaming store - Steam, and its games are consistently at the top of the gaming top.

But, of course, the path to the top of fame was long: the history of the development of the Source engine began back in 1998, when Valve developers, finishing work on Half-Life 1, realized that they had a lot of developments that they would like to use somewhere. And it was then that the division into two engines appeared: GoldSrc, on which the current version of the game ran, and Source, which belonged to the future version of the game and had new, not yet debugged technologies. And that's why at E3, when Valve showed off the beta version of Half-Life 2, it was said that the game runs on the Source engine. This name stuck, and later GoldSrc completely disappeared.

Source Engine 2004 (Source Engine 6)

The first public version of the engine was released in 2004 along with the beloved shooter Counter Strike, which was named Source in honor of the engine. There were quite a lot of changes from the original version: clearer textures (512x512 pixels versus 128x128 in the original) and well-developed three-dimensional models. The engine's capabilities related to mirror reflections are widely used - for weapons equipped with an optical sight, you can see the environment (but not the models of other players) behind the player on the sight lens when it is not in a close-up state.

Sound effects now match the acoustic conditions, and support for 5.1 and 7.1 speakers has been introduced. New features of the engine helped make the maps more detailed: bottles and packages lying on the ground appeared. The physics engine, created on the basis of Havok, made it possible to improve the physics of grenade flight, explosions, and the effects of their destruction towards greater realism.

A little later that year, Half-Life 2 was released, which added to the above features: shader rendering (Half-Life 2 was one of the first games to use shader water) and facial animation (with support for precise synchronization of actors' speech with animation), and with the help of Havok the “rag doll” effect was obtained:




This version of the engine was used until 2005, and is currently outdated - all games written in SE 6 have been transferred to newer engines.

Source Engine 2005 (Source Engine 7)

An updated version of the engine, released in 2005. The main addition is support for High Dynamic Range Rendering, which the developers released to demonstrate in Half-Life 2: Lost Coast: this game is essentially a level that did not make it into the final version of Half-Life 2. HDR Rendering in Lost Coast includes several components :

  • HDR Skybox is the result of overlaying multiple sky exposures to create the effect of changing exposure in real time. Over 16 different HDR Skyboxes were created for Half-Life 2: Lost Coast.
  • HDR Refraction Effect - HDR light passes through refractive materials and takes on the properties of these materials (for example, when a beam of light passes through the stained glass windows in the monastery in Half-Life 2: Lost Coast, colored highlights are cast on the floor).
  • HDR Light Maps - light maps generated using the radiosity effect (light not only reflects from objects and enters the observer's eye, but also hits other objects, reflecting from them). You can notice, for example, inside the monastery in Half-Life 2: Lost Coast, by the sun spots on the walls opposite the windows.
Like SE 6, the 7th version is also outdated at the moment - in 2014, the last game on it, CS: Source, was transferred to Source Engine 24.

Source Engine 2006 (Source Engine 7: Base Source Engine 2)

The first version of the engine to have a development kit available to everyone - Source SDK Base 2006, which allowed many people to create their own modifications for Valve games. The engine has been slightly improved - it supports updated facial animation, multi-core rendering and updated HDR.

Since modifications created using the 2006 SDK are not compatible with newer versions of the engine, this version of the engine is still used by the authors of some mods, and it can hardly be considered current.

Source Engine 2007 (Source Engine 14)

A global release, it was first used in the collection of games from Valve - The Orange Box (it includes: Half-Life 2, Half-Life 2: Episode One, Half-Life 2: Episode Two, Portal and Team Fortress 2). In this version, shader rendering was updated, dynamic lighting and shading were significantly improved, a soft particle system appeared (which greatly improved the quality of effects such as rain and fire), cinematic physics was added, as well as new facial animation (it was supported by hardware acceleration at video cards) and improved support for multi-core processors.

SE 14 became the first version of the engine to support consoles - The Orange Box was released not only for PC, but also for PlayStation 3 and Xbox 360.

Just like with SE 7, the modifications created in the SDK for the 14th version did not work on newer ones, so this version of the engine is still in use.

Source Engine 2008 (Source Engine 14: Base Source 3)

Version of the engine created for the game Left 4 Dead:

It improved the cinematic physics by adding:

  • Dynamic destruction of game geometry - before this, destruction lines had to be specified by the map creator.
  • Deformable objects - Previously, physical models could not be changed in any way except based on pre-calculated animation.
Some effects have also been added, such as motion blur and depth of field.

Source Engine 2009 (Source Engine 15)

The version that was released with the game Left 4 Dead 2, later all Valve games of that time were updated to this version. This version has updated all functions, significantly improved the particle system, facial animation, scaling and the ability to update.

Source Engine 2010 (Source Engine 17)

The first version of the engine, ported to macOS. Initially, The Orange Box game package was ported to the Apple OS, and later all new Valve games began to be released for both Mac and Windows.

Source Engine Multiplayer (Source Engine 19, 21 and 23)

Versions of the engine tailored for multiplayer games such as Dota 2 and CS: GO. Also in 2012, support for Linux appeared: the game Team Fortress 2 was ported to it, and later other Valve games.

Source Engine 2013 (Source Engine 24)

The current version of the engine that Valve has ported most of its games to. Among the changes: to optimize the use of disk space, it was decided to abandon the use of bulky .GCF files (archives with game resources) in favor of a file system codenamed SteamPipe. Games on the new engine are now installed in the Steam\SteamApps\Common directory, and game files are stored in .VPK files. For the games Counter-Strike: Source, Team Fortress 2 and Half-Life 2: Deathmatch, a convenient system for adding custom content (mods) has been created: there is a custom folder, in which a folder with an arbitrary name is created, and classic folders of modification materials are added to it ( materials, models, etc.).

Compatibility with Linux was also improved, and in May 2014 Nvidia ported Portal and Half-life 2 to Android for its Nvidia Shield console (however, craftsmen were able to run these games on other devices running Android OS, but performance was low ).

Source 2

A fundamentally new version of the engine, released in 2015 by Valve along with the release of the updated game Dota 2 - Reborn. Alas, there was no technical presentation, it is only known that the engine still runs on the OpenGL API (perhaps the Vulkan API will be added in the future), and can also use as many processor cores as it has. Valve also promised that the engine would work better on older computers (RAM consumption was reduced), but Dota 2 Reborn turned out to be heavier than Dota 2 on Source Engine 24. Another important addition - VR support appeared, and the first demo game of The Lab for HTC Vive:

The future of the engine

Valve is silent about the further development of the engine, and this is not news for gamers (they are still waiting for rumors about Half-Life 3 and Portal 3, right?) So far, the second version of the engine is quite crude and requires improvement, and, obviously, Valve fix it corrects errors , and only Gabe Newell knows about future games and engine versions.