This is Mapbase's second update since its release. The first update was v1.1, and the release version was v1.0. This update is named v2.0 instead of v1.2 because of the volume and nature of its contents.
- Added custom map compile tools (vbsp, vvis, vrad) - Changed blink fix (shouldn't change anything in-game) - Added auto-completion to ent_create, npc_create, and the main set of "npc_" debug commands - Added ent_create_aimed, an ent_create equivalent of npc_create_aimed - Made hunters start using the "vs. player" melee animation against smaller NPCs that look weird with the "stab" attack - Added "explosion_sparks" convar, which fixes broken code for giving explosions sparks (disabled by default because of how different it looks) - Made interaction code capable of being dispatched on any entity, not just combat characters - Added npc_barnacle_ignite convar, which lets barnacles be ignited by flares - Fixed certain NPCs getting out of the way for the player when they hate them - Fixed auto-generated "speak" scene responses not using parameters that work on real VCDs - Made "stop_on_nonidle" capable of being used in any mod, not just HL2 episodic mods - Selectable color for ragdoll boogie/point_ragdollboogie - Fixed PickupWeaponInstant not firing weapon pickup outputs - Introduced inputs and keyvalues for "lerping" to math_counter_advanced - Fixed ClearConsole on logic_console - logic_convar should now detect client convars correctly - New NormalizeAngles input on math_vector - logic_modelinfo LookupActivity input - math_generate fixed and expanded to be more like math_counter - Added a WIP game logging system for playtesting maps - Introduced logic_playerinfo, an entity that can read a player's name or ID - Fixed some new filters not working with filter_multi - Added radius pickup spawnflag to func_physbox - Added "Preserve name" spawnflag to weapons - Added cc_achievement_debug message for when an achievement doesn't exist - Made npc_combine_s not speak while in logic_choreographed_scenes - Fixed zombie torsos/legs/headcrabs not being serverside when zombie is forced to server ragdoll - Expanded and cleaned up npc_zombie_custom - Fixed func_commandredirects not cleaning up correctly and sometimes crashing the game - Allowed player squad commands to go through +USE-held objects - Added a bunch of I/O/KV to trigger_waterydeath for better configuration - Changed save comment system to use the chapter title from world properties, and the ability to suppress the title popup that normally results from it - Adjusted game_convar_mod for MP planning - Removed the func_precipitation custom particle/splash code for now, as it was causing problems - Fixed env_global_light not accepting lightcolor - Added "Additional Buttons" to player_speedmod - Added save comment to RPC - Added env_projectedtexture attenuation - Added scripted_sequence OnPreIdleSequence - Added OnCrab to zombies - Added skill_changed game event (may need further testing) - Added a fix for viewmodels flipping under extreme FOV values - Added code that allows mappers to change the skin on shotgunners without it usually flipping back randomly - Fixed a very, very, very major shader performance issue - New SetAbsOrigin/Angles inputs on all entities, analogous to SetLocalOrigin/Angles - Code improvements for I/O involving angles - logic_entity_position improvements/fixes, including a new OutAngles output that outputs the angles on position calls - Alternate collision/player avoidance spawnflag obsoletion enforcement disabled - Enable/DisableHazardLights inputs on the EP2 jalopy, equivalent to the keyvalue - Miscellaneous shader formatting adjustments and fixes - Fixed AlwaysDrawOff on env_projectedtexture not being a valid input - Fixed a video playback issue related to the "playvideo" command (contributed by Avanate)
The demo VMFs and BSPs were also updated.
This update took a lot longer than the last one, but it fixes a devastating performance issue with the shaders.
I didn't talk about this issue much because of how embarrassing it was and how much it compromised my work. It reduced my motivation to work on and publicize Mapbase. Now that the issue is out of the way, you can expect a lot more on Mapbase from now on.
…although it also coincides with me getting my time management skills in order, which reduces my time to work on Mapbase. I guess that means you can expect the same, moderate amount of Mapbase, but with a lot more enthusiasm.
The shader performance issue was discovered hours before Mapbase's first release while testing Mapbase with some existing maps from other mods. Massive drops of around 100 frames were reported while comparing an optimized map running in regular Source 2013 with the same map running in Mapbase. More testing was needed, but we proceeded with the release since it didn't seem like a huge deal at the time and we couldn't push back the release any farther anyway (September 2019 was promised).
Long story short, the issue was much more serious than we thought and we only knew that it was coming from the custom shaders. We theorized the code was getting "stuck" somewhere and had nothing to do with a user's hardware, but nobody could figure out what was actually causing it. Days turned into weeks and we were worried it was something engine-side that we couldn't fix. It quickly drained my hope and motivation to work on Mapbase, especially since some modders wanted to go to the extra effort to remove the shaders. I watched one guy slowly go from "The shaders lag, but they look really nice" to "I need to get these shaders out now" over the course of a few days. Removing the shaders from Mapbase meant no projected texture fixes, no radial fog, none of the misc. fixes, and the converted materials would need to be converted back.
After several weeks of this, I thought fixing the shaders wouldn't be possible. However, someone who had been helping me with the issue directed me to a shader-savvy friend of his who was able to analyze a Mapbase frame capture through a GPA and gave me some insight into what was going on, showing that the issue was almost certainly something inside of my code.
I made some intense comparisons to Source 2013's shader code and I finally found the issue.
A convar (r_flashlight_version2) that existed in the original shaders no longer existed in Mapbase's shader code, but references to the convar were replaced with calls to *search* for the convar. The difference is that the Source 2013 code accesses the convar directly while the Mapbase code searches the list of convars. This means the shaders were searching the entire convar lookup for a non-existent convar on a per-frame basis. That's what was decimating the FPS.
This happened because I started Mapbase's shader code from the work of another modder who was basing his work on Alien Swarm's shaders. He was porting Alien Swarm code over and didn't realize he removed the convar, and his code had issues since the convar reference was missing. As a quick fix, he used the searching method instead so the code would compile while keeping the convar's functionality. He didn't realize the implications of the code and I had passed by it several times thinking it was directly from Source 2013.
I apologize for the wall of text, but fixing this has restored my faith in Mapbase and people who were suffering from the issue before deserve to know the full story.
The shaders being fixed also helped me resume work on the Mapbase Multi-Tool. It was originally intended to be a more complicated and full installer, but it was much easier to just make a simpler and all-purpose tool.
It's a basic WPF program I made through C#. It might look like something you'd find on a suspicious website, but it's extremely useful for creating SDK tool shortcuts and converting VMTs to Mapbase's new shaders.
You can download it here and find more details in README.txt.
Another problem I only discovered around release was that the vanilla compilers don't support custom shaders. Custom shaders only work correctly on certain modded map compilers, most notably Slartibarty's improved Slammin' Source compilers. Maps compiled through the vanilla compilers can only run in fullbright. This irritated me when I found out about the issue since I wanted users to use any compiler they want, especially since having a compiler requirement would be yet another step in setting up Mapbase.
Although Slammin' Source works, I wanted users to have an alternative. I began work on Mapbase-specific custom compilers right after v1.1 released.
Another reason I started working on my own compilers was because it gave me the opportunity to introduce parallax corrected cubemaps, a very extreme feature that allows cubemap reflections to move in relation to the camera.
This implementation is based off of this article on the VDC, which is itself based off of the work of Brian Charles, who made this famous video showing it off. All credit goes to Brian Charles and the people who wrote that VDC article.
The code for parallax corrected cubemaps involves changes in both the shaders and VBSP, one of the map compilers. Slammin' Source's VBSP doesn't use this code, so you'll need to use Mapbase's VBSP to use parallax corrected cubemaps. Mapbase's VVIS and VRAD don't have as much work put into them as Slammin' Source, but you can use Mapbase's VBSP in conjunction with Slammin' Source's VVIS and VRAD without losing much.
The shader fix, the multi-tool, and the map compilers are the main highlights of this article, but this update introduces many other changes and bug fixes as well. The change list above has most of the details.