Mario [Fri, 30 Sep 2022 09:00:18 +0000 (19:00 +1000)]
Attempt to avoid generating mapinfo data if a .defi file exists when g_mapinfo_q3compat is enabled, to reduce the number of potential crashes from random defrag maps. Don't add regular gamemodes if a target_stopTimer entity exists in the map when generating mapinfo data
Mario [Fri, 30 Sep 2022 05:14:51 +0000 (15:14 +1000)]
Replace arena settings with a single q3compat cvar to handle mapinfo generation with .arena and .defi files, fix some edge cases and avoid using fallbacks if they aren't for the current map
Fix unnecessary inflation of g_warmup_majority_factor in some cases
For example with 10 players joined and g_warmup_majority_factor 0.8
the old code required 9 players to be ready, new code requires 8.
Behaviour is unchanged when joined players * factor is not an integer.
Implement automatic per-map min & max player limits
Enabled by g_warmup -1 and g_maxplayers -1 respectively.
Map settings are loaded from .sizes files
and are rounded to a multiple of the number of teams.
At the midpoint, min players is rounded down and max players is rounded up.
Neither can exceed engine maxplayers which is also rounded down if necessary.
g_warmup -1 means stay in warmup until enough players have joined,
then switch to g_warmup_limit and wait for ready players.
"Enough" has a lower limit of 2 or 2 * number of teams,
so this can be useful on maps with no set minimum.
Ensure maps with small minimum player count can be selected for voting
when player count is low or zero, even if their minimum would otherwise be
too high, to reduce chance of maplist fallback (which ignores sizes).
Setting (for example) every CTF map to min 4 and every DM map to min 2
is a viable config with this code.
Add g_maplist_sizes_specparty, reduces player count used when selecting
maps to allow for a consistent spectator population.
Bot AI: further improve aim of skilled bots by removing simulated aim lag: it's kind of redundant (aim is already lagged in another way) and wastes a lot of fields
Bot AI: increase the amount of error induced to the bots aim with skill < 10, make it less intense vertically and when bot is not aiming at any enemy and a bit more randomized in time. Also get rid of a useless normalize call
terencehill [Sat, 20 Aug 2022 16:28:52 +0000 (18:28 +0200)]
Bot AI: improve bots aim by requiring they aim at the target (with some tolerance) before starting to shoot (bot_ai_aimskill_firetolerance is now enabled by default). It fixes bots often missing the first shot right when they get a new target if they were aiming in a different direction
To make work bot_ai_aimskill_firetolerance with all weapons, fire tolerance is now raised for specific attacks that don't require too much accuracy, e.g. shotgun and devastator attacks
terencehill [Fri, 19 Aug 2022 17:09:10 +0000 (19:09 +0200)]
Bot AI: fix bots sometimes firing in the opposite direction if bot_ai_aimskill_firetolerance is on. Also avoid an useless makevector call if bot_ai_aimskill_firetolerance is off
terencehill [Tue, 9 Aug 2022 13:33:11 +0000 (15:33 +0200)]
Reloadable shotgun: fix primary fire triggering melee attack too if clip has some ammo but player has none
Implementation notes:
- the first return was added to fix only the case where clip has exactly 1 bullet but player has none
- the second return was added for consistency's sake and avoids wasting a couple checks because if(WEP_CVAR(shotgun, secondary) == 1) will always return false
terencehill [Mon, 8 Aug 2022 23:00:46 +0000 (01:00 +0200)]
Reloadable shotgun: when clip is empty automatically reload regardless of whether melee attack is available or not, and make sure player has some some ammo left
Note: WEP_CVAR(shotgun, secondary) < 2 check was wrong because it included secondary mode 0 where secondary attack is off