Half-Life SDK Programming #4.1: Creating new weapons

แชร์
ฝัง

ความคิดเห็น • 107

  • @macdaddymario
    @macdaddymario 11 หลายเดือนก่อน +6

    And Valve just killed HL mods. Unless they update the Half-Life SDK after their 25th anniversary update... No mods will ever work on HL again after they remove the "pre 25th" build from the beta branch, which they've confirmed they will be doing.

    • @Admer456
      @Admer456  11 หลายเดือนก่อน +6

      Nah, that's a bit over-exaggerating. I get what you're saying though, but don't worry. This update was indeed very rushed and I feel the folks working on it were a bit reckless in regards to modding.
      Mods like Poke646 reportedly work fine. Ricochet, TFC and OpFor work too. People have reported that there are now secret "test" branches for OpFor and BShift, which is a clear sign Valve is working on patching the other games to make sure they work.
      On Twitter, a couple Valve devs mentioned plans to fix things up before releasing an SDK. We, for the first time in a bajillion years, got actual *communication* from Valve that isn't just an email once every 3 months followed by eternal ghosting.
      Some links about that:
      twitter.com/bburbank/status/1725583031296237618 - Burbank's initial comment on the anniversary update
      twitter.com/bburbank/status/1725702050649125295 - Burbank replies to someone who asked about engine limits that got bumped up
      twitter.com/bburbank/status/1725702485778772384 - then mentions that, basically, they wanna focus on critical issues before publishing the new SDK
      twitter.com/phys_ballsocket/status/1725660727363727384 - Joshua Ashton (person involved with many a Source thing) comments on the anniversary
      twitter.com/GunshipMarkII/status/1725670157014507769 - GunshipMarkII asks about any potential BSP limit lifts
      twitter.com/phys_ballsocket/status/1725670847292018779 - "Potentially, lots to fix that we broke before that though" a.k.a. "let us fix stuff first, then we'll improve more stuff"
      Now, alright, let's consider the case where Valve just collapses and we get none of that. It's a terrible situation, buuut, new mods are still perfectly fine! Namely, Solokiller figured out why mods based on his HL Updated SDK are crashing and has found a workaround. We are just waiting for the new SDK so that HL-Updated can catch up with the new code changes. (HL Updated SDK is what my tutorial series uses, so I'm affected too!)
      No matter what though, this month will be super confusing for new modders, ones who wanna code in particular. Written tutorials, wiki pages for modding etc. will need some updating. We'll just have to see. One thing's for sure though, and that's the HL modding community entering a new era. Whether it's a bad or good one, depends basically on what Valve is gonna do.

    • @macdaddymario
      @macdaddymario 11 หลายเดือนก่อน

      @Admer456 am a member of the ESF development team.
      Unless they drop an Half-Life SDK update, they've killed it. Wasn't an over exaggeration. Older releases work fine. Our in-team build does not work. At all right now.

    • @Admer456
      @Admer456  11 หลายเดือนก่อน +1

      @@macdaddymario Oh hi!
      Fair enough then. I do believe they'll bring out that update though.

  • @chris_hass
    @chris_hass ปีที่แล้ว +7

    Honey wake up, a new Admer456 video just dropped

  • @VanillaModTeam
    @VanillaModTeam ปีที่แล้ว +7

    Genuinely, thank you for existing and making these. It means a lot to me and my silly little half-life modding endeavors, I'm better at the other elements than I am the programming, so it really is quite the help.

  • @vhetutor
    @vhetutor ปีที่แล้ว +1

    So much effort for the opening gag, I love it

  • @Pacca64
    @Pacca64 ปีที่แล้ว +2

    I love your video style! It's very relatable. I love how you go through the whole process and carefully share all your little stumbling blocks and how to fix them; a lot of guides omit that and end up being kind of obtuse to newcomers.

  • @whateverforevermusic
    @whateverforevermusic 11 หลายเดือนก่อน +1

    I've been toying with making goldsrc maps for a long time now and finally understanding the sdk is what I hope will finally push me over the edge to making something worth releasing. That is to say, thank you for making videos about a 30 year old game engine sdk

  • @adrianananu5974
    @adrianananu5974 ปีที่แล้ว

    The best pne so far, thanks for helping me this whole time!

  • @amaruqlonewolf3350
    @amaruqlonewolf3350 ปีที่แล้ว +2

    Never once a disappointing video. Always top tier content, g'job.
    😘

  • @SOLAS2010
    @SOLAS2010 ปีที่แล้ว

    I finally came did you miss me? It's me the man who is asking you to put weapons tutorial. I love everything and thank you.

    • @Admer456
      @Admer456  ปีที่แล้ว

      Yeah, I remember ya. I hope it was worth the wait!

    • @SOLAS2010
      @SOLAS2010 5 หลายเดือนก่อน

      8 months later I still love your tutorials.❤❤❤

  • @nynx8269
    @nynx8269 11 หลายเดือนก่อน

    Even if visual Studio and c++ don't feel like working, I look forward to your videos!

  • @americanhuman1848
    @americanhuman1848 ปีที่แล้ว

    thanks, been waiting for this because I always had bugs when I tried it on my own

  • @krazzy6440
    @krazzy6440 ปีที่แล้ว

    You have incredible knowledge. This was excellent. Thank you.

  • @pest045
    @pest045 ปีที่แล้ว

    when we need him, he actually does tutorials, admer, you're fucking best!

    • @Admer456
      @Admer456  ปีที่แล้ว +1

      I wouldn't quite say I'm the best, there's always room for improvement, either in editing/production quality, or the effectiveness of teaching/explaining these topics

    • @pest045
      @pest045 ปีที่แล้ว

      @@Admer456 honestly, you're the best in gold source programming, in TH-cam, i think there's no one who went so deep in all of this. Still, I'm gonna wait source engine series like waiting for steam fixing their pipe, but you at least gonna make source tutorials right? Right? (Or my memory playing bad jokes with me)

    • @Admer456
      @Admer456  ปีที่แล้ว +1

      @@pest045
      There is a chance. When I finish the HL SDK programming series (it's about 40% done), I may potentially start a Source programming series.
      "May" and "potentially" being the keywords, because I am not sure. If a Source 2 SDK comes out, I am definitely jumping on that instead, though it's unlikely.

    • @pest045
      @pest045 ปีที่แล้ว

      @@Admer456 now i might reconsider wishing source 2 sdk, but gaben said "thanks and wait" and so we do, anyway, good luck admer! and remember, valve forever!.

  • @MonkeyWrench28
    @MonkeyWrench28 ปีที่แล้ว +1

    Magnificent video as usual! Just one question, is it possible to make casings stay longer?

    • @Admer456
      @Admer456  ปีที่แล้ว

      Yup. In ev_common.cpp around line 140, you may see this:
      gEngfuncs.pEfxAPI->R_TempModel(origin, velocity, endpos, 2.5, model, soundtype);
      If it's not there, look for the function "EV_EjectBrass".
      R_TempModel is a function that spawns models which can bounce around, i.e. it's usable for gibs, shells, casings...
      The 2.5 there is the "lifetime" of the thing that gets spawned, so by increasing it you'll make casings stay longer.

    • @MonkeyWrench28
      @MonkeyWrench28 ปีที่แล้ว +1

      @@Admer456 You're a massive help, thanks man!

  • @joeydomingo8845
    @joeydomingo8845 ปีที่แล้ว

    Thank you so much for effort for this may help for this tutorial

  • @kirillholt2329
    @kirillholt2329 ปีที่แล้ว

    epic, thanks for putting those together

  • @oliverb.8995
    @oliverb.8995 ปีที่แล้ว

    THIS IS WHAT IVE BEEN WAITING FOR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @cederickforsberg5840
    @cederickforsberg5840 ปีที่แล้ว

    How was people able to know all this before TH-cam tutorials?
    Thinking about the good old days of Half Life modding in late 90s early 2000s.
    I didnt even know how to open a SDK back then xD

    • @Admer456
      @Admer456  ปีที่แล้ว +1

      I like to think there were 3 or 4 people in the beginning, who were such expert programmers, they could figure the stuff out just by reading the code and understanding what's going on.
      From then onward, they would participate in IRC chats and forums and such, sometimes sharing their knowledge and helping out other people, and soon the number of people knowing this stuff increased.
      It's very simple, really. There were many websites at the time: Half-Life Programming Planet, VERC, Planet Half-Life, Snark Cafe, TWHL v1 etc.
      Some of them weren't about programming, but there were lots of pools of knowledge where you could learn about this.

  • @ruzgar1372
    @ruzgar1372 ปีที่แล้ว +3

    I was going to ask whether or not if you were going to ever make a tutorial about integrating an actual physics engine into Goldsrc as you teased in a video from like 2021 I think. It'd be cool to have a tutorial that teaches you how to change the engine on such a fundamental level be along this main series (or not).

    • @Admer456
      @Admer456  ปีที่แล้ว +2

      That'll be in a future series called Half-Life SDK Extras. I would love to do a mini-series about integrating JoltPhysics for instance.
      It's not really changing the engine itself, more like "fooling" the engine so it doesn't do anything while you do all the work yourself - that's how custom renderers can be made. Other times it's just adding stuff on top of what the engine does.
      Some people like to do something called hooking, where you override the engine code in real time. I.e. you patch regions of memory where the engine DLL is loaded. But that stuff is way too dirty IMO, I don't really wanna encourage that.

  • @jackraiser4391
    @jackraiser4391 11 หลายเดือนก่อน

    Love these series. Can't wait to make a mod. But I wanted to ask, will you include how to add multiplayer to the mods? If so I'd love it if you could include how to put bots for the maps as well.

    • @Admer456
      @Admer456  11 หลายเดือนก่อน

      Wdym "add multiplayer", it's already there. As for bots, I honestly don't really know, I never worked with them

    • @jackraiser4391
      @jackraiser4391 11 หลายเดือนก่อน

      @@Admer456 Some mods don't have multiplayer exactly. Black Ops for example doesn't. If you choose a map on multiplayer it'll just take you to random parts of the game without being able to do anything.

    • @Admer456
      @Admer456  11 หลายเดือนก่อน +1

      @@jackraiser4391 Right, but HL Updated SDK is multiplayer-enabled by default. Some old mods were made with the old singleplayer SDK before that all got standardised in 2013, so that's probably what's going on there.
      There's also a keyvalue in liblist.gam which indicates whether or not it should be singleplayer-only or not.

  • @egoros7
    @egoros7 ปีที่แล้ว +1

    hazardous course 2

  • @RandomPlayer-tr5ge
    @RandomPlayer-tr5ge 11 หลายเดือนก่อน

    this means i can put mmod weapons into brutal half life with 2 double the instability? Very Cool!

    • @Admer456
      @Admer456  11 หลายเดือนก่อน

      If you can implement their behaviours, then yeah

  • @DeanAmx
    @DeanAmx ปีที่แล้ว +1

    Coding weapons are actually a lot easier without the client prediction

  • @Mcs1v
    @Mcs1v ปีที่แล้ว

    Yaaay, new video! \o/

  • @cannolithearcticfox4405
    @cannolithearcticfox4405 ปีที่แล้ว

    Based Video Admer

  • @nno64209
    @nno64209 ปีที่แล้ว

    the legend returned!

  • @Fastmancz_
    @Fastmancz_ ปีที่แล้ว

    Thank you!

  • @Strelokos666
    @Strelokos666 ปีที่แล้ว

    I really wanna see modernized HL engine in the most practical and accessible way like Unity or Godot for example. All in one assembly tool with modernized hammer included inside would be cool. I'd even donate on that.

    • @Admer456
      @Admer456  ปีที่แล้ว

      Me too, that's why I happen to be working on an engine like that as a side project.
      Can you tell me more though? Why do you need a modernised HL engine? To make games, HL mods or total conversion mods?

    • @Strelokos666
      @Strelokos666 ปีที่แล้ว

      ​@@Admer456 You have probably seen the rise of retro themed games for the past 3-4 years - ps1 games, fast paced stuff like Ultrakill etc. So I generally feel like HL1 fits perfectly into that category.
      Why not combine that I thought? HL1 can be a good platform since many people are not particularly interested in creating stuff from scratch but have some experience with Source / GldSource modding and mapping.
      That way some kind of editor where you would be able to create scripts, see models and play sounds would come handy.
      I can speak for myself, no matter what stuff I'm grabbing today - 3d modeling, programming or whatever - I somewhat feel an urge to open Hammer and test random stuff there.
      I mostly have experience with mapping for Source and failed to do mod for it in early 10's so I feel some kind of grief even a decade+ later.
      Source is not in a very good state compared to modern engines, again, and is not open source I guess?
      From what I see Source 2 is no better and is not aiming to be competitor.
      So that's a shame and I thought having this ghost of the past reanimated, healthy and relatable would be amazing.

  • @abelito2912
    @abelito2912 ปีที่แล้ว

    gran video brother gracais por enseñar el moding de half life
    espero que ya salga decay solo mision finalizado salu2 de Peru!!

  • @presidentmilitaryedwardgru2507
    @presidentmilitaryedwardgru2507 ปีที่แล้ว

    I want to change the explosion sounds to a custom sound, but I can't find explosion3-4 or 5.wav anywhere. I did a Ctrl-Shift Find and found nothing.

    • @Admer456
      @Admer456  ปีที่แล้ว

      If they are in the game's files, you can just precache them and use them. No need to look around to see if other code uses them.
      As for impulse 101, look for ImpulseCommands in player.cpp I think.

  • @nVcypher
    @nVcypher ปีที่แล้ว +1

    horay

  • @maze7873
    @maze7873 10 หลายเดือนก่อน +1

    i might sound dumb here but does this way of making custom weapons also apply to half life 2 and gmod

    • @Admer456
      @Admer456  10 หลายเดือนก่อน +2

      It is a fine and genuine question, no worries.
      Sadly no, the exact steps of making weapons here do not apply to HL2, and especially not GMod

  • @AlexanderJH
    @AlexanderJH 10 หลายเดือนก่อน

    Make a weapon out of thin air

  • @REDSOURCE
    @REDSOURCE ปีที่แล้ว

    Admer baby girl, great video once again, but I have to ask.
    Is it really worth it to learn HL SDK to make your dream game in 2023?
    The engine is pretty dated, but in the back of my head it still kinda feels worth it, just because of the Half life charm behind it.
    I could be just talking out of my ass tho, which is why I wanted to ask for your opinion.
    Love you.

    • @Admer456
      @Admer456  ปีที่แล้ว +3

      Define "game", really. If it's an idea that you want to realise, it's gonna be fine if you're comfy with GoldSRC.
      If it's a game game, that's meant to be its own thing entirely, you can't even make that on GoldSRC. It's better to pursue something like Godot instead for that.

    • @REDSOURCE
      @REDSOURCE ปีที่แล้ว

      @@Admer456 Aight, cheers mate

  • @greenth-mac2550
    @greenth-mac2550 6 หลายเดือนก่อน

    I would like to learn how to make weapons that uses sprites and models as bullets like the RPG and gauss. I Could probably use that knowledge to make npcs able to fire these types of weapons.

    • @Admer456
      @Admer456  6 หลายเดือนก่อน +1

      You can look at their code, that's exactly how you learn!
      My next programming video will be about projectile weapons, so you may be in luck

  • @franzk.himmler1196
    @franzk.himmler1196 ปีที่แล้ว

    How do you use pev->body = 1 in v_models? I wanted to make a separate weapon called 'weapon_silencer' that acts identical to the glock, but has the silencer already attached. I put the pev->body = 1; everywhere but nothing seems to work. The silencer shows up once you deploy the weapon, but once the idle animations start, it goes away.

    • @Admer456
      @Admer456  ปีที่แล้ว +1

      Valve kind of forced pev->body = 0 on the clientside, *except* for the 357 in deathmatch, which sets it to 1.
      Around 18:06, I visit a function called HUD_WeaponsPostThink. In there, you can specify the bodygroup for the weapon.

    • @franzk.himmler1196
      @franzk.himmler1196 ปีที่แล้ว

      @@Admer456 Thank you so much! I'll try it when I wake up.

  • @willemidaho
    @willemidaho ปีที่แล้ว

    More good videos! Kinda wish you had edited like your other videos though.

    • @Admer456
      @Admer456  ปีที่แล้ว

      Yeah.
      It would be not very feasible for me to script all of that out, it's a huge chunk of work as you can see. Possibly, it'd be harder to follow too.
      I'll try to edit it more in the next one though, because now that there is a concrete example on how to implement an entire weapon, we can kinda start focusing on ideas & mechanics.

  • @Trungledorph
    @Trungledorph 5 หลายเดือนก่อน

    Sorry I feel so stupid.
    How do you build/compile the weapons.h file, for the changes to take effect outside of the SDK?

    • @Admer456
      @Admer456  5 หลายเดือนก่อน +1

      I have a video on how to set up everything and compile the code, you can find it in the playlist on my channel. Look for "#1: Initial setup"
      But TL;DR in Visual Studio you right-click on hl_cdll and click "Build", of course do the same for hldll, then copy the resulting DLLs to your mod

    • @Trungledorph
      @Trungledorph 5 หลายเดือนก่อน

      @@Admer456 That was a quick answer, thank you! That's exactly what I was looking for.
      Do you know if the reverse is possible?
      Let's say I wanted to edit or extract the weapons.h file of an existing mod.

    • @Admer456
      @Admer456  5 หลายเดือนก่อน +1

      @@Trungledorph Sadly it's kinda like trying to extract a raw egg from an already cooked one, you cannot really do it.
      If a mod is open-source, only then you really have a chance.

    • @Trungledorph
      @Trungledorph 5 หลายเดือนก่อน

      @@Admer456 Yeah that what I was afraid of.
      Anyhow, thank you so much for the quick and useful help!
      😘

  • @fastboii221
    @fastboii221 ปีที่แล้ว +2

    First, great video btw

    • @Admer456
      @Admer456  ปีที่แล้ว

      Congrats on being first! What prize would you like?

    • @fastboii221
      @fastboii221 ปีที่แล้ว

      @@Admer456 A hug

    • @Admer456
      @Admer456  ปีที่แล้ว

      @@fastboii221 Sure thing

    • @fastboii221
      @fastboii221 ปีที่แล้ว

      @@Admer456 See u on ulica

  • @z3n1te
    @z3n1te 7 หลายเดือนก่อน

    i've tried adding the better weapons sdk to my mod, it compiles fine, but when i run the mod, it crashes with Segmentation Fault

    • @Admer456
      @Admer456  7 หลายเดือนก่อน

      Oh boy this is gonna be fun
      Can you attach a debugger to it and see where exactly it crashes?
      Have you fully followed the tutorial also? There's a part where I'm assigning a function pointer in gEngfuncs that I missed

    • @z3n1te
      @z3n1te 7 หลายเดือนก่อน

      ​@@Admer456i just forgot the g_eng function, now it works, thanks anyway :)

    • @z3n1te
      @z3n1te 7 หลายเดือนก่อน

      @@Admer456well, it almost works, now i cant fire some weapons

    • @z3n1te
      @z3n1te 7 หลายเดือนก่อน

      @@Admer456this is really weird, some animations, sounds and particles/effects just dont work

    • @Admer456
      @Admer456  7 หลายเดือนก่อน

      @@z3n1te Okay, you're almost there. I presume you did the LINK_WEAPON_TO_CLASS stuff and that you compiled both hl.dll and client.dll?

  • @munchkin_mania
    @munchkin_mania 11 หลายเดือนก่อน

    are going to make your own mods?

    • @Admer456
      @Admer456  11 หลายเดือนก่อน +1

      Yes. This is for making your own mods

  • @LostGameDev102
    @LostGameDev102 ปีที่แล้ว

    Hi

  • @funnimanexe
    @funnimanexe 11 หลายเดือนก่อน

    unresolved external symbol "private: static class CWeaponRegistry * CWeaponRegistry::m_pHead" (?m_pHead@CWeaponRegistry@@0PAV1@A) for every weapon's obj file as well as hl_weapons.obj
    what is causing this?

    • @Admer456
      @Admer456  11 หลายเดือนก่อน

      You prolly didn't do:
      CWeaponRegistry* CWeaponRegistry::m_pHead = nullptr;
      in either hl_cdll or hldll.

    • @funnimanexe
      @funnimanexe 11 หลายเดือนก่อน

      @@Admer456 what are you referring to by "hl_cdll or hldll"? the only reference to this line in my src code is player.cpp. I put it in player.cpp because there is no weapons_shared.cpp in my repo

    • @Admer456
      @Admer456  11 หลายเดือนก่อน

      @@funnimanexe I'm referring to the two projects on the left hand side of Visual Studio.
      Weapons are networked entities, and as such they're present on both sides (client and server). The weapon registry thingy is also thus present on both.
      player.cpp only exists on the serverside, so what you should do is create a weapons_shared.cpp, and also add it to the other project (right-click in some place, then Add -> Existing item).
      Alternatively, just add the necessary line of code to hl_weapons.cpp, that'll work too, even if it's less proper to do it that way.

    • @funnimanexe
      @funnimanexe 11 หลายเดือนก่อน

      @@Admer456 where would i put it in hl_weapons?

    • @Admer456
      @Admer456  11 หลายเดือนก่อน

      @@funnimanexe Anywhere, so long as it's outside of any functions etc.
      To be safe, you can write it right below the #include code.