Half-Life SDK Programming #0: Introduction

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[my lousy Windows NT 5.0 startup sound recreation] Have you ever wondered, how the HECK do entities work on the inside? Or maybe you wanna add a new weapon to your mod. Or a new NPC. Or physics. Or vehicles. Or shaders. Or a proper stealth system. Whatever you can imagine. But there's a question. How to achieve any of that? One word. Programming. Some people call it coding, some call it scripting. I call it programming. Doesn't realy matter. Although if you don't know the difference, then that's gonna be a bit of a problem. As this tutorial series progresses, it's gonna assume that you know about variables, data types, functions, arrays, pointers and classes. Basically, the basics of programming. In the first couple of videos, I'll spoonfeed you entirely, walking you through basically everything. Buuut after that, you will really need to know enough programming to be able to write a basic but functional calculator console app. If you've done some game development in Unity, Unreal Engine, CryEngine, Godot or any other engine where you had to write code, this might be easy enough. However there will be crucial differences. Most modern game engines use an entity component system, whereas HL uses a class-based hierarchy. So, what this means is, in modern engines, an entity is basically an empty thing. And you put components into it, like a model component, maybe a player input component, and stuff like that. But in HL, that's a bit different. Each entity is sort of like a prefab, in terms of functionality. Now, there's one myth I wanna debunk. Some people believe that it's most appropriate to use old tools to mod old games. In the case of Half-Life, especially when it comes to programming, this is SO, SO WRONG. You see, 5 years ago, I used VS 6.0, which is an IDE from 1998. (so it's as old as Half-Life) And, it was just horrible, I'd never use that again. Modern versions of Visual Studio are just so much better. And, there are versions of the SDK that are compatible with those latest versions and it's just so much better. Debugging is better. Writing code is better due to IntelliSense and stuff like that. So yeah, if you can, you should totally use modern tools. Since this is just the introduction, I'll show you 3 things. What you can do with programming in HL What is required to follow this series AND some additional resources for learning For starters, here's some stuff you can do with programming. Vehicles. That's entirely possible, it's got nothing to do with the engine itself. You can do graphical effects, so this means stuff like shaders. You can do time-dependent entities, such as... I dunno Months ago, I wrote an entity called trigger_date, which basically checks the current date and if it's, like, the 12th of November or a specific year, it's gonna trigger something. You can make new console commands. You can change the view bobbing so it looks more modern, or player movement so the player can sprint, do wall running, wall jumping, whatever you can imagine. So, what is required to start doing any of this stuff? First of all, you're gonna need something that can edit text. Whether you're gonna use an IDE, or a text editor like Notepad, it's up to you. On Windows, I'd recommend you to use Visual Studio Community. At the time of recording this stuff, the latest version is 2019. I know. It's big, takes a while to download and you need a decent-enough PC to use it. If you can't use it, you can use VS 2010 instead. It's alright. I used to use it on my 2007 laptop. On Linux, however, you can use anything. [chuckles] Any text editor will do. Visual Studio Code is pretty neat. I haven't actually compiled or programmed anything on/for Linux before, but I will cover that at some point. I will use VS most of the time, but almost all programming concepts will apply on other platforms too. Other than a text editor, you will also need some C++ knowledge. And this is already assumed. I'm telling you. If you don't know programming, do not try ANYTHING advanced like weapons, NPCs and such. Do yourself a favour and spend a couple of months learning programming itself and C++. Now, speaking of C++ knowledge and knowledge in general here are some nice resources: First of all, I'd totally recommend Cherno's tutorial series on YouTube, I learned a good chunk of advanced programming topics and graphics programming and some engine programming thanks to his videos. There is more talking than coding and that's really good, because he explains a bunch of stuff. Then there's TWHL. This is THE place for GoldSRC modding, where people still write guides & tutorials on their Wiki, and they have what I'd consider an active Discord server with quite some helpful people. The Wiki also has links to archives of old VERC and Rust articles. VERC - Valve Editing Resource Center, I think - was an extremely good website with some quality articles, written by ambitious modders who worked on well-known projects at the time. Sadly, it got shut down in the mid-2000s. Next up, there's learncpp.com. If you like to learn things in a more traditional way, it's basically like a book with 18 chapters, 5 to 10 lessons each, I think Difference is, it's not a physical book. It's a website. If you're overwhelmed by the size of learncpp, or just wanna learn something fast, you can quickly go through cplusplus.com's fast-paced tutorials. It's got 7 chapters, 3 to 7 lessons each, though it may leave you with more questions than answers in the long run. Still, it's kinda nice for revising, and I started learning C++ on this website. Then we have SourceModding. It's a nice website with a bunch of links for GoldSRC, Source and Source 2 modding. But basically (for HL1), there are a bunch of links to programming tutorials and archives of old ones. Most of the HL programming knowledge from the late 90s and early 2000s can be found there. Though a lot of that is just copy-paste, but still, it's better than nothing. Before I end this video, I'll just say what I'm planning to do with this series and what's the point. So, firstly I'm gonna cover some basic stuff like creating new entities, setting up a mod and so on, then we're gonna do some advanced entity stuff such as an entity that flies around, follows the player and is breakable, which sounds like an NPC but it's really not. Then we're gonna do some clientside stuff like HUD icons, maybe view bobbing, and at some point we're gonna do some really interesting stuff like file I/O so we can put, like, a text file in our mod folder and the mod actually does something (with it). It can be used to enhance the modding workflow. We've only scratched the surface so far. In the far future, we might even get to stuff like implementing a money system, or implementing vehicles, or graphics programming, which means shaders. Maybe integrating a 3rd-party library such as a physics engine and much much more. So yeah, that should be about it for the introduction. As for why I've started this series, I felt like it was pretty necessary, especially in this day and age. Almost all tutorials about HL programming are written. Some of them are badly formatted, and TBH some people just don't really like reading. I personally do, it's just that I know some people who turned down entire tutorials just because they were written. Video tutorials are cool anyway, because I can talk and explain something, then at the same time put up an illustration of what I'm talking about. And I was inspired by my buddy Dimbeak, who is working on a mapping tutorial series. He's pretty cool, you should check his stuff out. In the next part, we're gonna install some stuff, set up a mod, and write a simple entity that prints "Hello world" into the console. [outro thingy lmao]
Info
Channel: Admer456
Views: 34,606
Rating: undefined out of 5
Keywords: half-life, valve, c++, programming, visual studio, tutorial, fox, foxes, sdk, half-life sdk, hl sdk, source, goldsrc, gamedev, game dev, game development, mod, modding, mod development
Id: kxVcwlSP9Ts
Channel Id: undefined
Length: 9min 23sec (563 seconds)
Published: Tue Oct 20 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.