Raised This Month: $51 Target: $400
 12% 

[L4D(2)] SuperVersus [1.5.4]


Post New Thread Reply   
 
Thread Tools Display Modes
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 02-17-2016 , 15:36   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1061

Quote:
Originally Posted by Merudo View Post
I'm still studying the code. Each time I think I managed to wrap my mind around it, the game engine makes something unexpected happen.

Right now I'm trying to understand why running SpawnFakeClient a single time will very briefly create TWO survivors. It seems like somehow, kicking a "SurvivorBot" actually creates a survivor that exists for a few milliseconds, which triggers player_spawn. I don't get it.
Any suggestion where to move the spawning of extra bots? The main thing it should do is:
  • Activate Once only at a time.
  • Check constantly on a specific event (Connecting players, Spawn player)
  • Check that default max bot count is at l4d_survivor_limit, if its higher, and they are human, ignore, if they are bots, kick.

Maybe this will help debugging: https://forums.alliedmods.net/showthread.php?p=1651619
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
Merudo
Senior Member
Join Date: Feb 2016
Old 02-17-2016 , 18:14   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1062

Why do we need to check for connecting players? A player connecting will not change the number of survivors....
Merudo is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 02-17-2016 , 18:34   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1063

Quote:
Originally Posted by Merudo View Post
Why do we need to check for connecting players? A player connecting will not change the number of survivors....
Once all players are connected, spawn extra bots. If I spawn extra bots before, the value could be different. EG: A player leaves mid-transition, the player position of said bot is removed, so if 5 players are in-game, and one leaves, that 5th player doesn't exist apparently. So the code that checks how many extra bots are needed is misleading it to believe there are more than needed.

It is what I think is causing the extra spawning of bots.
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
Merudo
Senior Member
Join Date: Feb 2016
Old 02-17-2016 , 23:13   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1064

Superversus 1.8.15.5

Changes:
- l4d_management can now be set to 4, to show infected bots / players to survivors in team menu. Should help testing balance
- New cvar director_si_more_delay. Add seconds to the timer for special infected bots spawn in versus.
- Fixed deprecation errors from 1.8 sourcepawn compiler.
- StringMap now used to store SteamIds
- Small edits to the printed text of the plugin to show [SV].

Based on Marcus101RR, which itself is based on DDR_Khat

Description:
This plugin allows more than 4 survivors to join the survivor team, and more than 4 infected to join the infected team. In coop, a set number of survivors (l4d_survivor_limit) will always be present, but additional survivors will be created if more people join.

Players can switch teams using commands such as !join or !infected, and a team menu is available with !teams. There is also an option to increase the difficulty if more survivors are present. Finally, if the infected team is not full of players in versus/scavenge, there is an option to have the director spawn more infected bots to fill up the team.

Installation:
Simply put l4d_superversus.smx in \sourcemod\plugins\, and l4d_superversus.txt in \sourcemod\gamedata\

Previous changes:
Spoiler

Cvars:
- l4d_survivor_limit: Maximum amount of survivors. Default 4. Range: 1 to 24. By using !join, players can join beyond this limit (coop modes only)
- l4d_infected_limit: Maximum amount of infected. Default 4. Range: 4 to 24.
- l4d_killreservation: Should we clear Lobby reservaton when it is full? Default 1 (active). Requires Left 4 Downtown 1/2
- l4d_extra_first_aid: Give extra survivors HP packs? (1 for extra medpacks). Default 1
- l4d_respawn_on_join: Respawn alive when joining as an extra survivor for the first time? Default 1
- l4d_versus_si_more: If less infected players than l4d_infected_limit in versus/scavenge, spawn SI bots? Default 1
- l4d_versus_afk: In versus, afk players either go idle (1), become a spectator (2), or are kicked (3). 0 disables it. Default 1.

- director_auto_difficulty: Chooses difficulty based on the number of players on Survivor Team. Default 0. Needs to be 1 for the following 4 variables to have an effect
- director_tank_hpmulti: Tanks HP Multiplier (multi*(survivors-4)). Active if director_auto_difficulty is 1. Default .25 (25% increase in HP per extra player above 4)
- director_si_hpmulti: Special infected HP multiplier (multi*(survivors-4)). Active if director_auto_difficulty is 1. Default 0
- director_ci_multi: Common infected spawn rate multiplier (multi*(survivors-4)). Active if director_auto_difficulty is 1. Default 0.25 (25% increase in infected spawn per extra player)
- director_si_more: Spawn x more special infected per extra player in coop mode. Active if director_auto_difficulty is 1. Default 1 (1 extra SI per extra survivor). Requires Left 4 Downtown 1/2 (version 0.4.5+)

Commands:

- sm_join: Join a random team (in versus) or the survivors (in coop)
- sm_survivor: Join survivors
- sm_infected: Join infected (non-coop only)
- sm_teams: Show a teammenu where team can be selected
- sm_changeteam: Show teammenu
- sm_spectate: Become spectator
- sm_afk: Become idle (survivors) or become spectator (infected)
- sm_createplayer: Create a survivor bot, if empty slot available. Mainly used to fill a team with bots after survivor limit is increased. Admin only.

Joining when no free bot is available (coop only):
If a player joins when no free bot is available and the mode is coop/survival/realism, the plugin will automatically create a new bot for that player. This mean players can join even if there are more players than l4d_survivor_limit. If it's the first time the player joins the game and l4d_respawn_on_join is set to 1, they will respawn alive, with either double pistols, a smg, or an assault rifle, depending on the quality of the gear of the other survivors, as well as a medkit (if l4d_extra_first_aid is 1).

If the player already joined the game in the past, or if l4d_respawn_on_join is set to 0, the player will respawn dead instead, and will need to be rescued. This is to prevent abuse by player rejoining the survivor team to get a free revive.

director_auto_difficulty:
For each survivor beyond the traditional limit of 4, the harder the game the game will be for the survivors. If this is set to 0, all auto-difficulty features will be disabled
  • Tank will have increased health if director_tank_hpmulti is greater than 0. If .25, tanks will have 25% more hp per extra player (i.e. twice as many hp for 8 survivors)
  • Special infected will have increased health if director_si_hpmulti is greater than 0. If .25, SI will have 25% more hp per extra player (i.e. twice as many hp for 8 survivors)
  • Infected will spawn more often if director_ci_spmulti is greater than 0. This feature changes many variables related to spawning and is experimental. If .25, infected spawn rate will increase by roughly 25% per extra player.
  • In coop mode, the maximum special infected will be increased by x per extra player if director_si_more. For example, .5 would result in 1 extra SI per 2 extra survivors, while .34 would result in 1 extra SI per 3 extra survivors. This relies on the forward L4D_OnGetScriptValueInt, and thus either Left 4 Downtown 1 (version 0.4.5 and up) or Left 4 Downtown 2 is required.

Left 4 Downtown 1/2:
Two features, l4d_killreservation and director_si_more, require either Left 4 Downtown or Left 4 Downtown 2. These features and cvars will only work if one of these extensions is installed - otherwise, they won't do anything and can be safely ignored.

Other versions


Required: ONE of the following:
- L4DToolZ (has built-in lobby unreserve, so doesn't require KillRes. Can also be used with Left 4 Downtown 2 with no patched slots. Recommended.)
- Left 4 Downtown 2 with patched slots, New version (L4D2 only. Patched version is no longer supported, use L4DToolZ instead. Use un-patched for director_si_more)
- Left 4 Downtown New version (may be less stable than L4DToolz & Left 4 Downtown 2. Not recommended)

Other related mods for 8 players:
-Defibrillator Bug Fix (on servers higher than 8 players), New version (Allows proper defibrillator use with survivors > 4. Strongly recommended)
-Save Weapon New version (Saves equipment between levels for survivors > 4)
-Survivor Identity Fix Fixes bug where the identity of a survivor changes when a player connects/disconnects/goes idle.
-Survivor Clones Hunter Pounced Warning Fix (Allows hunter verbal warnings between clones)
-Upgrade packs BUG FIX (Allows upgrade packs to hold more charges for survivors > 4)
-Infected Fix Spawn (Fix bug when infected spawn always in same class when infected > 4)
-LEFT4FIX (Keeps track of the score of survivors > 4 for versus)
-8+ players Bug Fixes (1.0.2) New version (Fixes survivor finale score bug, charger stop bug, & Witch incorrect player attack)
-Character Select Menu/FakeZoey New version (Use both L4D1 & L4D2 survivors at once)
-4+ Survivor AFK Fix (1.2) New version (Keep your survivor after going AFK for survivors > 4. Not needed, similar feature implemented since 1.8.12)
-Remove Lobby Reservation (Not needed, similar feature implemented since 1.8.3)

Note: The Defibrillator Bug Fix is almost required for Superversus, otherwise you sometimes won't be able to defibrillate other survivors.

Rivals:
-Survivor Bot Controller (project cancelled due to unresolved bugs)
-Bebop (many unresolved bugs such as uncontrolled bot proliferation, coop only)
-Player Plus! (abandoned, relies on many dependencies)
-MultiSlots (newest version is coop only)
Attached Files
File Type: txt l4d_superversus.txt (2.7 KB, 2496 views)
File Type: sp Get Plugin or Get Source (l4d_superversus.sp - 4447 views - 62.4 KB)
__________________

Last edited by Merudo; 04-08-2016 at 15:03.
Merudo is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 02-18-2016 , 00:39   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1065

Quote:
Originally Posted by Marcus101RR View Post
Once all players are connected, spawn extra bots. If I spawn extra bots before, the value could be different. EG: A player leaves mid-transition, the player position of said bot is removed, so if 5 players are in-game, and one leaves, that 5th player doesn't exist apparently. So the code that checks how many extra bots are needed is misleading it to believe there are more than needed.

It is what I think is causing the extra spawning of bots.
I tried to fix those issues in my 1.8.0.0 version.

Basically, I reintroduced a timer. The timer adds a delay to ensure all the survivors that the game automatically spawns (i.e. 4 default survivors + player survivors) are spawned before adding any more bots.

I think what causes your version to spawn more bots than needed, is that you add extra bots before the game has time to spawn all the bots it wants to. This causes the game to add those bots *after* you already filled up the survivor team. It also causes visual glitches, such as Coach floating in midair during the opening of c1m1_hotel.

I also added a check IsClientInKickQueue(i) to GetAnyValidBot() so that bots about to be kicked are no longer considered valid. That also fixes issues where the plugin would try to kick the same bot twice.

Also, AreAllInGame() was not properly called in your code (you forgot the parentheses), and it crashed the plugin because you can't do IsFakeClient on a non-connected client. I fixed that as well.

Last edited by Merudo; 02-18-2016 at 00:48.
Merudo is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 02-18-2016 , 13:42   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1066

Quote:
Originally Posted by Merudo View Post
I tried to fix those issues in my 1.8.0.0 version.

Basically, I reintroduced a timer. The timer adds a delay to ensure all the survivors that the game automatically spawns (i.e. 4 default survivors + player survivors) are spawned before adding any more bots.

I think what causes your version to spawn more bots than needed, is that you add extra bots before the game has time to spawn all the bots it wants to. This causes the game to add those bots *after* you already filled up the survivor team. It also causes visual glitches, such as Coach floating in midair during the opening of c1m1_hotel.

I also added a check IsClientInKickQueue(i) to GetAnyValidBot() so that bots about to be kicked are no longer considered valid. That also fixes issues where the plugin would try to kick the same bot twice.

Also, AreAllInGame() was not properly called in your code (you forgot the parentheses), and it crashed the plugin because you can't do IsFakeClient on a non-connected client. I fixed that as well.
Looked at your plugin, ill add the stuff that I fixed with Autodifficulty, since it changed. I'll start testing it, and it if works i'll merge it to the post of mine
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
Merudo
Senior Member
Join Date: Feb 2016
Old 02-18-2016 , 15:57   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1067

Superversus 1.8.1

1.8.1.0 - Changes:

- Fixed bug where extra survivor bots wouldn't be kicked if l4d_survivor_limit < 4.
- Added check after spawning bots.

For more information, check this link about 1.8.0.0

New versions
-1.8.4
-1.8.3
-1.8.2
Attached Files
File Type: sp Get Plugin or Get Source (l4d_superversus.sp - 1461 views - 34.9 KB)

Last edited by Merudo; 02-19-2016 at 22:28.
Merudo is offline
Sev
Veteran Member
Join Date: May 2010
Old 02-18-2016 , 16:02   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1068

I haven't looked at the newer versions of this yet by Merudo, but I would be interested in a feature similar to what jess was going for with botcontroller. A flat number of survivors you set the plugin at (4 or 5 or a number less than 4,etc). Then from there, after the flat number is met, the plugin would act like bebop and allow for additional bots to add or subtract on the fly, but the default flat number would always be maintained, whatever that number may be.

Then the bebop problems would come into play though.

1. Idle bug
2. Kicking existing bots in favor of dead ones for the new clients

etc etc etc

Gonna have to test the newer versions to see whats what.
Sev is offline
Merudo
Senior Member
Join Date: Feb 2016
Old 02-18-2016 , 16:12   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1069

Marcus101RR, I'm really looking forward to the fix for Autodifficulty. I must admit I didn't study the code for Auto-difficulty or the infected counter much, so my understanding of it is limited.

Sev, if the code I posted proves to be robust and bug-free, I'll add a botcontroller-like feature where additional bots can be added/subtracted on the fly.

EDIT: It is already included in 1.8.1, just use !join created by Marcus101RR

Last edited by Merudo; 02-18-2016 at 17:10.
Merudo is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 02-18-2016 , 16:20   Re: [L4D(2)] SuperVersus [1.5.4]
Reply With Quote #1070

Quote:
Originally Posted by Merudo View Post
Marcus101RR, I'm really looking forward to the fix for Autodifficulty. I must admit I didn't study the code for Auto-difficulty or the infected counter much, so my understanding of it is limited.

Sev, if the code I posted proves to be robust and bug-free, I'll add a botcontroller-like feature where additional bots can be added/subtracted on the fly.
They can, its called !join. Obviously, you must be rescued from a closet first, because lets face it, you could constantly do !join, !spectate when you die and keep making yourself a new bot. We don't want people cheating the closet. If you just joined, you just gonna have to wait till you can be rescued. Hasn't failed me there.

I had 6 people playing, 2 new ones joined, they !join and boom they are in, of course you mean its automatic. Which is not that difficult to add.
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:14.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode