Post news Report RSS Mapbase v3.0 released

Mapbase's v3.0 update has been released. This update makes a few more changes to the Source mapping process.

Posted by on

This update introduces a bunch of new features that heavily impact the Source mapping process, and a unique video has been created to show the highlights.

Mapbase v3.0 Release Build

Mapbase Release Build

Mapbase v3.0 Compile Tools

Mapbase Compile Tools

Changelist:

Game:

- Overhauled matcher system and added expanded wildcard support, meaning "*_text", "te?t", "blah_*_test", etc. are now supported instead of only trailing *
- Added support for regular expression matching
- Added the missing matrixinvert.h file, which prevented programmers from compiling vbsp
- Fixed env_global_light brightness
- Added info_player_view_proxy, an entity which mimics a player's view (created for script_intro)
- New UnZoomWithRate and SetZoomRate inputs on env_zoom
- New "Don't change target's angles" flag on logic_measure_movement
- Fixed logic_measure_movement not using ignore origin flags correctly
- Fixed filter_damage_mod secondary filter not recognizing mode correctly
- Fixed DisableGeigerCounter causing NPCs to ignore player, and possibly fixed other adverse effects in similar code
- Added SetEntityName input for setting an entity's targetname
- Added "sk_alyx_health" convar for adjustable npc_alyx health, restored/fixed "sk_barney_health" for adjustable npc_barney health
- Added ignore flags and several direction-related inputs to math_vector
- Added pose parameter stuff to logic_modelinfo
- Fixed ChangeWeapon not changing during combat
- Fixed holster/unholster on NPCs without holster/unholster animations
- Fixed func_tank and other "player in the way" code ignoring notarget
- Added SetPoseParameter input to animating entities
- Introduced an experimental chapter system which allows for custom chapter title/restriction management
- Added SetChapterTitle input to worldspawn for dynamic title changing
- Fixed func_tankairboatgun damage credit, added ability to use its damage keyvalues
- Fixed mapbase_rpc_enabled not actually affecting RPC
- Moved some newly found Combine soldier grenade code to ai_grenade for other grenade users
- Fixed some problems with the new shared activities
- Restored an old Mapbase entity as "prop_interactable", an entity which contains all of the functionality of a func_button/func_door in a prop entity
- Added env_microphone pitch scale for scaling the pitch of transmitted sounds
- Added experimental, long-overdue code for scenes to be able to access !target#'s and other scene-related names through AI_INPUT

Shaders:

- Added "mat_specular_disable_on_missing", which "disables" specular reflections when the cubemap texture is missing
- Fixed $envmapmasktransform and $bumptransform on SDK_VertexLitGeneric and related shaders

Files/Scripts:

- Added new "chapters.txt" script
- Changed skill.cfg to contain the new health cvars, including fast zombie cvars; changed "sk_barney_health" from "35" to "80" to reflect his true, previously hardcoded health
- Replaced the "engine/defaultcubemap" texture with an all-black texture equivalent to the default cubemaps a map would compile with

FGD:

- Added spheres to vrad light radius keyvalues
- Added spheres to certain sprite-based entities, particularly for GlowProxySize
- Added ammo multiplier I/KV, which had been forgotten about
- Added sphere to point_tesla radius and point_tesla sound browser
- Turned instances of sphere() into sphere(radius) due to some parts of the sphere code apparently not accepting a default
- Reverted "Use Wind" back to "No Wind" due to issues with the keyvalue not recognizing 0 and legacy support requiring wind be enabled by default
- Fixed KillWhenNotVisible not accepting a parameter
- Fixed "Damaged Other Players" using the wrong name

Compile Tools:

- Areaportal leaks now stop compilation in leak testing
- Replaced "-nodefaultcubemap" with "-defaultcubemap" as the shader changes allow maps to compile without default cubemaps by default with little effect


The build, the mod templates, the demo maps, and the compile tools have all been changed.



This update has four main features:

  1. The matcher system used by I/O, filters, etc. has been overhauled and now supports wildcards in between text, one-character ? wildcards, and regular expressions.
  2. Specular reflection is disabled on the main shaders when the cubemap texture is missing, thus making default cubemaps obsolete. This allows the SteamPipe cubemap bug to be bypassed.
  3. An expanded version of Valve's hardcoded chapter system which could be configured through a newscript file.
  4. prop_interactable has been finished as a prop equivalent to func_button/func_door.


Wildcards and Regex

Source previously only supported "trailing *" when it comes to wildcards, meaning you could use "icons_*" to match "icons_soundscape1" and "icons_text", but you can't use something like "icons_*_sprite" to only match "icons_soundscape1_sprite" or "icons_text_sprite". This update introduces support for that kind of wildcard, even allowing you to use multiple at the same time. This makes Source's wildcards more like wildcards from other software.

This update also introduces "?" wildcards, which match only one character. "*" wildcards can match any number of characters. For example, "icons_soundscape?" will match "icons_soundscape1" and "icons_soundscape2", but not "icons_soundscape1_sprite". They can also go in between text and any number of them can be used.

In addition to wildcard changes, this update also introduces regular expressions, or regex. Regular expressions are special, complex-looking search patterns often used in programming and certain types of search prompts. They can be used by prefixing text with "@/" (but not suffixing it with anything) and then just using a raw regular expression. They can be used in I/O searches, filters, and any other area in which wildcards can be used. Mapbase currently uses the regex functions from the std library in C++ 11, which does not support lookbehinds.

Wildcards and regex being used in I/O


Wildcards and regex being used in filters.

Please note that existing maps which use "?" in its entities' names, use text after the wildcard in matching, or use "@/" in entity names (or in instance fixup escape) might have different behavior with this update. Use the mapbase_wildcards_enabled and mapbase_regex_enabled convars to toggle the new behavior.

The regex support and some of these wildcard changes were created very late in development (even while the update video was being created), so while the code seems to be stable, please keep an eye out for issues and report any problems you might have with these changes.



The SteamPipe Cubemap "Fix"

The SteamPipe cubemap bug is an issue with certain branches of Source (including Source 2013) where cubemaps built by the buildcubemaps command won't overwrite the default, all-black cubemap textures created by vbsp.exe during the map's compilation. Mappers work around this by first removing those default cubemaps created by VBSP so buildcubemaps has nothing to overwrite. However, removing the default cubemaps causes cubemap reflections to either show up as unnaturally shiny sky textures or as simple purple-and-black checkers, so they need to disable specular reflections with the mat_specular convar before running buildcubemaps.

This update eliminates the need for default cubemaps by redirecting missing cubemap textures to an all-black texture equivalent to the default cubemaps. This is a drastic and experimental change, but it's one of the only ways we could really fix the SteamPipe bug since it lies in the engine.

This "fix" works in three ways:


  1. Mapbase's vbsp.exe has been changed so default cubemaps aren't generated by default and the "-nodefaultcubemap" command has been replaced with a new "-defaultcubemap" command which turns generation back on.
  2. The sky texture-based "engine/defaultcubemap" texture has been replaced with an all-black texture.
  3. Whenever the cubemap texture is missing on SDK_LightmappedGeneric, it reverts to the now-black "engine/defaultcubemap" instead of showing purple-and-black checkers.

All in all, this replicates the effect of default cubemaps as well as the effect of mat_specular 0 without actually having to change the convar.

This is the original set of steps you had to take to build cubemaps under the SteamPipe bug:

  1. Compile your map with env_cubemap entities placed throughout the level.
  2. Open the BSP in a pakfile editor (e.g. VIDE) and remove all of the cubemap texture files, or use a custom VBSP which allows you to avoid default cubemaps.
  3. Load your map in-game.
  4. Type mat_specular 0 in the console to hide the effect of missing cubemaps.
  5. Run buildcubemaps.
  6. Toggle HDR and run buildcubemaps again (for HDR/LDR cubemaps).
  7. Type mat_specular 1 in the console to see the newly built cubemap reflections.

With this update, you now only have to take these steps:

  1. Compile your map with env_cubemap entities placed throughout the level.
  2. Load your map in-game.
  3. Run buildcubemaps.
  4. Toggle HDR and run buildcubemaps again (for HDR/LDR cubemaps).

Changing the mat_specular convar is no longer needed.

This fix appears to work well enough, but some other shaders might still try to display missing cubemaps, like the window texture shader used in func_areaportalwindows. We have no way of solving that yet, but the overall fix otherwise appears to be stable. You can disable the behavior on SDK_LightmappedGeneric with the new mat_specular_disable_on_missing convar and generate default cubemaps in vbsp.exe by using the "-defaultcubemap" parameter.



This update also introduces an accessible chapter system based on Valve's previously hardcoded system. v2.0 already added the ability to use a custom save comment and Discord RPC title through the world entity's properties, but this system allows mods to configure the chapter restriction system as well.

Unlike the world entity's chapter title, Discord RPC does not yet reflect titles using this chapter system alone. We are planning on adding support in a later update.



prop_interactable is a new entity that originates from an old suggestion from XBLAH before Mapbase released, at the time being named prop_button. It wasn't considered a priority and it wasn't finished before release. I forgot about it until people started pointing out its unfinished existence in Mapbase's code. I also found out there's a different prop_button entity in Portal 2, which would be confusing if Mapbase's prop_button kept its name. A friend of mine (1upD) eventually encouraged me to finish this, using "prop_interactable" as the classname instead.

This entity is also based from prop_dynamic and can use all of its features.



There are other features in this update as well, like an info_player_view_proxy entity which replicates the player's view with an optional offset. It's intended to be used by script_intro scenes using the HL2 ending's style of creating a fake overlay on the player's view. There's also a few new inputs on env_zoom and a fix for SDK_VertexLitGeneric and related shaders not using $bumptransform or $envmapmasktransform correctly. Take a look at the full changelist at the top of this article for more information.


I am planning on starting the MP port fairly soon after this version is wrapped up. If you find any issues with this update, please report them here or on the Discord server.

Post comment Comments
male07.mdl
male07.mdl - - 18 comments

This is awesome!

Reply Good karma Bad karma+5 votes
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: