aboutsummaryrefslogtreecommitdiff
path: root/compile
Commit message (Collapse)AuthorAgeFilesLines
* 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-6/+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.
* Rework OS abstractionsGravatar Michael Smith 2024-08-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | - 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/+2
| | | | | | | 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 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-2/+3
| | | | | - Add a couple of overdue -Werrors that make life easier - Reshuffle cc/ld flags a bit, mainly around -fuse-ld=lld
* Get things at least compiling under LinuxGravatar Michael Smith 2023-08-271-8/+8
| | | | | | | | | | | Nothing really works yet, but at least test.h and fastspin are fixed and some of the issues with RTTI and libdl and stuff are maybe kind of sorted, subject to more testing later. The main issue now seems to be the cvar interface not quite lining up and crashing pretty much immediately. That'll probably take a lot more debugging to figure out, which likely still won't be a priority for quite a while.
* Make various preparations for upcoming featuresGravatar Michael Smith 2023-08-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | 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
|
* Adapt vote reset code into fast campaign resettingGravatar Michael Smith 2023-06-031-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Move towards C23, improve events and vcall macrosGravatar Michael Smith 2022-09-131-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+5
| | | | | | | | 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.
* 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-0/+2
| | | | | Some of the alias stuff was kind of stolen from earlier figuring-out Bill did. More Bill code is also on the way. :^)
* Solve the error logging situationGravatar Michael Smith 2022-06-021-2/+6
|
* Add basic Portal crosshair colour customisationGravatar Michael Smith 2022-05-301-0/+1
| | | | | | | | | | | 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-0/+4
| | | | | | | | 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-1/+5
| | | | | | | | | | | | | | | - 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-1/+2
| | | | Default gamedata values actually work the way they're supposed to now.
* Replace udis86 with a very small x86 decoderGravatar Michael Smith 2022-04-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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-21/+33
| | | | | They're still temporary, I promise, but this will make tweaking the toolchain or turning debug builds on and off a lot simpler.
* Tidy up stubs, make vstdlib a stub, build on LinuxGravatar Michael Smith 2022-01-061-3/+5
| | | | | | 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.
* Fix build scripts and codegen on LinuxGravatar Michael Smith 2022-01-061-2/+2
| | | | | | | | | | | SST itself doesn't build, but it's a start! Really interesting is the declaration after a switch label. That's of course invalid, but Clang on Windows never complained. I guess it's an MSVC extension, eh? How annoying. Also, haha yes the script wasn't even executable. Forgot to update-index when I remade the repo, I guess...
* Split up os.h, inline functions and fix some typosGravatar Michael Smith 2021-12-301-3/+2
|
* Reintroduce autojump codeGravatar Michael Smith 2021-12-271-0/+1
|
* Unhide useful commands and allow cheats in lobbiesGravatar Michael Smith 2021-12-261-0/+2
| | | | | | | | | | | | | This is done through a new "fixes" file which will probably become one of those silly dumping grounds that every project has to have somewhere to put random miscellaneous crap in. These are mainly hidden in L4D2 but they just get unilaterally unhidden if they exist, just to be sure they're accessible. As a bonus, it turns out that unhiding a single cvar also allows us to set sv_cheats 1 in Left 4 Dead 2, bringing an end to the need to port- forward a listen server for co-op practice.
* Initial public snapshotGravatar Michael Smith 2021-11-201-0/+57
With code from Bill. Thanks Bill!