aboutsummaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite and redesign codegen and feature systemGravatar Michael Smith 2025-04-0646-1548/+1614
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Lowercase the stupid file, Windows. ARGH.Gravatar Michael Smith 2024-10-011-0/+0
| | | | Actually kind of Neovim's fault, I think. Whatever.
* Refine input HUD layoutsGravatar Michael Smith 2024-09-291-63/+77
| | | | | | | | | - Get rid of +left/+right things, as they were deemed unnecessary. - Add missing reload button in L4D games - Put a vertical gap between the group of directional buttons and attacks, and all the other buttons. While we're at it, add a few branch hints and fix up the includes.
* Add missing newlines to clientcon messagesGravatar Michael Smith 2024-09-281-3/+3
| | | | | | Just had a brain fart when writing this code initially, woops. Just as well I have people pointing these things out to me before I end up making releases with such mistakes. At least, usually. :^)
* Fix crash on exit when our raw input is usedGravatar Michael Smith 2024-09-281-2/+3
| | | | | | | | | | | | Turns out window messages still get generated after the plugin is unloaded, causing now-unloaded SST code to get called. In some edge cases some Windows appCompat logic will also then start suppressing FreeLibrary calls for that game, which breaks plugin hot reloading. Very dumb and very confusing. I didn't notice the crashing before due to lack of minidumps from the relevant games, so thanks aciidz for pointing this issue out.
* Create and use macros to define accessor functionsGravatar Michael Smith 2024-09-285-21/+116
| | | | | | | Avoids the need to manually mess around with mem_offset() and gamedata off_ and sz_ values as often, because that's kind of annoying. Should also make the codebase a little less confusing for new players.
* Use single-precision trig functions in testwarpGravatar Michael Smith 2024-09-251-3/+3
| | | | | There was never a need to calculate more precision and then throw it away again. This was just an oversight.
* Address some minor L4D warp testing oversightsGravatar Michael Smith 2024-09-161-4/+12
| | | | | | | - Check the player's team before attempting any form of warp prediction (as per the code bill wrote before) - Avoid overlapping boxes and an unnecessary line draw in the case where the player is never actually stuck.
* Increase mouse factor limit to 100Gravatar Michael Smith 2024-09-151-1/+1
| | | | | | Requested repeatedly by Portal people, and I don't see why not. We were conservative at first but I've yet to come up with a real reason why slowing mouse input further would be a problem.
* Add basic button input HUDGravatar Matthew Wozniak 2024-09-145-15/+490
| | | | | | | | | | | | 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.
* Fix an include-what-you-use omissionGravatar Michael Smith 2024-09-081-0/+1
|
* Improve the HUD API slightlyGravatar Michael Smith 2024-09-082-6/+23
| | | | | | | - Add text size measurement (for centring etc.). - Add a wchar_t equivalent since ushort would be wrong on Linux. Avoid actually using wchar.h because it's a big bloaty header, particularly on Windows.
* Fix a Linux woopsy in os.c I spotted the other dayGravatar Michael Smith 2024-09-081-1/+0
| | | | | | Note: for all I know Linux isn't even compiling right now - I rarely actually test that. But still, might as well fix this since it's an obvious mistake.
* Un-break and re-fix x86Gravatar Michael Smith 2024-09-072-8/+13
| | | | | | The last fix was, uh, not good. With any luck this is actually correct now. Certainly, running many millions of test cases fails to find any mismatch with udis, so it's at least a lot less wrong than it was.
* Fix more broken x86 casesGravatar Michael Smith 2024-09-062-3/+4
| | | | Thanks Evan Lin for reporting.
* Improve L4D warp testing and add visualisationGravatar Willian Henrique 2024-08-301-11/+275
| | | | | | | | | | | | | | sst_l4d_testwarp will now unstick the player unless "staystuck" is specifed as an argument. Additionally, sst_l4d_previewwarp is added to show the positions checked by the unstuck logic as well as the line-of-sight traces performed. Committer's note: the actual box-drawing logic was essentially rewritten by me since I realised the order of drawing didn't matter at all. All the code-digging logic is more-or-less still what bill wrote, though. So, you could say we have joint authorship of this, I suppose. Not that that's a huge deal, but if anyone's ever curious or if it ever legally matters for some reason then, well, there you go.
* Add very basic client console messaging for L4D2Gravatar Michael Smith 2024-08-294-2/+77
| | | | | | | | 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.
* Unhide con_logfile in fixesGravatar Michael Smith 2024-08-291-0/+1
|
* Add basic server-side tracing functionalityGravatar Willian Henrique 2024-08-292-0/+161
| | | | | | | | | | | 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.
* Fix mkentprops for real this time, probablyGravatar Michael Smith 2024-08-292-19/+27
| | | | | Last fix was apparently enough to make the release work, but not enough to actually work in general, lol. With any luck, it's actually good now.
* Begin the new version cycle yet again at 0.9Gravatar Michael Smith 2024-08-262-5/+5
|
* Add the one update note to release again, alreadyv0.8-BETAGravatar Michael Smith 2024-08-261-1/+1
|
* Fix broken mkentprops code generationGravatar Michael Smith 2024-08-261-3/+5
| | | | I screwed things up even more than I thought!
* Bump version to 0.8 for next releaseGravatar Michael Smith 2024-08-262-7/+5
|
* Add update notes and bump zip version for releasev0.7-BETAGravatar Michael Smith 2024-08-261-1/+3
|
* Add a quick hack fix for Portal 4104 demo playbackGravatar Michael Smith 2024-08-231-1/+30
| | | | | | Thanks Evan Lin for doing the hard RE work to figure out the necessary patch - I just reimplemented that here in about the dumbest way possible.
* Rewrite the gamedata and entprops systems entirelyGravatar Michael Smith 2024-08-239-695/+504
| | | | | | | | | | | | 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.
* Fix an old and stupid woopsy in hud.hGravatar Michael Smith 2024-08-231-1/+1
| | | | | | | | | | This wasn't woz's fault - I did some wrangling of his code and introduced this woopsy without noticing. Thanks to aciidz also, for pointing it out recently. Not touching the copyright years because it's such a stupidly trivial thing - I can't really claim to have done anything substantial here.
* Revise syntax macros and add a ton of branch hintsGravatar Michael Smith 2024-08-2337-292/+355
| | | | | | | | | My new programming style is branch hints. All non-confusing branches must be hinted when I can be bothered. It's faster, sometimes, maybe. Also, start trying to use more signed sizes in at least some of the places where it makes sense. Unsigned sizes are surprisingly error-prone!
* Rework OS abstractionsGravatar Michael Smith 2024-08-2218-361/+557
| | | | | | | | | | | | | | | | | | | | | | - 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.
* Bump the version to 0.7, ahead of next releaseGravatar Michael Smith 2024-08-052-12/+5
|
* Hotfix broken Portal 5135 autojumpv0.6-HOTFIXGravatar Michael Smith 2024-05-281-2/+2
| | | | | | | | The tf_arena_max_streak check turns out not to work on autoload since the client isn't loaded yet so the cvar doesn't exist yet. Using the server-side cvar tf_escort_score_rate appears to do for now. Also bump the zip date again since I'm doing this after midnight :^)
* Hide custom crosshair in menus/load screensGravatar Michael Smith 2024-05-272-2/+8
| | | | | | | | | | This isn't perfect logic - the standard crosshair has a lot more cases where it's not displayed - but it's better than nothing and avoids looking stupid as often. In the process, also fix the IConVar virtual table being one entry too small, which somehow wasn't a problem until it led to vtidx_IsInGame here getting clobbered and causing hard-to-debug crashes. Woopsy!
* Support fast-forwarding 38 custom L4D2 campaignsGravatar Hayden K 2024-05-221-17/+109
|
* Prepare a changelog for next releaseGravatar Michael Smith 2024-05-221-1/+8
|
* Disable fastfwd outside L4D so SPT doesn't breakGravatar Michael Smith 2024-05-211-0/+7
|
* Add temporary plugin version identifier to demosGravatar Michael Smith 2024-05-211-1/+11
| | | | | | | | | | | | I've resisted doing this for a long time but it's getting to the point where blocking a release indefinitely is a real problem, and this satisfies the original request from some leaderboard people to just make SST identifiable in some way or another. It means the demo stuff can happen at whatever pace it happens at and other stuff can happen independently. Less stress and sadness. Of course, it'll only be kept in as long as required, but there'll be no rush to get rid of it for any particular release either.
* Deal with the stupid NVDTOR situationGravatar Michael Smith 2024-05-216-33/+19
| | | | | | | Bill suggested using abi.h for this. Not sure if it's 100% ideal to need to pull in the whole header for this one macro but it's arguably better than most alternatives and definitely better than just continuing to duplicate it ad nauseam.
* Fix compatibility with latest L4D2 updateGravatar Willian Henrique 2024-05-212-11/+58
|
* Fix miscategorised jmp instructionGravatar Michael Smith 2024-05-051-3/+3
| | | | Woops! Thanks Uncrafted for reporting this.
* Remove some unnecessary and/or confusing stuffGravatar Michael Smith 2024-02-263-6/+3
|
* Re-learn how to write C headers, apparentlyGravatar Michael Smith 2024-01-221-0/+5
|
* Learn to spell correctlyGravatar Michael Smith 2024-01-211-4/+4
|
* Rethink mem_loadoffset, and consequently, kill itGravatar Michael Smith 2024-01-2111-43/+58
| | | | | | | | | Suggested by bill. Having something semantically pointer-sized that's only ever used for stuff that's always 32-bit doesn't really make sense. Note that I intentionally did not add a copyright line for myself in hud.c because, I mean, come on. I'll just say I waive any claim to that tiny trivial change.
* Add a half-decent custom crosshairGravatar Michael Smith 2024-01-214-38/+218
|
* Add VGUI HUD overlay drawing featureGravatar Matthew Wozniak 2023-12-192-0/+266
| | | | | | | 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.
* Cancel fast-forward after the player disconnectsGravatar Michael Smith 2023-12-173-10/+125
| | | | | | | | 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/).
* Improve quickreset command descriptions a bitGravatar Michael Smith 2023-12-131-2/+2
|
* Add fast-forward gaps for checking item spawnsGravatar Michael Smith 2023-12-053-38/+122
| | | | | | This complicates things greatly! Therefore, it's a separate commit to the baseline fast-forward functionality, to keep the confusing stuff relatively contained.
* Add cutscene skipping to L4D quick resetGravatar Michael Smith 2023-12-047-52/+298
| | | | Also done with quite a lot of RE help from bill - thanks again!