Mapbase MP Port 2025 (Mapbase TF2)#409
Conversation
…lveSoftware#797) * fix prediction for jumping when huntsman is charged/released * remove SetInternalChargeBeginTime override from CTFCompoundBow ValveSoftware#797 (comment)
…2013 into mapbase-mp-2025 # Conflicts: # CONTRIBUTING # src/game/server/SkyCamera.cpp # src/game/server/player.cpp
I've taken an initial look at the changes. About #321, what's interesting (to me anyways) is that construction from diff --git a/src/vscript/vscript_squirrel.cpp b/src/vscript/vscript_squirrel.cpp
index 0c5fa2fe6..0562120fb 100644
--- a/src/vscript/vscript_squirrel.cpp
+++ b/src/vscript/vscript_squirrel.cpp
@@ -1320,10 +1320,7 @@ bool getVariant(HSQUIRRELVM vm, SQInteger idx, ScriptVariant_t& variant)
tag == TYPETAG_VECTOR &&
SQ_SUCCEEDED(sq_getinstanceup(vm, idx, (SQUserPointer*)&v, TYPETAG_VECTOR)))
{
- variant.Free();
- variant = (Vector*)malloc(sizeof(Vector));
- //variant.EmplaceAllocedVector(*v);
- variant.m_flags |= SV_FREE;
+ variant = *v;
return true;
}
// fall-through for non-vector
|
|
My observations on vscript differences: There is no native function in TF2 that returns new script instances such as
They have
The offset hack in mapbase Then there is "script events" which is quite weird. It saves script functions in script, then executes those script functions through script calls to C++. I suppose whoever implemented it in L4D2 wanted a unified way of calling script functions by different authors, but the C++ section of this is completely passthrough.
It looks like They allow specifying Numbers roughly look like this:
It's odd that TF2 has a few debugoverlay functions individually exposed, mapbase uses TF2 includes the worst function ever They commented out ScriptDebug utility from L4D2 looks neat but I haven't used it before. They are also now obsolete with how convenient it is to use a real debugger, but they should be harmless apart from I think having TF2 doesn't have z33ky's stack allocation optimisation. I think it's worth keeping it. |
Includes a manually merged MRs from wgetJane wrt. scattergun prediction and minktusk with readme changes.
Spy bots should use Spy.MVM_TeaseVictim instead of Spy.TeaseVictim. The soundscript Spy.MVM_TeaseVictim will also need to be corrected as some of the sound paths are incorrect. Fixes: ValveSoftware/Source-1-Games#4794
Updated to remain sync'd with Valve's version.
…d-mapbase-support [HL2MP] Assorted changes for NPC support, Mapbase features in HL2DM, and new QOL features
Fixes: ValveSoftware/Source-1-Games#7691 When a Full Moon is active, the Halloween Spell text remains grayed out even though spells activate during a Full Moon.
…-2013 into mapbase-mp-2025
…-2013 into mapbase-mp-2025
added flag check for STUDIO_NO_OVERRIDE_FOR_ATTACH when drawing attachments on dropped weapons (replicated check used in econ_entity.cpp) -- should prevent attachments getting their materials overridden for dropped weapons with material-overriding war paints
Fixes effects flooding the screen when spectating a dead teammate in first person with an unusual weapon
Co-authored-by: sappho <sappho@sappho.io>
This branch represents a minimum viable product for Mapbase running on the updated Source 2013 Multiplayer branch.
The current goal of this branch is to support Mapbase on Team Fortress 2. Preliminary support for HL2:DM and singleplayer HL2 also exist, although the latter is still not viable on this branch due to engine issues.
This branch is being developed in cooperation with the Team Fortress 2: Classic team, and many "generic" fixes or improvements from Team Fortress 2: Classic will be added to this branch in the future.
This branch has the following limitations:
Feature removals
Before using this branch, be aware that we intend to remove features from the game that are barriers to modding and/or that we are reasonably certain will not (or cannot) be used by mods.
Most of these removals were originally meant for Team Fortress 2: Classic in particular, but many of them are being upstreamed to Mapbase due to an overlap of work with other TF2 mods. We are still working out the details of exactly what would be necessary to remove, but for now, this is what's on the chopping block:
If you are developing a TF2 mod which will rely on one or more of these features, please let us know.
Mapbase VScript + TF2 VScript
Mapbase and the TF2 SDK have their own separate implementations of VScript. The ideal state of Mapbase VScript in this branch would be a hybrid that supports everything TF2 VScript supports. Since they both derive from Alien Swarm, they have a common baseline, but they have also gone through several years of independent and sometimes convergent changes. As a result, these implementations still collide catastrophically overall and have serious conflicts.
There are three main points of complication:
NetPropsorConvarssingletons. As the new branch contains much of the original code for these features, Mapbase now awkwardly contains both their original implementations as well as the independent implementations based on them.For the time being, I have nested most conflicting sections of code from TF2 VScript in
#ifndef MAPBASE_VSCRIPTand merged sections where I'm reasonably certain the functionality is identical, although I did have to forego a number of Mapbase changes (e.g. some of the new memory safety fixes for Vectors/script variants) because I wasn't sure how to merge or#ifdefthem without risking further issues.Many of the sections I wasn't sure about merging involved changes from @samisalreadytaken and @z33ky, who may have a better impression of how their features could coexist with TF2 VScript.
TF2 vs. Mapbase syntax
Some functions in Mapbase and TF2 have the same name, but different syntax. I've added a preprocessor to prioritize TF2 VScript's syntax when playing MP games (TF2 or HL2:DM) while prioritizing Mapbase's syntax in SP games (HL2).
Currently, singletons such as
NetPropsandConvarswhich exist in both TF2 and Mapbase will use Mapbase's version. These singletons still have some syntax differences which may not yet be compatible with all TF2 vscripts.Other issues
Future features
Beyond the base feature set, we hope what Mapbase does for TF2 will eventually be on a similar level to what Mapbase does for HL2. We have discussed adding better support for custom weapons and optional support for more than 2 teams, like what TF2:C has.
I also intend to add some features to HL2:DM which I was working on prior to the SDK update, including integration of Mapbase's upcoming protagonist and animation state systems, although I will focus on those at a later time (and potentially in a separate pull request).
How to use this branch
I do not currently have a build prepared, although if you are developing a TF2 mod using the SDK code, you should be able to merge this branch and use it as-is. We recommend using Git so that further changes can be easily pulled in the future.
The shared content VPK normally used in Mapbase mods has some scripts which weren't meant to be used with TF2, so it should not override TF2's file paths. Instead, you can put it in between TF2 and HL2 content, like this:
Note that this file structure will likely change for any eventual build release.
You can also choose to forego the Mapbase VPK entirely, although entity icons/dev texture assets and some specific Mapbase features (e.g. map-specific files, console groups) may not be fully functional.
Mapbase FGDs for Source 2013 Multiplayer (including TF2) can be found here: https://github.com/mapbase-source/source-fgds/tree/mapbase-mp