aboutsummaryrefslogtreecommitdiff
path: root/compile.bat
Commit message (Collapse)AuthorAgeFilesLines
* Make Steam L4D1 demos backwards-compatibleGravatar Hayden K 2025-04-061-0/+1
|
* Add feature to remove the chat rate limitGravatar Hayden K 2025-04-061-0/+1
| | | | | This probably works for basically every game, but it was only tested for L4D/L4D2/L4D:S/Portal 2.
* Fix broken behaviour in the L4D2 addon systemGravatar Hayden K 2025-04-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This should greatly improve the experience of running newest/TLS as well as custom campaigns. The bugginess in question is quite a lot to explain so there's some rather substantial exposition via code comments. The actual fixes are comparatively simple, although still a little subtle to get exactly right and took a few iterations to nail down the edge cases. Thanks to bill for helping me with the RE & assistance on writing the hooks/code and so on. I tracked down a lot of this myself, but the end result wouldn't have been possible without his help. Committers' note: I ended up wrangling this change a fair bit, as I am apparently just always wont to do, and also fixed a bug in the process, hence adding my copyright notice as well. Nonetheless, big thanks to aciidz (and bill) for doing the bulk of the *actual* hard work of figuring out how to do any of this! The actual code changes I made to the original submitted patch were relatively minor; a lot of my effort honestly went into attempting to shorten the massive wall of comment text. At the end of the day, there's still a really long comment, but it's just a lot to explain really so it is what it is. I hope it's at least somewhat understandable to a reader, anyway.
* Rewrite and redesign codegen and feature systemGravatar Michael Smith 2025-04-061-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Also switch to somewhat proper C23 flags while we're at it. This is a huge change. It took me forever, in between being really busy. Sorry about that. But the good news is I'm now free to start integrating the various patches that have accumulated since last release. Well, at least in between still being really busy. Gotta manage expectations. The main benefit of introducing GAMESPECIFIC() is that features that don't apply to a particular game no longer show up *at all*, and less time is wasted on init. It also enables a cool optimisation wherein unnecessary REQUIRE_GAMEDATA() checks can elided at compile time whenever the gamedata is known up-front to always exist in supported games. The DEF_FEAT_CVAR macro family meanwhile makes it easier to manage the lifecycle of cvars/ccmds, with less manual registering, unhiding and such. Originally I was going to try and just hack these features into the existing codegen abomination, but it just got too terrible. This rewrite should make it easier to continue tweaking codegen behaviour in future. It also has slightly better error messages.
* Remove redundant and/or incorrect -municode flagGravatar Michael Smith 2024-09-281-3/+3
| | | | | | | | This tells MinGW toolchains, which we don't use, to use wmain() instead of main(), which we're also not doing for these programs. With the regular Clang toolchain that we do use, it makes no difference. In any case, then, we might as well remove it.
* Enable rebuilding the plugin while it is loadedGravatar Michael Smith 2024-09-281-1/+18
|
* Add basic button input HUDGravatar Matthew Wozniak 2024-09-141-0/+1
| | | | | | | | | | | | Committer's note: this is heavily modified from the original code contributed by woz (and somewhat improved by bill and aciidz). Copyright notices reflect joint authorship accordingly. woz still gets commit authorship though because it feels wrong to yoink that from someone. :^) And yes, the original code was written in 2022. Time flies. A lot of the code is still kind of hacky and ugly and I'd like to improve it later but there's other things to do so that can wait.
* Add very basic client console messaging for L4D2Gravatar Michael Smith 2024-08-291-0/+1
| | | | | | | | This isn't totally ideal - it'd be nice to have a way to get colours working, at least for errors/warnings. But it might not really be possible to do that without custom networking stuff, so this will do for the forseeable future. The main goal is just to be able to have CON_SERVERSIDE commands actually give output to the relevant player.
* Add basic server-side tracing functionalityGravatar Willian Henrique 2024-08-291-0/+1
| | | | | | | | | | | Restricted to L4D for now due to known ABI compatibility issues on other branches. This should be easy to fix later when needed elsewhere. Committer's note: I've counted myself as a joint author and added a copyright notice to the .c file since this code is reasonably modified from the code bill originally wrote last year. but June of this year and , so I've gone ahead and corrected his copyright notice too, with permission.
* Rewrite the gamedata and entprops systems entirelyGravatar Michael Smith 2024-08-231-8/+6
| | | | | | | | | | | | This removes the horrible janky old KeyValues parser and replaces it with a couple of trivial ad-hoc text parsers. In doing so, make the format of the actual gamedata files more human-friendly too. We also gain support for nested SendTables in mkentprops, which are required to get at various things like player velocity. And, the actual string matching is made more efficient (or, at least, more scalable) by way of a cool radix tree thing which generates a bunch of switch cases on distinct characters.
* Prevent errorlevel weirdness in compile.batGravatar Michael Smith 2024-08-221-21/+20
| | | | | | | | | | | | | | | This is an issue I've known about for a little while and kept forgetting to fix here. It's not been a huge issue for anyone, but still, improving correctness is always a good thing. Essentially, if you run a batch file straight through cmd /c, rather than interactively, exit /b with no number doesn't actually propagate the errorlevel value correctly, which is obviously bad. To fix this, just jump to the end on error and then explicitly return the errorlevel. If everything succeeds, this will of course still return 0, as expected. Special thanks go to Microsoft for writing this bug decades ago and never fixing it, probably in the name of backwards compatibility.
* Rework OS abstractionsGravatar Michael Smith 2024-08-221-10/+26
| | | | | | | | | | | | | | | | | | | | | | - As much as possible avoid dragging system headers into translation units. This should avoid namespace pollution and, hopefully, speed up builds a little bit. - Avoid leaning on the UCRT so much on Windows - prefer native win32 calls and native file handles except where doing so is inconvenient (in particular, for stat(), which we might try and replace later). - Also, switch from SystemFunction036 to ProcessPrng on Windows. This requires us to generate a stub for bcryptprimitives.dll because Microsoft haven't bothered to provide a link library, but the function is better-documented and seems to be a more direct under-the-hood call as well. Apparently it's what's used by the major web browsers these days, which seems like a good indication it's stable and trusted. - Lastly, remove a bunch of functions and macros and stuff that weren't actually being used. It seems good to try and keep the scope of OS-dependent stuff relatively contained and only add to it when actually required.
* Add a half-decent custom crosshairGravatar Michael Smith 2024-01-211-0/+2
|
* Add VGUI HUD overlay drawing featureGravatar Matthew Wozniak 2023-12-191-1/+3
| | | | | | | Currently only supports Orange Box and Left 4 Dead branches. There's quite a large amount of gamedata involved in making this work, and figuring it out for the likes of Portal 2 doesn't seem like a major priority at the moment.
* Don't compile kv.c as part of SST itselfGravatar Michael Smith 2023-12-171-1/+0
| | | | | | | | Of course, this has only been used at build time for quite a while now. Silly oversight! The linker would have dropped it anyway so this will just avoid some wasted effort.
* Cancel fast-forward after the player disconnectsGravatar Michael Smith 2023-12-171-0/+1
| | | | | | | | Avoids spurious and confusing fast-forward behaviour in the event of resetting a run, then disconnecting early and deciding to load some other map. Also fixes a stupid typo (s/propand/propane/).
* Add cutscene skipping to L4D quick resetGravatar Michael Smith 2023-12-041-2/+1
| | | | Also done with quite a lot of RE help from bill - thanks again!
* Add a way to fast-forward game timeGravatar Matthew Wozniak 2023-11-261-0/+1
| | | | | | | | | | | | This will be mostly useful for skipping cutscenes in Left 4 Dead games. It may work in other games, but probably won't really be as useful. Committer's note: this was adapted a fair bit from woz's original code, hence the joint copyright, but he did most the hard work of figuring out how to get this deep into the engine's call stack. Thanks! bill also provided a fair bit of help figuring out missing gamedata and fixing compatibility with L4D2 2147 and later. Also thanks!
* Perform minor build script tidyingGravatar Michael Smith 2023-08-301-14/+15
| | | | | - Add a couple of overdue -Werrors that make life easier - Reshuffle cc/ld flags a bit, mainly around -fuse-ld=lld
* Fix editorial mishapGravatar Michael Smith 2023-08-271-1/+0
|
* Remove vcruntime140.dll dependencyGravatar Michael Smith 2023-08-271-5/+9
| | | | | | | | | This will save users having to install the VS runtime in order to load the plugin. Turns out there was very little to implement to make this work. Turning off stack probing might cause spooky outcomes further down the line but we'll burn that bridge when we get there.
* Make various preparations for upcoming featuresGravatar Michael Smith 2023-08-021-3/+5
| | | | | | | | | | | | | | | | | | | | | | A lot of this is random WIP from a while back, at least a month ago, and is being committed now to get it out of the way so that other patches can be brought in and integrated against it without causing headaches. Also rolled into this commit is a way to distinguish plugin_unload from exiting the game. This is required for another soon-to-be-integrated feature to avoid crashing on exit, and could in theory also be used to speed up unloading on exit in future. While we're at it, this also avoids the need to linearly scan through the plugin list to do the old branch unloading fix, because we can. Rough summary of the other smaller stuff I can remember doing: - Rework bitbuf a bit - Add some cryptographic nonsense in ac.c (not final at all) - Introduce the first couple of "chunklets" libraries as a sort-of subproject of this one - Tidy up random small bits and bobs - Add source for a small keypair generation tool - Rework democustom to be very marginally more useful
* Fix another x86 case and add regression testsGravatar Michael Smith 2023-08-021-0/+2
|
* Fix spuriously-included test case in compile.batGravatar Michael Smith 2023-06-141-2/+0
| | | | | | | | This was clumsily added in 1c4318331663b152b0b298bd2c9e5c971506a86b as a test case for code I was writing at some point but has not been included in the repository yet. This means the 0.6 tag is broken for anyone trying to build from source unless this change is cherry-picked on top. Lesson learned: keep the working tree clean!
* Prune some comments and tidy up other minor thingsGravatar Michael Smith 2023-06-101-3/+8
|
* Adapt vote reset code into fast campaign resettingGravatar Michael Smith 2023-06-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is kind of a breaking change but the other code was obviously never released or relied on by anyone - it will be pushed at the same time as this in fact. It still seems worth having the original committed separately to show the progression of development of the feature, however. Technically the standalone vote cooldown resetting could also be added back if ever desired however there doesn't seem to be that much of a use case for that at the moment. This feature ought to be a lot more convenient now as it allows for resetting back to a set starting point no matter where the player is in a run. It isn't universally useful as All Campaigns Legacy solo runs require switching to a different type of server and Main Campaigns co-op runs require restarting the game after Swamp Fever to work around the god mode bug, however it is still useful in a good few situations. Unfortunately this turned out to be pretty complex to implement, first requiring a bunch of interop with valve's rather wacky KeyValues stuff, and then requiring a bunch of especially difficult reverse engineering of L4D1 v1.0.0.5 because it doesn't use said KeyValues stuff and does something else completely different instead. A side effect of all this work is that the nag removal hack is now part of the KeyValues stuff in kvsys.c, which is kind of a comfier place for it than just kind of dumped in the middle of sst.c.
* Add command to reset L4D2 vote cooldownsGravatar Willian Henrique 2023-05-211-0/+1
| | | | | | | | | | | | In most versions of L4D2, players cannot call a vote (e.g. switch campaign, change difficulty, restart campaign) more than once every 3 minutes. This makes resetting on a first map a pain, usually requiring reloading the map to reset the vote state. This new sst_l4d_vote_cooldown_reset command empties the list of structures tracking vote callers, allowing all players to vote again immediately. This should make resetting runs a lot easier on versions without unlimited votes.
* Add snd_mute_losefocus backportGravatar Willian Henrique 2023-05-171-1/+3
|
* Move towards C23, improve events and vcall macrosGravatar Michael Smith 2022-09-131-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Another big one. Here's a list of things: - Since the upcoming C23 standardises typeof(), use it as an extension for the time being in order to allow passing arbitrary types as macro/codegen parameters. It wouldn't have been a big leap to do this even without standardisation since it's apparently an easy extension to implement - and also, to be honest, this project is essentially glued to Clang anyway so who cares. - Likewise, bool, true and false are becoming pre-defined, so pre-pre-define them now in order to get the benefit of not having to remember one header everywhere. - Really ungodly/amazing vcall macro stuff now allows us to call C++ virtual functions like regular C functions. It's pretty cool! - Events can now take arbitrary parameters and come in two types: regular events and predicates. All this makes the base code even uglier but makes the feature implementation nicer. In other words, it places more of the cognitive burden on myself and less on other people who might want to contribute. This is a good tradeoff, because I'm a genius.
* Import Monocypher 3.1.3 + monocypher-rng moduleGravatar Michael Smith 2022-08-161-0/+1
| | | | | | | | This is for somewhat later. I'd always planned to use it - it existed already in earlier private repos, in fact. I just didn't bother to import it here in case it wouldn't actually be needed, but with the way current plans are going, it's definitely going to be needed, so here it is.
* Add event systemGravatar Michael Smith 2022-07-231-1/+1
|
* Split custom demo data into its own file/featureGravatar Michael Smith 2022-07-231-0/+1
| | | | Copyright note: the stuff Bill wrote is all still in the other file.
* Add keybind lookup codeGravatar Michael Smith 2022-07-231-0/+1
| | | | Also centralise NEXT_INSN macro, into its own header at least for now.
* Add alias management plus input filtering skeletonGravatar Michael Smith 2022-07-231-5/+5
| | | | | Some of the alias stuff was kind of stolen from earlier figuring-out Bill did. More Bill code is also on the way. :^)
* Add update detection, clean up minor stuffGravatar Michael Smith 2022-06-271-2/+2
|
* Solve the error logging situationGravatar Michael Smith 2022-06-021-25/+41
|
* Add basic Portal crosshair colour customisationGravatar Michael Smith 2022-05-301-2/+3
| | | | | | | | | | | Currently only works in 3420 and 5135 and uses hardcoded offsets with a byte pattern sanity check. Future work includes making it more widely compatible, and also doing the crazy thing I wanted to do but gave up on wherein the actual textures and stuff get patched in memory to sync up all the colours. Oh also, a couple of vtables were erroneously made executable, so I went ahead and fixed that while I was at it.
* Add entity property finding and L4D warp testingGravatar Michael Smith 2022-05-031-3/+7
| | | | | | | | This was a lot more code than expected, but it might be finally close to time to release the next beta... We'll see if any more rabbit holes present themselves to jump into, though.
* Centralise engine access, add Portal FOV changerGravatar Michael Smith 2022-04-301-3/+7
| | | | | | | | | | | | | | | - A bunch of stuff is now defined in one header, engineapi.h - engineapi.c is responsible for setting up any interfaces/stuff that's used in more than one place - mkgamedata is pretty much rewritten and now supports nested conditionals - gamedata variables no longer have the gamedata_ prefix because it was just annoyingly long all the time - vcall macros are somewhat revamped and support dynamic (gamedata) indices - Portal 1 FOV can be set anywhere from 75-120 using fov_desired - tested in both the main versions currently used by runners - A few typos were also fixed ("intput," "writeable," "indexes")
* Add engine_no_focus_sleep backport, fix codegenGravatar Michael Smith 2022-04-251-3/+4
| | | | Default gamedata values actually work the way they're supposed to now.
* Fix dark L4D2 rendering on Intel integrated GPUsGravatar Michael Smith 2022-04-251-1/+1
| | | | Thanks Aciidz for helping test this.
* Move WIN32_LEAN_AND_MEAN and NOMINMAX into flagsGravatar Michael Smith 2022-04-241-1/+1
| | | | | | | | They're literally always defined thusfar, and it's always possible to include specific headers for other stuff. So, rather than litter the source with defines (which might not even work in the likes of os.h if some other system header already decided to define/include stuff), let's just define it at the build script level.
* Dynamically link the Windows C runtimeGravatar Michael Smith 2022-04-241-3/+9
| | | | | This brings the DLL size down to a quarter of what it was. Dunno why Clang doesn't do this by default, but apparently it doesn't!
* Replace udis86 with a very small x86 decoderGravatar Michael Smith 2022-04-241-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | hook_inline() uses the new x86_len() function to get instruction lengths instead of doing full-blown disassembly, which should be a tiny bit quicker, and also removes the next for about 90KiB of lookup tables and such in the final binary. The code-digging logic in demorecord is also rewritten to be opcode-based rather than mnenmonic based. In general, going forward the plan is to always rely on opcodes and thus avoid a bunch of disassembly work every plugin load. udis86 is still in the tree for now to provide dbg_asmdump(), but it's only compiled into debug builds and left out of releases completely. As such, the whole BSD licence statement is also gone from the distribution LICENCE files. There's now also a dbg_toghidra() which spits out a rebased address to look stuff up for proper reverse engineering, which might be more useful than dbg_asmdump() anyway. If nobody ends up using the latter ever again, udis86 could get chucked completely. We'll see. Also shoehorned into this commit are a couple more forgotten copyright year bumps and some general minor cleanup here and there, because I couldn't be bothered wading through all the diff hunks. Oh, and makebindist.bat now makes an effort to make the zip file timestamps predictable/reproducible. That should be a different commit for sure, but oh well too bad.
* Make build scripts *slightly* more flexibleGravatar Michael Smith 2022-03-301-19/+30
| | | | | They're still temporary, I promise, but this will make tweaking the toolchain or turning debug builds on and off a lot simpler.
* Work around plugin unloading bug in old branchesGravatar Michael Smith 2022-03-231-1/+1
| | | | | This also introduces some stuff for interacting with the current plugin list. Other plugin management utilies are Coming Soon...
* Add m_rawinput reimplementation to replace RInputGravatar Michael Smith 2022-03-211-2/+3
| | | | | It's archive so you can set m_rawinput 1, load SST via VDF and then never think about it again.
* Tidy up stubs, make vstdlib a stub, build on LinuxGravatar Michael Smith 2022-01-061-2/+3
| | | | | | Important note: it doesn't WORK on Linux, and there's tons of warnings and stuff, but it's easier to work on when all the compiler output and whatnot is there.
* Split up os.h, inline functions and fix some typosGravatar Michael Smith 2021-12-301-4/+3
|
* Reintroduce autojump codeGravatar Michael Smith 2021-12-271-2/+3
|