Skip to content

Merge branch bones_was_here/q3compat

bones_was_here requested to merge bones_was_here/q3compat into master

This MR started as a few map compatibility improvements, but some of the later ones needed to build on the earlier ones, and so it grew. It's been in use on my server since the first version so it's well tested with a variety of maps from Q3 Q3TA QL and their mods, in gametypes dm ctf duel cts tdm and ft.


Many maps for Q3A, Q3TA and their mods use "not*" fields to prevent an entity from spawning in a particular game, mod, or mode.

For normal gametypes I chose Q3TA mode, because Xonotic has a wider range of items, buffs and related features than Q3A, more similar to that of Q3TA.

For CTS (DeFRaG maps) I chose CPM mode by default, because the physics people use in Xonotic are much closer to CPM than the alternative of VQ3. If g_mod_physics == Q3 (exec physicsQ3.cfg) the map will instead run in VQ3 mode. This mainly affects maps where the route is changed to suit the physics.


Spawn crylink in place of Q3TA nailgun: crylink is the most similar weapon in vanilla xonotic.
This makes crylink available in many CTF maps that support Q3TA, which has proved to be a significant improvement as it's tactically valuable, increases variety, and makes moderate skilled players more of a threat to fully stacked experts.
Previously electro was spawned, but most Q3TA maps also have lightning gun so that resulted in too many electros.

This is conditional: weapon_nailgun on Quake maps is still replaced with Electro.


Spawn fireball in place of Q3 BFG: fireball is the most similar weapon in vanilla xon.
This affects very few "good gameplay" maps, as Q3 BFG is very overpowered, so it mainly occurs in goof off maps.
Previously crylink was spawned, which is completely inappropriate as a BFG replacement.

This is conditional: XDF has configured crylink as a replacement for BFG (?????) so in XDF, that behaviour is preserved.


Spawn HLAC in place of Q3TA chaingun: without using overkill weapons, this is probably the most similar xonotic weapon, but obviously won't spawn by default.
Previous behaviour was to spawn nothing.

Also spawn HLAC in place of QL heavy machinegun (which replaced Q3TA chaingun), previously nothing spawned in xon.


Spawn Bash buff in place of Q3TA item_scout: scout is intended to help players rush a contested item such as a flag, and escape with it quickly. Bash achieves this by allowing players to knock opponents away and reduce their ability to land shots, and by making blaster/rocket jumps and crylink running more effective.

The QL version of Scout disables self damage and impact damage, but we don't have a buff for that (yet… that might be a cool buff to add)

Previously Speed powerup was spawned, but Speed must spawn in place of item_haste.


Spawn Inferno buff in place of Q3TA item_doubler: I don't think Inferno is ideal here, but it should be something that increases a player's damage output, but not by as much as quad. Maybe there should be a Damage buff (+50%).

Previously Bash, and before that, Quad (horribly broken on certain maps: 5 quads)


Replace sv_q3defragcompat cvar with a bitfield that tracks if a map supports Q3A/Q3TA/QL/CPMA/CCTF (.arena file entry) and/or DeFRaG (.defi file entry)

Also rename Q3DEFRAGCOMPAT stat to Q3COMPAT and use it to make that bitfield available in CSQC


Overhaul of target_give implementation

It supports a number of items that weren't supported previously, (indirectly) supports the count field on all items (including items that "give" negative ammo), and has simpler code.


New macros for Q3 compat spawnfuncs:
Reduces repetition in quake3.qc by allowing the Q3 weapon and it's ammo to be specified together
Looks up the type of ammo (if any) used by the Xonotic weapon in the xon ammo system, so that no longer needs to be specified, and updates automatically if changed.


CTS/DeFRaG: Spawn waypoints for all entities able to trigger a checkpoint and be directly activated by a player (Fixes #2465 (moved))

Previously some entities did not get waypoints, or the waypoints spawned in the wrong location (as they were spawned for an intermediate entity instead of for the one the player can activate)


Implements giving the player the right amount of ammo (under the xon unified ammo system) to achieve the number of shots specified by the mapper in the count field (of weapon and ammo items).

This looks up the configuration of the primary fire mode, so it automatically adjusts to different balance configs.

Also support count field on health items.


Make "fast" trigger_hurt always damage a player every frame (matches Q3), even if player's triggerhurttime is still on cooldown from another trigger_hurt with the HURT_SLOW spawnflag.

This fixes space maps where the player could fall off without dying, because two trigger_hurt ents were used, first a "slow" one with low damage, and then a "fast" one, such that the player was still on cooldown when they hit the "fast" one and so did not take damage from it.

I did not reimplement the Q3 behaviour verbatim: Q3 has a bug where if more than one player is touching a trigger_hurt simultaneously, only one player (the first to contact it) can be taking damage.


Support holdable_invulnerability: Vampire buff is not an appropriate replacement for this, but xonotic has nothing even remotely similar to this crazy Q3TA item, so i picked Vampire, for now. Maybe one of the special nades that's in development would be a better choice.


Support holdable_kamikaze: Xon has nothing similar to this Q3TA item, but it punishes players for shooting the holder, which is also what the Vengeance buff does (much less harshly! :), so I chose that.


Support holdable_teleporter: Swapper buff is a very appropriate (and more useful) replacement for this rare Q3A item.


Add support for __fullspawndata extension added to DP by Cloudwalk

This is now used to support fields used by CPMA maps for custom sounds on func_door and func_plat, which is only possible with __fullspawndata due to the way DP modifies the contents of those fields.

I plan to use this to support several other features in future.


Fix some nexuiz maps that rely on adjacent bboxes counting as touching

8b2d2647 introduced issues with map ents on some Nexuiz maps, so 9f91a408 makes that bbox fix apply to Q3 maps only.


Many small related fixes and comment updates and probably some stuff I forgot to mention.

9f91a408 changes the hash

Edited by bones_was_here

Merge request reports